summaryrefslogtreecommitdiff
path: root/sw/source/filter/ww8/wrtw8nds.cxx
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.com>2023-04-17 08:14:12 +0200
committerMiklos Vajna <vmiklos@collabora.com>2023-04-17 09:01:31 +0200
commit3cd14725b6a16d7e6cc328aef3d1d9a9a6649634 (patch)
tree27552ea19dfd5a4b69a9c061854345f728bc9016 /sw/source/filter/ww8/wrtw8nds.cxx
parente870d996efb4a856f667c601032e02e5b21c5b82 (diff)
sw floatable: teach the DOC export about SwFormatFlySplit
Floating tables were always written back as a shape, containing a table, which can't split over pages, not even in Word. Now that we have split flys, we know that floating tables are mapped to split flys, so we can map split flys back to floating tables on export. The following SPRMs need writing, which are more or less the equivalent to DOCX's <w:tblpPr> attributes: - sprmTPc: relation orient for positioning the table - sprmTDyaFromText, sprmTDyaFromTextBottom: top/bottom margin - sprmTDxaFromText, sprmTDxaFromTextRight: left/right margin - sprmTDxaAbs: horizontal orientation - sprmTDyaAbs: vertical orientation With this, testTdf107773 passes in the SW_FORCE_FLY_SPLIT=1 case, while previously only the import side worked. Change-Id: Id534c1497eb56f9268bf49d2a19764051397bb18 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150464 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
Diffstat (limited to 'sw/source/filter/ww8/wrtw8nds.cxx')
-rw-r--r--sw/source/filter/ww8/wrtw8nds.cxx17
1 files changed, 16 insertions, 1 deletions
diff --git a/sw/source/filter/ww8/wrtw8nds.cxx b/sw/source/filter/ww8/wrtw8nds.cxx
index 61d73c32f242..71f33f3a7d14 100644
--- a/sw/source/filter/ww8/wrtw8nds.cxx
+++ b/sw/source/filter/ww8/wrtw8nds.cxx
@@ -99,6 +99,7 @@
#include <ndgrf.hxx>
#include <ndole.hxx>
+#include <formatflysplit.hxx>
#include <cstdio>
@@ -3464,7 +3465,21 @@ void WW8AttributeOutput::OutputFlyFrame_Impl( const ww8::Frame& rFormat, const P
if (bUseEscher)
{
// write as escher
- m_rWW8Export.AppendFlyInFlys(rFormat, rNdTopLeft);
+ if (rFrameFormat.GetFlySplit().GetValue())
+ {
+ // The frame can split: this was originally from a floating table, write it back as
+ // such.
+ const SwNodeIndex* pNodeIndex = rFrameFormat.GetContent().GetContentIdx();
+ SwNodeOffset nStt = pNodeIndex ? pNodeIndex->GetIndex() + 1 : SwNodeOffset(0);
+ SwNodeOffset nEnd = pNodeIndex ? pNodeIndex->GetNode().EndOfSectionIndex() : SwNodeOffset(0);
+ m_rWW8Export.SaveData(nStt, nEnd);
+ GetExport().WriteText();
+ m_rWW8Export.RestoreData();
+ }
+ else
+ {
+ m_rWW8Export.AppendFlyInFlys(rFormat, rNdTopLeft);
+ }
}
else
{