sw/qa/core/layout/layout.cxx |    8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

New commits:
commit e15658a7576c8160c9f1b861201e206f9cf34df9
Author:     Miklos Vajna <vmik...@collabora.com>
AuthorDate: Tue Dec 13 20:15:19 2022 +0100
Commit:     Miklos Vajna <vmik...@collabora.com>
CommitDate: Wed Dec 14 07:08:28 2022 +0000

    CppunitTest_sw_core_layout: clean up testFollowTextFlowWrapInBackground
    
    Use SwFEShell::Insert() to insert a graphic instead of duplicating it.
    
    Change-Id: I99b6ebda4d8e4d0c7ec9d8dc34348b66b56951ff
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144105
    Tested-by: Jenkins
    Reviewed-by: Miklos Vajna <vmik...@collabora.com>

diff --git a/sw/qa/core/layout/layout.cxx b/sw/qa/core/layout/layout.cxx
index 7a0f69bab815..5454f4c21a16 100644
--- a/sw/qa/core/layout/layout.cxx
+++ b/sw/qa/core/layout/layout.cxx
@@ -862,9 +862,7 @@ CPPUNIT_TEST_FIXTURE(SwCoreLayoutTest, 
testFollowTextFlowWrapInBackground)
     SwInsertTableOptions aTableOptions(SwInsertTableFlags::DefaultBorder, 0);
     pWrtShell->InsertTable(aTableOptions, 1, 1);
     pWrtShell->MoveTable(GotoPrevTable, fnTableStart);
-    IDocumentContentOperations& rIDCO = pDoc->getIDocumentContentOperations();
     SfxItemSet aFrameSet(pDoc->GetAttrPool(), svl::Items<RES_FRMATR_BEGIN, 
RES_FRMATR_END - 1>);
-    SfxItemSet aGrfSet(pDoc->GetAttrPool(), svl::Items<RES_GRFATR_BEGIN, 
RES_GRFATR_END - 1>);
     SwFormatAnchor aAnchor(RndStdIds::FLY_AT_CHAR);
     aFrameSet.Put(aAnchor);
     SwFormatSurround aSurround(text::WrapTextMode_THROUGH);
@@ -874,11 +872,9 @@ CPPUNIT_TEST_FIXTURE(SwCoreLayoutTest, 
testFollowTextFlowWrapInBackground)
     SwFormatFollowTextFlow aFlow(true);
     aFrameSet.Put(aFlow);
     Graphic aGrf;
-    rIDCO.InsertGraphic(*pWrtShell->GetCursor(), OUString(), OUString(), 
&aGrf, &aFrameSet,
-                        &aGrfSet, nullptr);
 
-    // When laying out that document:
-    calcLayout();
+    // When inserting that image:
+    pWrtShell->SwFEShell::Insert(OUString(), OUString(), &aGrf, &aFrameSet);
 
     // Then make sure that the cell height grows to have space for the 
graphic, given that
     // background=true is not specified.

Reply via email to