diff options
author | Miklos Vajna <vmiklos@collabora.com> | 2020-01-10 13:20:40 +0100 |
---|---|---|
committer | Michael Stahl <michael.stahl@cib.de> | 2020-01-21 12:09:01 +0100 |
commit | 8f84922be15d37cb54fa592e1445fa5ab2c37f15 (patch) | |
tree | b2b176aa29fdb6673735396b6dfd51a199dbd4db /sw/source/core/inc | |
parent | 97928a862bd7e74955dbc59732be9e43f1a2d42a (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
(cherry picked from commit 04b2310aaa094794ceedaa1bb6ff1823a2d29d3e)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87122
Reviewed-by: Michael Stahl <michael.stahl@cib.de>
Diffstat (limited to 'sw/source/core/inc')
-rw-r--r-- | sw/source/core/inc/DocumentContentOperationsManager.hxx | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/sw/source/core/inc/DocumentContentOperationsManager.hxx b/sw/source/core/inc/DocumentContentOperationsManager.hxx index 21829eaf22a5..4f523bec9f3d 100644 --- a/sw/source/core/inc/DocumentContentOperationsManager.hxx +++ b/sw/source/core/inc/DocumentContentOperationsManager.hxx @@ -37,7 +37,7 @@ public: DocumentContentOperationsManager( SwDoc& i_rSwdoc ); //Interface methods: - bool CopyRange(SwPaM&, SwPosition&, const bool bCopyAll, bool bCheckPos ) const override; + bool CopyRange(SwPaM&, SwPosition&, const bool bCopyAll, bool bCheckPos, bool bCopyText ) const override; void DeleteSection(SwNode* pNode) override; @@ -108,11 +108,13 @@ public: const std::pair<const SwPaM&, const SwPosition&> * pCopiedPaM = nullptr, bool bMakeNewFrames = true, bool bDelRedlines = true, - bool bCopyFlyAtFly = false ) const; + bool bCopyFlyAtFly = false, + bool bCopyText = false ) const; void CopyFlyInFlyImpl( const SwNodeRange& rRg, SwPaM const*const pCopiedPaM, const SwNodeIndex& rStartIdx, - const bool bCopyFlyAtFly = false ) const; + const bool bCopyFlyAtFly = false, + bool bCopyText = false ) const; /// Parameters for _Rst and lcl_SetTextFormatColl //originallyfrom docfmt.cxx @@ -169,9 +171,9 @@ private: /* Copy a range within the same or to another document. Position may not lie within range! */ bool CopyImpl( SwPaM&, SwPosition&, - const bool bCopyAll, SwPaM *const pCpyRng /*= 0*/ ) const; + const bool bCopyAll, SwPaM *const pCpyRng /*= 0*/, bool bCopyText ) const; bool CopyImplImpl(SwPaM&, SwPosition&, - const bool bCopyAll, SwPaM *const pCpyRng /*= 0*/) const; + const bool bCopyAll, SwPaM *const pCpyRng /*= 0*/, bool bCopyText ) const; DocumentContentOperationsManager(DocumentContentOperationsManager const&) = delete; DocumentContentOperationsManager& operator=(DocumentContentOperationsManager const&) = delete; |