include/oox/export/vmlexport.hxx |    3 +++
 oox/source/export/vmlexport.cxx  |   36 ++++++++++++++++++++++++++----------
 2 files changed, 29 insertions(+), 10 deletions(-)

New commits:
commit 2af2b9be05a4733c691db7201e76b4058516c47b
Author:     Michael Stahl <michael.st...@cib.de>
AuthorDate: Fri Aug 7 15:45:25 2020 +0200
Commit:     Michael Stahl <michael.st...@cib.de>
CommitDate: Fri Aug 7 18:26:00 2020 +0200

    oox: VML export: produce bottom-to-top in a better way
    
    Replace code added in 090c61eb93db4302d4565d5f11f7673190835fdb
    with something that uses the already generated ESCHER property; this
    lets a warning about the unhandled property disappear too.
    
    Change-Id: Ieed83dd8e17e92eea9901124fce5e6da2a17196a
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100332
    Tested-by: Jenkins
    Reviewed-by: Michael Stahl <michael.st...@cib.de>

diff --git a/include/oox/export/vmlexport.hxx b/include/oox/export/vmlexport.hxx
index c010436499f9..06dbbc57a21c 100644
--- a/include/oox/export/vmlexport.hxx
+++ b/include/oox/export/vmlexport.hxx
@@ -96,6 +96,9 @@ class OOX_DLLPUBLIC VMLExport : public EscherEx
     /// Remember style, the most important shape attribute ;-)
     OStringBuffer m_ShapeStyle;
 
+    /// style for textbox
+    OStringBuffer m_TextboxStyle;
+
     /// Remember the generated shape id.
     OString m_sShapeId;
 
diff --git a/oox/source/export/vmlexport.cxx b/oox/source/export/vmlexport.cxx
index 22dcc871ab83..bb5e2b8eee50 100644
--- a/oox/source/export/vmlexport.cxx
+++ b/oox/source/export/vmlexport.cxx
@@ -430,6 +430,28 @@ void VMLExport::Commit( EscherPropertyContainer& rProps, 
const tools::Rectangle&
                 bAlreadyWritten[ ESCHER_Prop_WrapText ] = true;
                 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
+                    assert(m_TextboxStyle.isEmpty());
+                    switch (opt.nPropValue)
+                    {
+                        case ESCHER_txflHorzN:
+                            m_TextboxStyle.append("layout-flow:horizontal");
+                        break;
+                        case ESCHER_txflTtoBA:
+                            m_TextboxStyle.append("layout-flow:vertical");
+                        break;
+                        case ESCHER_txflBtoT:
+                            
m_TextboxStyle.append("mso-layout-flow-alt:bottom-to-top");
+                        break;
+                        default:
+                            assert(false); // unimplemented in escher export
+                        break;
+                    }
+                }
+                break;
+
             // coordorigin
             case ESCHER_Prop_geoLeft: // 320
             case ESCHER_Prop_geoTop: // 321
@@ -1345,6 +1367,8 @@ sal_Int32 VMLExport::StartShape()
     // start of the shape
     m_pSerializer->startElementNS( XML_v, nShapeElement, 
XFastAttributeListRef( m_pShapeAttrList ) );
 
+    OString const textboxStyle(m_TextboxStyle.makeStringAndClear());
+
     // now check if we have some editeng text (not associated textbox) and we 
have a text exporter registered
     const SdrTextObj* pTxtObj = dynamic_cast<const SdrTextObj*>( m_pSdrObject 
);
     if (pTxtObj && m_pTextExport && 
msfilter::util::HasTextBoxContent(m_nShapeType) && 
!IsWaterMarkShape(m_pSdrObject->GetName()) && !lcl_isTextBox(m_pSdrObject))
@@ -1369,19 +1393,11 @@ sal_Int32 VMLExport::StartShape()
 
         if( pParaObj )
         {
-            uno::Reference<beans::XPropertySet> 
xPropertySet(const_cast<SdrObject*>(m_pSdrObject)->getUnoShape(), 
uno::UNO_QUERY);
             sax_fastparser::FastAttributeList* pTextboxAttrList = 
FastSerializerHelper::createAttrList();
             sax_fastparser::XFastAttributeListRef 
xTextboxAttrList(pTextboxAttrList);
-            if 
(xPropertySet->getPropertySetInfo()->hasPropertyByName("RotateAngle"))
+            if (!textboxStyle.isEmpty())
             {
-                sal_Int32 nTextRotateAngle = sal_Int32();
-                if (xPropertySet->getPropertyValue("RotateAngle") >>= 
nTextRotateAngle)
-                {
-                    if (nTextRotateAngle == 9000)
-                    {
-                        pTextboxAttrList->add(XML_style, 
"mso-layout-flow-alt:bottom-to-top");
-                    }
-                }
+                pTextboxAttrList->add(XML_style, textboxStyle);
             }
 
             // this is reached only in case some text is attached to the shape
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to