summaryrefslogtreecommitdiff
path: root/sw/source/filter/ww8/docxexport.cxx
diff options
context:
space:
mode:
authorJustin Luth <justin_luth@sil.org>2015-06-24 23:02:57 +0300
committerMiklos Vajna <vmiklos@collabora.co.uk>2015-07-03 16:40:52 +0000
commit4802bf32b84655f6e1d3389070c76371ede8fbce (patch)
tree72d4bb14ffbb440e710a6e332b3a8896455437d2 /sw/source/filter/ww8/docxexport.cxx
parente83cb37cf7546e8bc46d0d49b487dcd352b67093 (diff)
tdf#87348 enable docx exporting linked textboxes that LO can import
Exporting linked textboxes to docx format is in terrible condition. Spacing, textboxes instead of frames, duplicate links and orphaned shapes lying around, not to mention being being unlinked in MSWord... This fix resolves this situation slightly: what LO saves can be re-imported and re-saved without breaking the links - an incremental improvement. Change-Id: I8f0aef39eeed88a2b3dfc673a565fb1d8f4713b0 Reviewed-on: https://gerrit.libreoffice.org/16516 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Diffstat (limited to 'sw/source/filter/ww8/docxexport.cxx')
-rw-r--r--sw/source/filter/ww8/docxexport.cxx8
1 files changed, 8 insertions, 0 deletions
diff --git a/sw/source/filter/ww8/docxexport.cxx b/sw/source/filter/ww8/docxexport.cxx
index e91bea85b15f..de23a27ee345 100644
--- a/sw/source/filter/ww8/docxexport.cxx
+++ b/sw/source/filter/ww8/docxexport.cxx
@@ -453,6 +453,7 @@ void DocxExport::ExportDocument_Impl()
WriteEmbeddings();
+ m_aLinkedTextboxesHelper.clear(); //final cleanup
delete m_pStyles, m_pStyles = NULL;
delete m_pSections, m_pSections = NULL;
}
@@ -1314,6 +1315,10 @@ void DocxExport::WriteMainText()
// setup the namespaces
m_pDocumentFS->startElementNS( XML_w, XML_document, MainXmlNamespaces());
+ // reset the incrementing linked-textboxes chain ID before re-saving.
+ m_nLinkedTextboxesChainId=0;
+ m_aLinkedTextboxesHelper.clear();
+
// Write background page color
if (boost::optional<SvxBrushItem> oBrush = getBackground())
{
@@ -1331,6 +1336,9 @@ void DocxExport::WriteMainText()
// the text
WriteText();
+ // clear linked textboxes since old ones can't be linked to frames in a different section (correct?)
+ m_aLinkedTextboxesHelper.clear();
+
// the last section info
m_pAttrOutput->EndParaSdtBlock();
const WW8_SepInfo *pSectionInfo = m_pSections? m_pSections->CurrentSectionInfo(): NULL;