Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
5 : * This Source Code Form is subject to the terms of the Mozilla Public
6 : * License, v. 2.0. If a copy of the MPL was not distributed with this
7 : * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 : *
9 : * This file incorporates work covered by the following license notice:
10 : *
11 : * Licensed to the Apache Software Foundation (ASF) under one or more
12 : * contributor license agreements. See the NOTICE file distributed
13 : * with this work for additional information regarding copyright
14 : * ownership. The ASF licenses this file to you under the Apache
15 : * License, Version 2.0 (the "License"); you may not use this file
16 : * except in compliance with the License. You may obtain a copy of
17 : * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 : */
19 :
20 : #include "svx/EnhancedCustomShapeTypeNames.hxx"
21 : #include <osl/mutex.hxx>
22 : #include <boost/unordered_map.hpp>
23 :
24 : typedef boost::unordered_map< const char*, MSO_SPT, rtl::CStringHash, rtl::CStringEqual> TypeNameHashMap;
25 :
26 : static TypeNameHashMap* pHashMap = NULL;
27 18 : static ::osl::Mutex& getHashMapMutex()
28 : {
29 18 : static osl::Mutex s_aHashMapProtection;
30 18 : return s_aHashMapProtection;
31 : }
32 :
33 : struct NameTypeTable
34 : {
35 : const char* pS;
36 : MSO_SPT pE;
37 : };
38 : static const NameTypeTable pNameTypeTableArray[] =
39 : {
40 : { "non-primitive", mso_sptMin },
41 : { "rectangle", mso_sptRectangle },
42 : { "round-rectangle", mso_sptRoundRectangle },
43 : { "ellipse", mso_sptEllipse },
44 : { "diamond", mso_sptDiamond },
45 : { "isosceles-triangle", mso_sptIsocelesTriangle },
46 : { "right-triangle", mso_sptRightTriangle },
47 : { "parallelogram", mso_sptParallelogram },
48 : { "trapezoid", mso_sptTrapezoid },
49 : { "hexagon", mso_sptHexagon },
50 : { "octagon", mso_sptOctagon },
51 : { "cross", mso_sptPlus },
52 : { "star5", mso_sptStar },
53 : { "right-arrow", mso_sptArrow },
54 : { "mso-spt14", mso_sptThickArrow },
55 : { "pentagon-right", mso_sptHomePlate },
56 : { "cube", mso_sptCube },
57 : { "mso-spt17", mso_sptBalloon },
58 : { "mso-spt18", mso_sptSeal },
59 : { "mso-spt19", mso_sptArc },
60 : { "mso-spt20", mso_sptLine },
61 : { "mso-spt21", mso_sptPlaque },
62 : { "can", mso_sptCan },
63 : { "ring", mso_sptDonut },
64 : { "mso-spt24", mso_sptTextSimple },
65 : { "mso-spt25", mso_sptTextOctagon },
66 : { "mso-spt26", mso_sptTextHexagon },
67 : { "mso-spt27", mso_sptTextCurve },
68 : { "mso-spt28", mso_sptTextWave },
69 : { "mso-spt29", mso_sptTextRing },
70 : { "mso-spt30", mso_sptTextOnCurve },
71 : { "mso-spt31", mso_sptTextOnRing },
72 : { "mso-spt32", mso_sptStraightConnector1 },
73 : { "mso-spt33", mso_sptBentConnector2 },
74 : { "mso-spt34", mso_sptBentConnector3 },
75 : { "mso-spt35", mso_sptBentConnector4 },
76 : { "mso-spt36", mso_sptBentConnector5 },
77 : { "mso-spt37", mso_sptCurvedConnector2 },
78 : { "mso-spt38", mso_sptCurvedConnector3 },
79 : { "mso-spt39", mso_sptCurvedConnector4 },
80 : { "mso-spt40", mso_sptCurvedConnector5 },
81 : { "mso-spt41", mso_sptCallout1 },
82 : { "mso-spt42", mso_sptCallout2 },
83 : { "mso-spt43", mso_sptCallout3 },
84 : { "mso-spt44", mso_sptAccentCallout1 },
85 : { "mso-spt45", mso_sptAccentCallout2 },
86 : { "mso-spt46", mso_sptAccentCallout3 },
87 : { "line-callout-1", mso_sptBorderCallout1 },
88 : { "line-callout-2", mso_sptBorderCallout2 },
89 : { "mso-spt49", mso_sptBorderCallout3 },
90 : { "mso-spt50", mso_sptAccentBorderCallout1 },
91 : { "mso-spt51", mso_sptAccentBorderCallout2 },
92 : { "mso-spt52", mso_sptAccentBorderCallout3 },
93 : { "mso-spt53", mso_sptRibbon },
94 : { "mso-spt54", mso_sptRibbon2 },
95 : { "chevron", mso_sptChevron },
96 : { "pentagon", mso_sptPentagon },
97 : { "forbidden", mso_sptNoSmoking },
98 : { "star8", mso_sptSeal8 },
99 : { "mso-spt59", mso_sptSeal16 },
100 : { "mso-spt60", mso_sptSeal32 },
101 : { "rectangular-callout", mso_sptWedgeRectCallout },
102 : { "round-rectangular-callout", mso_sptWedgeRRectCallout },
103 : { "round-callout", mso_sptWedgeEllipseCallout },
104 : { "mso-spt64", mso_sptWave },
105 : { "paper", mso_sptFoldedCorner },
106 : { "left-arrow", mso_sptLeftArrow },
107 : { "down-arrow", mso_sptDownArrow },
108 : { "up-arrow", mso_sptUpArrow },
109 : { "left-right-arrow", mso_sptLeftRightArrow },
110 : { "up-down-arrow", mso_sptUpDownArrow },
111 : { "mso-spt71", mso_sptIrregularSeal1 },
112 : { "bang", mso_sptIrregularSeal2 },
113 : { "lightning", mso_sptLightningBolt },
114 : { "heart", mso_sptHeart },
115 : { "mso-spt75", mso_sptPictureFrame },
116 : { "quad-arrow", mso_sptQuadArrow },
117 : { "left-arrow-callout", mso_sptLeftArrowCallout },
118 : { "right-arrow-callout", mso_sptRightArrowCallout },
119 : { "up-arrow-callout", mso_sptUpArrowCallout },
120 : { "down-arrow-callout", mso_sptDownArrowCallout },
121 : { "left-right-arrow-callout", mso_sptLeftRightArrowCallout },
122 : { "up-down-arrow-callout", mso_sptUpDownArrowCallout },
123 : { "quad-arrow-callout", mso_sptQuadArrowCallout },
124 : { "quad-bevel", mso_sptBevel },
125 : { "left-bracket", mso_sptLeftBracket },
126 : { "right-bracket", mso_sptRightBracket },
127 : { "left-brace", mso_sptLeftBrace },
128 : { "right-brace", mso_sptRightBrace },
129 : { "mso-spt89", mso_sptLeftUpArrow },
130 : { "mso-spt90", mso_sptBentUpArrow },
131 : { "mso-spt91", mso_sptBentArrow },
132 : { "star24", mso_sptSeal24 },
133 : { "striped-right-arrow", mso_sptStripedRightArrow },
134 : { "notched-right-arrow", mso_sptNotchedRightArrow },
135 : { "block-arc", mso_sptBlockArc },
136 : { "smiley", mso_sptSmileyFace },
137 : { "vertical-scroll", mso_sptVerticalScroll },
138 : { "horizontal-scroll", mso_sptHorizontalScroll },
139 : { "circular-arrow", mso_sptCircularArrow },
140 : { "mso-spt100", mso_sptNotchedCircularArrow },
141 : { "mso-spt101", mso_sptUturnArrow },
142 : { "mso-spt102", mso_sptCurvedRightArrow },
143 : { "mso-spt103", mso_sptCurvedLeftArrow },
144 : { "mso-spt104", mso_sptCurvedUpArrow },
145 : { "mso-spt105", mso_sptCurvedDownArrow },
146 : { "cloud-callout", mso_sptCloudCallout },
147 : { "mso-spt107", mso_sptEllipseRibbon },
148 : { "mso-spt108", mso_sptEllipseRibbon2 },
149 : { "flowchart-process", mso_sptFlowChartProcess },
150 : { "flowchart-decision", mso_sptFlowChartDecision },
151 : { "flowchart-data", mso_sptFlowChartInputOutput },
152 : { "flowchart-predefined-process", mso_sptFlowChartPredefinedProcess },
153 : { "flowchart-internal-storage", mso_sptFlowChartInternalStorage },
154 : { "flowchart-document", mso_sptFlowChartDocument },
155 : { "flowchart-multidocument", mso_sptFlowChartMultidocument },
156 : { "flowchart-terminator", mso_sptFlowChartTerminator },
157 : { "flowchart-preparation", mso_sptFlowChartPreparation },
158 : { "flowchart-manual-input", mso_sptFlowChartManualInput },
159 : { "flowchart-manual-operation", mso_sptFlowChartManualOperation },
160 : { "flowchart-connector", mso_sptFlowChartConnector },
161 : { "flowchart-card", mso_sptFlowChartPunchedCard },
162 : { "flowchart-punched-tape", mso_sptFlowChartPunchedTape },
163 : { "flowchart-summing-junction", mso_sptFlowChartSummingJunction },
164 : { "flowchart-or", mso_sptFlowChartOr },
165 : { "flowchart-collate", mso_sptFlowChartCollate },
166 : { "flowchart-sort", mso_sptFlowChartSort },
167 : { "flowchart-extract", mso_sptFlowChartExtract },
168 : { "flowchart-merge", mso_sptFlowChartMerge },
169 : { "mso-spt129", mso_sptFlowChartOfflineStorage },
170 : { "flowchart-stored-data", mso_sptFlowChartOnlineStorage },
171 : { "flowchart-sequential-access", mso_sptFlowChartMagneticTape },
172 : { "flowchart-magnetic-disk", mso_sptFlowChartMagneticDisk },
173 : { "flowchart-direct-access-storage", mso_sptFlowChartMagneticDrum },
174 : { "flowchart-display", mso_sptFlowChartDisplay },
175 : { "flowchart-delay", mso_sptFlowChartDelay },
176 : { "fontwork-plain-text", mso_sptTextPlainText },
177 : { "fontwork-stop", mso_sptTextStop },
178 : { "fontwork-triangle-up", mso_sptTextTriangle },
179 : { "fontwork-triangle-down", mso_sptTextTriangleInverted },
180 : { "fontwork-chevron-up", mso_sptTextChevron },
181 : { "fontwork-chevron-down", mso_sptTextChevronInverted },
182 : { "mso-spt142", mso_sptTextRingInside },
183 : { "mso-spt143", mso_sptTextRingOutside },
184 : { "fontwork-arch-up-curve", mso_sptTextArchUpCurve },
185 : { "fontwork-arch-down-curve", mso_sptTextArchDownCurve },
186 : { "fontwork-circle-curve", mso_sptTextCircleCurve },
187 : { "fontwork-open-circle-curve", mso_sptTextButtonCurve },
188 : { "fontwork-arch-up-pour", mso_sptTextArchUpPour },
189 : { "fontwork-arch-down-pour", mso_sptTextArchDownPour },
190 : { "fontwork-circle-pour", mso_sptTextCirclePour },
191 : { "fontwork-open-circle-pour", mso_sptTextButtonPour },
192 : { "fontwork-curve-up", mso_sptTextCurveUp },
193 : { "fontwork-curve-down", mso_sptTextCurveDown },
194 : { "fontwork-fade-up-and-right", mso_sptTextCascadeUp },
195 : { "fontwork-fade-up-and-left", mso_sptTextCascadeDown },
196 : { "fontwork-wave", mso_sptTextWave1 },
197 : { "mso-spt157", mso_sptTextWave2 },
198 : { "mso-spt158", mso_sptTextWave3 },
199 : { "mso-spt159", mso_sptTextWave4 },
200 : { "fontwork-inflate", mso_sptTextInflate },
201 : { "mso-spt161", mso_sptTextDeflate },
202 : { "mso-spt162", mso_sptTextInflateBottom },
203 : { "mso-spt163", mso_sptTextDeflateBottom },
204 : { "mso-spt164", mso_sptTextInflateTop },
205 : { "mso-spt165", mso_sptTextDeflateTop },
206 : { "mso-spt166", mso_sptTextDeflateInflate },
207 : { "mso-spt167", mso_sptTextDeflateInflateDeflate },
208 : { "fontwork-fade-right", mso_sptTextFadeRight },
209 : { "fontwork-fade-left", mso_sptTextFadeLeft },
210 : { "fontwork-fade-up", mso_sptTextFadeUp },
211 : { "fontwork-fade-down", mso_sptTextFadeDown },
212 : { "fontwork-slant-up", mso_sptTextSlantUp },
213 : { "fontwork-slant-down", mso_sptTextSlantDown },
214 : { "mso-spt174", mso_sptTextCanUp },
215 : { "mso-spt175", mso_sptTextCanDown },
216 : { "flowchart-alternate-process", mso_sptFlowChartAlternateProcess },
217 : { "flowchart-off-page-connector", mso_sptFlowChartOffpageConnector },
218 : { "mso-spt178", mso_sptCallout90 },
219 : { "mso-spt179", mso_sptAccentCallout90 },
220 : { "mso-spt180", mso_sptBorderCallout90 },
221 : { "line-callout-3", mso_sptAccentBorderCallout90 },
222 : { "mso-spt182", mso_sptLeftRightUpArrow },
223 : { "sun", mso_sptSun },
224 : { "moon", mso_sptMoon },
225 : { "bracket-pair", mso_sptBracketPair },
226 : { "brace-pair", mso_sptBracePair },
227 : { "star4", mso_sptSeal4 },
228 : { "mso-spt188", mso_sptDoubleWave },
229 : { "mso-spt189", mso_sptActionButtonBlank },
230 : { "mso-spt190", mso_sptActionButtonHome },
231 : { "mso-spt191", mso_sptActionButtonHelp },
232 : { "mso-spt192", mso_sptActionButtonInformation },
233 : { "mso-spt193", mso_sptActionButtonForwardNext },
234 : { "mso-spt194", mso_sptActionButtonBackPrevious },
235 : { "mso-spt195", mso_sptActionButtonEnd },
236 : { "mso-spt196", mso_sptActionButtonBeginning },
237 : { "mso-spt197", mso_sptActionButtonReturn },
238 : { "mso-spt198", mso_sptActionButtonDocument },
239 : { "mso-spt199", mso_sptActionButtonSound },
240 : { "mso-spt200", mso_sptActionButtonMovie },
241 : { "mso-spt201", mso_sptHostControl },
242 : { "mso-spt202", mso_sptTextBox },
243 : { "teardrop", mso_sptTearDrop }
244 : };
245 :
246 : // gallery: quadrat
247 : // gallery: round-quadrat
248 : // gallery: circle
249 : // gallery: circle-pie
250 : // gallery: frame
251 : // gallery: flower
252 : // gallery: cloud
253 : // gallery: puzzle
254 : // gallery: octagon-bevel
255 : // gallery: diamond-bevel
256 : // gallery: up-right-arrow
257 : // gallery: up-right-down-arrow
258 : // gallery: corner-right-arrow
259 : // gallery: split-arrow
260 : // gallery: up-right-arrow-callout
261 : // gallery: split-round-arrow
262 : // gallery: s-sharped-arrow
263 : // Gallery: star6
264 : // Gallery: star12
265 : // Gallery: concave-star6
266 : // Gallery: signet
267 : // Gallery: doorplate
268 : // gallery: fontwork-arch-left-curve
269 : // gallery: fontwork-arch-right-curve
270 : // gallery: fontwork-arch-left-pour
271 : // gallery: fontwork-arch-right-pour
272 :
273 15767 : MSO_SPT EnhancedCustomShapeTypeNames::Get( const OUString& rShapeType )
274 : {
275 15767 : if ( !pHashMap )
276 : { // init hash map
277 18 : ::osl::MutexGuard aGuard( getHashMapMutex() );
278 18 : if ( !pHashMap )
279 : {
280 18 : TypeNameHashMap* pH = new TypeNameHashMap;
281 18 : const NameTypeTable* pPtr = pNameTypeTableArray;
282 18 : const NameTypeTable* pEnd = pPtr + ( sizeof( pNameTypeTableArray ) / sizeof( NameTypeTable ) );
283 3690 : for ( ; pPtr < pEnd; pPtr++ )
284 3672 : (*pH)[ pPtr->pS ] = pPtr->pE;
285 18 : pHashMap = pH;
286 18 : }
287 : }
288 15767 : MSO_SPT eRetValue = mso_sptNil;
289 15767 : int i, nLen = rShapeType.getLength();
290 15767 : char* pBuf = new char[ nLen + 1 ];
291 127102 : for ( i = 0; i < nLen; i++ )
292 111335 : pBuf[ i ] = (char)rShapeType[ i ];
293 15767 : pBuf[ i ] = 0;
294 15767 : TypeNameHashMap::iterator aHashIter( pHashMap->find( pBuf ) );
295 15767 : delete[] pBuf;
296 15767 : if ( aHashIter != pHashMap->end() )
297 5084 : eRetValue = (*aHashIter).second;
298 15767 : return eRetValue;
299 : }
300 :
301 1960 : OUString EnhancedCustomShapeTypeNames::Get( const MSO_SPT eShapeType )
302 : {
303 1960 : return eShapeType <= mso_sptTextBox
304 : ? OUString::createFromAscii( pNameTypeTableArray[ eShapeType ].pS )
305 1960 : : OUString();
306 : }
307 :
308 : typedef boost::unordered_map< const char*, const char*, rtl::CStringHash, rtl::CStringEqual> TypeACCNameHashMap;
309 :
310 : static TypeACCNameHashMap* pACCHashMap = NULL;
311 : struct ACCNameTypeTable
312 : {
313 : const char* pS;
314 : const char* pE;
315 : };
316 :
317 : static const ACCNameTypeTable pACCNameTypeTableArray[] =
318 : {
319 : { "non-primitive", "Non Primitive Shape" },
320 : { "rectangle", "Rectangle" },
321 : { "round-rectangle", "Rounded Rectangle" },
322 : { "ellipse", "Ellipse" },
323 : { "diamond", "Diamond" },
324 : { "isosceles-triangle", "Triangle" },
325 : { "right-triangle", "Right Triangle" },
326 : { "parallelogram", "Parallelogram" },
327 : { "trapezoid", "Trapezoid" },
328 : { "hexagon", "Hexagon" },
329 : { "octagon", "Octagon" },
330 : { "cross", "Cross" },
331 : { "star5", "5-Point Star" },
332 : { "right-arrow", "Right Arrow" },
333 : //{ "mso-spt14", mso_sptThickArrow },
334 : { "pentagon-right", "Pentagon" },
335 : { "cube", "Cube" },
336 : { "mso-spt21", "Doorplate" },
337 : /*{ "mso-spt17", mso_sptBalloon },
338 : { "mso-spt18", mso_sptSeal },
339 : { "mso-spt19", mso_sptArc },
340 : { "mso-spt20", mso_sptLine },
341 : { "mso-spt21", mso_sptPlaque },
342 : { "can", mso_sptCan },*/
343 : { "ring", "Ring" },
344 : /*{ "mso-spt24", mso_sptTextSimple },
345 : { "mso-spt25", mso_sptTextOctagon },
346 : { "mso-spt26", mso_sptTextHexagon },
347 : { "mso-spt27", mso_sptTextCurve },
348 : { "mso-spt28", mso_sptTextWave },
349 : { "mso-spt29", mso_sptTextRing },
350 : { "mso-spt30", mso_sptTextOnCurve },
351 : { "mso-spt31", mso_sptTextOnRing },
352 : { "mso-spt32", mso_sptStraightConnector1 },
353 : { "mso-spt33", mso_sptBentConnector2 },
354 : { "mso-spt34", mso_sptBentConnector3 },
355 : { "mso-spt35", mso_sptBentConnector4 },
356 : { "mso-spt36", mso_sptBentConnector5 },
357 : { "mso-spt37", mso_sptCurvedConnector2 },
358 : { "mso-spt38", mso_sptCurvedConnector3 },
359 : { "mso-spt39", mso_sptCurvedConnector4 },
360 : { "mso-spt40", mso_sptCurvedConnector5 },
361 : { "mso-spt41", mso_sptCallout1 },
362 : { "mso-spt42", mso_sptCallout2 },
363 : { "mso-spt43", mso_sptCallout3 },
364 : { "mso-spt44", mso_sptAccentCallout1 },
365 : { "mso-spt45", mso_sptAccentCallout2 },
366 : { "mso-spt46", mso_sptAccentCallout3 },*/
367 : { "line-callout-1", "Line Callout 1" },
368 : { "line-callout-2", "Line Callout 2" },
369 : /*{ "mso-spt49", mso_sptBorderCallout3 },
370 : { "mso-spt50", mso_sptAccentBorderCallout1 },
371 : { "mso-spt51", mso_sptAccentBorderCallout2 },
372 : { "mso-spt52", mso_sptAccentBorderCallout3 },
373 : { "mso-spt53", mso_sptRibbon },
374 : { "mso-spt54", mso_sptRibbon2 },*/
375 : { "chevron", "Chevron" },
376 : { "pentagon", "Regular Pentagon" },
377 : { "forbidden", "'No' Symbol" },
378 : { "star8", "8-Point Star" },
379 : /*{ "mso-spt59", mso_sptSeal16 },
380 : { "mso-spt60", mso_sptSeal32 },*/
381 : { "rectangular-callout", "Rectangular Callout" },
382 : { "round-rectangular-callout", "Rounded Rectangular Callout" },
383 : { "round-callout", "Round Callout" },
384 : //{ "mso-spt64", mso_sptWave },
385 : { "paper", "Folded Corner" },
386 : { "left-arrow", "Left Arrow" },
387 : { "down-arrow", "Down Arrow" },
388 : { "up-arrow", "Up Arrow" },
389 : { "left-right-arrow", "Left and Right Arrow" },
390 : { "up-down-arrow", "Up and Down Arrow" },
391 : //{ "mso-spt71", mso_sptIrregularSeal1 },
392 : { "bang", "Explosion" },
393 : { "lightning", "Lighting Bolt" },
394 : { "heart", "Heart" },
395 : //{ "mso-spt75", mso_sptPictureFrame },
396 : { "quad-arrow", "4-Way Arrow" },
397 : { "left-arrow-callout", "Left Arrow Callout" },
398 : { "right-arrow-callout", "Right Arrow Callout" },
399 : { "up-arrow-callout", "Up Arrow Callout" },
400 : { "down-arrow-callout", "Down Arrow Callout" },
401 : { "left-right-arrow-callout", "Left and Right Arrow Callout" },
402 : { "up-down-arrow-callout", "Up and Down Arrow Callout" },
403 : { "quad-arrow-callout", "4-Way Arrow Callout" },
404 : { "quad-bevel", "Square Bevel" },
405 : { "left-bracket", "Left Bracket" },
406 : { "right-bracket", "Right Bracket" },
407 : { "left-brace", "Left Brace" },
408 : { "right-brace", "Right Brace" },
409 : { "mso-spt89", "Up and Left Arrow" },
410 : //{ "mso-spt90", mso_sptBentUpArrow },
411 : //{ "mso-spt91", mso_sptBentArrow },
412 : { "star24", "24-Point Star" },
413 : { "striped-right-arrow", "Striped Right Arrow" },
414 : { "notched-right-arrow", "Notched Right Arrow" },
415 : { "block-arc", "Block Arc" },
416 : { "smiley", "Smile Face" },
417 : { "vertical-scroll", "Vertical Scroll" },
418 : { "horizontal-scroll", "Horizontal Scroll" },
419 : { "circular-arrow", "Circular Arrow" },
420 : { "mso-spt100", "Notched Circular Arrow" },
421 : /*
422 : { "mso-spt101", mso_sptUturnArrow },
423 : { "mso-spt102", mso_sptCurvedRightArrow },
424 : { "mso-spt103", mso_sptCurvedLeftArrow },
425 : { "mso-spt104", mso_sptCurvedUpArrow },
426 : { "mso-spt105", mso_sptCurvedDownArrow },*/
427 : { "cloud-callout", "Cloud Callout" },
428 : /*{ "mso-spt107", mso_sptEllipseRibbon },
429 : { "mso-spt108", mso_sptEllipseRibbon2 },*/
430 : { "flowchart-process", "Flowchart:Process" },
431 : { "flowchart-decision", "Flowchart:Decision" },
432 : { "flowchart-data", "Flowchart:Data" },
433 : { "flowchart-predefined-process", "Flowchart:Predefined Process" },
434 : { "flowchart-internal-storage", "Flowchart:Internal Storage" },
435 : { "flowchart-document", "Flowchart:Document" },
436 : { "flowchart-multidocument", "Flowchart:Multidocument" },
437 : { "flowchart-terminator", "Flowchart:Terminator" },
438 : { "flowchart-preparation", "Flowchart:Preparation" },
439 : { "flowchart-manual-input", "Flowchart:Manual Input" },
440 : { "flowchart-manual-operation", "Flowchart:Manual Operation" },
441 : { "flowchart-connector", "Flowchart:Connector" },
442 : { "flowchart-card", "Flowchart:Card" },
443 : { "flowchart-punched-tape", "Flowchart:Punched Tape" },
444 : { "flowchart-summing-junction", "Flowchart:Summing Junction" },
445 : { "flowchart-or", "Flowchart:Or" },
446 : { "flowchart-collate", "Flowchart:Collate" },
447 : { "flowchart-sort", "Flowchart:Sort" },
448 : { "flowchart-extract", "Flowchart:Extract" },
449 : { "flowchart-merge", "Flowchart:Merge" },
450 : //{ "mso-spt129", mso_sptFlowChartOfflineStorage },
451 : { "flowchart-stored-data", "Flowchart:Stored Data" },
452 : { "flowchart-sequential-access", "drawingbar.fc.25=Flowchart:Sequential Access" },
453 : { "flowchart-magnetic-disk", "Flowchart:Magnetic Disk" },
454 : { "flowchart-direct-access-storage", "Flowchart:Direct Access Storage" },
455 : { "flowchart-display", "Flowchart:Display" },
456 : { "flowchart-delay", "Flowchart:Delay" },
457 : /*{ "fontwork-plain-text", mso_sptTextPlainText },
458 : { "fontwork-stop", mso_sptTextStop },
459 : { "fontwork-triangle-up", mso_sptTextTriangle },
460 : { "fontwork-triangle-down", mso_sptTextTriangleInverted },
461 : { "fontwork-chevron-up", mso_sptTextChevron },
462 : { "fontwork-chevron-down", mso_sptTextChevronInverted },
463 : { "mso-spt142", mso_sptTextRingInside },
464 : { "mso-spt143", mso_sptTextRingOutside },
465 : { "fontwork-arch-up-curve", mso_sptTextArchUpCurve },
466 : { "fontwork-arch-down-curve", mso_sptTextArchDownCurve },
467 : { "fontwork-circle-curve", mso_sptTextCircleCurve },
468 : { "fontwork-open-circle-curve", mso_sptTextButtonCurve },
469 : { "fontwork-arch-up-pour", mso_sptTextArchUpPour },
470 : { "fontwork-arch-down-pour", mso_sptTextArchDownPour },
471 : { "fontwork-circle-pour", mso_sptTextCirclePour },
472 : { "fontwork-open-circle-pour", mso_sptTextButtonPour },
473 : { "fontwork-curve-up", mso_sptTextCurveUp },
474 : { "fontwork-curve-down", mso_sptTextCurveDown },
475 : { "fontwork-fade-up-and-right", mso_sptTextCascadeUp },
476 : { "fontwork-fade-up-and-left", mso_sptTextCascadeDown },
477 : { "fontwork-wave", mso_sptTextWave1 },
478 : { "mso-spt157", mso_sptTextWave2 },
479 : { "mso-spt158", mso_sptTextWave3 },
480 : { "mso-spt159", mso_sptTextWave4 },
481 : { "fontwork-inflate", mso_sptTextInflate },
482 : { "mso-spt161", mso_sptTextDeflate },
483 : { "mso-spt162", mso_sptTextInflateBottom },
484 : { "mso-spt163", mso_sptTextDeflateBottom },
485 : { "mso-spt164", mso_sptTextInflateTop },
486 : { "mso-spt165", mso_sptTextDeflateTop },
487 : { "mso-spt166", mso_sptTextDeflateInflate },
488 : { "mso-spt167", mso_sptTextDeflateInflateDeflate },
489 : { "fontwork-fade-right", mso_sptTextFadeRight },
490 : { "fontwork-fade-left", mso_sptTextFadeLeft },
491 : { "fontwork-fade-up", mso_sptTextFadeUp },
492 : { "fontwork-fade-down", mso_sptTextFadeDown },
493 : { "fontwork-slant-up", mso_sptTextSlantUp },
494 : { "fontwork-slant-down", mso_sptTextSlantDown },
495 : { "mso-spt174", mso_sptTextCanUp },
496 : { "mso-spt175", mso_sptTextCanDown },*/
497 : { "flowchart-alternate-process", "Flowchart:Alternate Process " },
498 : { "flowchart-off-page-connector", "Flowchart:Off-page Connector" },
499 : /*{ "mso-spt178", mso_sptCallout90 },
500 : { "mso-spt179", mso_sptAccentCallout90 },
501 : { "mso-spt180", mso_sptBorderCallout90 },*/
502 : { "line-callout-3", "Line Callout 3" },
503 : //{ "mso-spt182", mso_sptLeftRightUpArrow },
504 : { "sun", "Sun" },
505 : { "moon", "Moon" },
506 : { "bracket-pair", "Double Bracket" },
507 : { "brace-pair", "Double Brace" },
508 : { "star4", "4-Point Star" },
509 : /*{ "mso-spt188", mso_sptDoubleWave },
510 : { "mso-spt189", mso_sptActionButtonBlank },
511 : { "mso-spt190", mso_sptActionButtonHome },
512 : { "mso-spt191", mso_sptActionButtonHelp },
513 : { "mso-spt192", mso_sptActionButtonInformation },
514 : { "mso-spt193", mso_sptActionButtonForwardNext },
515 : { "mso-spt194", mso_sptActionButtonBackPrevious },
516 : { "mso-spt195", mso_sptActionButtonEnd },
517 : { "mso-spt196", mso_sptActionButtonBeginning },
518 : { "mso-spt197", mso_sptActionButtonReturn },
519 : { "mso-spt198", mso_sptActionButtonDocument },
520 : { "mso-spt199", mso_sptActionButtonSound },
521 : { "mso-spt200", mso_sptActionButtonMovie },
522 : { "mso-spt201", mso_sptHostControl },
523 : { "mso-spt202", mso_sptTextBox },*/
524 : { "frame", "Frame" },
525 : { "col-60da8460", "Octagon Bevel" },
526 : { "col-502ad400", "Diamond Bevel" }
527 : };
528 :
529 0 : OUString EnhancedCustomShapeTypeNames::GetAccName( const OUString& rShapeType )
530 : {
531 0 : if ( !pACCHashMap )
532 : { // init hash map
533 0 : ::osl::MutexGuard aGuard( getHashMapMutex() );
534 0 : if ( !pACCHashMap )
535 : {
536 0 : TypeACCNameHashMap* pH = new TypeACCNameHashMap;
537 0 : const ACCNameTypeTable* pPtr = pACCNameTypeTableArray;
538 0 : const ACCNameTypeTable* pEnd = pPtr + ( sizeof( pACCNameTypeTableArray ) / sizeof( ACCNameTypeTable ) );
539 0 : for ( ; pPtr < pEnd; pPtr++ )
540 0 : (*pH)[ pPtr->pS ] = pPtr->pE;
541 0 : pACCHashMap = pH;
542 0 : }
543 : }
544 0 : OUString sRetValue;
545 0 : int i, nLen = rShapeType.getLength();
546 0 : char* pBuf = new char[ nLen + 1 ];
547 0 : for ( i = 0; i < nLen; i++ )
548 0 : pBuf[ i ] = (char)rShapeType[ i ];
549 0 : pBuf[ i ] = 0;
550 0 : TypeACCNameHashMap::iterator aHashIter( pACCHashMap->find( pBuf ) );
551 0 : delete[] pBuf;
552 0 : if ( aHashIter != pACCHashMap->end() )
553 0 : sRetValue = OUString::createFromAscii( (*aHashIter).second );
554 0 : return sRetValue;
555 : }
556 :
557 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|