[Libreoffice-commits] core.git: Branch 'distro/lhm/libreoffice-6-1+backports' - 5 commits - sw/inc sw/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Fri Mar 8 11:59:21 UTC 2019


 sw/inc/doc.hxx                      |    3 +-
 sw/source/core/crsr/crstrvl.cxx     |    8 +++---
 sw/source/core/doc/doctxm.cxx       |    7 +++++-
 sw/source/core/docnode/ndsect.cxx   |    5 ++--
 sw/source/core/fields/expfld.cxx    |    1 
 sw/source/core/inc/UndoSection.hxx  |    9 ++++++-
 sw/source/core/inc/rootfrm.hxx      |    7 ++++++
 sw/source/core/txtnode/atrflyin.cxx |    8 ++++++
 sw/source/core/txtnode/ndtxt.cxx    |    3 --
 sw/source/core/undo/unsect.cxx      |   42 ++++++++++++++++++++++++++++++++----
 sw/source/filter/basflt/shellio.cxx |   17 ++++++++++++++
 sw/source/uibase/app/docsh2.cxx     |   11 ---------
 12 files changed, 93 insertions(+), 28 deletions(-)

New commits:
commit f3cb06e94f612c63e3a3df27c31c02735d2cd5e2
Author:     Michael Stahl <Michael.Stahl at cib.de>
AuthorDate: Thu Mar 7 15:53:36 2019 +0100
Commit:     Michael Stahl <Michael.Stahl at cib.de>
CommitDate: Fri Mar 8 12:22:43 2019 +0100

    tdf#123259 sw_redlinehide: fix reanchoring of drawing objects
    
    ... in SplitNode.
    
    The problem is that first the new anchor position is set in the
    SwFrameFormat, then SwDrawContact::DisconnectFromLayout() is called
    (implicitly from its SwClientNotify()).
    
    This then cause the a11y wrapper to be disposed and an event to be sent,
    which then ATKListener::notifyEvent() immediately processes by
    retrieving all of the children of the anchor SwTextFrame.
    
    At this point, we get an assert from SwTextFrame::MapModelToView,
    because the layout anchor frame is still the old one, but the model
    format already has the new position, so the frame can't map the
    anchor position.
    
    Avoid this by explicitly disconnecting from the layout before setting
    the anchor on the SwFrameFormat.
    
    Change-Id: Iba8960729dd041e13de4963d1b2ab6b223c8a427
    Reviewed-on: https://gerrit.libreoffice.org/68880
    Tested-by: Jenkins
    Reviewed-by: Michael Stahl <Michael.Stahl at cib.de>
    (cherry picked from commit 468ac1bdf1dcdc1f0d679ae2a7bf75102333c0af)

diff --git a/sw/source/core/txtnode/atrflyin.cxx b/sw/source/core/txtnode/atrflyin.cxx
index 45cc6bdf48d1..a8fe920630a3 100644
--- a/sw/source/core/txtnode/atrflyin.cxx
+++ b/sw/source/core/txtnode/atrflyin.cxx
@@ -34,6 +34,7 @@
 #include <flyfrms.hxx>
 #include <objectformatter.hxx>
 #include <calbck.hxx>
+#include <dcontact.hxx>
 
 SwFormatFlyCnt::SwFormatFlyCnt( SwFrameFormat *pFrameFormat )
     : SfxPoolItem( RES_TXTATR_FLYCNT ),
@@ -193,6 +194,13 @@ void SwTextFlyCnt::SetAnchor( const SwTextNode *pNode )
     else
     {
         assert(!pFormat->IsModifyLocked()); // need to notify anchor node
+        if (RES_DRAWFRMFMT == pFormat->Which())
+        {
+            if (SdrObject const*const pObj = pFormat->FindSdrObject())
+            {   // tdf#123259 disconnect with *old* anchor position
+                static_cast<SwDrawContact*>(::GetUserCall(pObj))->DisconnectFromLayout();
+            }
+        }
         pFormat->SetFormatAttr( aAnchor );  // only set the anchor
     }
 
commit 4463d697be0e3e57ac072de558b25e600e5e5efa
Author:     Michael Stahl <Michael.Stahl at cib.de>
AuthorDate: Wed Mar 6 18:38:37 2019 +0100
Commit:     Michael Stahl <Michael.Stahl at cib.de>
CommitDate: Fri Mar 8 12:21:40 2019 +0100

    tdf#123637 sw_redlinehide: fix iteration in SwCursorShell::GotoNextOutline()
    
    If nStartPos == size() and !bUseFirst.
    
    (regression from d0e9cc832d19b622532f01580d9cf78ee0b215db)
    
    Change-Id: I571d24ec5e9d4f2780e7c6d5c8cee09baeaffcc1
    Reviewed-on: https://gerrit.libreoffice.org/68821
    Tested-by: Jenkins
    Reviewed-by: Michael Stahl <Michael.Stahl at cib.de>
    (cherry picked from commit dfdb7f9fcffe0b8594359c22277b64c7b6cdfd4c)
    Reviewed-on: https://gerrit.libreoffice.org/68845
    Reviewed-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>
    (cherry picked from commit 0308bfd590a5bdf602254491b1a76e055e6c3f85)

diff --git a/sw/source/core/crsr/crstrvl.cxx b/sw/source/core/crsr/crstrvl.cxx
index 075953ca7bc7..212ebfee6079 100644
--- a/sw/source/core/crsr/crstrvl.cxx
+++ b/sw/source/core/crsr/crstrvl.cxx
@@ -980,13 +980,13 @@ bool SwCursorShell::GotoNextOutline()
 
     do
     {
-        if (nPos == rNds.GetOutLineNds().size())
+        if (!bUseFirst)
         {
-            nPos = 0;
+            ++nPos;
         }
-        else if (!bUseFirst)
+        if (rNds.GetOutLineNds().size() <= nPos)
         {
-            ++nPos;
+            nPos = 0;
         }
 
         if (bUseFirst)
commit 6ad229c6597ed9f7efa52855b69ea6f9ed981c8d
Author:     Michael Stahl <Michael.Stahl at cib.de>
AuthorDate: Wed Mar 6 17:11:25 2019 +0100
Commit:     Michael Stahl <Michael.Stahl at cib.de>
CommitDate: Fri Mar 8 12:21:40 2019 +0100

    sw_redlinehide: fix SwGetExpField ODF import
    
    After import, SwGetExpField are empty if ShowRedlineChanges=false
    because the content from the document is lost in SwGetExpField::Copy().
    
    Example is ooo26330-3.sxw, which then asserts once fields are updated,
    but that is a different problem.
    
    (regression from 57f358f1ac4f3e05fcdf54326388ba8a19f0f2b3)
    
    Change-Id: I1bf939d69e599919c3a5c5631091ca0a0074d139
    Reviewed-on: https://gerrit.libreoffice.org/68820
    Tested-by: Jenkins
    Reviewed-by: Michael Stahl <Michael.Stahl at cib.de>
    (cherry picked from commit ac7de9a54d67e4e4f3bacedb68a4cff6cc6e9af0)
    Reviewed-on: https://gerrit.libreoffice.org/68844
    Reviewed-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>
    (cherry picked from commit 143823fc511bf86b5f4d7f39c498929597abb68f)

diff --git a/sw/source/core/fields/expfld.cxx b/sw/source/core/fields/expfld.cxx
index 3ea3831e0a60..4bd0c9654f6a 100644
--- a/sw/source/core/fields/expfld.cxx
+++ b/sw/source/core/fields/expfld.cxx
@@ -331,6 +331,7 @@ SwField* SwGetExpField::Copy() const
     pTmp->m_fValueRLHidden = m_fValueRLHidden;
     pTmp->SwValueField::SetValue(GetValue());
     pTmp->m_sExpand       = m_sExpand;
+    pTmp->m_sExpandRLHidden = m_sExpandRLHidden;
     pTmp->m_bIsInBodyText  = m_bIsInBodyText;
     pTmp->SetAutomaticLanguage(IsAutomaticLanguage());
     if( m_bLateInitialization )
commit f6d653e17a7757568080eacbe344ffb59b63b4d6
Author:     Michael Stahl <Michael.Stahl at cib.de>
AuthorDate: Tue Mar 5 14:12:27 2019 +0100
Commit:     Michael Stahl <Michael.Stahl at cib.de>
CommitDate: Fri Mar 8 12:21:40 2019 +0100

    sw_redlinehide: fix RSID related asserts regression
    
    Due to sw_redlinehide the SwTextNode::MakeFrame() is skipped on
    SwTextNodes that are merged due to redlining. But then the
    IgnoreStart/IgnoreEnd flags on the hints are not initialised and some
    assert like assert(pHt->IsFormatIgnoreStart()) fails.
    
    tdf90056-1.odt is an example document.
    
    There doesn't appear to be a convenient place to initialise it per-node
    as it is finished; the ODF import inserts APPEND_PARAGRAPH before
    inserting the hints themselves.
    
    So remove the initialisation from MakeFrame() and just do it in
    SwReader::Read().
    
    Change-Id: Ib33fe3033fc05bd2f5ef2ac8d059d587642ccf48
    Reviewed-on: https://gerrit.libreoffice.org/68748
    Tested-by: Jenkins
    Reviewed-by: Michael Stahl <Michael.Stahl at cib.de>
    (cherry picked from commit d55e75d9173fd0d5928bae45ed49d3c105140468)
    Reviewed-on: https://gerrit.libreoffice.org/68768
    Reviewed-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>
    (cherry picked from commit c782dc3441ef29056ba146e0798637b923bcf5f3)

diff --git a/sw/source/core/txtnode/ndtxt.cxx b/sw/source/core/txtnode/ndtxt.cxx
index 3e6bce9b808f..5285c71fc903 100755
--- a/sw/source/core/txtnode/ndtxt.cxx
+++ b/sw/source/core/txtnode/ndtxt.cxx
@@ -278,9 +278,6 @@ void SwTextNode::FileLoadedInitHints()
 
 SwContentFrame *SwTextNode::MakeFrame( SwFrame* pSib )
 {
-    // fdo#52028: ODF file import does not result in MergePortions being called
-    // for every attribute, since that would be inefficient.  So call it here.
-    FileLoadedInitHints();
     SwContentFrame *pFrame = new SwTextFrame( this, pSib );
     return pFrame;
 }
diff --git a/sw/source/filter/basflt/shellio.cxx b/sw/source/filter/basflt/shellio.cxx
index 24e92e23412b..c687b0c89cfb 100644
--- a/sw/source/filter/basflt/shellio.cxx
+++ b/sw/source/filter/basflt/shellio.cxx
@@ -55,6 +55,7 @@
 #include <poolfmt.hxx>
 #include <fltini.hxx>
 #include <docsh.hxx>
+#include <ndtxt.hxx>
 #include <redline.hxx>
 #include <swerror.h>
 #include <paratr.hxx>
@@ -62,6 +63,15 @@
 
 using namespace ::com::sun::star;
 
+static bool sw_MergePortions(SwNode *const& pNode, void *)
+{
+    if (pNode->IsTextNode())
+    {
+        pNode->GetTextNode()->FileLoadedInitHints();
+    }
+    return true;
+}
+
 ErrCode SwReader::Read( const Reader& rOptions )
 {
     // copy variables
@@ -338,6 +348,13 @@ ErrCode SwReader::Read( const Reader& rOptions )
         }
     }
 
+    // fdo#52028: ODF file import does not result in MergePortions being called
+    // for every attribute, since that would be inefficient.  So call it here.
+    // This is only necessary for formats that may contain RSIDs (ODF,MSO).
+    // It's too hard to figure out which nodes were inserted in Insert->File
+    // case (redlines, flys, footnotes, header/footer) so just do every node.
+    mxDoc->GetNodes().ForEach(&sw_MergePortions);
+
     mxDoc->SetInReading( false );
     mxDoc->SetInXMLImport( false );
 
diff --git a/sw/source/uibase/app/docsh2.cxx b/sw/source/uibase/app/docsh2.cxx
index c9678c6b9836..a681bfde1388 100644
--- a/sw/source/uibase/app/docsh2.cxx
+++ b/sw/source/uibase/app/docsh2.cxx
@@ -1608,15 +1608,6 @@ SfxInPlaceClient* SwDocShell::GetIPClient( const ::svt::EmbeddedObjectRef& xObjR
     return pResult;
 }
 
-static bool lcl_MergePortions(SwNode *const& pNode, void *)
-{
-    if (pNode->IsTextNode())
-    {
-        pNode->GetTextNode()->FileLoadedInitHints();
-    }
-    return true;
-}
-
 int SwFindDocShell( SfxObjectShellRef& xDocSh,
                     SfxObjectShellLock& xLockRef,
                     const OUString& rFileName,
@@ -1707,8 +1698,6 @@ int SwFindDocShell( SfxObjectShellRef& xDocSh,
             xDocSh = static_cast<SfxObjectShell*>(xLockRef);
             if (xDocSh->DoLoad(xMed.release()))
             {
-                SwDoc const& rDoc(*pNew->GetDoc());
-                const_cast<SwDoc&>(rDoc).GetNodes().ForEach(&lcl_MergePortions);
                 return 2;
             }
         }
commit 5ebbc44a8121416167df9db921bd3037202a42fa
Author:     Michael Stahl <Michael.Stahl at cib.de>
AuthorDate: Mon Mar 4 13:12:09 2019 +0100
Commit:     Michael Stahl <Michael.Stahl at cib.de>
CommitDate: Fri Mar 8 12:19:35 2019 +0100

    tdf#123446 sw_redlinehide: fix crash on Redo of ToX
    
    The problem is that the ToX must be updated with the same layout redline
    setting as it was originally created, so that subsequent Redo actions
    see the expected node indexes.
    
    Unfortunately it's not enough to just pass a flag to the ToX update
    functions, because they check GetTextNodeForParaProps() so we need a
    layout corresponding to the layout setting; if there isn't one, the
    existing one is temporarily toggled.
    
    This could be much better if the MergedPara would be independent of the
    layout and always exist, but with the various SwModify design issues
    that looks tricky to do...
    
    (regression from 80cedb5dcb6a7dd6c01349b93fab49ecee5f6594)
    
    Reviewed-on: https://gerrit.libreoffice.org/68704
    Reviewed-by: Michael Stahl <Michael.Stahl at cib.de>
    Tested-by: Michael Stahl <Michael.Stahl at cib.de>
    (cherry picked from commit 405661a98f01416c596083262691cedd941733a1)
    
    Reviewed-on: https://gerrit.libreoffice.org/68736
    Tested-by: Jenkins
    Reviewed-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>
    (cherry picked from commit e53a3e8cc21b5c54c2463fbad6debd2011307b1c)
    
    Change-Id: Ibdc5b4ace54ace27e5223a25ecaf39bb493fb69b

diff --git a/sw/inc/doc.hxx b/sw/inc/doc.hxx
index 701c7677de7c..1d162ee98eb7 100644
--- a/sw/inc/doc.hxx
+++ b/sw/inc/doc.hxx
@@ -138,6 +138,7 @@ namespace sw { namespace mark {
     class MarkManager;
 }}
 namespace sw {
+    enum class RedlineMode;
     class MetaFieldManager;
     class UndoManager;
     class IShellCursorSupplier;
@@ -1311,7 +1312,7 @@ public:
 
     // insert section (the ODF kind of section, not the nodesarray kind)
     SwSection * InsertSwSection(SwPaM const& rRange, SwSectionData &,
-            SwTOXBase const*const pTOXBase,
+            std::pair<SwTOXBase const*, sw::RedlineMode> const* pTOXBase,
             SfxItemSet const*const pAttr, bool const bUpdate = true);
     static sal_uInt16 IsInsRegionAvailable( const SwPaM& rRange,
                                 const SwNode** ppSttNd = nullptr );
diff --git a/sw/source/core/doc/doctxm.cxx b/sw/source/core/doc/doctxm.cxx
index c51419f9f43f..7c514f782ffb 100644
--- a/sw/source/core/doc/doctxm.cxx
+++ b/sw/source/core/doc/doctxm.cxx
@@ -366,8 +366,13 @@ SwTOXBaseSection* SwDoc::InsertTableOf( const SwPaM& aPam,
 
     OUString sSectNm = GetUniqueTOXBaseName( *rTOX.GetTOXType(), rTOX.GetTOXName() );
     SwSectionData aSectionData( TOX_CONTENT_SECTION, sSectNm );
+
+    std::pair<SwTOXBase const*, sw::RedlineMode> const tmp(&rTOX,
+        pLayout && pLayout->IsHideRedlines()
+            ? sw::RedlineMode::Hidden
+            : sw::RedlineMode::Shown);
     SwTOXBaseSection *const pNewSection = dynamic_cast<SwTOXBaseSection *>(
-        InsertSwSection( aPam, aSectionData, & rTOX, pSet, false ));
+        InsertSwSection(aPam, aSectionData, & tmp, pSet, false));
     if (pNewSection)
     {
         SwSectionNode *const pSectNd = pNewSection->GetFormat()->GetSectionNode();
diff --git a/sw/source/core/docnode/ndsect.cxx b/sw/source/core/docnode/ndsect.cxx
index 599b099a0c3f..75b5e1de5276 100644
--- a/sw/source/core/docnode/ndsect.cxx
+++ b/sw/source/core/docnode/ndsect.cxx
@@ -151,7 +151,7 @@ static void lcl_CheckEmptyLayFrame( SwNodes const & rNds, SwSectionData& rSectio
 
 SwSection *
 SwDoc::InsertSwSection(SwPaM const& rRange, SwSectionData & rNewData,
-                       SwTOXBase const*const pTOXBase,
+       std::pair<SwTOXBase const*, sw::RedlineMode> const*const pTOXBaseAndMode,
                        SfxItemSet const*const pAttr, bool const bUpdate)
 {
     const SwNode* pPrvNd = nullptr;
@@ -184,7 +184,7 @@ SwDoc::InsertSwSection(SwPaM const& rRange, SwSectionData & rNewData,
     bool const bUndo(GetIDocumentUndoRedo().DoesUndo());
     if (bUndo)
     {
-        pUndoInsSect = new SwUndoInsSection(rRange, rNewData, pAttr, pTOXBase);
+        pUndoInsSect = new SwUndoInsSection(rRange, rNewData, pAttr, pTOXBaseAndMode);
         GetIDocumentUndoRedo().AppendUndo( pUndoInsSect );
         GetIDocumentUndoRedo().DoUndo(false);
     }
@@ -195,6 +195,7 @@ SwDoc::InsertSwSection(SwPaM const& rRange, SwSectionData & rNewData,
         pFormat->SetFormatAttr( *pAttr );
     }
 
+    SwTOXBase const*const pTOXBase(pTOXBaseAndMode ? pTOXBaseAndMode->first : nullptr);
     SwSectionNode* pNewSectNode = nullptr;
 
     RedlineFlags eOld = getIDocumentRedlineAccess().GetRedlineFlags();
diff --git a/sw/source/core/inc/UndoSection.hxx b/sw/source/core/inc/UndoSection.hxx
index a3c3ea307233..fabb54dc9d1a 100644
--- a/sw/source/core/inc/UndoSection.hxx
+++ b/sw/source/core/inc/UndoSection.hxx
@@ -30,11 +30,15 @@ class SwSectionData;
 class SwSectionFormat;
 class SwTOXBase;
 
+namespace sw {
+    enum class RedlineMode;
+};
+
 class SwUndoInsSection : public SwUndo, private SwUndRng
 {
 private:
     const std::unique_ptr<SwSectionData> m_pSectionData;
-    const std::unique_ptr<SwTOXBase> m_pTOXBase; /// set iff section is TOX
+    const std::unique_ptr<std::pair<SwTOXBase *, sw::RedlineMode>> m_pTOXBase; /// set iff section is TOX
     const std::unique_ptr<SfxItemSet> m_pAttrSet;
     std::unique_ptr<SwHistory> m_pHistory;
     std::unique_ptr<SwRedlineData> m_pRedlData;
@@ -48,7 +52,8 @@ private:
 
 public:
     SwUndoInsSection(SwPaM const&, SwSectionData const&,
-        SfxItemSet const*const pSet, SwTOXBase const*const pTOXBase);
+        SfxItemSet const* pSet,
+        std::pair<SwTOXBase const*, sw::RedlineMode> const* pTOXBase);
 
     virtual ~SwUndoInsSection() override;
 
diff --git a/sw/source/core/inc/rootfrm.hxx b/sw/source/core/inc/rootfrm.hxx
index 6428ffbc77a1..222716642eee 100644
--- a/sw/source/core/inc/rootfrm.hxx
+++ b/sw/source/core/inc/rootfrm.hxx
@@ -41,6 +41,13 @@ class SwSelectionList;
 struct SwPosition;
 struct SwCursorMoveState;
 
+namespace sw {
+    enum class RedlineMode
+    {
+        Shown, Hidden
+    };
+};
+
 enum class SwInvalidateFlags
 {
     Size      = 0x01,
diff --git a/sw/source/core/undo/unsect.cxx b/sw/source/core/undo/unsect.cxx
index f17cae630316..63f39a67e913 100644
--- a/sw/source/core/undo/unsect.cxx
+++ b/sw/source/core/undo/unsect.cxx
@@ -20,12 +20,15 @@
 #include <memory>
 #include <UndoSection.hxx>
 
+#include <o3tl/make_unique.hxx>
+#include <comphelper/scopeguard.hxx>
 #include <sfx2/linkmgr.hxx>
 #include <fmtcntnt.hxx>
 #include <doc.hxx>
 #include <IDocumentLinksAdministration.hxx>
 #include <IDocumentRedlineAccess.hxx>
 #include <IDocumentFieldsAccess.hxx>
+#include <IDocumentLayoutAccess.hxx>
 #include <docary.hxx>
 #include <swundo.hxx>
 #include <pam.hxx>
@@ -36,6 +39,7 @@
 #include <redline.hxx>
 #include <doctxm.hxx>
 #include <ftnidx.hxx>
+#include <rootfrm.hxx>
 #include <editsh.hxx>
 /// OD 04.10.2002 #102894#
 /// class Calc needed for calculation of the hidden condition of a section.
@@ -70,10 +74,14 @@ static SfxItemSet* lcl_GetAttrSet( const SwSection& rSect )
 
 SwUndoInsSection::SwUndoInsSection(
         SwPaM const& rPam, SwSectionData const& rNewData,
-        SfxItemSet const*const pSet, SwTOXBase const*const pTOXBase)
+        SfxItemSet const*const pSet,
+        std::pair<SwTOXBase const*, sw::RedlineMode> const*const pTOXBase)
     : SwUndo( SwUndoId::INSSECTION, rPam.GetDoc() ), SwUndRng( rPam )
     , m_pSectionData(new SwSectionData(rNewData))
-    , m_pTOXBase( pTOXBase ? new SwTOXBase(*pTOXBase) : nullptr )
+    , m_pTOXBase( pTOXBase
+        ? o3tl::make_unique<std::pair<SwTOXBase *, sw::RedlineMode>>(
+            new SwTOXBase(*pTOXBase->first), pTOXBase->second)
+        : nullptr )
     , m_pAttrSet( (pSet && pSet->Count()) ? new SfxItemSet( *pSet ) : nullptr )
     , m_nSectionNodePos(0)
     , m_bSplitAtStart(false)
@@ -172,8 +180,32 @@ void SwUndoInsSection::RedoImpl(::sw::UndoRedoContext & rContext)
     const SwTOXBaseSection* pUpdateTOX = nullptr;
     if (m_pTOXBase.get())
     {
+        SwRootFrame const* pLayout(nullptr);
+        SwRootFrame * pLayoutToReset(nullptr);
+        comphelper::ScopeGuard g([&]() {
+                if (pLayoutToReset)
+                {
+                    pLayoutToReset->SetHideRedlines(m_pTOXBase->second == sw::RedlineMode::Shown);
+                }
+            });
+        std::set<SwRootFrame *> layouts(rDoc.GetAllLayouts());
+        for (SwRootFrame const*const p : layouts)
+        {
+            if ((m_pTOXBase->second == sw::RedlineMode::Hidden) == p->IsHideRedlines())
+            {
+                pLayout = p;
+                break;
+            }
+        }
+        if (!pLayout)
+        {
+            assert(!layouts.empty()); // must have one layout
+            pLayoutToReset = *layouts.begin();
+            pLayoutToReset->SetHideRedlines(m_pTOXBase->second == sw::RedlineMode::Hidden);
+            pLayout = pLayoutToReset;
+        }
         pUpdateTOX = rDoc.InsertTableOf( *rPam.GetPoint(),
-                                        *m_pTOXBase, m_pAttrSet.get(), true);
+            *m_pTOXBase->first, m_pAttrSet.get(), true, pLayout);
     }
     else
     {
@@ -222,7 +254,8 @@ void SwUndoInsSection::RepeatImpl(::sw::RepeatContext & rContext)
     if (m_pTOXBase.get())
     {
         rDoc.InsertTableOf(*rContext.GetRepeatPaM().GetPoint(),
-                                        *m_pTOXBase, m_pAttrSet.get(), true);
+            *m_pTOXBase->first, m_pAttrSet.get(), true,
+            rDoc.getIDocumentLayoutAccess().GetCurrentLayout()); // TODO add shell to RepeatContext?
     }
     else
     {
@@ -320,6 +353,7 @@ void SwUndoDelSection::UndoImpl(::sw::UndoRedoContext & rContext)
 
     if (m_pTOXBase.get())
     {
+        // sw_redlinehide: this should work as-is; there will be another undo for the update
         rDoc.InsertTableOf(m_nStartNode, m_nEndNode-2, *m_pTOXBase,
                 m_pAttrSet.get());
     }


More information about the Libreoffice-commits mailing list