summaryrefslogtreecommitdiff
path: root/sw/qa
diff options
context:
space:
mode:
authorBjoern Michaelsen <bjoern.michaelsen@libreoffice.org>2023-04-15 20:51:52 +0200
committerBjoern Michaelsen <bjoern.michaelsen@libreoffice.org>2023-04-24 21:59:04 +0200
commit09cdcb5f37bb4e42da7b28db6e757b9f2affed14 (patch)
treeb1c67335c7da4ab7cc1da63f3a6d4a8ef72656f9 /sw/qa
parenteebd13c97ecef1e39aa054701a6e6618227d7ae0 (diff)
introduce sw::SpzFrameFormat ...
- ... as a base class of frame formats allowed into the spz frame format container - with a private ctor and friends SwDrawFrameFormat and SwFlyFrameFormat so only these two classes derive from it - with that, switch over the SpzFrameFormats to only ever allow these types into the container - in followups, likely quite a bit of stronger typing can be introduced. - ultimately, it would be nice to have each SwDrawFrameFormats and SwFlyFrameFormats in their own strongly typed container in the end. Change-Id: Ic30efc1220aded701533c9ca5003d2aaf8bbdaec Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150452 Tested-by: Jenkins Reviewed-by: Bjoern Michaelsen <bjoern.michaelsen@libreoffice.org>
Diffstat (limited to 'sw/qa')
-rw-r--r--sw/qa/core/attr/attr.cxx4
-rw-r--r--sw/qa/core/doc/doc.cxx13
-rw-r--r--sw/qa/core/draw/draw.cxx2
-rw-r--r--sw/qa/core/layout/flycnt.cxx4
-rw-r--r--sw/qa/core/txtnode/txtnode.cxx4
-rw-r--r--sw/qa/core/undo/undo.cxx2
-rw-r--r--sw/qa/core/view/view.cxx6
-rw-r--r--sw/qa/extras/htmlimport/htmlimport.cxx2
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport.cxx4
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport13.cxx2
-rw-r--r--sw/qa/extras/rtfexport/rtfexport4.cxx2
-rw-r--r--sw/qa/extras/uiwriter/uiwriter2.cxx6
-rw-r--r--sw/qa/extras/uiwriter/uiwriter5.cxx6
-rw-r--r--sw/qa/extras/uiwriter/uiwriter8.cxx12
-rw-r--r--sw/qa/extras/ww8export/ww8export.cxx4
-rw-r--r--sw/qa/filter/html/html.cxx8
-rw-r--r--sw/qa/filter/ww8/ww8.cxx4
-rw-r--r--sw/qa/uibase/docvw/docvw.cxx4
-rw-r--r--sw/qa/uibase/uno/uno.cxx4
19 files changed, 45 insertions, 48 deletions
diff --git a/sw/qa/core/attr/attr.cxx b/sw/qa/core/attr/attr.cxx
index 25d2a8025020..d123ed858b57 100644
--- a/sw/qa/core/attr/attr.cxx
+++ b/sw/qa/core/attr/attr.cxx
@@ -62,8 +62,8 @@ CPPUNIT_TEST_FIXTURE(Test, testFormatFlySplit)
RndStdIds eAnchor = RndStdIds::FLY_AT_PARA;
aMgr.InsertFlyFrame(eAnchor, aMgr.GetPos(), aMgr.GetSize());
SwDoc* pDoc = getSwDoc();
- SwFrameFormats& rFlys = *pDoc->GetSpzFrameFormats();
- SwFrameFormat* pFly = rFlys[0];
+ sw::SpzFrameFormats& rFlys = *pDoc->GetSpzFrameFormats();
+ sw::SpzFrameFormat* pFly = rFlys[0];
CPPUNIT_ASSERT(!pFly->GetAttrSet().GetFlySplit().GetValue());
SfxItemSet aSet(pFly->GetAttrSet());
diff --git a/sw/qa/core/doc/doc.cxx b/sw/qa/core/doc/doc.cxx
index 1597302a5f64..fc1ffc69e8d9 100644
--- a/sw/qa/core/doc/doc.cxx
+++ b/sw/qa/core/doc/doc.cxx
@@ -55,7 +55,7 @@ CPPUNIT_TEST_FIXTURE(SwCoreDocTest, testMathInsertAnchorType)
pShell->InsertObject(svt::EmbeddedObjectRef(), &aGlobalName);
// Then the anchor type should be as-char.
- SwFrameFormats& rFormats = *pDoc->GetSpzFrameFormats();
+ sw::SpzFrameFormats& rFormats = *pDoc->GetSpzFrameFormats();
CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(1), rFormats.size());
const SwFrameFormat& rFormat = *rFormats[0];
const SwFormatAnchor& rAnchor = rFormat.GetAnchor();
@@ -72,7 +72,7 @@ CPPUNIT_TEST_FIXTURE(SwCoreDocTest, testTextboxTextRotateAngle)
// Check the writing direction of the only TextFrame in the document.
createSwDoc("textbox-textrotateangle.odt");
SwDoc* pDoc = getSwDoc();
- SwFrameFormats& rFrameFormats = *pDoc->GetSpzFrameFormats();
+ sw::SpzFrameFormats& rFrameFormats = *pDoc->GetSpzFrameFormats();
CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(2), rFrameFormats.size());
CPPUNIT_ASSERT_EQUAL(o3tl::narrowing<sal_uInt16>(RES_DRAWFRMFMT), rFrameFormats[0]->Which());
CPPUNIT_ASSERT_EQUAL(o3tl::narrowing<sal_uInt16>(RES_FLYFRMFMT), rFrameFormats[1]->Which());
@@ -132,9 +132,9 @@ CPPUNIT_TEST_FIXTURE(SwCoreDocTest, testTextBoxZOrder)
{
createSwDoc("textbox-zorder.docx");
SwDoc* pDoc = getSwDoc();
- SwFrameFormats& rFormats = *pDoc->GetSpzFrameFormats();
+ sw::SpzFrameFormats& rFormats = *pDoc->GetSpzFrameFormats();
CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(3), rFormats.size());
- const SwFrameFormat* pEllipse = rFormats[2];
+ const sw::SpzFrameFormat* pEllipse = rFormats[2];
const SdrObject* pEllipseShape = pEllipse->FindRealSdrObject();
// Make sure we test the right shape.
CPPUNIT_ASSERT_EQUAL(OUString("Shape3"), pEllipseShape->GetName());
@@ -291,10 +291,9 @@ CPPUNIT_TEST_FIXTURE(SwCoreDocTest, testCopyBookmarks)
// Also, when checking the # of non-copy images in the resulting doc model:
nActual = 0;
- SwFrameFormats& rFrameFormats = *pDoc->GetSpzFrameFormats();
- for (size_t i = 0; i < rFrameFormats.size(); ++i)
+ for (auto pSpz : *pDoc->GetSpzFrameFormats())
{
- if (rFrameFormats[i]->GetName().indexOf("Copy") == -1)
+ if (pSpz->GetName().indexOf("Copy") == -1)
{
++nActual;
}
diff --git a/sw/qa/core/draw/draw.cxx b/sw/qa/core/draw/draw.cxx
index 17bedbdbab9c..b77a4ea65d94 100644
--- a/sw/qa/core/draw/draw.cxx
+++ b/sw/qa/core/draw/draw.cxx
@@ -64,7 +64,7 @@ CPPUNIT_TEST_FIXTURE(SwCoreDrawTest, testTextboxUndoOrdNum)
createSwDoc("textbox-undo-ordnum.docx");
SwDoc* pDoc = getSwDoc();
SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell();
- const SwFrameFormats& rFormats = *pDoc->GetSpzFrameFormats();
+ const auto& rFormats = *pDoc->GetSpzFrameFormats();
// Test the state before del + undo.
for (const auto& pFormat : rFormats)
{
diff --git a/sw/qa/core/layout/flycnt.cxx b/sw/qa/core/layout/flycnt.cxx
index ca2f0f7cbb95..0bdd70ceb511 100644
--- a/sw/qa/core/layout/flycnt.cxx
+++ b/sw/qa/core/layout/flycnt.cxx
@@ -77,8 +77,8 @@ void Test::Create1x2SplitFly()
pWrtShell->EndAllAction();
// Allow the text frame to split:
pWrtShell->StartAllAction();
- SwFrameFormats& rFlys = *pDoc->GetSpzFrameFormats();
- SwFrameFormat* pFly = rFlys[0];
+ auto& rFlys = *pDoc->GetSpzFrameFormats();
+ auto pFly = rFlys[0];
SwAttrSet aSet(pFly->GetAttrSet());
aSet.Put(SwFormatFlySplit(true));
pDoc->SetAttr(aSet, *pFly);
diff --git a/sw/qa/core/txtnode/txtnode.cxx b/sw/qa/core/txtnode/txtnode.cxx
index e0526bdbb361..f99cc3dd54dd 100644
--- a/sw/qa/core/txtnode/txtnode.cxx
+++ b/sw/qa/core/txtnode/txtnode.cxx
@@ -74,7 +74,7 @@ CPPUNIT_TEST_FIXTURE(SwCoreTxtnodeTest, testTextBoxCopyAnchor)
pWrtShell->SttEndDoc(/*bStart=*/false);
pWrtShell->Paste(aClipboard);
- const SwFrameFormats& rFormats = *pShell->GetDoc()->GetSpzFrameFormats();
+ const auto& rFormats = *pShell->GetDoc()->GetSpzFrameFormats();
// Without the accompanying fix in place, this test would have failed with:
// - Expected: 4
// - Actual : 6
@@ -176,7 +176,7 @@ CPPUNIT_TEST_FIXTURE(SwCoreTxtnodeTest, testFlyAnchorUndo)
SwXTextDocument* pTextDoc = dynamic_cast<SwXTextDocument*>(mxComponent.get());
SwDocShell* pShell = pTextDoc->GetDocShell();
SwDoc* pDoc = pShell->GetDoc();
- const SwFrameFormats& rSpz = *pDoc->GetSpzFrameFormats();
+ const auto& rSpz = *pDoc->GetSpzFrameFormats();
sal_Int32 nExpected = rSpz[0]->GetAnchor().GetAnchorContentOffset();
// When deleting that last character and undoing it:
diff --git a/sw/qa/core/undo/undo.cxx b/sw/qa/core/undo/undo.cxx
index 21543416dae8..221f2ba4ece7 100644
--- a/sw/qa/core/undo/undo.cxx
+++ b/sw/qa/core/undo/undo.cxx
@@ -66,7 +66,7 @@ CPPUNIT_TEST_FIXTURE(SwCoreUndoTest, testTextboxCutUndo)
selectShape(1);
rtl::Reference<SwTransferable> pTransfer = new SwTransferable(*pWrtShell);
pTransfer->Cut();
- SwFrameFormats& rSpzFrameFormats = *pDoc->GetSpzFrameFormats();
+ auto& rSpzFrameFormats = *pDoc->GetSpzFrameFormats();
CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(0), rSpzFrameFormats.size());
pWrtShell->Undo();
diff --git a/sw/qa/core/view/view.cxx b/sw/qa/core/view/view.cxx
index a3fd1863031e..576095c7f4cc 100644
--- a/sw/qa/core/view/view.cxx
+++ b/sw/qa/core/view/view.cxx
@@ -49,13 +49,11 @@ CPPUNIT_TEST_FIXTURE(Test, testUpdateOleObjectPreviews)
pWrtShell->UpdateOleObjectPreviews();
// Then make sure that the working preview of those objects are not lost:
- const SwFrameFormats* pFormats = pDoc->GetSpzFrameFormats();
+ const auto pFormats = pDoc->GetSpzFrameFormats();
CPPUNIT_ASSERT(pFormats);
CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(2), pFormats->size());
- for (size_t i = 0; i < pFormats->size(); ++i)
+ for (auto pFormat : *pFormats)
{
- SwFrameFormat* pFormat = (*pFormats)[i];
-
const SwNodeIndex* pNodeIndex = pFormat->GetContent().GetContentIdx();
CPPUNIT_ASSERT(pNodeIndex);
SwNode* pNode = pDoc->GetNodes()[pNodeIndex->GetIndex() + 1];
diff --git a/sw/qa/extras/htmlimport/htmlimport.cxx b/sw/qa/extras/htmlimport/htmlimport.cxx
index 41efcee327f3..d39d651560d6 100644
--- a/sw/qa/extras/htmlimport/htmlimport.cxx
+++ b/sw/qa/extras/htmlimport/htmlimport.cxx
@@ -402,7 +402,7 @@ CPPUNIT_TEST_FIXTURE(HtmlImportTest, testTdf122789)
SwXTextDocument* pTextDoc = dynamic_cast<SwXTextDocument*>(mxComponent.get());
CPPUNIT_ASSERT(pTextDoc);
SwDoc* pDoc = pTextDoc->GetDocShell()->GetDoc();
- const SwFrameFormats& rFormats = *pDoc->GetSpzFrameFormats();
+ const auto& rFormats = *pDoc->GetSpzFrameFormats();
CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(1), rFormats.size());
// This failed, the image had an absolute size, not a relative one.
CPPUNIT_ASSERT_EQUAL(static_cast<sal_uInt8>(70), rFormats[0]->GetAttrSet().GetFrameSize().GetWidthPercent());
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
index d69b53fa924c..a0dd296e5e32 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
@@ -1103,8 +1103,8 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf115094v3)
createSwDoc("tdf115094v3.docx");
{
SwDoc* pDoc = getSwDoc();
- SwFrameFormats& rSpzFormats = *pDoc->GetSpzFrameFormats();
- SwFrameFormat* pFormat = rSpzFormats[0];
+ auto& rSpzFormats = *pDoc->GetSpzFrameFormats();
+ auto pFormat = rSpzFormats[0];
// Without the fix, this has failed with:
// - Expected: 1991
// - Actual : 1883
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx
index a1610c35dbbb..491626ff7812 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx
@@ -324,7 +324,7 @@ DECLARE_OOXMLEXPORT_TEST(testBtlrShape, "btlr-textbox.docx")
SwXTextDocument* pTextDoc = dynamic_cast<SwXTextDocument*>(mxComponent.get());
CPPUNIT_ASSERT(pTextDoc);
SwDoc* pDoc = pTextDoc->GetDocShell()->GetDoc();
- const SwFrameFormats& rFormats = *pDoc->GetSpzFrameFormats();
+ const auto& rFormats = *pDoc->GetSpzFrameFormats();
CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(2), rFormats.size());
CPPUNIT_ASSERT_EQUAL(o3tl::narrowing<sal_uInt16>(RES_DRAWFRMFMT), rFormats[0]->Which());
CPPUNIT_ASSERT_EQUAL(o3tl::narrowing<sal_uInt16>(RES_FLYFRMFMT), rFormats[1]->Which());
diff --git a/sw/qa/extras/rtfexport/rtfexport4.cxx b/sw/qa/extras/rtfexport/rtfexport4.cxx
index 3ae9fa470000..0213d0b893b7 100644
--- a/sw/qa/extras/rtfexport/rtfexport4.cxx
+++ b/sw/qa/extras/rtfexport/rtfexport4.cxx
@@ -243,7 +243,7 @@ DECLARE_RTFEXPORT_TEST(testAnchoredAtSamePosition, "anchor.fodt")
CPPUNIT_ASSERT_EQUAL(OUString("foobar"), getParagraph(1)->getString());
- SwFrameFormats& rFlys(*pDoc->GetSpzFrameFormats());
+ auto& rFlys = *pDoc->GetSpzFrameFormats();
if (isExported())
{ // 2, not 3: the form control becomes a field on export...
CPPUNIT_ASSERT_EQUAL(size_t(2), rFlys.size());
diff --git a/sw/qa/extras/uiwriter/uiwriter2.cxx b/sw/qa/extras/uiwriter/uiwriter2.cxx
index 492de89912bc..1833b1220dbd 100644
--- a/sw/qa/extras/uiwriter/uiwriter2.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter2.cxx
@@ -753,7 +753,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf137245)
CPPUNIT_ASSERT(pFly != nullptr);
}
- const SwFrameFormats& rFormats = *pDoc->GetSpzFrameFormats();
+ const auto& rFormats = *pDoc->GetSpzFrameFormats();
CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(4), rFormats.size());
// move cursor back to body
@@ -2692,12 +2692,12 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf122942)
pWrtShell->EndCreate(SdrCreateCmd::ForceEnd);
// Make sure that the shape is inserted.
- const SwFrameFormats& rFormats = *pDoc->GetSpzFrameFormats();
+ const auto& rFormats = *pDoc->GetSpzFrameFormats();
CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(2), rFormats.size());
reload("writer8", "tdf122942.odt");
pDoc = getSwDoc();
- const SwFrameFormats& rFormats2 = *pDoc->GetSpzFrameFormats();
+ const auto& rFormats2 = *pDoc->GetSpzFrameFormats();
CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(2), rFormats2.size());
// Make sure the top of the inserted shape does not move outside the existing shape, even after
diff --git a/sw/qa/extras/uiwriter/uiwriter5.cxx b/sw/qa/extras/uiwriter/uiwriter5.cxx
index a0356dfec4e5..b7a9a08d4316 100644
--- a/sw/qa/extras/uiwriter/uiwriter5.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter5.cxx
@@ -1459,10 +1459,10 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testShapePageMove)
{ &aXItem, &aYItem });
// Check if the shape anchor was moved to the 2nd page as well.
- SwFrameFormats* pShapeFormats = pDoc->GetSpzFrameFormats();
+ auto pShapeFormats = pDoc->GetSpzFrameFormats();
CPPUNIT_ASSERT(!pShapeFormats->empty());
auto it = pShapeFormats->begin();
- SwFrameFormat* pShapeFormat = *it;
+ auto pShapeFormat = *it;
const SwPosition* pAnchor = pShapeFormat->GetAnchor().GetContentAnchor();
CPPUNIT_ASSERT(pAnchor);
@@ -2798,7 +2798,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest5, testTdf128603)
rUndoManager.Undo();
// Make sure the content indexes still match.
- const SwFrameFormats& rSpzFrameFormats = *pDoc->GetSpzFrameFormats();
+ const auto& rSpzFrameFormats = *pDoc->GetSpzFrameFormats();
CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(6), rSpzFrameFormats.size());
const SwNodeIndex* pIndex4 = rSpzFrameFormats[4]->GetContent().GetContentIdx();
CPPUNIT_ASSERT(pIndex4);
diff --git a/sw/qa/extras/uiwriter/uiwriter8.cxx b/sw/qa/extras/uiwriter/uiwriter8.cxx
index 65a1352dc79b..81a6d9e25fc2 100644
--- a/sw/qa/extras/uiwriter/uiwriter8.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter8.cxx
@@ -1072,7 +1072,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest8, testTdf130805)
createSwDoc("tdf130805.odt");
SwDoc* pDoc = getSwDoc();
- const SwFrameFormats& rFrmFormats = *pDoc->GetSpzFrameFormats();
+ const auto& rFrmFormats = *pDoc->GetSpzFrameFormats();
CPPUNIT_ASSERT(rFrmFormats.size() >= size_t(o3tl::make_unsigned(1)));
auto pShape = rFrmFormats.front();
CPPUNIT_ASSERT(pShape);
@@ -1097,9 +1097,9 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest8, testTdf107893)
SwDoc* pDoc = getSwDoc();
//Get the format of the shape
- const SwFrameFormats& rFrmFormats = *pDoc->GetSpzFrameFormats();
+ const auto& rFrmFormats = *pDoc->GetSpzFrameFormats();
CPPUNIT_ASSERT(rFrmFormats.size() >= size_t(o3tl::make_unsigned(1)));
- SwFrameFormat* pShape = rFrmFormats.front();
+ auto pShape = rFrmFormats.front();
CPPUNIT_ASSERT(pShape);
//Add a textbox
@@ -1150,9 +1150,9 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest8, TestTextBoxCrashAfterLineDel)
SwDoc* pDoc = getSwDoc();
// Get the format of the shape
- const SwFrameFormats& rFrmFormats = *pDoc->GetSpzFrameFormats();
+ const auto& rFrmFormats = *pDoc->GetSpzFrameFormats();
CPPUNIT_ASSERT(rFrmFormats.size() >= size_t(o3tl::make_unsigned(1)));
- SwFrameFormat* pShape = rFrmFormats.front();
+ auto pShape = rFrmFormats.front();
CPPUNIT_ASSERT(pShape);
// Add a textbox
@@ -1974,7 +1974,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest8, AtPageTextBoxCrash)
SwDoc* pDoc = getSwDoc();
// Get the format of the shape
- const SwFrameFormats& rFrmFormats = *pDoc->GetSpzFrameFormats();
+ const auto& rFrmFormats = *pDoc->GetSpzFrameFormats();
CPPUNIT_ASSERT(rFrmFormats.size() >= size_t(o3tl::make_unsigned(1)));
auto pShape = rFrmFormats.front();
CPPUNIT_ASSERT(pShape);
diff --git a/sw/qa/extras/ww8export/ww8export.cxx b/sw/qa/extras/ww8export/ww8export.cxx
index f4274a629d39..d248c6ce6b26 100644
--- a/sw/qa/extras/ww8export/ww8export.cxx
+++ b/sw/qa/extras/ww8export/ww8export.cxx
@@ -689,10 +689,10 @@ DECLARE_WW8EXPORT_TEST(testTdf112535, "tdf112535.doc")
SwDoc* pDoc = pTextDoc->GetDocShell()->GetDoc();
CPPUNIT_ASSERT(pDoc->GetSpzFrameFormats());
- SwFrameFormats& rFormats = *pDoc->GetSpzFrameFormats();
+ auto& rFormats = *pDoc->GetSpzFrameFormats();
CPPUNIT_ASSERT(!rFormats.empty());
- const SwFrameFormat* pFormat = rFormats[0];
+ const auto pFormat = rFormats[0];
CPPUNIT_ASSERT(pFormat);
// Without the accompanying fix in place, this test would have failed: auto-contour was enabled
diff --git a/sw/qa/filter/html/html.cxx b/sw/qa/filter/html/html.cxx
index 6cd714bbdd48..523bc49a4358 100644
--- a/sw/qa/filter/html/html.cxx
+++ b/sw/qa/filter/html/html.cxx
@@ -65,8 +65,8 @@ CPPUNIT_TEST_FIXTURE(Test, testRelativeKeepAspect)
// Then make sure that the aspect ratio of the image is kept:
auto pTextDocument = dynamic_cast<SwXTextDocument*>(mxComponent.get());
SwDoc* pDoc = pTextDocument->GetDocShell()->GetDoc();
- const SwFrameFormats& rFormats = *pDoc->GetSpzFrameFormats();
- const SwFrameFormat* pFormat = rFormats[0];
+ const auto& rFormats = *pDoc->GetSpzFrameFormats();
+ const auto pFormat = rFormats[0];
const SwFormatFrameSize& rSize = pFormat->GetFrameSize();
// Without the accompanying fix in place, this test would have failed with:
// - Expected: 255
@@ -86,8 +86,8 @@ CPPUNIT_TEST_FIXTURE(Test, testRelativeKeepAspectImage)
// Then make sure that the aspect ratio of the image is kept:
auto pTextDocument = dynamic_cast<SwXTextDocument*>(mxComponent.get());
SwDoc* pDoc = pTextDocument->GetDocShell()->GetDoc();
- const SwFrameFormats& rFormats = *pDoc->GetSpzFrameFormats();
- const SwFrameFormat* pFormat = rFormats[0];
+ const auto& rFormats = *pDoc->GetSpzFrameFormats();
+ const auto pFormat = rFormats[0];
const SwFormatFrameSize& rSize = pFormat->GetFrameSize();
// Without the accompanying fix in place, this test would have failed with:
// - Expected: 255
diff --git a/sw/qa/filter/ww8/ww8.cxx b/sw/qa/filter/ww8/ww8.cxx
index c7dc85669a2c..f965d2cdae63 100644
--- a/sw/qa/filter/ww8/ww8.cxx
+++ b/sw/qa/filter/ww8/ww8.cxx
@@ -212,8 +212,8 @@ CPPUNIT_TEST_FIXTURE(Test, testDocxFloatingTableExport)
pWrtShell->StartAllAction();
aMgr.InsertFlyFrame(RndStdIds::FLY_AT_PARA, aMgr.GetPos(), aMgr.GetSize());
// Mark it as a floating table:
- SwFrameFormats& rFlys = *pDoc->GetSpzFrameFormats();
- SwFrameFormat* pFly = rFlys[0];
+ auto& rFlys = *pDoc->GetSpzFrameFormats();
+ auto pFly = rFlys[0];
SwAttrSet aSet(pFly->GetAttrSet());
aSet.Put(SwFormatFlySplit(true));
pDoc->SetAttr(aSet, *pFly);
diff --git a/sw/qa/uibase/docvw/docvw.cxx b/sw/qa/uibase/docvw/docvw.cxx
index 677a5abd2a54..280a0459109e 100644
--- a/sw/qa/uibase/docvw/docvw.cxx
+++ b/sw/qa/uibase/docvw/docvw.cxx
@@ -48,7 +48,7 @@ CPPUNIT_TEST_FIXTURE(Test, testShiftClickOnImage)
pWrtShell->SttEndDoc(/*bStt=*/false);
// When shift-clicking on that fly frame:
- SwFrameFormats& rSpzFormats = *pDoc->GetSpzFrameFormats();
+ auto& rSpzFormats = *pDoc->GetSpzFrameFormats();
auto pFrameFormat = dynamic_cast<SwFlyFrameFormat*>(rSpzFormats[0]);
CPPUNIT_ASSERT(pFrameFormat);
SwFlyFrame* pFlyFrame = pFrameFormat->GetFrame();
@@ -163,7 +163,7 @@ CPPUNIT_TEST_FIXTURE(Test, testShiftDoubleClickOnImage)
xRegistration->registerDispatchProviderInterceptor(pInterceptor);
// When shift-double-clicking on that fly frame:
- SwFrameFormats& rSpzFormats = *pDoc->GetSpzFrameFormats();
+ auto& rSpzFormats = *pDoc->GetSpzFrameFormats();
auto pFrameFormat = dynamic_cast<SwFlyFrameFormat*>(rSpzFormats[0]);
CPPUNIT_ASSERT(pFrameFormat);
SwFlyFrame* pFlyFrame = pFrameFormat->GetFrame();
diff --git a/sw/qa/uibase/uno/uno.cxx b/sw/qa/uibase/uno/uno.cxx
index b9f03d42d5ee..6ad35e07466a 100644
--- a/sw/qa/uibase/uno/uno.cxx
+++ b/sw/qa/uibase/uno/uno.cxx
@@ -149,8 +149,8 @@ CPPUNIT_TEST_FIXTURE(SwUibaseUnoTest, testCreateTextRangeByPixelPositionGraphic)
= xController->createTextRangeByPixelPosition(aPoint);
// Then make sure that the anchor of the image is returned:
- const SwFrameFormats& rFormats = *pDoc->GetSpzFrameFormats();
- const SwFrameFormat* pFormat = rFormats[0];
+ const auto& rFormats = *pDoc->GetSpzFrameFormats();
+ const auto pFormat = rFormats[0];
SwPosition aAnchorPos(*pFormat->GetAnchor().GetContentAnchor());
auto pTextRange = dynamic_cast<SwXTextRange*>(xTextRange.get());
SwPaM aPaM(pDoc->GetNodes());