[Libreoffice-commits] core.git: 2 commits - filter/source include/filter oox/source

Miklos Vajna vmiklos at collabora.co.uk
Mon Dec 2 10:04:39 PST 2013


 filter/source/msfilter/util.cxx  |  654 +++++++++++++++++++++++++++++++++++++++
 include/filter/msfilter/util.hxx |    7 
 oox/source/export/shapes.cxx     |  428 -------------------------
 3 files changed, 663 insertions(+), 426 deletions(-)

New commits:
commit 7f9a03e1b7cf14ae28e3dbd6ac827c04c5e2b85c
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Mon Dec 2 18:38:14 2013 +0100

    msfilter: add a drawingML -> VML map
    
    This can be used later for the VML or binary export of shapes imported
    from drawingML. Note that without this, drawingML shapes won't be
    exported to VML, as e.g. for a triangle it expects a
    'isosceles-triangle' type, while the shype's type is 'ooxml-triangle'.
    
    Change-Id: I59abc27febdd026c181a7ff38b16c93567058cb9

diff --git a/filter/source/msfilter/util.cxx b/filter/source/msfilter/util.cxx
index d3ffc5d..614c3ac 100644
--- a/filter/source/msfilter/util.cxx
+++ b/filter/source/msfilter/util.cxx
@@ -1088,6 +1088,215 @@ static const CustomShapeTypeTranslationTable pCustomShapeTypeTranslationTable[]
     { "ooxml-ribbon", "ribbon" },
 };
 
+struct {
+    const char* sDML;
+    MSO_SPT nVML;
+} pDMLToVMLTable[] = {
+    {"notPrimitive", mso_sptNotPrimitive},
+    {"rectangle", mso_sptRectangle},
+    {"roundRectangle", mso_sptRoundRectangle},
+    {"ellipse", mso_sptEllipse},
+    {"diamond", mso_sptDiamond},
+    {"triangle", mso_sptIsocelesTriangle},
+    {"rtTriangle", mso_sptRightTriangle},
+    {"parallelogram", mso_sptParallelogram},
+    {"trapezoid", mso_sptTrapezoid},
+    {"hexagon", mso_sptHexagon},
+    {"octagon", mso_sptOctagon},
+    {"plus", mso_sptPlus},
+    {"star5", mso_sptStar},
+    {"rightArrow", mso_sptArrow},
+    {"thickArrow", mso_sptThickArrow},
+    {"homePlate", mso_sptHomePlate},
+    {"cube", mso_sptCube},
+    {"wedgeRoundRectCallout", mso_sptBalloon},
+    {"star16", mso_sptSeal},
+    {"arc", mso_sptArc},
+    {"line", mso_sptLine},
+    {"plaque", mso_sptPlaque},
+    {"can", mso_sptCan},
+    {"donut", mso_sptDonut},
+    {"textPlain", mso_sptTextSimple},
+    {"textStop", mso_sptTextOctagon},
+    {"textTriangle", mso_sptTextHexagon},
+    {"textCanDown", mso_sptTextCurve},
+    {"textWave1", mso_sptTextWave},
+    {"textArchUpPour", mso_sptTextRing},
+    {"textCanDown", mso_sptTextOnCurve},
+    {"textArchUp", mso_sptTextOnRing},
+    {"straightConnector1", mso_sptStraightConnector1},
+    {"bentConnector2", mso_sptBentConnector2},
+    {"bentConnector3", mso_sptBentConnector3},
+    {"bentConnector4", mso_sptBentConnector4},
+    {"bentConnector5", mso_sptBentConnector5},
+    {"curvedConnector2", mso_sptCurvedConnector2},
+    {"curvedConnector3", mso_sptCurvedConnector3},
+    {"curvedConnector4", mso_sptCurvedConnector4},
+    {"curvedConnector5", mso_sptCurvedConnector5},
+    {"callout1", mso_sptCallout1},
+    {"callout2", mso_sptCallout2},
+    {"callout3", mso_sptCallout3},
+    {"accentCallout1", mso_sptAccentCallout1},
+    {"accentCallout2", mso_sptAccentCallout2},
+    {"accentCallout3", mso_sptAccentCallout3},
+    {"borderCallout1", mso_sptBorderCallout1},
+    {"borderCallout2", mso_sptBorderCallout2},
+    {"borderCallout3", mso_sptBorderCallout3},
+    {"accentBorderCallout1", mso_sptAccentBorderCallout1},
+    {"accentBorderCallout2", mso_sptAccentBorderCallout2},
+    {"accentBorderCallout3", mso_sptAccentBorderCallout3},
+    {"ribbon", mso_sptRibbon},
+    {"ribbon2", mso_sptRibbon2},
+    {"chevron", mso_sptChevron},
+    {"pentagon", mso_sptPentagon},
+    {"noSmoking", mso_sptNoSmoking},
+    {"star8", mso_sptSeal8},
+    {"star16", mso_sptSeal16},
+    {"star32", mso_sptSeal32},
+    {"wedgeRectCallout", mso_sptWedgeRectCallout},
+    {"wedgeRoundRectCallout", mso_sptWedgeRRectCallout},
+    {"wedgeEllipseCallout", mso_sptWedgeEllipseCallout},
+    {"wave", mso_sptWave},
+    {"foldedCorner", mso_sptFoldedCorner},
+    {"leftArrow", mso_sptLeftArrow},
+    {"downArrow", mso_sptDownArrow},
+    {"upArrow", mso_sptUpArrow},
+    {"leftRightArrow", mso_sptLeftRightArrow},
+    {"upDownArrow", mso_sptUpDownArrow},
+    {"irregularSeal1", mso_sptIrregularSeal1},
+    {"irregularSeal2", mso_sptIrregularSeal2},
+    {"lightningBolt", mso_sptLightningBolt},
+    {"heart", mso_sptHeart},
+    {"pictureFrame", mso_sptPictureFrame},
+    {"quadArrow", mso_sptQuadArrow},
+    {"leftArrowCallout", mso_sptLeftArrowCallout},
+    {"rightArrowCallout", mso_sptRightArrowCallout},
+    {"upArrowCallout", mso_sptUpArrowCallout},
+    {"downArrowCallout", mso_sptDownArrowCallout},
+    {"leftRightArrowCallout", mso_sptLeftRightArrowCallout},
+    {"upDownArrowCallout", mso_sptUpDownArrowCallout},
+    {"quadArrowCallout", mso_sptQuadArrowCallout},
+    {"bevel", mso_sptBevel},
+    {"leftBracket", mso_sptLeftBracket},
+    {"rightBracket", mso_sptRightBracket},
+    {"leftBrace", mso_sptLeftBrace},
+    {"rightBrace", mso_sptRightBrace},
+    {"leftUpArrow", mso_sptLeftUpArrow},
+    {"bentUpArrow", mso_sptBentUpArrow},
+    {"bentArrow", mso_sptBentArrow},
+    {"star24", mso_sptSeal24},
+    {"stripedRightArrow", mso_sptStripedRightArrow},
+    {"notchedRightArrow", mso_sptNotchedRightArrow},
+    {"blockArc", mso_sptBlockArc},
+    {"smileyFace", mso_sptSmileyFace},
+    {"verticalScroll", mso_sptVerticalScroll},
+    {"horizontalScroll", mso_sptHorizontalScroll},
+    {"circularArrow", mso_sptCircularArrow},
+    {"notchedCircularArrow", mso_sptNotchedCircularArrow},
+    {"uturnArrow", mso_sptUturnArrow},
+    {"curvedRightArrow", mso_sptCurvedRightArrow},
+    {"curvedLeftArrow", mso_sptCurvedLeftArrow},
+    {"curvedUpArrow", mso_sptCurvedUpArrow},
+    {"curvedDownArrow", mso_sptCurvedDownArrow},
+    {"cloudCallout", mso_sptCloudCallout},
+    {"ellipseRibbon", mso_sptEllipseRibbon},
+    {"ellipseRibbon2", mso_sptEllipseRibbon2},
+    {"flowChartProcess", mso_sptFlowChartProcess},
+    {"flowChartDecision", mso_sptFlowChartDecision},
+    {"flowChartInputOutput", mso_sptFlowChartInputOutput},
+    {"flowChartPredefinedProcess", mso_sptFlowChartPredefinedProcess},
+    {"flowChartInternalStorage", mso_sptFlowChartInternalStorage},
+    {"flowChartDocument", mso_sptFlowChartDocument},
+    {"flowChartMultidocument", mso_sptFlowChartMultidocument},
+    {"flowChartTerminator", mso_sptFlowChartTerminator},
+    {"flowChartPreparation", mso_sptFlowChartPreparation},
+    {"flowChartManualInput", mso_sptFlowChartManualInput},
+    {"flowChartManualOperation", mso_sptFlowChartManualOperation},
+    {"flowChartConnector", mso_sptFlowChartConnector},
+    {"flowChartPunchedCard", mso_sptFlowChartPunchedCard},
+    {"flowChartPunchedTape", mso_sptFlowChartPunchedTape},
+    {"flowChartSummingJunction", mso_sptFlowChartSummingJunction},
+    {"flowChartOr", mso_sptFlowChartOr},
+    {"flowChartCollate", mso_sptFlowChartCollate},
+    {"flowChartSort", mso_sptFlowChartSort},
+    {"flowChartExtract", mso_sptFlowChartExtract},
+    {"flowChartMerge", mso_sptFlowChartMerge},
+    {"flowChartOfflineStorage", mso_sptFlowChartOfflineStorage},
+    {"flowChartOnlineStorage", mso_sptFlowChartOnlineStorage},
+    {"flowChartMagneticTape", mso_sptFlowChartMagneticTape},
+    {"flowChartMagneticDisk", mso_sptFlowChartMagneticDisk},
+    {"flowChartMagneticDrum", mso_sptFlowChartMagneticDrum},
+    {"flowChartDisplay", mso_sptFlowChartDisplay},
+    {"flowChartDelay", mso_sptFlowChartDelay},
+    {"textPlain", mso_sptTextPlainText},
+    {"textStop", mso_sptTextStop},
+    {"textTriangle", mso_sptTextTriangle},
+    {"textTriangleInverted", mso_sptTextTriangleInverted},
+    {"textChevron", mso_sptTextChevron},
+    {"textChevronInverted", mso_sptTextChevronInverted},
+    {"textRingInside", mso_sptTextRingInside},
+    {"textRingOutside", mso_sptTextRingOutside},
+    {"textArchUp", mso_sptTextArchUpCurve},
+    {"textArchDown", mso_sptTextArchDownCurve},
+    {"textCircle", mso_sptTextCircleCurve},
+    {"textButton", mso_sptTextButtonCurve},
+    {"textArchUpPour", mso_sptTextArchUpPour},
+    {"textArchDownPour", mso_sptTextArchDownPour},
+    {"textCirclePour", mso_sptTextCirclePour},
+    {"textButtonPour", mso_sptTextButtonPour},
+    {"textCurveUp", mso_sptTextCurveUp},
+    {"textCurveDown", mso_sptTextCurveDown},
+    {"textCascadeUp", mso_sptTextCascadeUp},
+    {"textCascadeDown", mso_sptTextCascadeDown},
+    {"textWave1", mso_sptTextWave1},
+    {"textWave2", mso_sptTextWave2},
+    {"textWave3", mso_sptTextWave3},
+    {"textWave4", mso_sptTextWave4},
+    {"textInflate", mso_sptTextInflate},
+    {"textDeflate", mso_sptTextDeflate},
+    {"textInflateBottom", mso_sptTextInflateBottom},
+    {"textDeflateBottom", mso_sptTextDeflateBottom},
+    {"textInflateTop", mso_sptTextInflateTop},
+    {"textDeflateTop", mso_sptTextDeflateTop},
+    {"textDeflateInflate", mso_sptTextDeflateInflate},
+    {"textDeflateInflateDeflate", mso_sptTextDeflateInflateDeflate},
+    {"textFadeRight", mso_sptTextFadeRight},
+    {"textFadeLeft", mso_sptTextFadeLeft},
+    {"textFadeUp", mso_sptTextFadeUp},
+    {"textFadeDown", mso_sptTextFadeDown},
+    {"textSlantUp", mso_sptTextSlantUp},
+    {"textSlantDown", mso_sptTextSlantDown},
+    {"textCanUp", mso_sptTextCanUp},
+    {"textCanDown", mso_sptTextCanDown},
+    {"flowChartAlternateProcess", mso_sptFlowChartAlternateProcess},
+    {"flowChartOffpageConnector", mso_sptFlowChartOffpageConnector},
+    {"callout1", mso_sptCallout90},
+    {"accentCallout1", mso_sptAccentCallout90},
+    {"borderCallout1", mso_sptBorderCallout90},
+    {"accentBorderCallout1", mso_sptAccentBorderCallout90},
+    {"leftRightUpArrow", mso_sptLeftRightUpArrow},
+    {"sun", mso_sptSun},
+    {"moon", mso_sptMoon},
+    {"bracketPair", mso_sptBracketPair},
+    {"bracePair", mso_sptBracePair},
+    {"star4", mso_sptSeal4},
+    {"doubleWave", mso_sptDoubleWave},
+    {"actionButtonBlank", mso_sptActionButtonBlank},
+    {"actionButtonHome", mso_sptActionButtonHome},
+    {"actionButtonHelp", mso_sptActionButtonHelp},
+    {"actionButtonInformation", mso_sptActionButtonInformation},
+    {"actionButtonForwardNext", mso_sptActionButtonForwardNext},
+    {"actionButtonBackPrevious", mso_sptActionButtonBackPrevious},
+    {"actionButtonEnd", mso_sptActionButtonEnd},
+    {"actionButtonBeginning", mso_sptActionButtonBeginning},
+    {"actionButtonReturn", mso_sptActionButtonReturn},
+    {"actionButtonDocument", mso_sptActionButtonDocument},
+    {"actionButtonSound", mso_sptActionButtonSound},
+    {"actionButtonMovie", mso_sptActionButtonMovie},
+    {"hostControl", mso_sptHostControl},
+    {"textBox", mso_sptTextBox},
+};
+
 typedef boost::unordered_map< const char*, const char*, rtl::CStringHash, rtl::CStringEqual> CustomShapeTypeTranslationHashMap;
 static CustomShapeTypeTranslationHashMap* pCustomShapeTypeTranslationHashMap = NULL;
 
@@ -1112,6 +1321,26 @@ const char* GetOOXMLPresetGeometry( const char* sShapeType )
     return sPresetGeo;
 }
 
+typedef boost::unordered_map< const char*, MSO_SPT, rtl::CStringHash, rtl::CStringEqual> DMLToVMLTranslationHashMap;
+static DMLToVMLTranslationHashMap* pDMLToVMLMap;
+
+MSO_SPT GETVMLShapeType(OString aType)
+{
+    const char* pDML = GetOOXMLPresetGeometry(aType.getStr());
+
+    if (!pDMLToVMLMap)
+    {
+        pDMLToVMLMap = new DMLToVMLTranslationHashMap();
+        for (size_t i = 0; i < SAL_N_ELEMENTS(pDMLToVMLTable); ++i)
+            (*pDMLToVMLMap)[pDMLToVMLTable[i].sDML] = pDMLToVMLTable[i].nVML;
+    }
+
+    if (pDMLToVMLMap->find(pDML) == pDMLToVMLMap->end())
+        return mso_sptNil;
+
+    return (*pDMLToVMLMap)[pDML];
+}
+
 }
 }
 
diff --git a/include/filter/msfilter/util.hxx b/include/filter/msfilter/util.hxx
index 80a0a8f..b22c6fb 100644
--- a/include/filter/msfilter/util.hxx
+++ b/include/filter/msfilter/util.hxx
@@ -15,6 +15,7 @@
 #include <tools/color.hxx>
 #include <com/sun/star/lang/Locale.hpp>
 #include <filter/msfilter/msfilterdllapi.h>
+#include <svx/msdffdef.hxx>
 #include <com/sun/star/awt/Size.hpp>
 
 namespace msfilter {
@@ -131,9 +132,12 @@ struct MSFILTER_DLLPUBLIC EquationResult
 
 MSFILTER_DLLPUBLIC EquationResult ParseCombinedChars(const OUString& rStr);
 
-/// Similar to EnhancedCustomShapeTypeNames::Get(), but it also supports OOXML types.
+/// Similar to EnhancedCustomShapeTypeNames::Get(), but it also supports OOXML types and returns a drawingML string.
 MSFILTER_DLLPUBLIC const char* GetOOXMLPresetGeometry( const char* sShapeType );
 
+/// Similar to EnhancedCustomShapeTypeNames::Get(), but returns an MSO_SPT (binary / VML type).
+MSFILTER_DLLPUBLIC MSO_SPT GETVMLShapeType(OString aType);
+
 }
 
 }
commit 8dbedf1667f2558c682c636ac9162b36d252e362
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Mon Dec 2 17:41:41 2013 +0100

    oox: move lcl_GetPresetGeometry to msfilter, so filter can use it
    
    Change-Id: Ia741d392a87eaa2f02615a6c9626417a420f205c

diff --git a/filter/source/msfilter/util.cxx b/filter/source/msfilter/util.cxx
index 0bd7cbe..d3ffc5d 100644
--- a/filter/source/msfilter/util.cxx
+++ b/filter/source/msfilter/util.cxx
@@ -13,6 +13,7 @@
 #include <unotools/fontdefs.hxx>
 #include <vcl/svapp.hxx>
 #include <filter/msfilter/util.hxx>
+#include <boost/unordered_map.hpp>
 
 namespace msfilter {
 namespace util {
@@ -687,6 +688,430 @@ EquationResult ParseCombinedChars(const OUString& rStr)
     return aResult;
 }
 
+struct CustomShapeTypeTranslationTable
+{
+    const char* sOOo;
+    const char* sMSO;
+};
+
+static const CustomShapeTypeTranslationTable pCustomShapeTypeTranslationTable[] =
+{
+    // { "non-primitive", mso_sptMin },
+    { "rectangle", "rect" },
+    { "round-rectangle", "roundRect" },
+    { "ellipse", "ellipse" },
+    { "diamond", "diamond" },
+    { "isosceles-triangle", "triangle" },
+    { "right-triangle", "rtTriangle" },
+    { "parallelogram", "parallelogram" },
+    { "trapezoid", "trapezoid" },
+    { "hexagon", "hexagon" },
+    { "octagon", "octagon" },
+    { "cross", "plus" },
+    { "star5", "star5" },
+    { "right-arrow", "rightArrow" },
+    // { "mso-spt14", mso_sptThickArrow },
+    { "pentagon-right", "homePlate" },
+    { "cube", "cube" },
+    // { "mso-spt17", mso_sptBalloon },
+    // { "mso-spt18", mso_sptSeal },
+    { "mso-spt19", "arc" },
+    { "mso-spt20", "line" },
+    { "mso-spt21", "plaque" },
+    { "can", "can" },
+    { "ring", "donut" },
+    { "mso-spt24", "textSimple" },
+    { "mso-spt25", "textOctagon" },
+    { "mso-spt26", "textHexagon" },
+    { "mso-spt27", "textCurve" },
+    { "mso-spt28", "textWave" },
+    { "mso-spt29", "textRing" },
+    { "mso-spt30", "textOnCurve" },
+    { "mso-spt31", "textOnRing" },
+    { "mso-spt32", "straightConnector1" },
+    { "mso-spt33", "bentConnector2" },
+    { "mso-spt34", "bentConnector3" },
+    { "mso-spt35", "bentConnector4" },
+    { "mso-spt36", "bentConnector5" },
+    { "mso-spt37", "curvedConnector2" },
+    { "mso-spt38", "curvedConnector3" },
+    { "mso-spt39", "curvedConnector4" },
+    { "mso-spt40", "curvedConnector5" },
+    { "mso-spt41", "callout1" },
+    { "mso-spt42", "callout2" },
+    { "mso-spt43", "callout3" },
+    { "mso-spt44", "accentCallout1" },
+    { "mso-spt45", "accentCallout2" },
+    { "mso-spt46", "accentCallout3" },
+    { "line-callout-1", "borderCallout1" },
+    { "line-callout-2", "borderCallout2" },
+    { "line-callout-3", "borderCallout3" },
+    { "mso-spt49", "accentBorderCallout90" },
+    { "mso-spt50", "accentBorderCallout1" },
+    { "mso-spt51", "accentBorderCallout2" },
+    { "mso-spt52", "accentBorderCallout3" },
+    { "mso-spt53", "ribbon" },
+    { "mso-spt54", "ribbon2" },
+    { "chevron", "chevron" },
+    { "pentagon", "pentagon" },
+    { "forbidden", "noSmoking" },
+    { "star8", "seal8" },
+    { "mso-spt59", "seal16" },
+    { "mso-spt60", "seal32" },
+    { "rectangular-callout", "wedgeRectCallout" },
+    { "round-rectangular-callout", "wedgeRoundRectCallout" },
+    { "round-callout", "wedgeEllipseCallout" },
+    { "mso-spt64", "wave" },
+    { "paper", "foldedCorner" },
+    { "left-arrow", "leftArrow" },
+    { "down-arrow", "downArrow" },
+    { "up-arrow", "upArrow" },
+    { "left-right-arrow", "leftRightArrow" },
+    { "up-down-arrow", "upDownArrow" },
+    { "mso-spt71", "irregularSeal1" },
+    { "bang", "irregularSeal2" },
+    { "lightning", "lightningBolt" },
+    { "heart", "heart" },
+    { "mso-spt75", "pictureFrame" },
+    { "quad-arrow", "quadArrow" },
+    { "left-arrow-callout", "leftArrowCallout" },
+    { "right-arrow-callout", "rightArrowCallout" },
+    { "up-arrow-callout", "upArrowCallout" },
+    { "down-arrow-callout", "downArrowCallout" },
+    { "left-right-arrow-callout", "leftRightArrowCallout" },
+    { "up-down-arrow-callout", "upDownArrowCallout" },
+    { "quad-arrow-callout", "quadArrowCallout" },
+    { "quad-bevel", "bevel" },
+    { "left-bracket", "leftBracket" },
+    { "right-bracket", "rightBracket" },
+    { "left-brace", "leftBrace" },
+    { "right-brace", "rightBrace" },
+    { "mso-spt89", "leftUpArrow" },
+    { "mso-spt90", "bentUpArrow" },
+    { "mso-spt91", "bentArrow" },
+    { "star24", "seal24" },
+    { "striped-right-arrow", "stripedRightArrow" },
+    { "notched-right-arrow", "notchedRightArrow" },
+    { "block-arc", "blockArc" },
+    { "smiley", "smileyFace" },
+    { "vertical-scroll", "verticalScroll" },
+    { "horizontal-scroll", "horizontalScroll" },
+    { "circular-arrow", "circularArrow" },
+    { "mso-spt100", "pie" }, // looks like MSO_SPT is wrong here
+    { "mso-spt101", "uturnArrow" },
+    { "mso-spt102", "curvedRightArrow" },
+    { "mso-spt103", "curvedLeftArrow" },
+    { "mso-spt104", "curvedUpArrow" },
+    { "mso-spt105", "curvedDownArrow" },
+    { "cloud-callout", "cloudCallout" },
+    { "mso-spt107", "ellipseRibbon" },
+    { "mso-spt108", "ellipseRibbon2" },
+    { "flowchart-process", "flowChartProcess" },
+    { "flowchart-decision", "flowChartDecision" },
+    { "flowchart-data", "flowChartInputOutput" },
+    { "flowchart-predefined-process", "flowChartPredefinedProcess" },
+    { "flowchart-internal-storage", "flowChartInternalStorage" },
+    { "flowchart-document", "flowChartDocument" },
+    { "flowchart-multidocument", "flowChartMultidocument" },
+    { "flowchart-terminator", "flowChartTerminator" },
+    { "flowchart-preparation", "flowChartPreparation" },
+    { "flowchart-manual-input", "flowChartManualInput" },
+    { "flowchart-manual-operation", "flowChartManualOperation" },
+    { "flowchart-connector", "flowChartConnector" },
+    { "flowchart-card", "flowChartPunchedCard" },
+    { "flowchart-punched-tape", "flowChartPunchedTape" },
+    { "flowchart-summing-junction", "flowChartSummingJunction" },
+    { "flowchart-or", "flowChartOr" },
+    { "flowchart-collate", "flowChartCollate" },
+    { "flowchart-sort", "flowChartSort" },
+    { "flowchart-extract", "flowChartExtract" },
+    { "flowchart-merge", "flowChartMerge" },
+    { "mso-spt129", "flowChartOfflineStorage" },
+    { "flowchart-stored-data", "flowChartOnlineStorage" },
+    { "flowchart-sequential-access", "flowChartMagneticTape" },
+    { "flowchart-magnetic-disk", "flowChartMagneticDisk" },
+    { "flowchart-direct-access-storage", "flowChartMagneticDrum" },
+    { "flowchart-display", "flowChartDisplay" },
+    { "flowchart-delay", "flowChartDelay" },
+    { "fontwork-plain-text", "textPlainText" },
+    { "fontwork-stop", "textStop" },
+    { "fontwork-triangle-up", "textTriangle" },
+    { "fontwork-triangle-down", "textTriangleInverted" },
+    { "fontwork-chevron-up", "textChevron" },
+    { "fontwork-chevron-down", "textChevronInverted" },
+    { "mso-spt142", "textRingInside" },
+    { "mso-spt143", "textRingOutside" },
+    { "fontwork-arch-up-curve", "textArchUpCurve" },
+    { "fontwork-arch-down-curve", "textArchDownCurve" },
+    { "fontwork-circle-curve", "textCircleCurve" },
+    { "fontwork-open-circle-curve", "textButtonCurve" },
+    { "fontwork-arch-up-pour", "textArchUpPour" },
+    { "fontwork-arch-down-pour", "textArchDownPour" },
+    { "fontwork-circle-pour", "textCirclePour" },
+    { "fontwork-open-circle-pour", "textButtonPour" },
+    { "fontwork-curve-up", "textCurveUp" },
+    { "fontwork-curve-down", "textCurveDown" },
+    { "fontwork-fade-up-and-right", "textCascadeUp" },
+    { "fontwork-fade-up-and-left", "textCascadeDown" },
+    { "fontwork-wave", "textWave1" },
+    { "mso-spt157", "textWave2" },
+    { "mso-spt158", "textWave3" },
+    { "mso-spt159", "textWave4" },
+    { "fontwork-inflate", "textInflate" },
+    { "mso-spt161", "textDeflate" },
+    { "mso-spt162", "textInflateBottom" },
+    { "mso-spt163", "textDeflateBottom" },
+    { "mso-spt164", "textInflateTop" },
+    { "mso-spt165", "textDeflateTop" },
+    { "mso-spt166", "textDeflateInflate" },
+    { "mso-spt167", "textDeflateInflateDeflate" },
+    { "fontwork-fade-right", "textFadeRight" },
+    { "fontwork-fade-left", "textFadeLeft" },
+    { "fontwork-fade-up", "textFadeUp" },
+    { "fontwork-fade-down", "textFadeDown" },
+    { "fontwork-slant-up", "textSlantUp" },
+    { "fontwork-slant-down", "textSlantDown" },
+    { "mso-spt174", "textCanUp" },
+    { "mso-spt175", "textCanDown" },
+    { "flowchart-alternate-process", "flowChartAlternateProcess" },
+    { "flowchart-off-page-connector", "flowChartOffpageConnector" },
+    { "mso-spt178", "callout90" },
+    { "mso-spt179", "accentCallout90" },
+    { "mso-spt180", "borderCallout90" },
+    { "mso-spt182", "leftRightUpArrow" },
+    { "sun", "sun" },
+    { "moon", "moon" },
+    { "bracket-pair", "bracketPair" },
+    { "brace-pair", "bracePair" },
+    { "star4", "seal4" },
+    { "mso-spt188", "doubleWave" },
+    { "mso-spt189", "actionButtonBlank" },
+    { "mso-spt190", "actionButtonHome" },
+    { "mso-spt191", "actionButtonHelp" },
+    { "mso-spt192", "actionButtonInformation" },
+    { "mso-spt193", "actionButtonForwardNext" },
+    { "mso-spt194", "actionButtonBackPrevious" },
+    { "mso-spt195", "actionButtonEnd" },
+    { "mso-spt196", "actionButtonBeginning" },
+    { "mso-spt197", "actionButtonReturn" },
+    { "mso-spt198", "actionButtonDocument" },
+    { "mso-spt199", "actionButtonSound" },
+    { "mso-spt200", "actionButtonMovie" },
+    { "mso-spt201", "hostControl" },
+    { "mso-spt202", "rect" },
+    { "ooxml-actionButtonSound", "actionButtonSound" },
+    { "ooxml-borderCallout1", "borderCallout1" },
+    { "ooxml-plaqueTabs", "plaqueTabs" },
+    { "ooxml-curvedLeftArrow", "curvedLeftArrow" },
+    { "ooxml-octagon", "octagon" },
+    { "ooxml-leftRightRibbon", "leftRightRibbon" },
+    { "ooxml-actionButtonInformation", "actionButtonInformation" },
+    { "ooxml-bentConnector5", "bentConnector5" },
+    { "ooxml-circularArrow", "circularArrow" },
+    { "ooxml-downArrowCallout", "downArrowCallout" },
+    { "ooxml-mathMinus", "mathMinus" },
+    { "ooxml-gear9", "gear9" },
+    { "ooxml-round1Rect", "round1Rect" },
+    { "ooxml-sun", "sun" },
+    { "ooxml-plaque", "plaque" },
+    { "ooxml-chevron", "chevron" },
+    { "ooxml-flowChartPreparation", "flowChartPreparation" },
+    { "ooxml-diagStripe", "diagStripe" },
+    { "ooxml-pentagon", "pentagon" },
+    { "ooxml-funnel", "funnel" },
+    { "ooxml-chartStar", "chartStar" },
+    { "ooxml-accentBorderCallout1", "accentBorderCallout1" },
+    { "ooxml-notchedRightArrow", "notchedRightArrow" },
+    { "ooxml-rightBracket", "rightBracket" },
+    { "ooxml-flowChartOffpageConnector", "flowChartOffpageConnector" },
+    { "ooxml-leftRightArrow", "leftRightArrow" },
+    { "ooxml-decagon", "decagon" },
+    { "ooxml-actionButtonHelp", "actionButtonHelp" },
+    { "ooxml-star24", "star24" },
+    { "ooxml-mathDivide", "mathDivide" },
+    { "ooxml-curvedConnector4", "curvedConnector4" },
+    { "ooxml-flowChartOr", "flowChartOr" },
+    { "ooxml-borderCallout3", "borderCallout3" },
+    { "ooxml-upDownArrowCallout", "upDownArrowCallout" },
+    { "ooxml-flowChartDecision", "flowChartDecision" },
+    { "ooxml-leftRightArrowCallout", "leftRightArrowCallout" },
+    { "ooxml-flowChartManualOperation", "flowChartManualOperation" },
+    { "ooxml-snipRoundRect", "snipRoundRect" },
+    { "ooxml-mathPlus", "mathPlus" },
+    { "ooxml-actionButtonForwardNext", "actionButtonForwardNext" },
+    { "ooxml-can", "can" },
+    { "ooxml-foldedCorner", "foldedCorner" },
+    { "ooxml-star32", "star32" },
+    { "ooxml-flowChartInternalStorage", "flowChartInternalStorage" },
+    { "ooxml-upDownArrow", "upDownArrow" },
+    { "ooxml-irregularSeal2", "irregularSeal2" },
+    { "ooxml-mathEqual", "mathEqual" },
+    { "ooxml-star12", "star12" },
+    { "ooxml-uturnArrow", "uturnArrow" },
+    { "ooxml-squareTabs", "squareTabs" },
+    { "ooxml-leftRightUpArrow", "leftRightUpArrow" },
+    { "ooxml-homePlate", "homePlate" },
+    { "ooxml-dodecagon", "dodecagon" },
+    { "ooxml-leftArrowCallout", "leftArrowCallout" },
+    { "ooxml-chord", "chord" },
+    { "ooxml-quadArrowCallout", "quadArrowCallout" },
+    { "ooxml-actionButtonBeginning", "actionButtonBeginning" },
+    { "ooxml-ellipse", "ellipse" },
+    { "ooxml-actionButtonEnd", "actionButtonEnd" },
+    { "ooxml-arc", "arc" },
+    { "ooxml-star16", "star16" },
+    { "ooxml-parallelogram", "parallelogram" },
+    { "ooxml-bevel", "bevel" },
+    { "ooxml-roundRect", "roundRect" },
+    { "ooxml-accentCallout1", "accentCallout1" },
+    { "ooxml-flowChartSort", "flowChartSort" },
+    { "ooxml-star8", "star8" },
+    { "ooxml-flowChartAlternateProcess", "flowChartAlternateProcess" },
+    { "ooxml-moon", "moon" },
+    { "ooxml-star6", "star6" },
+    { "ooxml-round2SameRect", "round2SameRect" },
+    { "ooxml-nonIsoscelesTrapezoid", "nonIsoscelesTrapezoid" },
+    { "ooxml-diamond", "diamond" },
+    { "ooxml-ellipseRibbon", "ellipseRibbon" },
+    { "ooxml-callout2", "callout2" },
+    { "ooxml-pie", "pie" },
+    { "ooxml-star4", "star4" },
+    { "ooxml-flowChartPredefinedProcess", "flowChartPredefinedProcess" },
+    { "ooxml-flowChartPunchedTape", "flowChartPunchedTape" },
+    { "ooxml-curvedConnector2", "curvedConnector2" },
+    { "ooxml-bentConnector3", "bentConnector3" },
+    { "ooxml-cornerTabs", "cornerTabs" },
+    { "ooxml-hexagon", "hexagon" },
+    { "ooxml-flowChartConnector", "flowChartConnector" },
+    { "ooxml-flowChartMagneticDisk", "flowChartMagneticDisk" },
+    { "ooxml-heart", "heart" },
+    { "ooxml-ribbon2", "ribbon2" },
+    { "ooxml-bracePair", "bracePair" },
+    { "ooxml-flowChartExtract", "flowChartExtract" },
+    { "ooxml-actionButtonHome", "actionButtonHome" },
+    { "ooxml-accentBorderCallout3", "accentBorderCallout3" },
+    { "ooxml-flowChartOfflineStorage", "flowChartOfflineStorage" },
+    { "ooxml-irregularSeal1", "irregularSeal1" },
+    { "ooxml-quadArrow", "quadArrow" },
+    { "ooxml-leftBrace", "leftBrace" },
+    { "ooxml-leftBracket", "leftBracket" },
+    { "ooxml-blockArc", "blockArc" },
+    { "ooxml-curvedConnector3", "curvedConnector3" },
+    { "ooxml-wedgeRoundRectCallout", "wedgeRoundRectCallout" },
+    { "ooxml-actionButtonMovie", "actionButtonMovie" },
+    { "ooxml-flowChartOnlineStorage", "flowChartOnlineStorage" },
+    { "ooxml-gear6", "gear6" },
+    { "ooxml-halfFrame", "halfFrame" },
+    { "ooxml-snip2SameRect", "snip2SameRect" },
+    { "ooxml-triangle", "triangle" },
+    { "ooxml-teardrop", "teardrop" },
+    { "ooxml-flowChartDocument", "flowChartDocument" },
+    { "ooxml-rightArrowCallout", "rightArrowCallout" },
+    { "ooxml-rightBrace", "rightBrace" },
+    { "ooxml-chartPlus", "chartPlus" },
+    { "ooxml-flowChartManualInput", "flowChartManualInput" },
+    { "ooxml-flowChartMerge", "flowChartMerge" },
+    { "ooxml-line", "line" },
+    { "ooxml-downArrow", "downArrow" },
+    { "ooxml-upArrow", "upArrow" },
+    { "ooxml-curvedDownArrow", "curvedDownArrow" },
+    { "ooxml-actionButtonReturn", "actionButtonReturn" },
+    { "ooxml-flowChartInputOutput", "flowChartInputOutput" },
+    { "ooxml-bracketPair", "bracketPair" },
+    { "ooxml-smileyFace", "smileyFace" },
+    { "ooxml-actionButtonBlank", "actionButtonBlank" },
+    { "ooxml-wave", "wave" },
+    { "ooxml-swooshArrow", "swooshArrow" },
+    { "ooxml-flowChartSummingJunction", "flowChartSummingJunction" },
+    { "ooxml-lightningBolt", "lightningBolt" },
+    { "ooxml-flowChartDisplay", "flowChartDisplay" },
+    { "ooxml-actionButtonBackPrevious", "actionButtonBackPrevious" },
+    { "ooxml-frame", "frame" },
+    { "ooxml-rtTriangle", "rtTriangle" },
+    { "ooxml-flowChartMagneticTape", "flowChartMagneticTape" },
+    { "ooxml-curvedRightArrow", "curvedRightArrow" },
+    { "ooxml-leftUpArrow", "leftUpArrow" },
+    { "ooxml-wedgeEllipseCallout", "wedgeEllipseCallout" },
+    { "ooxml-doubleWave", "doubleWave" },
+    { "ooxml-bentArrow", "bentArrow" },
+    { "ooxml-star10", "star10" },
+    { "ooxml-leftArrow", "leftArrow" },
+    { "ooxml-curvedUpArrow", "curvedUpArrow" },
+    { "ooxml-snip1Rect", "snip1Rect" },
+    { "ooxml-ellipseRibbon2", "ellipseRibbon2" },
+    { "ooxml-plus", "plus" },
+    { "ooxml-accentCallout3", "accentCallout3" },
+    { "ooxml-leftCircularArrow", "leftCircularArrow" },
+    { "ooxml-rightArrow", "rightArrow" },
+    { "ooxml-flowChartPunchedCard", "flowChartPunchedCard" },
+    { "ooxml-snip2DiagRect", "snip2DiagRect" },
+    { "ooxml-verticalScroll", "verticalScroll" },
+    { "ooxml-star7", "star7" },
+    { "ooxml-chartX", "chartX" },
+    { "ooxml-cloud", "cloud" },
+    { "ooxml-cube", "cube" },
+    { "ooxml-round2DiagRect", "round2DiagRect" },
+    { "ooxml-flowChartMultidocument", "flowChartMultidocument" },
+    { "ooxml-actionButtonDocument", "actionButtonDocument" },
+    { "ooxml-flowChartTerminator", "flowChartTerminator" },
+    { "ooxml-flowChartDelay", "flowChartDelay" },
+    { "ooxml-curvedConnector5", "curvedConnector5" },
+    { "ooxml-horizontalScroll", "horizontalScroll" },
+    { "ooxml-bentConnector4", "bentConnector4" },
+    { "ooxml-leftRightCircularArrow", "leftRightCircularArrow" },
+    { "ooxml-wedgeRectCallout", "wedgeRectCallout" },
+    { "ooxml-accentCallout2", "accentCallout2" },
+    { "ooxml-flowChartMagneticDrum", "flowChartMagneticDrum" },
+    { "ooxml-corner", "corner" },
+    { "ooxml-borderCallout2", "borderCallout2" },
+    { "ooxml-donut", "donut" },
+    { "ooxml-flowChartCollate", "flowChartCollate" },
+    { "ooxml-mathNotEqual", "mathNotEqual" },
+    { "ooxml-bentConnector2", "bentConnector2" },
+    { "ooxml-mathMultiply", "mathMultiply" },
+    { "ooxml-heptagon", "heptagon" },
+    { "ooxml-rect", "rect" },
+    { "ooxml-accentBorderCallout2", "accentBorderCallout2" },
+    { "ooxml-pieWedge", "pieWedge" },
+    { "ooxml-upArrowCallout", "upArrowCallout" },
+    { "ooxml-flowChartProcess", "flowChartProcess" },
+    { "ooxml-star5", "star5" },
+    { "ooxml-lineInv", "lineInv" },
+    { "ooxml-straightConnector1", "straightConnector1" },
+    { "ooxml-stripedRightArrow", "stripedRightArrow" },
+    { "ooxml-callout3", "callout3" },
+    { "ooxml-bentUpArrow", "bentUpArrow" },
+    { "ooxml-noSmoking", "noSmoking" },
+    { "ooxml-trapezoid", "trapezoid" },
+    { "ooxml-cloudCallout", "cloudCallout" },
+    { "ooxml-callout1", "callout1" },
+    { "ooxml-ribbon", "ribbon" },
+};
+
+typedef boost::unordered_map< const char*, const char*, rtl::CStringHash, rtl::CStringEqual> CustomShapeTypeTranslationHashMap;
+static CustomShapeTypeTranslationHashMap* pCustomShapeTypeTranslationHashMap = NULL;
+
+const char* GetOOXMLPresetGeometry( const char* sShapeType )
+{
+    const char* sPresetGeo;
+
+    if( pCustomShapeTypeTranslationHashMap == NULL )
+    {
+        pCustomShapeTypeTranslationHashMap = new CustomShapeTypeTranslationHashMap ();
+        for( unsigned int i = 0; i < sizeof( pCustomShapeTypeTranslationTable )/sizeof( CustomShapeTypeTranslationTable ); i ++ )
+        {
+            (*pCustomShapeTypeTranslationHashMap)[ pCustomShapeTypeTranslationTable[ i ].sOOo ] = pCustomShapeTypeTranslationTable[ i ].sMSO;
+        }
+    }
+
+    sPresetGeo = (*pCustomShapeTypeTranslationHashMap)[ sShapeType ];
+
+    if( sPresetGeo == NULL )
+        sPresetGeo = "rect";
+
+    return sPresetGeo;
+}
+
 }
 }
 
diff --git a/include/filter/msfilter/util.hxx b/include/filter/msfilter/util.hxx
index f857bf5..80a0a8f 100644
--- a/include/filter/msfilter/util.hxx
+++ b/include/filter/msfilter/util.hxx
@@ -131,6 +131,9 @@ struct MSFILTER_DLLPUBLIC EquationResult
 
 MSFILTER_DLLPUBLIC EquationResult ParseCombinedChars(const OUString& rStr);
 
+/// Similar to EnhancedCustomShapeTypeNames::Get(), but it also supports OOXML types.
+MSFILTER_DLLPUBLIC const char* GetOOXMLPresetGeometry( const char* sShapeType );
+
 }
 
 }
diff --git a/oox/source/export/shapes.cxx b/oox/source/export/shapes.cxx
index 311b2dc..c1836b2 100644
--- a/oox/source/export/shapes.cxx
+++ b/oox/source/export/shapes.cxx
@@ -18,6 +18,7 @@
  */
 
 #include <unotools/mediadescriptor.hxx>
+#include <filter/msfilter/util.hxx>
 #include "oox/core/xmlfilterbase.hxx"
 #include "oox/export/shapes.hxx"
 #include "oox/export/utils.hxx"
@@ -107,431 +108,6 @@ using ::sax_fastparser::FSHelperPtr;
 
 #define IDS(x) OString(OStringLiteral(#x " ") + OString::number( mnShapeIdMax++ )).getStr()
 
-struct CustomShapeTypeTranslationTable
-{
-    const char* sOOo;
-    const char* sMSO;
-};
-
-static const CustomShapeTypeTranslationTable pCustomShapeTypeTranslationTable[] =
-{
-    // { "non-primitive", mso_sptMin },
-    { "rectangle", "rect" },
-    { "round-rectangle", "roundRect" },
-    { "ellipse", "ellipse" },
-    { "diamond", "diamond" },
-    { "isosceles-triangle", "triangle" },
-    { "right-triangle", "rtTriangle" },
-    { "parallelogram", "parallelogram" },
-    { "trapezoid", "trapezoid" },
-    { "hexagon", "hexagon" },
-    { "octagon", "octagon" },
-    { "cross", "plus" },
-    { "star5", "star5" },
-    { "right-arrow", "rightArrow" },
-    // { "mso-spt14", mso_sptThickArrow },
-    { "pentagon-right", "homePlate" },
-    { "cube", "cube" },
-    // { "mso-spt17", mso_sptBalloon },
-    // { "mso-spt18", mso_sptSeal },
-    { "mso-spt19", "arc" },
-    { "mso-spt20", "line" },
-    { "mso-spt21", "plaque" },
-    { "can", "can" },
-    { "ring", "donut" },
-    { "mso-spt24", "textSimple" },
-    { "mso-spt25", "textOctagon" },
-    { "mso-spt26", "textHexagon" },
-    { "mso-spt27", "textCurve" },
-    { "mso-spt28", "textWave" },
-    { "mso-spt29", "textRing" },
-    { "mso-spt30", "textOnCurve" },
-    { "mso-spt31", "textOnRing" },
-    { "mso-spt32", "straightConnector1" },
-    { "mso-spt33", "bentConnector2" },
-    { "mso-spt34", "bentConnector3" },
-    { "mso-spt35", "bentConnector4" },
-    { "mso-spt36", "bentConnector5" },
-    { "mso-spt37", "curvedConnector2" },
-    { "mso-spt38", "curvedConnector3" },
-    { "mso-spt39", "curvedConnector4" },
-    { "mso-spt40", "curvedConnector5" },
-    { "mso-spt41", "callout1" },
-    { "mso-spt42", "callout2" },
-    { "mso-spt43", "callout3" },
-    { "mso-spt44", "accentCallout1" },
-    { "mso-spt45", "accentCallout2" },
-    { "mso-spt46", "accentCallout3" },
-    { "line-callout-1", "borderCallout1" },
-    { "line-callout-2", "borderCallout2" },
-    { "line-callout-3", "borderCallout3" },
-    { "mso-spt49", "accentBorderCallout90" },
-    { "mso-spt50", "accentBorderCallout1" },
-    { "mso-spt51", "accentBorderCallout2" },
-    { "mso-spt52", "accentBorderCallout3" },
-    { "mso-spt53", "ribbon" },
-    { "mso-spt54", "ribbon2" },
-    { "chevron", "chevron" },
-    { "pentagon", "pentagon" },
-    { "forbidden", "noSmoking" },
-    { "star8", "seal8" },
-    { "mso-spt59", "seal16" },
-    { "mso-spt60", "seal32" },
-    { "rectangular-callout", "wedgeRectCallout" },
-    { "round-rectangular-callout", "wedgeRoundRectCallout" },
-    { "round-callout", "wedgeEllipseCallout" },
-    { "mso-spt64", "wave" },
-    { "paper", "foldedCorner" },
-    { "left-arrow", "leftArrow" },
-    { "down-arrow", "downArrow" },
-    { "up-arrow", "upArrow" },
-    { "left-right-arrow", "leftRightArrow" },
-    { "up-down-arrow", "upDownArrow" },
-    { "mso-spt71", "irregularSeal1" },
-    { "bang", "irregularSeal2" },
-    { "lightning", "lightningBolt" },
-    { "heart", "heart" },
-    { "mso-spt75", "pictureFrame" },
-    { "quad-arrow", "quadArrow" },
-    { "left-arrow-callout", "leftArrowCallout" },
-    { "right-arrow-callout", "rightArrowCallout" },
-    { "up-arrow-callout", "upArrowCallout" },
-    { "down-arrow-callout", "downArrowCallout" },
-    { "left-right-arrow-callout", "leftRightArrowCallout" },
-    { "up-down-arrow-callout", "upDownArrowCallout" },
-    { "quad-arrow-callout", "quadArrowCallout" },
-    { "quad-bevel", "bevel" },
-    { "left-bracket", "leftBracket" },
-    { "right-bracket", "rightBracket" },
-    { "left-brace", "leftBrace" },
-    { "right-brace", "rightBrace" },
-    { "mso-spt89", "leftUpArrow" },
-    { "mso-spt90", "bentUpArrow" },
-    { "mso-spt91", "bentArrow" },
-    { "star24", "seal24" },
-    { "striped-right-arrow", "stripedRightArrow" },
-    { "notched-right-arrow", "notchedRightArrow" },
-    { "block-arc", "blockArc" },
-    { "smiley", "smileyFace" },
-    { "vertical-scroll", "verticalScroll" },
-    { "horizontal-scroll", "horizontalScroll" },
-    { "circular-arrow", "circularArrow" },
-    { "mso-spt100", "pie" }, // looks like MSO_SPT is wrong here
-    { "mso-spt101", "uturnArrow" },
-    { "mso-spt102", "curvedRightArrow" },
-    { "mso-spt103", "curvedLeftArrow" },
-    { "mso-spt104", "curvedUpArrow" },
-    { "mso-spt105", "curvedDownArrow" },
-    { "cloud-callout", "cloudCallout" },
-    { "mso-spt107", "ellipseRibbon" },
-    { "mso-spt108", "ellipseRibbon2" },
-    { "flowchart-process", "flowChartProcess" },
-    { "flowchart-decision", "flowChartDecision" },
-    { "flowchart-data", "flowChartInputOutput" },
-    { "flowchart-predefined-process", "flowChartPredefinedProcess" },
-    { "flowchart-internal-storage", "flowChartInternalStorage" },
-    { "flowchart-document", "flowChartDocument" },
-    { "flowchart-multidocument", "flowChartMultidocument" },
-    { "flowchart-terminator", "flowChartTerminator" },
-    { "flowchart-preparation", "flowChartPreparation" },
-    { "flowchart-manual-input", "flowChartManualInput" },
-    { "flowchart-manual-operation", "flowChartManualOperation" },
-    { "flowchart-connector", "flowChartConnector" },
-    { "flowchart-card", "flowChartPunchedCard" },
-    { "flowchart-punched-tape", "flowChartPunchedTape" },
-    { "flowchart-summing-junction", "flowChartSummingJunction" },
-    { "flowchart-or", "flowChartOr" },
-    { "flowchart-collate", "flowChartCollate" },
-    { "flowchart-sort", "flowChartSort" },
-    { "flowchart-extract", "flowChartExtract" },
-    { "flowchart-merge", "flowChartMerge" },
-    { "mso-spt129", "flowChartOfflineStorage" },
-    { "flowchart-stored-data", "flowChartOnlineStorage" },
-    { "flowchart-sequential-access", "flowChartMagneticTape" },
-    { "flowchart-magnetic-disk", "flowChartMagneticDisk" },
-    { "flowchart-direct-access-storage", "flowChartMagneticDrum" },
-    { "flowchart-display", "flowChartDisplay" },
-    { "flowchart-delay", "flowChartDelay" },
-    { "fontwork-plain-text", "textPlainText" },
-    { "fontwork-stop", "textStop" },
-    { "fontwork-triangle-up", "textTriangle" },
-    { "fontwork-triangle-down", "textTriangleInverted" },
-    { "fontwork-chevron-up", "textChevron" },
-    { "fontwork-chevron-down", "textChevronInverted" },
-    { "mso-spt142", "textRingInside" },
-    { "mso-spt143", "textRingOutside" },
-    { "fontwork-arch-up-curve", "textArchUpCurve" },
-    { "fontwork-arch-down-curve", "textArchDownCurve" },
-    { "fontwork-circle-curve", "textCircleCurve" },
-    { "fontwork-open-circle-curve", "textButtonCurve" },
-    { "fontwork-arch-up-pour", "textArchUpPour" },
-    { "fontwork-arch-down-pour", "textArchDownPour" },
-    { "fontwork-circle-pour", "textCirclePour" },
-    { "fontwork-open-circle-pour", "textButtonPour" },
-    { "fontwork-curve-up", "textCurveUp" },
-    { "fontwork-curve-down", "textCurveDown" },
-    { "fontwork-fade-up-and-right", "textCascadeUp" },
-    { "fontwork-fade-up-and-left", "textCascadeDown" },
-    { "fontwork-wave", "textWave1" },
-    { "mso-spt157", "textWave2" },
-    { "mso-spt158", "textWave3" },
-    { "mso-spt159", "textWave4" },
-    { "fontwork-inflate", "textInflate" },
-    { "mso-spt161", "textDeflate" },
-    { "mso-spt162", "textInflateBottom" },
-    { "mso-spt163", "textDeflateBottom" },
-    { "mso-spt164", "textInflateTop" },
-    { "mso-spt165", "textDeflateTop" },
-    { "mso-spt166", "textDeflateInflate" },
-    { "mso-spt167", "textDeflateInflateDeflate" },
-    { "fontwork-fade-right", "textFadeRight" },
-    { "fontwork-fade-left", "textFadeLeft" },
-    { "fontwork-fade-up", "textFadeUp" },
-    { "fontwork-fade-down", "textFadeDown" },
-    { "fontwork-slant-up", "textSlantUp" },
-    { "fontwork-slant-down", "textSlantDown" },
-    { "mso-spt174", "textCanUp" },
-    { "mso-spt175", "textCanDown" },
-    { "flowchart-alternate-process", "flowChartAlternateProcess" },
-    { "flowchart-off-page-connector", "flowChartOffpageConnector" },
-    { "mso-spt178", "callout90" },
-    { "mso-spt179", "accentCallout90" },
-    { "mso-spt180", "borderCallout90" },
-    { "mso-spt182", "leftRightUpArrow" },
-    { "sun", "sun" },
-    { "moon", "moon" },
-    { "bracket-pair", "bracketPair" },
-    { "brace-pair", "bracePair" },
-    { "star4", "seal4" },
-    { "mso-spt188", "doubleWave" },
-    { "mso-spt189", "actionButtonBlank" },
-    { "mso-spt190", "actionButtonHome" },
-    { "mso-spt191", "actionButtonHelp" },
-    { "mso-spt192", "actionButtonInformation" },
-    { "mso-spt193", "actionButtonForwardNext" },
-    { "mso-spt194", "actionButtonBackPrevious" },
-    { "mso-spt195", "actionButtonEnd" },
-    { "mso-spt196", "actionButtonBeginning" },
-    { "mso-spt197", "actionButtonReturn" },
-    { "mso-spt198", "actionButtonDocument" },
-    { "mso-spt199", "actionButtonSound" },
-    { "mso-spt200", "actionButtonMovie" },
-    { "mso-spt201", "hostControl" },
-    { "mso-spt202", "rect" },
-    { "ooxml-actionButtonSound", "actionButtonSound" },
-    { "ooxml-borderCallout1", "borderCallout1" },
-    { "ooxml-plaqueTabs", "plaqueTabs" },
-    { "ooxml-curvedLeftArrow", "curvedLeftArrow" },
-    { "ooxml-octagon", "octagon" },
-    { "ooxml-leftRightRibbon", "leftRightRibbon" },
-    { "ooxml-actionButtonInformation", "actionButtonInformation" },
-    { "ooxml-bentConnector5", "bentConnector5" },
-    { "ooxml-circularArrow", "circularArrow" },
-    { "ooxml-downArrowCallout", "downArrowCallout" },
-    { "ooxml-mathMinus", "mathMinus" },
-    { "ooxml-gear9", "gear9" },
-    { "ooxml-round1Rect", "round1Rect" },
-    { "ooxml-sun", "sun" },
-    { "ooxml-plaque", "plaque" },
-    { "ooxml-chevron", "chevron" },
-    { "ooxml-flowChartPreparation", "flowChartPreparation" },
-    { "ooxml-diagStripe", "diagStripe" },
-    { "ooxml-pentagon", "pentagon" },
-    { "ooxml-funnel", "funnel" },
-    { "ooxml-chartStar", "chartStar" },
-    { "ooxml-accentBorderCallout1", "accentBorderCallout1" },
-    { "ooxml-notchedRightArrow", "notchedRightArrow" },
-    { "ooxml-rightBracket", "rightBracket" },
-    { "ooxml-flowChartOffpageConnector", "flowChartOffpageConnector" },
-    { "ooxml-leftRightArrow", "leftRightArrow" },
-    { "ooxml-decagon", "decagon" },
-    { "ooxml-actionButtonHelp", "actionButtonHelp" },
-    { "ooxml-star24", "star24" },
-    { "ooxml-mathDivide", "mathDivide" },
-    { "ooxml-curvedConnector4", "curvedConnector4" },
-    { "ooxml-flowChartOr", "flowChartOr" },
-    { "ooxml-borderCallout3", "borderCallout3" },
-    { "ooxml-upDownArrowCallout", "upDownArrowCallout" },
-    { "ooxml-flowChartDecision", "flowChartDecision" },
-    { "ooxml-leftRightArrowCallout", "leftRightArrowCallout" },
-    { "ooxml-flowChartManualOperation", "flowChartManualOperation" },
-    { "ooxml-snipRoundRect", "snipRoundRect" },
-    { "ooxml-mathPlus", "mathPlus" },
-    { "ooxml-actionButtonForwardNext", "actionButtonForwardNext" },
-    { "ooxml-can", "can" },
-    { "ooxml-foldedCorner", "foldedCorner" },
-    { "ooxml-star32", "star32" },
-    { "ooxml-flowChartInternalStorage", "flowChartInternalStorage" },
-    { "ooxml-upDownArrow", "upDownArrow" },
-    { "ooxml-irregularSeal2", "irregularSeal2" },
-    { "ooxml-mathEqual", "mathEqual" },
-    { "ooxml-star12", "star12" },
-    { "ooxml-uturnArrow", "uturnArrow" },
-    { "ooxml-squareTabs", "squareTabs" },
-    { "ooxml-leftRightUpArrow", "leftRightUpArrow" },
-    { "ooxml-homePlate", "homePlate" },
-    { "ooxml-dodecagon", "dodecagon" },
-    { "ooxml-leftArrowCallout", "leftArrowCallout" },
-    { "ooxml-chord", "chord" },
-    { "ooxml-quadArrowCallout", "quadArrowCallout" },
-    { "ooxml-actionButtonBeginning", "actionButtonBeginning" },
-    { "ooxml-ellipse", "ellipse" },
-    { "ooxml-actionButtonEnd", "actionButtonEnd" },
-    { "ooxml-arc", "arc" },
-    { "ooxml-star16", "star16" },
-    { "ooxml-parallelogram", "parallelogram" },
-    { "ooxml-bevel", "bevel" },
-    { "ooxml-roundRect", "roundRect" },
-    { "ooxml-accentCallout1", "accentCallout1" },
-    { "ooxml-flowChartSort", "flowChartSort" },
-    { "ooxml-star8", "star8" },
-    { "ooxml-flowChartAlternateProcess", "flowChartAlternateProcess" },
-    { "ooxml-moon", "moon" },
-    { "ooxml-star6", "star6" },
-    { "ooxml-round2SameRect", "round2SameRect" },
-    { "ooxml-nonIsoscelesTrapezoid", "nonIsoscelesTrapezoid" },
-    { "ooxml-diamond", "diamond" },
-    { "ooxml-ellipseRibbon", "ellipseRibbon" },
-    { "ooxml-callout2", "callout2" },
-    { "ooxml-pie", "pie" },
-    { "ooxml-star4", "star4" },
-    { "ooxml-flowChartPredefinedProcess", "flowChartPredefinedProcess" },
-    { "ooxml-flowChartPunchedTape", "flowChartPunchedTape" },
-    { "ooxml-curvedConnector2", "curvedConnector2" },
-    { "ooxml-bentConnector3", "bentConnector3" },
-    { "ooxml-cornerTabs", "cornerTabs" },
-    { "ooxml-hexagon", "hexagon" },
-    { "ooxml-flowChartConnector", "flowChartConnector" },
-    { "ooxml-flowChartMagneticDisk", "flowChartMagneticDisk" },
-    { "ooxml-heart", "heart" },
-    { "ooxml-ribbon2", "ribbon2" },
-    { "ooxml-bracePair", "bracePair" },
-    { "ooxml-flowChartExtract", "flowChartExtract" },
-    { "ooxml-actionButtonHome", "actionButtonHome" },
-    { "ooxml-accentBorderCallout3", "accentBorderCallout3" },
-    { "ooxml-flowChartOfflineStorage", "flowChartOfflineStorage" },
-    { "ooxml-irregularSeal1", "irregularSeal1" },
-    { "ooxml-quadArrow", "quadArrow" },
-    { "ooxml-leftBrace", "leftBrace" },
-    { "ooxml-leftBracket", "leftBracket" },
-    { "ooxml-blockArc", "blockArc" },
-    { "ooxml-curvedConnector3", "curvedConnector3" },
-    { "ooxml-wedgeRoundRectCallout", "wedgeRoundRectCallout" },
-    { "ooxml-actionButtonMovie", "actionButtonMovie" },
-    { "ooxml-flowChartOnlineStorage", "flowChartOnlineStorage" },
-    { "ooxml-gear6", "gear6" },
-    { "ooxml-halfFrame", "halfFrame" },
-    { "ooxml-snip2SameRect", "snip2SameRect" },
-    { "ooxml-triangle", "triangle" },
-    { "ooxml-teardrop", "teardrop" },
-    { "ooxml-flowChartDocument", "flowChartDocument" },
-    { "ooxml-rightArrowCallout", "rightArrowCallout" },
-    { "ooxml-rightBrace", "rightBrace" },
-    { "ooxml-chartPlus", "chartPlus" },
-    { "ooxml-flowChartManualInput", "flowChartManualInput" },
-    { "ooxml-flowChartMerge", "flowChartMerge" },
-    { "ooxml-line", "line" },
-    { "ooxml-downArrow", "downArrow" },
-    { "ooxml-upArrow", "upArrow" },
-    { "ooxml-curvedDownArrow", "curvedDownArrow" },
-    { "ooxml-actionButtonReturn", "actionButtonReturn" },
-    { "ooxml-flowChartInputOutput", "flowChartInputOutput" },
-    { "ooxml-bracketPair", "bracketPair" },
-    { "ooxml-smileyFace", "smileyFace" },
-    { "ooxml-actionButtonBlank", "actionButtonBlank" },
-    { "ooxml-wave", "wave" },
-    { "ooxml-swooshArrow", "swooshArrow" },
-    { "ooxml-flowChartSummingJunction", "flowChartSummingJunction" },
-    { "ooxml-lightningBolt", "lightningBolt" },
-    { "ooxml-flowChartDisplay", "flowChartDisplay" },
-    { "ooxml-actionButtonBackPrevious", "actionButtonBackPrevious" },
-    { "ooxml-frame", "frame" },
-    { "ooxml-rtTriangle", "rtTriangle" },
-    { "ooxml-flowChartMagneticTape", "flowChartMagneticTape" },
-    { "ooxml-curvedRightArrow", "curvedRightArrow" },
-    { "ooxml-leftUpArrow", "leftUpArrow" },
-    { "ooxml-wedgeEllipseCallout", "wedgeEllipseCallout" },
-    { "ooxml-doubleWave", "doubleWave" },
-    { "ooxml-bentArrow", "bentArrow" },
-    { "ooxml-star10", "star10" },
-    { "ooxml-leftArrow", "leftArrow" },
-    { "ooxml-curvedUpArrow", "curvedUpArrow" },
-    { "ooxml-snip1Rect", "snip1Rect" },
-    { "ooxml-ellipseRibbon2", "ellipseRibbon2" },
-    { "ooxml-plus", "plus" },
-    { "ooxml-accentCallout3", "accentCallout3" },
-    { "ooxml-leftCircularArrow", "leftCircularArrow" },
-    { "ooxml-rightArrow", "rightArrow" },
-    { "ooxml-flowChartPunchedCard", "flowChartPunchedCard" },
-    { "ooxml-snip2DiagRect", "snip2DiagRect" },
-    { "ooxml-verticalScroll", "verticalScroll" },
-    { "ooxml-star7", "star7" },
-    { "ooxml-chartX", "chartX" },
-    { "ooxml-cloud", "cloud" },
-    { "ooxml-cube", "cube" },
-    { "ooxml-round2DiagRect", "round2DiagRect" },
-    { "ooxml-flowChartMultidocument", "flowChartMultidocument" },
-    { "ooxml-actionButtonDocument", "actionButtonDocument" },
-    { "ooxml-flowChartTerminator", "flowChartTerminator" },
-    { "ooxml-flowChartDelay", "flowChartDelay" },
-    { "ooxml-curvedConnector5", "curvedConnector5" },
-    { "ooxml-horizontalScroll", "horizontalScroll" },
-    { "ooxml-bentConnector4", "bentConnector4" },
-    { "ooxml-leftRightCircularArrow", "leftRightCircularArrow" },
-    { "ooxml-wedgeRectCallout", "wedgeRectCallout" },
-    { "ooxml-accentCallout2", "accentCallout2" },
-    { "ooxml-flowChartMagneticDrum", "flowChartMagneticDrum" },
-    { "ooxml-corner", "corner" },
-    { "ooxml-borderCallout2", "borderCallout2" },
-    { "ooxml-donut", "donut" },
-    { "ooxml-flowChartCollate", "flowChartCollate" },
-    { "ooxml-mathNotEqual", "mathNotEqual" },
-    { "ooxml-bentConnector2", "bentConnector2" },
-    { "ooxml-mathMultiply", "mathMultiply" },
-    { "ooxml-heptagon", "heptagon" },
-    { "ooxml-rect", "rect" },
-    { "ooxml-accentBorderCallout2", "accentBorderCallout2" },
-    { "ooxml-pieWedge", "pieWedge" },
-    { "ooxml-upArrowCallout", "upArrowCallout" },
-    { "ooxml-flowChartProcess", "flowChartProcess" },
-    { "ooxml-star5", "star5" },
-    { "ooxml-lineInv", "lineInv" },
-    { "ooxml-straightConnector1", "straightConnector1" },
-    { "ooxml-stripedRightArrow", "stripedRightArrow" },
-    { "ooxml-callout3", "callout3" },
-    { "ooxml-bentUpArrow", "bentUpArrow" },
-    { "ooxml-noSmoking", "noSmoking" },
-    { "ooxml-trapezoid", "trapezoid" },
-    { "ooxml-cloudCallout", "cloudCallout" },
-    { "ooxml-callout1", "callout1" },
-    { "ooxml-ribbon", "ribbon" },
-};
-
-typedef boost::unordered_map< const char*, const char*, rtl::CStringHash, rtl::CStringEqual> CustomShapeTypeTranslationHashMap;
-static CustomShapeTypeTranslationHashMap* pCustomShapeTypeTranslationHashMap = NULL;
-
-static const char* lcl_GetPresetGeometry( const char* sShapeType )
-{
-    const char* sPresetGeo;
-
-    if( pCustomShapeTypeTranslationHashMap == NULL )
-    {
-        pCustomShapeTypeTranslationHashMap = new CustomShapeTypeTranslationHashMap ();
-        for( unsigned int i = 0; i < sizeof( pCustomShapeTypeTranslationTable )/sizeof( CustomShapeTypeTranslationTable ); i ++ )
-        {
-            (*pCustomShapeTypeTranslationHashMap)[ pCustomShapeTypeTranslationTable[ i ].sOOo ] = pCustomShapeTypeTranslationTable[ i ].sMSO;
-            //DBG(printf("type OOo: %s MSO: %s\n", pCustomShapeTypeTranslationTable[ i ].sOOo, pCustomShapeTypeTranslationTable[ i ].sMSO));
-        }
-    }
-
-    sPresetGeo = (*pCustomShapeTypeTranslationHashMap)[ sShapeType ];
-
-    if( sPresetGeo == NULL )
-        sPresetGeo = "rect";
-
-    return sPresetGeo;
-}
-
 namespace oox { namespace drawingml {
 
 #define GETA(propName) \
@@ -678,7 +254,7 @@ ShapeExport& ShapeExport::WriteCustomShape( Reference< XShape > xShape )
     MSO_SPT eShapeType = EscherPropertyContainer::GetCustomShapeType( xShape, nMirrorFlags, sShapeType );
     SdrObjCustomShape* pShape = (SdrObjCustomShape*) GetSdrObjectFromXShape( xShape );
     sal_Bool bIsDefaultObject = EscherPropertyContainer::IsDefaultObject( pShape, eShapeType );
-    const char* sPresetShape = lcl_GetPresetGeometry( USS( sShapeType ) );
+    const char* sPresetShape = msfilter::util::GetOOXMLPresetGeometry( USS( sShapeType ) );
     DBG(printf("custom shape type: %s ==> %s\n", USS( sShapeType ), sPresetShape));
     Sequence< PropertyValue > aGeometrySeq;
     sal_Int32 nAdjustmentValuesIndex = -1;


More information about the Libreoffice-commits mailing list