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