summaryrefslogtreecommitdiff
path: root/sw/source/filter/ww8/wrtw8nds.cxx
diff options
context:
space:
mode:
authorTamás Zolnai <tamas.zolnai@collabora.com>2017-11-04 16:26:23 +0100
committerTamás Zolnai <tamas.zolnai@collabora.com>2017-11-04 19:11:00 +0100
commit98bc7215935f1eb2e0dc6f1db826d8e729430c13 (patch)
tree677dc15a3800537b25738b35f0dac82a54e5bc9e /sw/source/filter/ww8/wrtw8nds.cxx
parentffb5ad4681f7f68b3b50dc4d94ea7ea8127da5e0 (diff)
tdf#42346: DOCX export of cross-references to objects
* Objects means tables, images, text frames and shapes * Implementation ** MSO uses simple bookmark references as cross-references to objects ** So generate bookmarks in export time if a caption is referenced ** In some cases we also need to split some of the runs ** Implemented all types of cross-references, except the chapter reference Change-Id: I3b17753123d94a04e4f28783ad5663831e7c6c84 Reviewed-on: https://gerrit.libreoffice.org/44294 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tamás Zolnai <tamas.zolnai@collabora.com>
Diffstat (limited to 'sw/source/filter/ww8/wrtw8nds.cxx')
-rw-r--r--sw/source/filter/ww8/wrtw8nds.cxx23
1 files changed, 23 insertions, 0 deletions
diff --git a/sw/source/filter/ww8/wrtw8nds.cxx b/sw/source/filter/ww8/wrtw8nds.cxx
index 87c27db44c89..23208e90a8fc 100644
--- a/sw/source/filter/ww8/wrtw8nds.cxx
+++ b/sw/source/filter/ww8/wrtw8nds.cxx
@@ -1173,6 +1173,25 @@ void SwWW8AttrIter::OutSwFormatRefMark(const SwFormatRefMark& rAttr)
&rAttr.GetRefName(), 0 ));
}
+void SwWW8AttrIter::SplitRun( sal_Int32 nSplitEndPos )
+{
+ for(auto aIter = maCharRuns.begin(); aIter != maCharRuns.end(); ++aIter)
+ {
+ if(aIter->mnEndPos == nSplitEndPos)
+ return;
+ else if (aIter->mnEndPos > nSplitEndPos)
+ {
+ CharRunEntry aNewEntry = *aIter;
+ aIter->mnEndPos = nSplitEndPos;
+ maCharRuns.insert( ++aIter, aNewEntry);
+ maCharRunIter = maCharRuns.begin();
+ IterToCurrent();
+ nAktSwPos = SearchNext(1);
+ break;
+ }
+ }
+}
+
void WW8AttributeOutput::FieldVanish( const OUString& rText, ww::eField /*eType*/ )
{
ww::bytes aItems;
@@ -2163,6 +2182,10 @@ void MSWordExportBase::OutputTextNode( SwTextNode& rNode )
AppendBookmark( BookmarkToWord( sBkmkName ) );
}
+ // Call this before write out fields and runs
+ if(GetExportFormat() == ExportFormat::DOCX)
+ AttrOutput().GenerateBookmarksForSequenceField(rNode, aAttrIter);
+
const OUString& aStr( rNode.GetText() );
sal_Int32 nAktPos = 0;