[Libreoffice-commits] core.git: Branch 'libreoffice-7-0' - oox/source sw/qa

Michael Stahl (via logerrit) logerrit at kemper.freedesktop.org
Mon Aug 10 11:29:49 UTC 2020


 oox/source/export/vmlexport.cxx            |   41 +++++++++++++++++++++++++++++
 sw/qa/extras/ooxmlexport/ooxmlexport15.cxx |    4 ++
 2 files changed, 44 insertions(+), 1 deletion(-)

New commits:
commit ad3813c0ab5303625cda7d04ebe6a6b48712255d
Author:     Michael Stahl <Michael.Stahl at cib.de>
AuthorDate: Fri Aug 7 15:50:12 2020 +0200
Commit:     Xisco Fauli <xiscofauli at libreoffice.org>
CommitDate: Mon Aug 10 13:29:18 2020 +0200

    oox: VML export: convert ESCHER_Prop_AnchorText to v-text-anchor
    
    Change-Id: I903cac8d7b02138680613b5a1b6dab4b1c448158
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100333
    Tested-by: Jenkins
    Reviewed-by: Michael Stahl <michael.stahl at cib.de>
    (cherry picked from commit 8d83c29905ca6c4067ae0330d3544ddb983cafbc)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100343
    Reviewed-by: Xisco Fauli <xiscofauli at libreoffice.org>

diff --git a/oox/source/export/vmlexport.cxx b/oox/source/export/vmlexport.cxx
index 964cf27c6921..79733db5ced0 100644
--- a/oox/source/export/vmlexport.cxx
+++ b/oox/source/export/vmlexport.cxx
@@ -430,6 +430,47 @@ void VMLExport::Commit( EscherPropertyContainer& rProps, const tools::Rectangle&
                 bAlreadyWritten[ ESCHER_Prop_WrapText ] = true;
                 break;
 
+            case ESCHER_Prop_AnchorText: // 135
+                {
+                    char const* pValue(nullptr);
+                    switch (opt.nPropValue)
+                    {
+                        case ESCHER_AnchorTop:
+                            pValue = "top";
+                        break;
+                        case ESCHER_AnchorMiddle:
+                            pValue = "middle";
+                        break;
+                        case ESCHER_AnchorBottom:
+                            pValue = "bottom";
+                        break;
+                        case ESCHER_AnchorTopCentered:
+                            pValue = "top-center";
+                        break;
+                        case ESCHER_AnchorMiddleCentered:
+                            pValue = "middle-center";
+                        break;
+                        case ESCHER_AnchorBottomCentered:
+                            pValue = "bottom-center";
+                        break;
+                        case ESCHER_AnchorTopBaseline:
+                            pValue = "top-baseline";
+                        break;
+                        case ESCHER_AnchorBottomBaseline:
+                            pValue = "bottom-baseline";
+                        break;
+                        case ESCHER_AnchorTopCenteredBaseline:
+                            pValue = "top-center-baseline";
+                        break;
+                        case ESCHER_AnchorBottomCenteredBaseline:
+                            pValue = "bottom-center-baseline";
+                        break;
+                    }
+                    m_ShapeStyle.append(";v-text-anchor:");
+                    m_ShapeStyle.append(pValue);
+                }
+                break;
+
             case ESCHER_Prop_txflTextFlow: // 136
                 {
                     // at least "bottom-to-top" only has an effect when it's on the v:textbox element, not on v:shape
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport15.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport15.cxx
index 67184ba57636..8dd905a6405b 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport15.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport15.cxx
@@ -84,7 +84,9 @@ DECLARE_OOXMLEXPORT_TEST(testAtPageShapeRelOrientation, "rotated_shape.fodt")
     assertXPath(pXmlDocument, "/w:document/w:body/w:p/w:r/mc:AlternateContent[1]/mc:Fallback/w:pict/v:shape/v:textbox", "style", "mso-layout-flow-alt:bottom-to-top");
     // text wrap -> VML
     assertXPath(pXmlDocument, "/w:document/w:body/w:p/w:r/mc:AlternateContent[1]/mc:Fallback/w:pict/v:shape/w10:wrap", "type", "none");
-
+    // vertical alignment -> VML
+    OUString const style = getXPath(pXmlDocument, "/w:document/w:body/w:p/w:r/mc:AlternateContent[1]/mc:Fallback/w:pict/v:shape", "style");
+    CPPUNIT_ASSERT(style.indexOf("v-text-anchor:middle") != -1);
 }
 
 DECLARE_OOXMLEXPORT_TEST(testRelativeAnchorHeightFromBottomMarginHasFooter,


More information about the Libreoffice-commits mailing list