[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-5.3' - filter/source

Tamás Zolnai tamas.zolnai at collabora.com
Fri Sep 1 11:08:20 UTC 2017


 filter/source/msfilter/eschesdo.cxx |   30 ++++++++++++++----------------
 1 file changed, 14 insertions(+), 16 deletions(-)

New commits:
commit 0b7da4106adb9f760c96acdfb522538213aac479
Author: Tamás Zolnai <tamas.zolnai at collabora.com>
Date:   Mon Aug 28 19:15:25 2017 +0200

    Follow up changes related to DOCX form control export
    
    These lines are expected to be called only for DOCX format.
    AnchorType is a Writer specific attribute so it can be used
    to decide on the file format.
    
    Change-Id: Ie92f1ff801fac09cb9f658e523244ffc928690f2
    Reviewed-on: https://gerrit.libreoffice.org/41655
    Reviewed-by: Tamás Zolnai <tamas.zolnai at collabora.com>
    Tested-by: Tamás Zolnai <tamas.zolnai at collabora.com>
    (cherry picked from commit dada5958c1a5565e9d7e098c75c90f60e575ab62)
    Reviewed-on: https://gerrit.libreoffice.org/41661
    Reviewed-by: Andras Timar <andras.timar at collabora.com>
    Tested-by: Andras Timar <andras.timar at collabora.com>

diff --git a/filter/source/msfilter/eschesdo.cxx b/filter/source/msfilter/eschesdo.cxx
index d7be855f911b..53a8daf6131c 100644
--- a/filter/source/msfilter/eschesdo.cxx
+++ b/filter/source/msfilter/eschesdo.cxx
@@ -424,28 +424,26 @@ sal_uInt32 ImplEESdrWriter::ImplWriteShape( ImplEESdrObject& rObj,
         }
         else if ( rObj.GetType() == "drawing.Control" )
         {
-            mpEscherEx->OpenContainer( ESCHER_SpContainer );
-            bool bInline = false;
             const Reference< XPropertySet > xPropSet(rObj.mXPropSet, UNO_QUERY);
-            if(xPropSet.is())
+            const Reference<XPropertySetInfo> xPropInfo = xPropSet.is() ? xPropSet->getPropertySetInfo() : Reference<XPropertySetInfo>();
+            // This code is expected to be called only for DOCX format.
+            if (xPropInfo.is() && xPropInfo->hasPropertyByName("AnchorType") && bOOxmlExport)
             {
-                const Reference<XPropertySetInfo> xPropInfo = xPropSet->getPropertySetInfo();
-                if (xPropInfo.is() && xPropInfo->hasPropertyByName("AnchorType"))
+                text::TextContentAnchorType eAnchorType;
+                xPropSet->getPropertyValue("AnchorType") >>= eAnchorType;
+                bool bInline = eAnchorType == text::TextContentAnchorType_AS_CHARACTER;
+                mpEscherEx->OpenContainer( ESCHER_SpContainer );
+                if(bInline)
                 {
-                    text::TextContentAnchorType eAnchorType;
-                    xPropSet->getPropertyValue("AnchorType") >>= eAnchorType;
-                    bInline = eAnchorType == text::TextContentAnchorType_AS_CHARACTER;
+                    ADD_SHAPE( ESCHER_ShpInst_PictureFrame, SHAPEFLAG_HAVESPT | SHAPEFLAG_HAVEANCHOR );
+                }
+                else
+                {
+                    ADD_SHAPE( ESCHER_ShpInst_HostControl, SHAPEFLAG_HAVESPT | SHAPEFLAG_HAVEANCHOR );
                 }
-            }
-
-            if(bInline)
-            {
-                ADD_SHAPE( ESCHER_ShpInst_PictureFrame, SHAPEFLAG_HAVESPT | SHAPEFLAG_HAVEANCHOR );
             }
             else
-            {
-                ADD_SHAPE( ESCHER_ShpInst_HostControl, SHAPEFLAG_HAVESPT | SHAPEFLAG_HAVEANCHOR );
-            }
+                break;
         }
         else if ( rObj.GetType() == "drawing.Connector" )
         {


More information about the Libreoffice-commits mailing list