summaryrefslogtreecommitdiff
path: root/sw/source/filter/docx
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.com>2020-01-10 13:20:40 +0100
committerMiklos Vajna <vmiklos@collabora.com>2020-01-10 14:13:05 +0100
commit04b2310aaa094794ceedaa1bb6ff1823a2d29d3e (patch)
tree6ed8c727ef149a6443a06cca064e7612340a33fb /sw/source/filter/docx
parentd9c535ead688e9f156dbcf43948df08a69e218be (diff)
DOCX import: fix lost objects anchored to the single para of a linked header
Regression from commit 08f13ab85b5c65b5dc8adfa15918fb3e426fcc3c (tdf#112202 writerfilter,sw: fix loss of headers, 2019-12-16), the problem is that on one hand, copyText() is meant to copy a complete XText (header, table cell, footnote, etc), OTOH the internal API use used only copies at-para anchored objects for complete text nodes, so a one-paragraph header will loose its anchored objects when a linked header is copied. Introduce a new "CopyText" flag that provides the expected copyText() behavior and use that when the copyText() UNO API is invoked, but leave the selection behavior unchanged. Perform the inclusive check in IsSelectFrameAnchoredAtPara(), opt in for that from SwXText::copyText(), the rest is just passing the flag around. Change-Id: Id727f7ca4f6121a7050340359716a52ecb4886f2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86529 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
Diffstat (limited to 'sw/source/filter/docx')
-rw-r--r--sw/source/filter/docx/swdocxreader.cxx2
1 files changed, 1 insertions, 1 deletions
diff --git a/sw/source/filter/docx/swdocxreader.cxx b/sw/source/filter/docx/swdocxreader.cxx
index f13127fcabd7..ce04767173ad 100644
--- a/sw/source/filter/docx/swdocxreader.cxx
+++ b/sw/source/filter/docx/swdocxreader.cxx
@@ -233,7 +233,7 @@ bool SwDOCXReader::MakeEntries( SwDoc *pD, SwTextBlocks &rBlocks )
SwNodeIndex aIdx( pGlDoc->GetNodes().GetEndOfContent(), -1 );
pCNd = aIdx.GetNode().GetContentNode();
SwPosition aPos( aIdx, SwIndex( pCNd, pCNd ? pCNd->Len() : 0 ) );
- pD->getIDocumentContentOperations().CopyRange( aPam, aPos, /*bCopyAll=*/false, /*bCheckPos=*/true );
+ pD->getIDocumentContentOperations().CopyRange( aPam, aPos, /*bCopyAll=*/false, /*bCheckPos=*/true, /*bCopyText=*/false );
rBlocks.PutDoc();
}
else