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