summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.com>2022-12-13 20:15:19 +0100
committerMiklos Vajna <vmiklos@collabora.com>2022-12-14 07:08:28 +0000
commite15658a7576c8160c9f1b861201e206f9cf34df9 (patch)
tree1593098b3d392983d34abe03548d0f1e7c282197 /sw
parent71085deec7a24ed6650a1e6a07dcbb822ab4334d (diff)
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 <vmiklos@collabora.com>
Diffstat (limited to 'sw')
-rw-r--r--sw/qa/core/layout/layout.cxx8
1 files changed, 2 insertions, 6 deletions
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.