summaryrefslogtreecommitdiff
path: root/sw/source/core/unocore/unotext.cxx
diff options
context:
space:
mode:
authorMichael Stahl <Michael.Stahl@cib.de>2020-01-20 13:48:27 +0100
committerMichael Stahl <michael.stahl@cib.de>2020-01-20 19:25:41 +0100
commit81ec0039b2085faab49380c7a56af0c562d4c9e4 (patch)
tree62eced31897b111ad03f6f50b943f68cc17102e3 /sw/source/core/unocore/unotext.cxx
parent901ae316b919680d59b064c6f79fb0910e6be7da (diff)
tdf#129582 sw: fix copying of flys in header/footer in DOCX/RTF import
The problem is that the exception for writerfilter in IsDestroyFrameAnchoredAtChar() and IsSelectFrameAnchoredAtPara() is wrong in the case when the header/footer content is copied via SwXText::copyText(); that is, previously the situation was that writerfilter relied on Delete not deleting such flys (for RemoveLastParagraph) but Copy copying them. (regression from 28b77c89dfcafae82cf2a6d85731b643ff9290e5 and e75dd1fc992f168f24d66595265a978071cdd277) So restrict the writerfilter hack to delete; this causes a problem with ooxmlexport9 test testTdf100075: it has 2 flys anchored at the same paragraph; writerfilter will insert the content into the body and then convert to fly; when the 2nd one is converted it will copy the 1st fly and anchor it inside the 2nd fly but then unotext.cxx:1719 will reset its anchor to inside the body... Prevent this unwanted copy by relying on the new parameter bCopyText that was introduced in 04b2310aaa094794ceedaa1bb6ff1823a2d29d3e, but change things a bit so that the case that pass in the extra flag isn't the copyText() one that wants the *normal* selection semantics in writerfilter import, but the 2 known places that want the *exceptional* selection semantics in writerfilter import (hopefully there aren't more). This is not ideal and the various bool parameters to CopyRange() plus mbCopyIsMove plus mbIsRedlineMove should probably be consolidated into some flags enum passed to CopyRange(). Change-Id: I638c7fa7ad0b4ec149aa6a1485e32f2c8e29ff5a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87072 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@cib.de>
Diffstat (limited to 'sw/source/core/unocore/unotext.cxx')
-rw-r--r--sw/source/core/unocore/unotext.cxx4
1 files changed, 2 insertions, 2 deletions
diff --git a/sw/source/core/unocore/unotext.cxx b/sw/source/core/unocore/unotext.cxx
index 0c98cae57a3e..2857b2808cca 100644
--- a/sw/source/core/unocore/unotext.cxx
+++ b/sw/source/core/unocore/unotext.cxx
@@ -2252,7 +2252,7 @@ SwXText::copyText(
// Explicitly request copy text mode, so
// sw::DocumentContentOperationsManager::CopyFlyInFlyImpl() will copy shapes anchored to
// us, even if we have only a single paragraph.
- m_pImpl->m_pDoc->getIDocumentContentOperations().CopyRange(temp, rPos, /*bCopyAll=*/false, /*bCheckPos=*/true, /*bCopyText=*/true);
+ m_pImpl->m_pDoc->getIDocumentContentOperations().CopyRange(temp, rPos, /*bCopyAll=*/false, /*bCheckPos=*/true, /*bCopyText=*/false);
}
if (!pFirstNode)
{ // the node at rPos was split; get rid of the first empty one so
@@ -2263,7 +2263,7 @@ SwXText::copyText(
}
else
{
- m_pImpl->m_pDoc->getIDocumentContentOperations().CopyRange(*pCursor->GetPaM(), rPos, /*bCopyAll=*/false, /*bCheckPos=*/true, /*bCopyText=*/true);
+ m_pImpl->m_pDoc->getIDocumentContentOperations().CopyRange(*pCursor->GetPaM(), rPos, /*bCopyAll=*/false, /*bCheckPos=*/true, /*bCopyText=*/false);
}
}