[Libreoffice-commits] core.git: Branch 'libreoffice-7-0' - sw/source

Michael Stahl (via logerrit) logerrit at kemper.freedesktop.org
Thu Jun 18 12:42:36 UTC 2020


 sw/source/core/edit/edglss.cxx |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

New commits:
commit ad4f96d6a51744a48988bf80c0d059d86a4e8897
Author:     Michael Stahl <Michael.Stahl at cib.de>
AuthorDate: Wed Jun 17 17:40:48 2020 +0200
Commit:     Michael Stahl <michael.stahl at cib.de>
CommitDate: Thu Jun 18 14:42:05 2020 +0200

    tdf#133982 sw: fix Copy of document that starts with nested table
    
    Started to assert with ef8427d12a63127a2eb867637699343d630545dd
    because a bookmark was created on the wrong node but this never worked.
    
    Change-Id: Ife01a3c8041b4c7d08b2d749dde77ced388f7215
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96556
    Tested-by: Jenkins
    Reviewed-by: Michael Stahl <michael.stahl at cib.de>
    (cherry picked from commit 310271df2e4dc67d223dbec4b23e39ea4a67c042)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96579

diff --git a/sw/source/core/edit/edglss.cxx b/sw/source/core/edit/edglss.cxx
index fbe20f8991e2..5c37ec22a03c 100644
--- a/sw/source/core/edit/edglss.cxx
+++ b/sw/source/core/edit/edglss.cxx
@@ -231,7 +231,12 @@ bool SwEditShell::CopySelToDoc( SwDoc* pInsDoc )
                         // Selection starts at the first para of the first cell,
                         // but we want to copy the table and the start node before
                         // the first cell as well.
-                        aPaM.Start()->nNode = aPaM.Start()->nNode.GetNode().FindTableNode()->GetIndex();
+                        // tdf#133982 tables can be nested
+                        while (SwTableNode const* pTableNode =
+                            aPaM.Start()->nNode.GetNode().StartOfSectionNode()->FindTableNode())
+                        {
+                            aPaM.Start()->nNode = *pTableNode;
+                        }
                         aPaM.Start()->nContent.Assign(nullptr, 0);
                     }
                     bRet = GetDoc()->getIDocumentContentOperations().CopyRange( aPaM, aPos, SwCopyFlags::CheckPosInFly)


More information about the Libreoffice-commits mailing list