[Libreoffice-commits] core.git: Branch 'feature/cib_contract3753' - include/oox oox/source sw/qa sw/source

Michael Stahl (via logerrit) logerrit at kemper.freedesktop.org
Mon Feb 22 18:13:56 UTC 2021


 include/oox/export/vmlexport.hxx                         |    6 
 oox/source/export/vmlexport.cxx                          |    8 
 sw/qa/extras/ooxmlexport/data/shape-atpage-in-table.fodt |  185 +++++++++++++++
 sw/qa/extras/ooxmlexport/ooxmlexport15.cxx               |   13 +
 sw/source/filter/ww8/docxattributeoutput.cxx             |    3 
 sw/source/filter/ww8/docxsdrexport.cxx                   |    6 
 6 files changed, 216 insertions(+), 5 deletions(-)

New commits:
commit 20ce7306d2761652d36ec16e971e30b5a937121f
Author:     Michael Stahl <michael.stahl at allotropia.de>
AuthorDate: Mon Feb 22 14:11:05 2021 +0100
Commit:     Michael Stahl <michael.stahl at allotropia.de>
CommitDate: Mon Feb 22 19:12:05 2021 +0100

    oox: VML export: write o:allowincell attribute on shapes
    
    Apparently the default is "t", which causes a fly that is anchored
    at-page with the first content on the page being a table to be wrongly
    positioned.
    
    Change-Id: Iba1b961c6e884b2a55928952937187732ef73a5a
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111336
    Tested-by: Jenkins
    Reviewed-by: Michael Stahl <michael.stahl at allotropia.de>
    (cherry picked from commit 60b61fdaf85cecea0f972fc435530ee5d7492c98)

diff --git a/include/oox/export/vmlexport.hxx b/include/oox/export/vmlexport.hxx
index 3736420756a6..f64f0cd04c65 100644
--- a/include/oox/export/vmlexport.hxx
+++ b/include/oox/export/vmlexport.hxx
@@ -84,6 +84,7 @@ class OOX_DLLPUBLIC VMLExport : public EscherEx
     sal_Int16 m_eHOri, m_eVOri, m_eHRel, m_eVRel;
     std::unique_ptr<sax_fastparser::FastAttributeList> m_pWrapAttrList;
     bool m_bInline; // css::text::TextContentAnchorType_AS_CHARACTER
+    bool m_IsFollowingTextFlow = false;
 
     /// The object we're exporting.
     const SdrObject* m_pSdrObject;
@@ -138,8 +139,9 @@ public:
     /// Export the sdr object as VML.
     ///
     /// Call this when you need to export the object as VML.
-    OString const & AddSdrObject( const SdrObject& rObj, sal_Int16 eHOri = -1,
-            sal_Int16 eVOri = -1, sal_Int16 eHRel = -1,
+    OString const & AddSdrObject( const SdrObject& rObj,
+            bool const bIsFollowingTextFlow = false,
+            sal_Int16 eHOri = -1, sal_Int16 eVOri = -1, sal_Int16 eHRel = -1,
             sal_Int16 eVRel = -1,
             std::unique_ptr<sax_fastparser::FastAttributeList> m_pWrapAttrList = nullptr,
             const bool bOOxmlExport = false );
diff --git a/oox/source/export/vmlexport.cxx b/oox/source/export/vmlexport.cxx
index deea12e04330..99a591add354 100644
--- a/oox/source/export/vmlexport.cxx
+++ b/oox/source/export/vmlexport.cxx
@@ -1392,6 +1392,8 @@ sal_Int32 VMLExport::StartShape()
             break;
     }
 
+    m_pShapeAttrList->addNS(XML_o, XML_allowincell, m_IsFollowingTextFlow ? "t" : "f");
+
     // add style
     m_pShapeAttrList->add( XML_style, m_ShapeStyle.makeStringAndClear() );
 
@@ -1492,7 +1494,9 @@ void VMLExport::EndShape( sal_Int32 nShapeElement )
     }
 }
 
-OString const & VMLExport::AddSdrObject( const SdrObject& rObj, sal_Int16 eHOri, sal_Int16 eVOri, sal_Int16 eHRel, sal_Int16 eVRel,
+OString const & VMLExport::AddSdrObject( const SdrObject& rObj,
+        bool const bIsFollowingTextFlow,
+        sal_Int16 eHOri, sal_Int16 eVOri, sal_Int16 eHRel, sal_Int16 eVRel,
         std::unique_ptr<FastAttributeList> pWrapAttrList,
         const bool bOOxmlExport )
 {
@@ -1503,6 +1507,7 @@ OString const & VMLExport::AddSdrObject( const SdrObject& rObj, sal_Int16 eHOri,
     m_eVRel = eVRel;
     m_pWrapAttrList = std::move(pWrapAttrList);
     m_bInline = false;
+    m_IsFollowingTextFlow = bIsFollowingTextFlow;
     EscherEx::AddSdrObject(rObj, bOOxmlExport);
     return m_sShapeId;
 }
@@ -1516,6 +1521,7 @@ OString const & VMLExport::AddInlineSdrObject( const SdrObject& rObj, const bool
     m_eVRel = -1;
     m_pWrapAttrList.reset();
     m_bInline = true;
+    m_IsFollowingTextFlow = true;
     EscherEx::AddSdrObject(rObj, bOOxmlExport);
     return m_sShapeId;
 }
diff --git a/sw/qa/extras/ooxmlexport/data/shape-atpage-in-table.fodt b/sw/qa/extras/ooxmlexport/data/shape-atpage-in-table.fodt
new file mode 100644
index 000000000000..42c9c7790509
--- /dev/null
+++ b/sw/qa/extras/ooxmlexport/data/shape-atpage-in-table.fodt
@@ -0,0 +1,185 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<office:document xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0" xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" xmlns:ooo="http://openoffice.org/2004/office" xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:config="urn:oasis:names:tc:opendocument:xmlns:config:1.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0" xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" xmlns:dr3d="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0" xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0" xmlns:chart="urn:oasis:names:tc:opendocument:xmlns:chart:1.0" xmlns:rpt="http://openoffice.org/2005/report" xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0" xmlns:number="urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0" xmlns:ooow="http://openoffice.org/200
 4/writer" xmlns:oooc="http://openoffice.org/2004/calc" xmlns:of="urn:oasis:names:tc:opendocument:xmlns:of:1.2" xmlns:css3t="http://www.w3.org/TR/css3-text/" xmlns:tableooo="http://openoffice.org/2009/table" xmlns:calcext="urn:org:documentfoundation:names:experimental:calc:xmlns:calcext:1.0" xmlns:drawooo="http://openoffice.org/2010/draw" xmlns:loext="urn:org:documentfoundation:names:experimental:office:xmlns:loext:1.0" xmlns:grddl="http://www.w3.org/2003/g/data-view#" xmlns:field="urn:openoffice:names:experimental:ooo-ms-interop:xmlns:field:1.0" xmlns:math="http://www.w3.org/1998/Math/MathML" xmlns:form="urn:oasis:names:tc:opendocument:xmlns:form:1.0" xmlns:script="urn:oasis:names:tc:opendocument:xmlns:script:1.0" xmlns:dom="http://www.w3.org/2001/xml-events" xmlns:xforms="http://www.w3.org/2002/xforms" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:formx="urn:openoffice:names:experimental:ooxml-odf-interop:xmlns:form:1.0" xm
 lns:xhtml="http://www.w3.org/1999/xhtml" xmlns:officeooo="http://openoffice.org/2009/office" office:version="1.2" office:mimetype="application/vnd.oasis.opendocument.text">
+ <office:font-face-decls>
+  <style:font-face style:name="StarSymbol" svg:font-family="StarSymbol" style:font-charset="x-symbol"/>
+  <style:font-face style:name="Arial" svg:font-family="Arial"/>
+  <style:font-face style:name="Tahoma1" svg:font-family="Tahoma"/>
+  <style:font-face style:name="Lucida Sans Unicode" svg:font-family="'Lucida Sans Unicode'" style:font-pitch="variable"/>
+  <style:font-face style:name="Tahoma" svg:font-family="Tahoma" style:font-pitch="variable"/>
+  <style:font-face style:name="Arial1" svg:font-family="Arial" style:font-family-generic="swiss" style:font-pitch="variable"/>
+ </office:font-face-decls>
+ <office:styles>
+  <style:default-style style:family="graphic">
+   <style:graphic-properties svg:stroke-color="#000000" draw:fill-color="#99ccff" fo:wrap-option="no-wrap" draw:shadow-offset-x="0.3cm" draw:shadow-offset-y="0.3cm" draw:start-line-spacing-horizontal="0.283cm" draw:start-line-spacing-vertical="0.283cm" draw:end-line-spacing-horizontal="0.283cm" draw:end-line-spacing-vertical="0.283cm" style:flow-with-text="false"/>
+   <style:paragraph-properties style:text-autospace="ideograph-alpha" style:line-break="strict" style:writing-mode="lr-tb" style:font-independent-line-spacing="false">
+    <style:tab-stops/>
+   </style:paragraph-properties>
+   <style:text-properties style:use-window-font-color="true" loext:opacity="0%" style:font-name="Arial" fo:font-size="12pt" fo:language="de" fo:country="DE" style:font-name-asian="Lucida Sans Unicode" style:font-size-asian="12pt" style:language-asian="de" style:country-asian="DE" style:font-name-complex="Tahoma" style:font-size-complex="12pt" style:language-complex="de" style:country-complex="DE"/>
+  </style:default-style>
+  <style:default-style style:family="paragraph">
+   <style:paragraph-properties fo:hyphenation-ladder-count="no-limit" style:text-autospace="ideograph-alpha" style:punctuation-wrap="hanging" style:line-break="strict" style:tab-stop-distance="1.251cm" style:writing-mode="page"/>
+   <style:text-properties style:use-window-font-color="true" loext:opacity="0%" style:font-name="Arial" fo:font-size="12pt" fo:language="de" fo:country="DE" style:font-name-asian="Lucida Sans Unicode" style:font-size-asian="12pt" style:language-asian="de" style:country-asian="DE" style:font-name-complex="Tahoma" style:font-size-complex="12pt" style:language-complex="de" style:country-complex="DE" fo:hyphenate="false" fo:hyphenation-remain-char-count="2" fo:hyphenation-push-char-count="2" loext:hyphenation-no-caps="false"/>
+  </style:default-style>
+  <style:default-style style:family="table">
+   <style:table-properties table:border-model="collapsing"/>
+  </style:default-style>
+  <style:default-style style:family="table-row">
+   <style:table-row-properties fo:keep-together="auto"/>
+  </style:default-style>
+  <style:style style:name="Standard" style:family="paragraph" style:class="text">
+   <style:text-properties fo:font-size="11pt"/>
+  </style:style>
+  <style:style style:name="Text_20_body" style:display-name="Text body" style:family="paragraph" style:parent-style-name="Standard" style:class="text">
+   <style:paragraph-properties fo:margin-top="0cm" fo:margin-bottom="0cm" loext:contextual-spacing="false" style:line-height-at-least="0.46cm"/>
+  </style:style>
+  <style:style style:name="Heading" style:family="paragraph" style:parent-style-name="Standard" style:next-style-name="Text_20_body" style:class="text">
+   <style:paragraph-properties fo:margin-top="0.423cm" fo:margin-bottom="0.212cm" loext:contextual-spacing="false" fo:keep-with-next="always"/>
+   <style:text-properties style:font-name="Arial1" fo:font-family="Arial" style:font-family-generic="swiss" style:font-pitch="variable" fo:font-size="14pt" style:font-name-asian="Lucida Sans Unicode" style:font-family-asian="'Lucida Sans Unicode'" style:font-pitch-asian="variable" style:font-size-asian="14pt" style:font-name-complex="Tahoma" style:font-family-complex="Tahoma" style:font-pitch-complex="variable" style:font-size-complex="14pt"/>
+  </style:style>
+  <style:style style:name="List" style:family="paragraph" style:parent-style-name="Text_20_body" style:class="list">
+   <style:text-properties style:font-name="Arial" fo:font-family="Arial" style:font-name-complex="Tahoma1" style:font-family-complex="Tahoma"/>
+  </style:style>
+  <style:style style:name="Table_20_Contents" style:display-name="Table Contents" style:family="paragraph" style:parent-style-name="Standard" style:class="extra">
+   <style:paragraph-properties text:number-lines="false" text:line-number="0"/>
+  </style:style>
+  <style:style style:name="Heading_20_1" style:display-name="Heading 1" style:family="paragraph" style:parent-style-name="Heading" style:next-style-name="Text_20_body" style:default-outline-level="1" style:class="text">
+   <style:text-properties fo:font-size="115%" fo:font-weight="bold" style:font-size-asian="115%" style:font-weight-asian="bold" style:font-size-complex="115%" style:font-weight-complex="bold"/>
+  </style:style>
+  <style:style style:name="Heading_20_2" style:display-name="Heading 2" style:family="paragraph" style:parent-style-name="Heading" style:next-style-name="Text_20_body" style:default-outline-level="2" style:class="text">
+   <style:text-properties fo:font-size="14pt" fo:font-style="italic" fo:font-weight="bold" style:font-size-asian="14pt" style:font-style-asian="italic" style:font-weight-asian="bold" style:font-size-complex="14pt" style:font-style-complex="italic" style:font-weight-complex="bold"/>
+  </style:style>
+  <style:style style:name="Heading_20_3" style:display-name="Heading 3" style:family="paragraph" style:parent-style-name="Heading" style:next-style-name="Text_20_body" style:default-outline-level="3" style:class="text">
+   <style:text-properties fo:font-size="14pt" fo:font-weight="bold" style:font-size-asian="14pt" style:font-weight-asian="bold" style:font-size-complex="14pt" style:font-weight-complex="bold"/>
+  </style:style>
+  <style:style style:name="Numbering_20_Symbols" style:display-name="Numbering Symbols" style:family="text"/>
+  <style:style style:name="Frame" style:family="graphic">
+   <style:graphic-properties text:anchor-type="paragraph" svg:x="0cm" svg:y="0cm" fo:margin-left="0.201cm" fo:margin-right="0.201cm" fo:margin-top="0.201cm" fo:margin-bottom="0.201cm" style:wrap="parallel" style:number-wrapped-paragraphs="no-limit" style:wrap-contour="false" style:vertical-pos="top" style:vertical-rel="paragraph-content" style:horizontal-pos="center" style:horizontal-rel="paragraph-content" fo:padding="0.15cm" fo:border="0.06pt solid #000000"/>
+  </style:style>
+  <text:outline-style style:name="Outline">
+   <text:outline-level-style text:level="1" style:num-format="">
+    <style:list-level-properties text:min-label-distance="0.381cm"/>
+   </text:outline-level-style>
+   <text:outline-level-style text:level="2" style:num-format="">
+    <style:list-level-properties text:min-label-distance="0.381cm"/>
+   </text:outline-level-style>
+   <text:outline-level-style text:level="3" style:num-format="">
+    <style:list-level-properties text:min-label-distance="0.381cm"/>
+   </text:outline-level-style>
+   <text:outline-level-style text:level="4" style:num-format="">
+    <style:list-level-properties text:min-label-distance="0.381cm"/>
+   </text:outline-level-style>
+   <text:outline-level-style text:level="5" style:num-format="">
+    <style:list-level-properties text:min-label-distance="0.381cm"/>
+   </text:outline-level-style>
+   <text:outline-level-style text:level="6" style:num-format="">
+    <style:list-level-properties text:min-label-distance="0.381cm"/>
+   </text:outline-level-style>
+   <text:outline-level-style text:level="7" style:num-format="">
+    <style:list-level-properties text:min-label-distance="0.381cm"/>
+   </text:outline-level-style>
+   <text:outline-level-style text:level="8" style:num-format="">
+    <style:list-level-properties text:min-label-distance="0.381cm"/>
+   </text:outline-level-style>
+   <text:outline-level-style text:level="9" style:num-format="">
+    <style:list-level-properties text:min-label-distance="0.381cm"/>
+   </text:outline-level-style>
+   <text:outline-level-style text:level="10" style:num-format="">
+    <style:list-level-properties text:min-label-distance="0.381cm"/>
+   </text:outline-level-style>
+  </text:outline-style>
+ </office:styles>
+ <office:automatic-styles>
+     <style:style style:name="Tabelle1" style:family="table" style:master-page-name="First_20_Page">
+      <style:table-properties style:width="19.396cm" fo:margin-left="-1.642cm" style:page-number="auto" table:align="left" style:writing-mode="lr-tb"/>
+    </style:style>
+    <style:style style:name="Tabelle1.A" style:family="table-column">
+      <style:table-column-properties style:column-width="19.396cm"/>
+    </style:style>
+    <style:style style:name="Tabelle1.1" style:family="table-row">
+      <style:table-row-properties fo:keep-together="auto"/>
+    </style:style>
+    <style:style style:name="Tabelle1.A1" style:family="table-cell">
+      <style:table-cell-properties style:vertical-align="top" fo:padding="0cm" fo:border="none" style:writing-mode="lr-tb"/>
+    </style:style>
+    <style:style style:name="gr2" style:family="graphic">
+      <style:graphic-properties draw:stroke="none" draw:fill="none" draw:fill-color="#ffffff" draw:textarea-horizontal-align="justify" draw:textarea-vertical-align="middle" draw:auto-grow-height="false" draw:auto-grow-width="false" fo:padding-top="0.1in" fo:padding-bottom="0.1in" fo:padding-left="0.05in" fo:padding-right="0.05in" fo:wrap-option="wrap" draw:shadow="hidden" style:run-through="foreground" style:wrap="run-through" style:number-wrapped-paragraphs="no-limit" style:vertical-pos="from-top" style:vertical-rel="page" style:horizontal-pos="from-left" style:horizontal-rel="page" draw:wrap-influence-on-position="once-concurrent" loext:allow-overlap="true" style:flow-with-text="false"/>
+      <style:paragraph-properties style:writing-mode="lr-tb"/>
+    </style:style>
+  <style:style style:name="P1" style:family="paragraph" style:parent-style-name="Table_20_Contents">
+  </style:style>
+  <style:style style:name="P54" style:family="paragraph">
+    <loext:graphic-properties draw:fill="none" draw:fill-color="#ffffff"/>
+    <style:paragraph-properties style:writing-mode="lr-tb"/>
+    <style:text-properties fo:color="#000000" style:font-name="Arial1" fo:font-size="7pt" fo:language="de" fo:country="DE" style:font-name-asian="Arial1" style:font-size-asian="7pt" style:font-name-complex="Arial1" style:font-size-complex="7pt" style:language-complex="ar" style:country-complex="SA"/>
+  </style:style>
+  <style:page-layout style:name="pm1">
+   <style:page-layout-properties fo:page-width="21.001cm" fo:page-height="29.7cm" style:num-format="1" style:print-orientation="portrait" fo:margin-top="1.199cm" fo:margin-bottom="2.071cm" fo:margin-left="2.499cm" fo:margin-right="2.221cm" style:shadow="none" fo:background-color="transparent" style:writing-mode="lr-tb" style:layout-grid-color="#c0c0c0" style:layout-grid-lines="20" style:layout-grid-base-height="0.706cm" style:layout-grid-ruby-height="0.353cm" style:layout-grid-mode="none" style:layout-grid-ruby-below="false" style:layout-grid-print="false" style:layout-grid-display="false" draw:fill="none" draw:fill-color="#99ccff" style:footnote-max-height="0cm">
+    <style:columns fo:column-count="1" fo:column-gap="0cm"/>
+    <style:footnote-sep style:width="0.018cm" style:distance-before-sep="0.101cm" style:distance-after-sep="0.101cm" style:line-style="none" style:adjustment="left" style:rel-width="25%" style:color="#000000"/>
+   </style:page-layout-properties>
+   <style:header-style>
+    <style:header-footer-properties svg:height="4.399cm" fo:margin-left="0cm" fo:margin-right="0cm" fo:margin-bottom="3.9cm" style:dynamic-spacing="false"/>
+   </style:header-style>
+   <style:footer-style/>
+  </style:page-layout>
+  <style:page-layout style:name="pm2">
+   <style:page-layout-properties fo:page-width="21.001cm" fo:page-height="29.7cm" style:num-format="1" style:print-orientation="portrait" fo:margin-top="1.199cm" fo:margin-bottom="2.071cm" fo:margin-left="2.499cm" fo:margin-right="2.221cm" style:shadow="none" style:writing-mode="lr-tb" style:layout-grid-color="#c0c0c0" style:layout-grid-lines="20" style:layout-grid-base-height="0.706cm" style:layout-grid-ruby-height="0.353cm" style:layout-grid-mode="none" style:layout-grid-ruby-below="false" style:layout-grid-print="false" style:layout-grid-display="false" style:footnote-max-height="0cm">
+    <style:columns fo:column-count="1" fo:column-gap="0cm"/>
+    <style:footnote-sep style:width="0.018cm" style:distance-before-sep="0.101cm" style:distance-after-sep="0.101cm" style:line-style="none" style:adjustment="left" style:rel-width="25%" style:color="#000000"/>
+   </style:page-layout-properties>
+   <style:header-style>
+    <style:header-footer-properties svg:height="4.399cm" fo:margin-left="0cm" fo:margin-right="0cm" fo:margin-bottom="3.9cm" style:dynamic-spacing="false"/>
+   </style:header-style>
+   <style:footer-style/>
+  </style:page-layout>
+ </office:automatic-styles>
+ <office:master-styles>
+  <style:master-page style:name="Standard" style:page-layout-name="pm1">
+  </style:master-page>
+ </office:master-styles>
+ <office:body>
+  <office:text>
+      <office:forms form:automatic-focus="false" form:apply-design-mode="false">
+        <form:form form:name="WW-Standard" form:apply-filter="true" form:control-implementation="ooo:com.sun.star.form.component.Form" office:target-frame="">
+          <form:properties>
+            <form:property form:property-name="PropertyChangeNotificationEnabled" office:value-type="boolean" office:boolean-value="true"/>
+            <form:property form:property-name="TargetURL" office:value-type="string" office:string-value=""/>
+          </form:properties>
+          <form:checkbox form:name="Kontrollkästchen1" form:control-implementation="ooo:com.sun.star.form.component.CheckBox" xml:id="control1" form:id="control1" form:input-required="false" form:state="checked" form:current-state="checked" form:image-position="center">
+            <form:properties>
+              <form:property form:property-name="ControlTypeinMSO" office:value-type="float" office:value="0"/>
+              <form:property form:property-name="DefaultControl" office:value-type="string" office:string-value="com.sun.star.form.control.CheckBox"/>
+              <form:property form:property-name="ObjIDinMSO" office:value-type="float" office:value="65535"/>
+              <form:property form:property-name="SecondaryRefValue" office:value-type="string" office:string-value=""/>
+            </form:properties>
+          </form:checkbox>
+        </form:form>
+      </office:forms>
+   <text:sequence-decls>
+    <text:sequence-decl text:display-outline-level="0" text:name="Illustration"/>
+    <text:sequence-decl text:display-outline-level="0" text:name="Table"/>
+    <text:sequence-decl text:display-outline-level="0" text:name="Text"/>
+    <text:sequence-decl text:display-outline-level="0" text:name="Drawing"/>
+    <text:sequence-decl text:display-outline-level="0" text:name="Figure"/>
+   </text:sequence-decls>
+      <draw:frame text:anchor-type="page" text:anchor-page-number="1" draw:z-index="0" draw:name="Shape1" draw:style-name="gr2" draw:text-style-name="P54" svg:width="2.3213in" svg:height="0.3776in" draw:transform="rotate (1.5707963267949) translate (0.364583333333333in 10.65in)">
+        <draw:text-box>
+          <text:p text:style-name="P53">
+            ABC DEF GHI
+          </text:p>
+        </draw:text-box>
+      </draw:frame>
+      <table:table table:name="Tabelle1" table:style-name="Tabelle1">
+        <table:table-column table:style-name="Tabelle1.A"/>
+        <table:table-row table:style-name="Tabelle1.1">
+          <table:table-cell table:style-name="Tabelle1.A1" office:value-type="string">
+            <text:p>
+            </text:p>
+          </table:table-cell>
+        </table:table-row>
+      </table:table>
+   <text:p/>
+  </office:text>
+ </office:body>
+</office:document>
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport15.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport15.cxx
index d5e067b98f07..6912379369d5 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport15.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport15.cxx
@@ -146,6 +146,19 @@ DECLARE_OOXMLEXPORT_TEST(testTdf135973, "tdf135973.odt")
     }
 }
 
+DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testVMLallowincell, "shape-atpage-in-table.fodt")
+{
+    xmlDocPtr pXmlDocument = parseExport("word/document.xml");
+
+    // VML o:allowincell, apparently the default is "t"
+    assertXPath(pXmlDocument, "/w:document/w:body/w:tbl[1]/w:tr[1]/w:tc[1]/w:p[1]/w:r/w:pict/v:shape", "allowincell", "f");
+
+#if 0
+    // DML layoutInCell
+    assertXPath(pXmlDocument, "/w:document/w:body/w:tbl[1]/w:tr[1]/w:tc[1]/w:p[1]/w:r/mc:AlternateContent[1]/mc:Choice/w:drawing/wp:anchor", "layoutInCell", "0");
+#endif
+}
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx
index e9c09f206d01..0eb2a733ac33 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -30,6 +30,7 @@
 #include <fchrfmt.hxx>
 #include <tgrditem.hxx>
 #include <fmtruby.hxx>
+#include <fmtfollowtextflow.hxx>
 #include <fmtanchr.hxx>
 #include <breakit.hxx>
 #include <redline.hxx>
@@ -5345,11 +5346,13 @@ void DocxAttributeOutput::WriteActiveXControl(const SdrObject* pObject, const Sw
     }
     else
     {
+        SwFormatFollowTextFlow const& rFlow(rFrameFormat.GetFollowTextFlow());
         const SwFormatHoriOrient& rHoriOri = rFrameFormat.GetHoriOrient();
         const SwFormatVertOrient& rVertOri = rFrameFormat.GetVertOrient();
         SwFormatSurround const& rSurround(rFrameFormat.GetSurround());
         std::unique_ptr<sax_fastparser::FastAttributeList> pAttrList(docx::SurroundToVMLWrap(rSurround));
         sShapeId = m_rExport.VMLExporter().AddSdrObject(*pObject,
+            rFlow.GetValue(),
             rHoriOri.GetHoriOrient(), rVertOri.GetVertOrient(),
             rHoriOri.GetRelationOrient(),
             rVertOri.GetRelationOrient(),
diff --git a/sw/source/filter/ww8/docxsdrexport.cxx b/sw/source/filter/ww8/docxsdrexport.cxx
index a1f8b7b2f5be..57fa2d708126 100644
--- a/sw/source/filter/ww8/docxsdrexport.cxx
+++ b/sw/source/filter/ww8/docxsdrexport.cxx
@@ -24,6 +24,7 @@
 #include <fmtcntnt.hxx>
 #include <fmtornt.hxx>
 #include <fmtfsize.hxx>
+#include <fmtfollowtextflow.hxx>
 #include <frmatr.hxx>
 #include <fmtwrapinfluenceonobjpos.hxx>
 #include "docxattributeoutput.hxx"
@@ -825,6 +826,7 @@ void DocxSdrExport::writeVMLDrawing(const SdrObject* sdrObj, const SwFrameFormat
     m_pImpl->getDrawingML()->SetFS(m_pImpl->getSerializer());
     // See WinwordAnchoring::SetAnchoring(), these are not part of the SdrObject, have to be passed around manually.
 
+    SwFormatFollowTextFlow const& rFlow(rFrameFormat.GetFollowTextFlow());
     const SwFormatHoriOrient& rHoriOri = rFrameFormat.GetHoriOrient();
     const SwFormatVertOrient& rVertOri = rFrameFormat.GetVertOrient();
     SwFormatSurround const& rSurround(rFrameFormat.GetSurround());
@@ -832,8 +834,8 @@ void DocxSdrExport::writeVMLDrawing(const SdrObject* sdrObj, const SwFrameFormat
     std::unique_ptr<sax_fastparser::FastAttributeList> pAttrList(
         docx::SurroundToVMLWrap(rSurround));
     m_pImpl->getExport().VMLExporter().AddSdrObject(
-        *sdrObj, rHoriOri.GetHoriOrient(), rVertOri.GetVertOrient(), rHoriOri.GetRelationOrient(),
-        rVertOri.GetRelationOrient(), std::move(pAttrList), true);
+        *sdrObj, rFlow.GetValue(), rHoriOri.GetHoriOrient(), rVertOri.GetVertOrient(),
+        rHoriOri.GetRelationOrient(), rVertOri.GetRelationOrient(), std::move(pAttrList), true);
     m_pImpl->getSerializer()->endElementNS(XML_w, XML_pict);
 }
 


More information about the Libreoffice-commits mailing list