21 #include <osl/mutex.hxx>
22 #include <unordered_map>
25 typedef std::unordered_map< const char*, MSO_SPT, rtl::CStringHash, rtl::CStringEqual>
TypeNameHashMap;
30 static osl::Mutex s_aHashMapProtection;
31 return s_aHashMapProtection;
289 const NameTypeTable* pEnd = pPtr +
SAL_N_ELEMENTS( pNameTypeTableArray );
290 for ( ; pPtr < pEnd; pPtr++ )
291 (*pH)[ pPtr->pS ] = pPtr->pE;
296 int i, nLen = rShapeType.getLength();
297 std::unique_ptr<char[]> pBuf(
new char[ nLen + 1 ]);
298 for ( i = 0; i < nLen; i++ )
299 pBuf[ i ] = static_cast<char>(rShapeType[ i ]);
301 TypeNameHashMap::const_iterator aHashIter(
pHashMap->find( pBuf.get() ) );
303 eRetValue = (*aHashIter).second;
309 return (eShapeType <= mso_sptTextBox && eShapeType >=
mso_sptMin)
310 ? OUString::createFromAscii( pNameTypeTableArray[ eShapeType ].
pS )
314 typedef std::unordered_map< const char*, const char*, rtl::CStringHash, rtl::CStringEqual>
TypeACCNameHashMap;
320 struct ACCNameTypeTable
330 {
"non-primitive",
"Non Primitive Shape" },
331 {
"rectangle",
"Rectangle" },
332 {
"round-rectangle",
"Rounded Rectangle" },
333 {
"ellipse",
"Ellipse" },
334 {
"diamond",
"Diamond" },
335 {
"isosceles-triangle",
"Triangle" },
336 {
"right-triangle",
"Right Triangle" },
337 {
"parallelogram",
"Parallelogram" },
338 {
"trapezoid",
"Trapezoid" },
339 {
"hexagon",
"Hexagon" },
340 {
"octagon",
"Octagon" },
341 {
"cross",
"Cross" },
342 {
"star5",
"5-Point Star" },
343 {
"right-arrow",
"Right Arrow" },
345 {
"pentagon-right",
"Pentagon" },
347 {
"mso-spt21",
"Doorplate" },
378 {
"line-callout-1",
"Line Callout 1" },
379 {
"line-callout-2",
"Line Callout 2" },
386 {
"chevron",
"Chevron" },
387 {
"pentagon",
"Regular Pentagon" },
388 {
"forbidden",
"'No' Symbol" },
389 {
"star8",
"8-Point Star" },
392 {
"rectangular-callout",
"Rectangular Callout" },
393 {
"round-rectangular-callout",
"Rounded Rectangular Callout" },
394 {
"round-callout",
"Round Callout" },
396 {
"paper",
"Folded Corner" },
397 {
"left-arrow",
"Left Arrow" },
398 {
"down-arrow",
"Down Arrow" },
399 {
"up-arrow",
"Up Arrow" },
400 {
"left-right-arrow",
"Left and Right Arrow" },
401 {
"up-down-arrow",
"Up and Down Arrow" },
403 {
"bang",
"Explosion" },
404 {
"lightning",
"Lighting Bolt" },
405 {
"heart",
"Heart" },
407 {
"quad-arrow",
"4-Way Arrow" },
408 {
"left-arrow-callout",
"Left Arrow Callout" },
409 {
"right-arrow-callout",
"Right Arrow Callout" },
410 {
"up-arrow-callout",
"Up Arrow Callout" },
411 {
"down-arrow-callout",
"Down Arrow Callout" },
412 {
"left-right-arrow-callout",
"Left and Right Arrow Callout" },
413 {
"up-down-arrow-callout",
"Up and Down Arrow Callout" },
414 {
"quad-arrow-callout",
"4-Way Arrow Callout" },
415 {
"quad-bevel",
"Square Bevel" },
416 {
"left-bracket",
"Left Bracket" },
417 {
"right-bracket",
"Right Bracket" },
418 {
"left-brace",
"Left Brace" },
419 {
"right-brace",
"Right Brace" },
420 {
"mso-spt89",
"Up and Left Arrow" },
423 {
"star24",
"24-Point Star" },
424 {
"striped-right-arrow",
"Striped Right Arrow" },
425 {
"notched-right-arrow",
"Notched Right Arrow" },
426 {
"block-arc",
"Block Arc" },
427 {
"smiley",
"Smile Face" },
428 {
"vertical-scroll",
"Vertical Scroll" },
429 {
"horizontal-scroll",
"Horizontal Scroll" },
430 {
"circular-arrow",
"Circular Arrow" },
431 {
"mso-spt100",
"Notched Circular Arrow" },
438 {
"cloud-callout",
"Cloud Callout" },
441 {
"flowchart-process",
"Flowchart:Process" },
442 {
"flowchart-decision",
"Flowchart:Decision" },
443 {
"flowchart-data",
"Flowchart:Data" },
444 {
"flowchart-predefined-process",
"Flowchart:Predefined Process" },
445 {
"flowchart-internal-storage",
"Flowchart:Internal Storage" },
446 {
"flowchart-document",
"Flowchart:Document" },
447 {
"flowchart-multidocument",
"Flowchart:Multidocument" },
448 {
"flowchart-terminator",
"Flowchart:Terminator" },
449 {
"flowchart-preparation",
"Flowchart:Preparation" },
450 {
"flowchart-manual-input",
"Flowchart:Manual Input" },
451 {
"flowchart-manual-operation",
"Flowchart:Manual Operation" },
452 {
"flowchart-connector",
"Flowchart:Connector" },
453 {
"flowchart-card",
"Flowchart:Card" },
454 {
"flowchart-punched-tape",
"Flowchart:Punched Tape" },
455 {
"flowchart-summing-junction",
"Flowchart:Summing Junction" },
456 {
"flowchart-or",
"Flowchart:Or" },
457 {
"flowchart-collate",
"Flowchart:Collate" },
458 {
"flowchart-sort",
"Flowchart:Sort" },
459 {
"flowchart-extract",
"Flowchart:Extract" },
460 {
"flowchart-merge",
"Flowchart:Merge" },
462 {
"flowchart-stored-data",
"Flowchart:Stored Data" },
463 {
"flowchart-sequential-access",
"drawingbar.fc.25=Flowchart:Sequential Access" },
464 {
"flowchart-magnetic-disk",
"Flowchart:Magnetic Disk" },
465 {
"flowchart-direct-access-storage",
"Flowchart:Direct Access Storage" },
466 {
"flowchart-display",
"Flowchart:Display" },
467 {
"flowchart-delay",
"Flowchart:Delay" },
508 {
"flowchart-alternate-process",
"Flowchart:Alternate Process " },
509 {
"flowchart-off-page-connector",
"Flowchart:Off-page Connector" },
513 {
"line-callout-3",
"Line Callout 3" },
517 {
"bracket-pair",
"Double Bracket" },
518 {
"brace-pair",
"Double Brace" },
519 {
"star4",
"4-Point Star" },
535 {
"frame",
"Frame" },
536 {
"col-60da8460",
"Octagon Bevel" },
537 {
"col-502ad400",
"Diamond Bevel" }
549 const ACCNameTypeTable* pEnd = pPtr +
SAL_N_ELEMENTS( pACCNameTypeTableArray );
550 for ( ; pPtr < pEnd; pPtr++ )
551 (*pH)[ pPtr->pS ] = pPtr->pE;
556 int i, nLen = rShapeType.getLength();
557 std::unique_ptr<char[]> pBuf(
new char[ nLen + 1 ]);
558 for ( i = 0; i < nLen; i++ )
559 pBuf[ i ] = static_cast<char>(rShapeType[ i ]);
561 TypeACCNameHashMap::const_iterator aHashIter(
pACCHashMap->find( pBuf.get() ) );
563 sRetValue = OUString::createFromAscii( (*aHashIter).second );
static TypeACCNameHashMap * pACCHashMap
std::unordered_map< const char *, MSO_SPT, rtl::CStringHash, rtl::CStringEqual > TypeNameHashMap
::osl::Mutex & getHashMapMutex()
const NameTypeTable pNameTypeTableArray[]
std::unordered_map< const char *, PPPOptimizerTokenEnum, rtl::CStringHash, rtl::CStringEqual > TypeNameHashMap
#define SAL_N_ELEMENTS(arr)
std::unordered_map< const char *, const char *, rtl::CStringHash, rtl::CStringEqual > TypeACCNameHashMap
const ACCNameTypeTable pACCNameTypeTableArray[]
SVXCORE_DLLPUBLIC OUString GetAccName(const OUString &)
SVXCORE_DLLPUBLIC MSO_SPT Get(const OUString &)
static TypeNameHashMap * pHashMap