xref: /AOO42X/main/sdext/source/minimizer/pppoptimizertoken.cxx (revision cf91b95bba25eaa8518e00d0efc300966efd999d)
1c142477cSAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3c142477cSAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4c142477cSAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5c142477cSAndrew Rist  * distributed with this work for additional information
6c142477cSAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7c142477cSAndrew Rist  * to you under the Apache License, Version 2.0 (the
8c142477cSAndrew Rist  * "License"); you may not use this file except in compliance
9c142477cSAndrew Rist  * with the License.  You may obtain a copy of the License at
10cdf0e10cSrcweir  *
11c142477cSAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12cdf0e10cSrcweir  *
13c142477cSAndrew Rist  * Unless required by applicable law or agreed to in writing,
14c142477cSAndrew Rist  * software distributed under the License is distributed on an
15c142477cSAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16c142477cSAndrew Rist  * KIND, either express or implied.  See the License for the
17c142477cSAndrew Rist  * specific language governing permissions and limitations
18c142477cSAndrew Rist  * under the License.
19cdf0e10cSrcweir  *
20c142477cSAndrew Rist  *************************************************************/
21c142477cSAndrew Rist 
22cdf0e10cSrcweir // MARKER(update_precomp.py): autogen include statement, do not remove
23cdf0e10cSrcweir #include "precompiled_sdext.hxx"
24cdf0e10cSrcweir 
25cdf0e10cSrcweir #include "pppoptimizertoken.hxx"
26cdf0e10cSrcweir #include <osl/mutex.hxx>
27cdf0e10cSrcweir #include <hash_map>
28fda69661SHerbert Dürr #include <rtl/string.hxx>
29cdf0e10cSrcweir 
30fda69661SHerbert Dürr typedef std::hash_map< const char*, PPPOptimizerTokenEnum, rtl::CStringHash, rtl::CStringEqual> TypeNameHashMap;
31cdf0e10cSrcweir static TypeNameHashMap* pHashMap = NULL;
getHashMapMutex()32cdf0e10cSrcweir static ::osl::Mutex& getHashMapMutex()
33cdf0e10cSrcweir {
34cdf0e10cSrcweir     static osl::Mutex s_aHashMapProtection;
35cdf0e10cSrcweir     return s_aHashMapProtection;
36cdf0e10cSrcweir }
37cdf0e10cSrcweir 
38cdf0e10cSrcweir struct TokenTable
39cdf0e10cSrcweir {
40cdf0e10cSrcweir     const char*                         pS;
41cdf0e10cSrcweir     PPPOptimizerTokenEnum               pE;
42cdf0e10cSrcweir };
43cdf0e10cSrcweir 
44cdf0e10cSrcweir static const TokenTable pTokenTableArray[] =
45cdf0e10cSrcweir {
46cdf0e10cSrcweir     { "rdmNavi",            TK_rdmNavi },
47cdf0e10cSrcweir     { "lnNavSep1",          TK_lnNavSep1 },
48cdf0e10cSrcweir     { "lnNavSep2",          TK_lnNavSep2 },
49cdf0e10cSrcweir     { "btnNavHelp",         TK_btnNavHelp },
50cdf0e10cSrcweir     { "btnNavBack",         TK_btnNavBack },
51cdf0e10cSrcweir     { "btnNavNext",         TK_btnNavNext },
52cdf0e10cSrcweir     { "btnNavFinish",       TK_btnNavFinish },
53cdf0e10cSrcweir     { "btnNavCancel",       TK_btnNavCancel },
54cdf0e10cSrcweir 
55cdf0e10cSrcweir     { "FixedText0Pg0",      TK_FixedText0Pg0 },
56cdf0e10cSrcweir     { "FixedText1Pg0",      TK_FixedText1Pg0 },
57cdf0e10cSrcweir     { "Separator1Pg0",      TK_Separator1Pg0 },
58cdf0e10cSrcweir     { "FixedText2Pg0",      TK_FixedText2Pg0 },
59cdf0e10cSrcweir     { "ListBox0Pg0",        TK_ListBox0Pg0 },
60cdf0e10cSrcweir     { "Button0Pg0",         TK_Button0Pg0 },
61cdf0e10cSrcweir     { "RadioButton0Pg1",    TK_RadioButton0Pg1 },
62cdf0e10cSrcweir     { "RadioButton1Pg1",    TK_RadioButton1Pg1 },
63cdf0e10cSrcweir     { "FixedText0Pg1",      TK_FixedText0Pg1 },
64cdf0e10cSrcweir     { "CheckBox1Pg1",       TK_CheckBox1Pg1 },
65cdf0e10cSrcweir     { "FixedText1Pg1",      TK_FixedText1Pg1 },
66cdf0e10cSrcweir     { "FixedText2Pg1",      TK_FixedText2Pg1 },
67cdf0e10cSrcweir     { "FormattedField0Pg1", TK_FormattedField0Pg1 },
68cdf0e10cSrcweir     { "ComboBox0Pg1",       TK_ComboBox0Pg1 },
69cdf0e10cSrcweir     { "CheckBox2Pg1",       TK_CheckBox2Pg1 },
70cdf0e10cSrcweir     { "FixedText0Pg2",      TK_FixedText0Pg2 },
71cdf0e10cSrcweir     { "FixedText1Pg2",      TK_FixedText1Pg2 },
72cdf0e10cSrcweir     { "CheckBox0Pg2",       TK_CheckBox0Pg2 },
73cdf0e10cSrcweir     { "RadioButton0Pg2",    TK_RadioButton0Pg2 },
74cdf0e10cSrcweir     { "RadioButton1Pg2",    TK_RadioButton1Pg2 },
75cdf0e10cSrcweir     { "FixedText0Pg3",      TK_FixedText0Pg3 },
76cdf0e10cSrcweir     { "CheckBox0Pg3",       TK_CheckBox0Pg3 },
77cdf0e10cSrcweir     { "FixedText1Pg3",      TK_FixedText1Pg3 },
78cdf0e10cSrcweir     { "CheckBox1Pg3",       TK_CheckBox1Pg3 },
79cdf0e10cSrcweir     { "FixedText2Pg3",      TK_FixedText2Pg3 },
80cdf0e10cSrcweir     { "CheckBox2Pg3",       TK_CheckBox2Pg3 },
81cdf0e10cSrcweir     { "CheckBox3Pg3",       TK_CheckBox3Pg3 },
82cdf0e10cSrcweir     { "ListBox0Pg3",        TK_ListBox0Pg3 },
83cdf0e10cSrcweir     { "Separator0Pg4",      TK_Separator0Pg4 },
84cdf0e10cSrcweir     { "RadioButton0Pg4",    TK_RadioButton0Pg4 },
85cdf0e10cSrcweir     { "RadioButton1Pg4",    TK_RadioButton1Pg4 },
86cdf0e10cSrcweir     { "Separator1Pg4",      TK_Separator1Pg4 },
87cdf0e10cSrcweir     { "FixedText0Pg4",      TK_FixedText0Pg4 },
88cdf0e10cSrcweir     { "FixedText1Pg4",      TK_FixedText1Pg4 },
89cdf0e10cSrcweir     { "FixedText2Pg4",      TK_FixedText2Pg4 },
90cdf0e10cSrcweir     { "FixedText3Pg4",      TK_FixedText3Pg4 },
91cdf0e10cSrcweir     { "FixedText4Pg4",      TK_FixedText4Pg4 },
92cdf0e10cSrcweir     { "FixedText5Pg4",      TK_FixedText5Pg4 },
93cdf0e10cSrcweir     { "FixedText6Pg4",      TK_FixedText6Pg4 },
94cdf0e10cSrcweir     { "FixedText7Pg4",      TK_FixedText7Pg4 },
95cdf0e10cSrcweir     { "FixedText8Pg4",      TK_FixedText8Pg4 },
96cdf0e10cSrcweir     { "CheckBox1Pg4",       TK_CheckBox1Pg4 },
97cdf0e10cSrcweir     { "ComboBox0Pg4",       TK_ComboBox0Pg4 },
98cdf0e10cSrcweir 
99cdf0e10cSrcweir     { "_blank",             TK__blank },
100cdf0e10cSrcweir     { "_self",              TK__self },
101cdf0e10cSrcweir     { "Activated",          TK_Activated },
102cdf0e10cSrcweir     { "Align",              TK_Align },
103cdf0e10cSrcweir     { "Alpha",              TK_Alpha },
104cdf0e10cSrcweir     { "Animated",           TK_Animated },
105cdf0e10cSrcweir     { "Background",         TK_Background },
106cdf0e10cSrcweir     { "Border",             TK_Border },
107cdf0e10cSrcweir     { "Closeable",          TK_Closeable },
108cdf0e10cSrcweir     { "ColorMode",          TK_ColorMode },
109cdf0e10cSrcweir     { "Complete",           TK_Complete },
110cdf0e10cSrcweir     { "Compression",        TK_Compression },
111cdf0e10cSrcweir     { "CurrentItemID",      TK_CurrentItemID },
112cdf0e10cSrcweir     { "DefaultButton",      TK_DefaultButton },
113cdf0e10cSrcweir     { "DocumentService",    TK_DocumentService },
114cdf0e10cSrcweir     { "Dropdown",           TK_Dropdown },
115cdf0e10cSrcweir     { "EffectiveValue",     TK_EffectiveValue },
116cdf0e10cSrcweir     { "EffectiveMin",       TK_EffectiveMin },
117cdf0e10cSrcweir     { "EffectiveMax",       TK_EffectiveMax },
118cdf0e10cSrcweir     { "Enabled",            TK_Enabled },
119cdf0e10cSrcweir     { "Extensions",         TK_Extensions },
120cdf0e10cSrcweir     { "FileSizeDestination",TK_FileSizeDestination },
121cdf0e10cSrcweir     { "FileSizeSource",     TK_FileSizeSource },
122cdf0e10cSrcweir     { "FillBitmap",         TK_FillBitmap },
123cdf0e10cSrcweir     { "FillBitmapLogicalSize",TK_FillBitmapLogicalSize },
124cdf0e10cSrcweir     { "FillBitmapMode",     TK_FillBitmapMode },
125cdf0e10cSrcweir     { "FillBitmapSizeX",    TK_FillBitmapSizeX },
126cdf0e10cSrcweir     { "FillBitmapSizeY",    TK_FillBitmapSizeY },
127cdf0e10cSrcweir     { "FillBitmapURL",      TK_FillBitmapURL },
128cdf0e10cSrcweir     { "FillStyle",          TK_FillStyle },
129cdf0e10cSrcweir     { "FilterData",         TK_FilterData },
130cdf0e10cSrcweir     { "FilterName",         TK_FilterName },
131cdf0e10cSrcweir     { "Flags",              TK_Flags },
132cdf0e10cSrcweir     { "FontDescriptor",     TK_FontDescriptor },
133cdf0e10cSrcweir     { "Graphic",            TK_Graphic },
134cdf0e10cSrcweir     { "GraphicCrop",        TK_GraphicCrop },
135cdf0e10cSrcweir     { "GraphicCropLogic",   TK_GraphicCropLogic },
136cdf0e10cSrcweir     { "GraphicURL",         TK_GraphicURL },
137cdf0e10cSrcweir     { "GraphicStreamURL",   TK_GraphicStreamURL },
138cdf0e10cSrcweir     { "Height",             TK_Height },
139597a4c59SAriel Constenla-Haile     { "HelpURL",            TK_HelpURL },
140cdf0e10cSrcweir     { "Hidden",             TK_Hidden },
141cdf0e10cSrcweir     { "ID",                 TK_ID },
142cdf0e10cSrcweir     { "ImageURL",           TK_ImageURL },
143597a4c59SAriel Constenla-Haile     { "ParentWindow",       TK_ParentWindow }, // TODO move it
144cdf0e10cSrcweir     { "InputStream",        TK_InputStream },
145cdf0e10cSrcweir     { "Interlaced",         TK_Interlaced },
146cdf0e10cSrcweir     { "IsInternal",         TK_IsInternal },
147cdf0e10cSrcweir     { "Label",              TK_Label },
148cdf0e10cSrcweir     { "LineCount",          TK_LineCount },
149cdf0e10cSrcweir     { "LogicalHeight",      TK_LogicalHeight },
150cdf0e10cSrcweir     { "LogicalWidth",       TK_LogicalWidth },
151cdf0e10cSrcweir     { "LogicalSize",        TK_LogicalSize },
152cdf0e10cSrcweir     { "MimeType",           TK_MimeType },
153cdf0e10cSrcweir     { "Moveable",           TK_Moveable },
154cdf0e10cSrcweir     { "MultiLine",          TK_MultiLine },
155cdf0e10cSrcweir     { "MultiSelection",     TK_MultiSelection },
156cdf0e10cSrcweir     { "Name",               TK_Name },
157cdf0e10cSrcweir     { "Orientation",        TK_Orientation },
158cdf0e10cSrcweir     { "OutputStream",       TK_OutputStream },
159cdf0e10cSrcweir     { "PixelHeight",        TK_PixelHeight },
160cdf0e10cSrcweir     { "PixelWidth",         TK_PixelWidth },
161cdf0e10cSrcweir     { "PositionX",          TK_PositionX },
162cdf0e10cSrcweir     { "PositionY",          TK_PositionY },
163cdf0e10cSrcweir     { "Progress",           TK_Progress },
164cdf0e10cSrcweir     { "ProgressValue",      TK_ProgressValue },
165cdf0e10cSrcweir     { "ProgressValueMax",   TK_ProgressValueMax },
166cdf0e10cSrcweir     { "ProgressValueMin",   TK_ProgressValueMin },
167cdf0e10cSrcweir     { "PushButtonType",     TK_PushButtonType },
168cdf0e10cSrcweir     { "Quality",            TK_Quality },
169cdf0e10cSrcweir     { "ReadOnly",           TK_ReadOnly },
170cdf0e10cSrcweir     { "Repeat",             TK_Repeat },
171cdf0e10cSrcweir     { "ScaleImage",         TK_ScaleImage },
172cdf0e10cSrcweir     { "SelectedItems",      TK_SelectedItems },
173cdf0e10cSrcweir     { "Settings",           TK_Settings },
174cdf0e10cSrcweir     { "Size100thMM",        TK_Size100thMM },
175cdf0e10cSrcweir     { "SizePixel",          TK_SizePixel },
176cdf0e10cSrcweir     { "Spin",               TK_Spin },
177cdf0e10cSrcweir     { "Step",               TK_Step },
178cdf0e10cSrcweir     { "State",              TK_State },
179597a4c59SAriel Constenla-Haile     { "StatusListener",     TK_StatusListener },
180cdf0e10cSrcweir     { "StringItemList",     TK_StringItemList },
181cdf0e10cSrcweir     { "Strings",            TK_Strings },
182cdf0e10cSrcweir     { "TabIndex",           TK_TabIndex },
183cdf0e10cSrcweir     { "Template",           TK_Template },
184cdf0e10cSrcweir     { "Text",               TK_Text },
185cdf0e10cSrcweir     { "Title",              TK_Title },
186cdf0e10cSrcweir     { "Transparent",        TK_Transparent },
187cdf0e10cSrcweir     { "Type",               TK_Type },
188cdf0e10cSrcweir     { "UIName",             TK_UIName },
189cdf0e10cSrcweir     { "Value",              TK_Value },
190cdf0e10cSrcweir     { "Width",              TK_Width },
191cdf0e10cSrcweir     { "ZOrder",             TK_ZOrder },
192cdf0e10cSrcweir 
193cdf0e10cSrcweir     { "LastUsedSettings",   TK_LastUsedSettings },
194cdf0e10cSrcweir     { "Settings/Templates", TK_Settings_Templates },
195cdf0e10cSrcweir     { "Settings/Templates/",TK_Settings_Templates_ },
196cdf0e10cSrcweir     { "JPEGCompression",    TK_JPEGCompression },
197cdf0e10cSrcweir     { "JPEGQuality",        TK_JPEGQuality },
198cdf0e10cSrcweir     { "RemoveCropArea",     TK_RemoveCropArea },
199cdf0e10cSrcweir     { "ImageResolution",    TK_ImageResolution },
200cdf0e10cSrcweir     { "EmbedLinkedGraphics",TK_EmbedLinkedGraphics },
201cdf0e10cSrcweir     { "OLEOptimization",    TK_OLEOptimization },
202cdf0e10cSrcweir     { "OLEOptimizationType",TK_OLEOptimizationType },
203cdf0e10cSrcweir     { "DeleteUnusedMasterPages", TK_DeleteUnusedMasterPages },
204cdf0e10cSrcweir     { "DeleteHiddenSlides", TK_DeleteHiddenSlides },
205cdf0e10cSrcweir     { "DeleteNotesPages",   TK_DeleteNotesPages },
206cdf0e10cSrcweir     { "CustomShowName",     TK_CustomShowName },
207cdf0e10cSrcweir     { "SaveAs",             TK_SaveAs },
208cdf0e10cSrcweir     { "SaveAsURL",          TK_SaveAsURL },
209cdf0e10cSrcweir     { "OpenNewDocument",    TK_OpenNewDocument },
210cdf0e10cSrcweir     { "EstimatedFileSize",  TK_EstimatedFileSize },
211cdf0e10cSrcweir 
212cdf0e10cSrcweir     { "Status",             TK_Status },
213cdf0e10cSrcweir     { "Pages",              TK_Pages },
214cdf0e10cSrcweir     { "CurrentPage",        TK_CurrentPage },
215cdf0e10cSrcweir     { "GraphicObjects",     TK_GraphicObjects },
216cdf0e10cSrcweir     { "CurrentGraphicObject",TK_CurrentGraphicObject },
217cdf0e10cSrcweir     { "OLEObjects",         TK_OLEObjects },
218cdf0e10cSrcweir     { "CurrentOLEObject",   TK_CurrentOLEObject },
219597a4c59SAriel Constenla-Haile #if 0
220597a4c59SAriel Constenla-Haile     { "STR_PRESENTATION_MINIMIZER",STR_PRESENTATION_MINIMIZER },
221cdf0e10cSrcweir     { "STR_STEPS",                  STR_STEPS },
222cdf0e10cSrcweir     { "STR_HELP",                   STR_HELP },
223cdf0e10cSrcweir     { "STR_BACK",                   STR_BACK },
224cdf0e10cSrcweir     { "STR_NEXT",                   STR_NEXT },
225cdf0e10cSrcweir     { "STR_FINISH",                 STR_FINISH },
226cdf0e10cSrcweir     { "STR_CANCEL",                 STR_CANCEL },
227cdf0e10cSrcweir     { "STR_INTRODUCTION",           STR_INTRODUCTION },
228cdf0e10cSrcweir     { "STR_INTRODUCTION_T",         STR_INTRODUCTION_T },
229*cf91b95bSmseidel     { "STR_CHOOSE_SETTINGS",        STR_CHOOSE_SETTINGS },
230cdf0e10cSrcweir     { "STR_REMOVE",                 STR_REMOVE },
231cdf0e10cSrcweir     { "STR_GRAPHIC_OPTIMIZATION",   STR_GRAPHIC_OPTIMIZATION },
232cdf0e10cSrcweir     { "STR_IMAGE_OPTIMIZATION",     STR_IMAGE_OPTIMIZATION },
233cdf0e10cSrcweir     { "STR_LOSSLESS_COMPRESSION",   STR_LOSSLESS_COMPRESSION },
234cdf0e10cSrcweir     { "STR_JPEG_COMPRESSION",       STR_JPEG_COMPRESSION },
235cdf0e10cSrcweir     { "STR_QUALITY",                STR_QUALITY },
236cdf0e10cSrcweir     { "STR_REMOVE_CROP_AREA",       STR_REMOVE_CROP_AREA },
237cdf0e10cSrcweir     { "STR_IMAGE_RESOLUTION",       STR_IMAGE_RESOLUTION },
238cdf0e10cSrcweir     { "STR_IMAGE_RESOLUTION_0",     STR_IMAGE_RESOLUTION_0 },
239cdf0e10cSrcweir     { "STR_IMAGE_RESOLUTION_1",     STR_IMAGE_RESOLUTION_1 },
240cdf0e10cSrcweir     { "STR_IMAGE_RESOLUTION_2",     STR_IMAGE_RESOLUTION_2 },
241cdf0e10cSrcweir     { "STR_IMAGE_RESOLUTION_3",     STR_IMAGE_RESOLUTION_3 },
242cdf0e10cSrcweir     { "STR_EMBED_LINKED_GRAPHICS",  STR_EMBED_LINKED_GRAPHICS },
243cdf0e10cSrcweir     { "STR_OLE_OBJECTS",            STR_OLE_OBJECTS },
244cdf0e10cSrcweir     { "STR_OLE_OPTIMIZATION",       STR_OLE_OPTIMIZATION },
245cdf0e10cSrcweir     { "STR_OLE_REPLACE",            STR_OLE_REPLACE },
246cdf0e10cSrcweir     { "STR_ALL_OLE_OBJECTS",        STR_ALL_OLE_OBJECTS },
247cdf0e10cSrcweir     { "STR_ALIEN_OLE_OBJECTS_ONLY", STR_ALIEN_OLE_OBJECTS_ONLY },
248cdf0e10cSrcweir     { "STR__OLE_OBJECTS_DESC",      STR_OLE_OBJECTS_DESC },
249cdf0e10cSrcweir     { "STR_NO_OLE_OBJECTS_DESC",    STR_NO_OLE_OBJECTS_DESC },
250cdf0e10cSrcweir     { "STR_SLIDES",                 STR_SLIDES },
251cdf0e10cSrcweir     { "STR_CHOOSE_SLIDES",          STR_CHOOSE_SLIDES },
252cdf0e10cSrcweir     { "STR_MASTER_PAGES",           STR_MASTER_PAGES },
253cdf0e10cSrcweir     { "STR_DELETE_MASTER_PAGES",    STR_DELETE_MASTER_PAGES },
254cdf0e10cSrcweir     { "STR_DELETE_NOTES_PAGES",     STR_DELETE_NOTES_PAGES },
255cdf0e10cSrcweir     { "STR_DELETE_HIDDEN_SLIDES",   STR_DELETE_HIDDEN_SLIDES },
256cdf0e10cSrcweir     { "STR_CUSTOM_SHOW",            STR_CUSTOM_SHOW },
257cdf0e10cSrcweir     { "STR_SUMMARY",                STR_SUMMARY },
258cdf0e10cSrcweir     { "STR_SUMMARY_TITLE",          STR_SUMMARY_TITLE },
259cdf0e10cSrcweir     { "STR_PROGRESS",               STR_PROGRESS },
260cdf0e10cSrcweir     { "STR_OBJECTS_OPTIMIZED",      STR_OBJECTS_OPTIMIZED },
261cdf0e10cSrcweir     { "STR_APPLY_TO_CURRENT",       STR_APPLY_TO_CURRENT },
262cdf0e10cSrcweir     { "STR_AUTOMATICALLY_OPEN",     STR_AUTOMATICALLY_OPEN },
263cdf0e10cSrcweir     { "STR_SAVE_SETTINGS",          STR_SAVE_SETTINGS },
264cdf0e10cSrcweir     { "STR_SAVE_AS",                STR_SAVE_AS },
265cdf0e10cSrcweir     { "STR_DELETE_SLIDES",          STR_DELETE_SLIDES },
266cdf0e10cSrcweir     { "STR_OPTIMIZE_IMAGES",        STR_OPTIMIZE_IMAGES },
267cdf0e10cSrcweir     { "STR_CREATE_REPLACEMENT",     STR_CREATE_REPLACEMENT },
268cdf0e10cSrcweir     { "STR_CURRENT_FILESIZE",       STR_CURRENT_FILESIZE },
269cdf0e10cSrcweir     { "STR_ESTIMATED_FILESIZE",     STR_ESTIMATED_FILESIZE },
270cdf0e10cSrcweir     { "STR_MB",                     STR_MB },
271cdf0e10cSrcweir     { "MY_SETTINGS",                STR_MY_SETTINGS },
272cdf0e10cSrcweir     { "STR_DEFAULT_SESSION",        STR_DEFAULT_SESSION },
273cdf0e10cSrcweir     { "STR_MODIFY_WARNING",         STR_MODIFY_WARNING },
274cdf0e10cSrcweir     { "STR_YES",                    STR_YES },
275cdf0e10cSrcweir     { "STR_OK",                     STR_OK },
276cdf0e10cSrcweir     { "STR_INFO_1",                 STR_INFO_1 },
277cdf0e10cSrcweir     { "STR_INFO_2",                 STR_INFO_2 },
278cdf0e10cSrcweir     { "STR_INFO_3",                 STR_INFO_3 },
279cdf0e10cSrcweir     { "STR_INFO_4",                 STR_INFO_4 },
280cdf0e10cSrcweir     { "STR_DUPLICATING_PRESENTATION",STR_DUPLICATING_PRESENTATION },
281cdf0e10cSrcweir     { "STR_DELETING_SLIDES",        STR_DELETING_SLIDES },
282cdf0e10cSrcweir     { "STR_OPTIMIZING_GRAPHICS",    STR_OPTIMIZING_GRAPHICS },
283cdf0e10cSrcweir     { "STR_CREATING_OLE_REPLACEMENTS",STR_CREATING_OLE_REPLACEMENTS },
284cdf0e10cSrcweir     { "STR_FileSizeSeparator",      STR_FILESIZESEPARATOR },
285597a4c59SAriel Constenla-Haile #endif
286cdf0e10cSrcweir     { "Last",               TK_Last },
287cdf0e10cSrcweir     { "NotFound",           TK_NotFound }
288cdf0e10cSrcweir };
289cdf0e10cSrcweir 
TKGet(const rtl::OUString & rToken)290cdf0e10cSrcweir PPPOptimizerTokenEnum TKGet( const rtl::OUString& rToken )
291cdf0e10cSrcweir {
292cdf0e10cSrcweir     if ( !pHashMap )
293cdf0e10cSrcweir     {   // init hash map
294cdf0e10cSrcweir         ::osl::MutexGuard aGuard( getHashMapMutex() );
295cdf0e10cSrcweir         if ( !pHashMap )
296cdf0e10cSrcweir         {
297cdf0e10cSrcweir             TypeNameHashMap* pH = new TypeNameHashMap;
298cdf0e10cSrcweir             const TokenTable* pPtr = pTokenTableArray;
299cdf0e10cSrcweir             const TokenTable* pEnd = pPtr + ( sizeof( pTokenTableArray ) / sizeof( TokenTable ) );
300cdf0e10cSrcweir             for ( ; pPtr < pEnd; pPtr++ )
301cdf0e10cSrcweir                 (*pH)[ pPtr->pS ] = pPtr->pE;
302cdf0e10cSrcweir             pHashMap = pH;
303cdf0e10cSrcweir         }
304cdf0e10cSrcweir     }
305cdf0e10cSrcweir     PPPOptimizerTokenEnum eRetValue = TK_NotFound;
306cdf0e10cSrcweir     int i, nLen = rToken.getLength();
307cdf0e10cSrcweir     char* pBuf = new char[ nLen + 1 ];
308cdf0e10cSrcweir     for ( i = 0; i < nLen; i++ )
309cdf0e10cSrcweir         pBuf[ i ] = (char)rToken[ i ];
310cdf0e10cSrcweir     pBuf[ i ] = 0;
311cdf0e10cSrcweir     TypeNameHashMap::iterator aHashIter( pHashMap->find( pBuf ) );
312cdf0e10cSrcweir     delete[] pBuf;
313cdf0e10cSrcweir     if ( aHashIter != pHashMap->end() )
314cdf0e10cSrcweir         eRetValue = (*aHashIter).second;
315cdf0e10cSrcweir     return eRetValue;
316cdf0e10cSrcweir }
317cdf0e10cSrcweir 
TKGet(const PPPOptimizerTokenEnum eToken)318cdf0e10cSrcweir rtl::OUString TKGet( const PPPOptimizerTokenEnum eToken )
319cdf0e10cSrcweir {
320cdf0e10cSrcweir     sal_uInt32 i = eToken >= TK_Last
321cdf0e10cSrcweir         ? (sal_uInt32)TK_NotFound
322cdf0e10cSrcweir         : (sal_uInt32)eToken;
323cdf0e10cSrcweir     return rtl::OUString::createFromAscii( pTokenTableArray[ i ].pS );
324cdf0e10cSrcweir }
325*cf91b95bSmseidel 
326*cf91b95bSmseidel /* vim: set noet sw=4 ts=4: */
327