diff options
-rw-r--r-- | sw/qa/extras/uiwriter/uiwriter3.cxx | 8 | ||||
-rw-r--r-- | sw/source/core/frmedt/tblsel.cxx | 11 | ||||
-rw-r--r-- | sw/source/core/undo/untbl.cxx | 11 |
3 files changed, 29 insertions, 1 deletions
diff --git a/sw/qa/extras/uiwriter/uiwriter3.cxx b/sw/qa/extras/uiwriter/uiwriter3.cxx index b8cb857043b2..57f5e6649b70 100644 --- a/sw/qa/extras/uiwriter/uiwriter3.cxx +++ b/sw/qa/extras/uiwriter/uiwriter3.cxx @@ -1987,6 +1987,14 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf146962) pXmlDoc = parseLayoutDump(); // only a single row is visible again assertXPath(pXmlDoc, "/root/page[1]/body/tab/row", 1); + + // check Undo + + dispatchCommand(mxComponent, ".uno:Undo", {}); + discardDumpedLayout(); + pXmlDoc = parseLayoutDump(); + // This was 1 + assertXPath(pXmlDoc, "/root/page[1]/body/tab/row", 2); } CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf147347) diff --git a/sw/source/core/frmedt/tblsel.cxx b/sw/source/core/frmedt/tblsel.cxx index 80b797384859..b203281506cd 100644 --- a/sw/source/core/frmedt/tblsel.cxx +++ b/sw/source/core/frmedt/tblsel.cxx @@ -2336,6 +2336,10 @@ void FndBox_::MakeFrames( SwTable &rTable ) // And this for all instances of a table (for example in header/footer). sal_uInt16 nStPos = 0; sal_uInt16 nEndPos= rTable.GetTabLines().size() - 1; + SwRootFrame* pLayout = + rTable.GetFrameFormat()->GetDoc()->getIDocumentLayoutAccess().GetCurrentLayout(); + bool bHideChanges = pLayout && pLayout->IsHideRedlines(); + if ( m_pLineBefore ) { nStPos = rTable.GetTabLines().GetPos( @@ -2389,9 +2393,14 @@ void FndBox_::MakeFrames( SwTable &rTable ) // ???? or is this the last Follow of the table ???? pUpperFrame = pTable; + SwRedlineTable::size_type nRedlinePos = 0; for ( sal_uInt16 j = nStPos; j <= nEndPos; ++j ) - ::lcl_InsertRow( *rTable.GetTabLines()[j], + { + SwTableLine * pLine = rTable.GetTabLines()[j]; + if ( !bHideChanges || !pLine->IsDeleted(nRedlinePos) ) + ::lcl_InsertRow( *pLine, static_cast<SwLayoutFrame*>(pUpperFrame), pSibling ); + } if ( pUpperFrame->IsTabFrame() ) static_cast<SwTabFrame*>(pUpperFrame)->SetCalcLowers(); } diff --git a/sw/source/core/undo/untbl.cxx b/sw/source/core/undo/untbl.cxx index d3294b5446a3..d5536b01e624 100644 --- a/sw/source/core/undo/untbl.cxx +++ b/sw/source/core/undo/untbl.cxx @@ -34,6 +34,8 @@ #include <IDocumentRedlineAccess.hxx> #include <IDocumentFieldsAccess.hxx> #include <IDocumentStylePoolAccess.hxx> +#include <IDocumentLayoutAccess.hxx> +#include <rootfrm.hxx> #include <editsh.hxx> #include <docary.hxx> #include <ndtxt.hxx> @@ -936,6 +938,12 @@ void SaveTable::RestoreAttr( SwTable& rTable, bool bMdfyBox ) { m_bModifyBox = bMdfyBox; + FndBox_ aTmpBox( nullptr, nullptr ); + bool bHideChanges = rTable.GetFrameFormat()->GetDoc()->getIDocumentLayoutAccess().GetCurrentLayout()->IsHideRedlines(); + // TODO delete/make frames only at changing line attribute TextChangesOnly (RES_PRINT) to true again + if ( bHideChanges ) + aTmpBox.DelFrames( rTable ); + // first, get back attributes of TableFrameFormat SwFrameFormat* pFormat = rTable.GetFrameFormat(); SfxItemSet& rFormatSet = const_cast<SfxItemSet&>(static_cast<SfxItemSet const &>(pFormat->GetAttrSet())); @@ -976,6 +984,9 @@ void SaveTable::RestoreAttr( SwTable& rTable, bool bMdfyBox ) m_aFrameFormats.clear(); m_bModifyBox = false; + + if ( bHideChanges ) + aTmpBox.MakeFrames( rTable ); } void SaveTable::SaveContentAttrs( SwDoc* pDoc ) |