summaryrefslogtreecommitdiff
path: root/sw/source/filter/ww8/wrtw8nds.cxx
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2022-11-25 15:20:48 +0300
committerMike Kaganski <mike.kaganski@collabora.com>2022-11-25 16:54:30 +0100
commitec345c02d8fa5a7c7d4ea4ad08ae7be5303d9b20 (patch)
tree4dd95d5b760239bd06332dfd72bbda0bb652d664 /sw/source/filter/ww8/wrtw8nds.cxx
parent75eb99cec153e720407b44c376285a0c543018b2 (diff)
tdf#152200: Make sure to not write objects into field character runs
Similar how it's done for preceding objects immediately after calculating 'ofs', we also need to make sure to create a separate run for the objects that may be anchored after the last character; otherwise, the field that was just processed (and is waiting in the attributes) would be put out of place, inside an inner run (e.g., in a text box inside the object). Change-Id: I2702693595acf4befdbd25ef07a9f7c444926aab Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143297 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'sw/source/filter/ww8/wrtw8nds.cxx')
-rw-r--r--sw/source/filter/ww8/wrtw8nds.cxx8
1 files changed, 8 insertions, 0 deletions
diff --git a/sw/source/filter/ww8/wrtw8nds.cxx b/sw/source/filter/ww8/wrtw8nds.cxx
index a173a2014c4b..115a009bde79 100644
--- a/sw/source/filter/ww8/wrtw8nds.cxx
+++ b/sw/source/filter/ww8/wrtw8nds.cxx
@@ -2640,6 +2640,14 @@ void MSWordExportBase::OutputTextNode( SwTextNode& rNode )
bPostponeWritingText = false ;
AttrOutput().RunText( aSnippet, eChrSet );
}
+
+ if (ofs == 1 && nNextAttr == nEnd)
+ {
+ // tdf#152200: There could be flys anchored after the last position; make sure
+ // to provide a separate run after field character to write them
+ AttrOutput().EndRun(&rNode, nCurrentPos, -1, nNextAttr == nEnd);
+ AttrOutput().StartRun(pRedlineData, nCurrentPos, bSingleEmptyRun);
+ }
}
if ( aAttrIter.IsDropCap( nNextAttr ) )