sw: use calcLayout() everywhere
Change-Id: Ie03a3f13808456c831db10f2203fbfb84a50b999 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171076 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
This commit is contained in:
parent
b147debad0
commit
7c5ae132fa
6 changed files with 20 additions and 24 deletions
|
@ -157,7 +157,7 @@ CPPUNIT_TEST_FIXTURE(SwCoreLayoutTest, testTablesMoveBackwards)
|
|||
pWrtShell->DelLeft();
|
||||
|
||||
// Calc the layout and check the number of pages.
|
||||
pWrtShell->CalcLayout();
|
||||
calcLayout();
|
||||
xmlDocUniquePtr pLayout = parseLayoutDump();
|
||||
// Without the accompanying fix in place, this test would have failed with:
|
||||
// - Expected: 1
|
||||
|
|
|
@ -251,7 +251,7 @@ CPPUNIT_TEST_FIXTURE(Test, testSplitFlyHeader)
|
|||
pWrtShell->SttEndDoc(/*bStt=*/true);
|
||||
pWrtShell->SplitNode();
|
||||
// Without the accompanying fix in place, this test would have crashed here.
|
||||
pWrtShell->CalcLayout();
|
||||
calcLayout();
|
||||
|
||||
// Then make sure we get one more page, since the first page is now 2 pages:
|
||||
CPPUNIT_ASSERT_EQUAL(9, getPages());
|
||||
|
|
|
@ -3321,7 +3321,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testRedlineSections)
|
|||
dispatchCommand(mxComponent, u".uno:ShowTrackedChanges"_ustr, {});
|
||||
CPPUNIT_ASSERT(!pLayout->IsHideRedlines());
|
||||
// why is this needed explicitly?
|
||||
pDoc->getIDocumentLayoutAccess().GetCurrentViewShell()->CalcLayout();
|
||||
calcLayout();
|
||||
discardDumpedLayout();
|
||||
xmlDocUniquePtr pXmlDoc = parseLayoutDump();
|
||||
|
||||
|
@ -3399,7 +3399,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testRedlineSections)
|
|||
dispatchCommand(mxComponent, u".uno:ShowTrackedChanges"_ustr, {});
|
||||
CPPUNIT_ASSERT(pLayout->IsHideRedlines());
|
||||
// why is this needed explicitly?
|
||||
pDoc->getIDocumentLayoutAccess().GetCurrentViewShell()->CalcLayout();
|
||||
calcLayout();
|
||||
discardDumpedLayout();
|
||||
CheckRedlineSectionsHidden();
|
||||
}
|
||||
|
@ -3444,7 +3444,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testRedlineTables)
|
|||
dispatchCommand(mxComponent, u".uno:ShowTrackedChanges"_ustr, {});
|
||||
CPPUNIT_ASSERT(!pLayout->IsHideRedlines());
|
||||
// why is this needed explicitly?
|
||||
pDoc->getIDocumentLayoutAccess().GetCurrentViewShell()->CalcLayout();
|
||||
calcLayout();
|
||||
discardDumpedLayout();
|
||||
pXmlDoc = parseLayoutDump();
|
||||
|
||||
|
@ -3504,7 +3504,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testRedlineTables)
|
|||
dispatchCommand(mxComponent, u".uno:ShowTrackedChanges"_ustr, {});
|
||||
CPPUNIT_ASSERT(pLayout->IsHideRedlines());
|
||||
// why is this needed explicitly?
|
||||
pDoc->getIDocumentLayoutAccess().GetCurrentViewShell()->CalcLayout();
|
||||
calcLayout();
|
||||
discardDumpedLayout();
|
||||
pXmlDoc = parseLayoutDump();
|
||||
assertXPath(pXmlDoc, "/root/page[1]/body/txt[1]/merged"_ostr, "paraPropsNodeIndex"_ostr,
|
||||
|
@ -3549,7 +3549,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf144057)
|
|||
// hide tracked table and table row deletions
|
||||
dispatchCommand(mxComponent, u".uno:ShowTrackedChanges"_ustr, {});
|
||||
CPPUNIT_ASSERT(pLayout->IsHideRedlines());
|
||||
pDoc->getIDocumentLayoutAccess().GetCurrentViewShell()->CalcLayout();
|
||||
calcLayout();
|
||||
discardDumpedLayout();
|
||||
pXmlDoc = parseLayoutDump();
|
||||
|
||||
|
@ -3565,7 +3565,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf144057)
|
|||
// show tracked table and table row deletions again
|
||||
dispatchCommand(mxComponent, u".uno:ShowTrackedChanges"_ustr, {});
|
||||
CPPUNIT_ASSERT(!pLayout->IsHideRedlines());
|
||||
pDoc->getIDocumentLayoutAccess().GetCurrentViewShell()->CalcLayout();
|
||||
calcLayout();
|
||||
discardDumpedLayout();
|
||||
pXmlDoc = parseLayoutDump();
|
||||
assertXPath(pXmlDoc, "/root/page"_ostr, 4);
|
||||
|
@ -3607,7 +3607,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf144347)
|
|||
for (int i = 0; i < 12; ++i)
|
||||
pEditShell->AcceptRedline(0);
|
||||
|
||||
pDoc->getIDocumentLayoutAccess().GetCurrentViewShell()->CalcLayout();
|
||||
calcLayout();
|
||||
discardDumpedLayout();
|
||||
xmlDocUniquePtr pXmlDoc = parseLayoutDump();
|
||||
// show tracked row deletions
|
||||
|
@ -3621,7 +3621,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf144347)
|
|||
dispatchCommand(mxComponent, u".uno:SelectAll"_ustr, {});
|
||||
dispatchCommand(mxComponent, u".uno:SelectAll"_ustr, {});
|
||||
dispatchCommand(mxComponent, u".uno:Delete"_ustr, {});
|
||||
pDoc->getIDocumentLayoutAccess().GetCurrentViewShell()->CalcLayout();
|
||||
calcLayout();
|
||||
discardDumpedLayout();
|
||||
pXmlDoc = parseLayoutDump();
|
||||
|
||||
|
@ -3633,7 +3633,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf144347)
|
|||
while (pEditShell->GetRedlineCount() > 0)
|
||||
pEditShell->AcceptRedline(0);
|
||||
|
||||
pDoc->getIDocumentLayoutAccess().GetCurrentViewShell()->CalcLayout();
|
||||
calcLayout();
|
||||
discardDumpedLayout();
|
||||
pXmlDoc = parseLayoutDump();
|
||||
|
||||
|
@ -3670,7 +3670,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf155345)
|
|||
// hide tracked table column deletions
|
||||
dispatchCommand(mxComponent, u".uno:ShowTrackedChanges"_ustr, {});
|
||||
CPPUNIT_ASSERT(pLayout->IsHideRedlines());
|
||||
pDoc->getIDocumentLayoutAccess().GetCurrentViewShell()->CalcLayout();
|
||||
calcLayout();
|
||||
discardDumpedLayout();
|
||||
pXmlDoc = parseLayoutDump();
|
||||
|
||||
|
@ -3680,7 +3680,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf155345)
|
|||
// show tracked table column deletions again
|
||||
dispatchCommand(mxComponent, u".uno:ShowTrackedChanges"_ustr, {});
|
||||
CPPUNIT_ASSERT(!pLayout->IsHideRedlines());
|
||||
pDoc->getIDocumentLayoutAccess().GetCurrentViewShell()->CalcLayout();
|
||||
calcLayout();
|
||||
discardDumpedLayout();
|
||||
pXmlDoc = parseLayoutDump();
|
||||
assertXPath(pXmlDoc, "/root/page"_ostr, 4);
|
||||
|
@ -3768,9 +3768,8 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf147485Forcepoint)
|
|||
CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf118058)
|
||||
{
|
||||
createSwDoc("tdf118058.fodt");
|
||||
SwDoc* pDoc = getSwDoc();
|
||||
// This resulted in a layout loop.
|
||||
pDoc->getIDocumentLayoutAccess().GetCurrentViewShell()->CalcLayout();
|
||||
calcLayout();
|
||||
}
|
||||
|
||||
//just care it doesn't crash/assert
|
||||
|
|
|
@ -287,7 +287,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testRedlineCharAttributes)
|
|||
dispatchCommand(mxComponent, u".uno:ShowTrackedChanges"_ustr, {});
|
||||
CPPUNIT_ASSERT(!pLayout->IsHideRedlines());
|
||||
// why is this needed explicitly?
|
||||
pDoc->getIDocumentLayoutAccess().GetCurrentViewShell()->CalcLayout();
|
||||
calcLayout();
|
||||
discardDumpedLayout();
|
||||
xmlDocUniquePtr pXmlDoc = parseLayoutDump();
|
||||
|
||||
|
@ -526,7 +526,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testRedlineCharAttributes)
|
|||
dispatchCommand(mxComponent, u".uno:ShowTrackedChanges"_ustr, {});
|
||||
CPPUNIT_ASSERT(pLayout->IsHideRedlines());
|
||||
// why is this needed explicitly?
|
||||
pDoc->getIDocumentLayoutAccess().GetCurrentViewShell()->CalcLayout();
|
||||
calcLayout();
|
||||
CheckRedlineCharAttributesHidden();
|
||||
}
|
||||
|
||||
|
@ -583,7 +583,6 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testtdf138951)
|
|||
{
|
||||
// Open the bugdoc
|
||||
createSwDoc("tdf138951.odt");
|
||||
auto pDoc = getSwDoc();
|
||||
|
||||
// Get the only shape
|
||||
uno::Reference<drawing::XShape> xShape(getShape(1), uno::UNO_QUERY);
|
||||
|
@ -595,7 +594,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testtdf138951)
|
|||
const SwFrameFormat* pShFrm = SwTextBoxHelper::getOtherTextBoxFormat(pTxFrm, RES_FLYFRMFMT);
|
||||
CPPUNIT_ASSERT(pShFrm);
|
||||
|
||||
pDoc->getIDocumentLayoutAccess().GetCurrentViewShell()->CalcLayout();
|
||||
calcLayout();
|
||||
|
||||
// Get the bound rectangle of the textframe
|
||||
tools::Rectangle aTxtFrmRect(pTxFrm->FindRealSdrObject()->GetLogicRect());
|
||||
|
@ -2430,9 +2429,8 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTableExtrusion2)
|
|||
CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf116848)
|
||||
{
|
||||
createSwDoc("tdf116848.odt");
|
||||
SwDoc* pDoc = getSwDoc();
|
||||
// This resulted in a layout loop.
|
||||
pDoc->getIDocumentLayoutAccess().GetCurrentViewShell()->CalcLayout();
|
||||
calcLayout();
|
||||
}
|
||||
|
||||
CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf117245)
|
||||
|
|
|
@ -1364,9 +1364,8 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf130218)
|
|||
CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf127235)
|
||||
{
|
||||
createSwDoc("tdf127235.odt");
|
||||
SwDoc* pDoc = getSwDoc();
|
||||
// This resulted in a layout loop.
|
||||
pDoc->getIDocumentLayoutAccess().GetCurrentViewShell()->CalcLayout();
|
||||
calcLayout();
|
||||
}
|
||||
|
||||
CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf138039)
|
||||
|
|
|
@ -307,7 +307,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testRedlineSplitContentNode)
|
|||
|
||||
sw::UndoManager& rUndoManager = pDoc->GetUndoManager();
|
||||
|
||||
pWrtShell->CalcLayout();
|
||||
calcLayout();
|
||||
pWrtShell->Right(SwCursorSkipMode::Chars, /*bSelect=*/false, 18, /*bBasicCall=*/false);
|
||||
pWrtShell->SplitNode(true);
|
||||
rUndoManager.Undo();
|
||||
|
|
Loading…
Reference in a new issue