~ubuntu-branches/ubuntu/oneiric/cups/oneiric

« back to all changes in this revision

Viewing changes to cups/mark.c

  • Committer: Bazaar Package Importer
  • Author(s): Martin Pitt
  • Date: 2010-04-09 16:19:16 UTC
  • mto: (25.1.2 lucid) (55.1.1 sid)
  • mto: This revision was merged to the branch mainline in revision 28.
  • Revision ID: james.westby@ubuntu.com-20100409161916-k0e6prz52ubf4vlg
Tags: upstream-1.4.3
ImportĀ upstreamĀ versionĀ 1.4.3

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
 
 * "$Id: mark.c 8532 2009-04-20 21:37:14Z mike $"
 
2
 * "$Id: mark.c 8912 2009-12-08 02:13:42Z mike $"
3
3
 *
4
4
 *   Option marking routines for the Common UNIX Printing System (CUPS).
5
5
 *
842
842
 
843
843
  if (!strcasecmp(option, "AP_D_InputSlot"))
844
844
  {
 
845
    cupsArraySave(ppd->options);
 
846
 
845
847
    if ((o = ppdFindOption(ppd, "InputSlot")) != NULL)
846
848
    {
847
849
      key.option = o;
851
853
        cupsArrayRemove(ppd->marked, oldc);
852
854
      }
853
855
    }
 
856
 
 
857
    cupsArrayRestore(ppd->options);
854
858
  }
855
859
 
856
860
 /*
857
861
  * Check for custom options...
858
862
  */
859
863
 
860
 
  if ((o = ppdFindOption(ppd, option)) == NULL)
 
864
  cupsArraySave(ppd->options);
 
865
 
 
866
  o = ppdFindOption(ppd, option);
 
867
 
 
868
  cupsArrayRestore(ppd->options);
 
869
 
 
870
  if (!o)
861
871
    return;
862
872
 
863
873
  loc = localeconv();
912
922
              if (units)
913
923
              {
914
924
                if (!strcasecmp(units, "cm"))
915
 
                  cparam->current.custom_points *= 72.0f / 2.54f;             
 
925
                  cparam->current.custom_points *= 72.0f / 2.54f;
916
926
                else if (!strcasecmp(units, "mm"))
917
 
                  cparam->current.custom_points *= 72.0f / 25.4f;             
 
927
                  cparam->current.custom_points *= 72.0f / 25.4f;
918
928
                else if (!strcasecmp(units, "m"))
919
 
                  cparam->current.custom_points *= 72.0f / 0.0254f;           
 
929
                  cparam->current.custom_points *= 72.0f / 0.0254f;
920
930
                else if (!strcasecmp(units, "in"))
921
 
                  cparam->current.custom_points *= 72.0f;             
 
931
                  cparam->current.custom_points *= 72.0f;
922
932
                else if (!strcasecmp(units, "ft"))
923
 
                  cparam->current.custom_points *= 12.0f * 72.0f;             
 
933
                  cparam->current.custom_points *= 12.0f * 72.0f;
924
934
              }
925
935
              break;
926
936
 
1060
1070
      * appropriate...
1061
1071
      */
1062
1072
 
 
1073
      cupsArraySave(ppd->options);
 
1074
 
1063
1075
      if (!strcasecmp(option, "PageSize"))
1064
1076
      {
1065
1077
        if ((o = ppdFindOption(ppd, "PageRegion")) != NULL)
1084
1096
          }
1085
1097
        }
1086
1098
      }
 
1099
 
 
1100
      cupsArrayRestore(ppd->options);
1087
1101
    }
1088
1102
    else if (!strcasecmp(option, "InputSlot"))
1089
1103
    {
1091
1105
      * Unmark ManualFeed option...
1092
1106
      */
1093
1107
 
 
1108
      cupsArraySave(ppd->options);
 
1109
 
1094
1110
      if ((o = ppdFindOption(ppd, "ManualFeed")) != NULL)
1095
1111
      {
1096
1112
        key.option = o;
1100
1116
          cupsArrayRemove(ppd->marked, oldc);
1101
1117
        }
1102
1118
      }
 
1119
 
 
1120
      cupsArrayRestore(ppd->options);
1103
1121
    }
1104
1122
    else if (!strcasecmp(option, "ManualFeed") &&
1105
1123
             !strcasecmp(choice, "True"))
1108
1126
      * Unmark InputSlot option...
1109
1127
      */
1110
1128
 
 
1129
      cupsArraySave(ppd->options);
 
1130
 
1111
1131
      if ((o = ppdFindOption(ppd, "InputSlot")) != NULL)
1112
1132
      {
1113
1133
        key.option = o;
1117
1137
          cupsArrayRemove(ppd->marked, oldc);
1118
1138
        }
1119
1139
      }
 
1140
 
 
1141
      cupsArrayRestore(ppd->options);
1120
1142
    }
1121
1143
  }
1122
1144
 
1197
1219
      return;
1198
1220
  }
1199
1221
  else
1200
 
    return;    
 
1222
    return;
1201
1223
 
1202
1224
 /*
1203
1225
  * Search the PPD file for a matching size...
1228
1250
 
1229
1251
 
1230
1252
/*
1231
 
 * End of "$Id: mark.c 8532 2009-04-20 21:37:14Z mike $".
 
1253
 * End of "$Id: mark.c 8912 2009-12-08 02:13:42Z mike $".
1232
1254
 */