diff options
author | Bjoern Michaelsen <bjoern.michaelsen@libreoffice.org> | 2023-04-15 20:51:52 +0200 |
---|---|---|
committer | Bjoern Michaelsen <bjoern.michaelsen@libreoffice.org> | 2023-04-24 21:59:04 +0200 |
commit | 09cdcb5f37bb4e42da7b28db6e757b9f2affed14 (patch) | |
tree | b1c67335c7da4ab7cc1da63f3a6d4a8ef72656f9 /sw/qa/uibase | |
parent | eebd13c97ecef1e39aa054701a6e6618227d7ae0 (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/uibase')
-rw-r--r-- | sw/qa/uibase/docvw/docvw.cxx | 4 | ||||
-rw-r--r-- | sw/qa/uibase/uno/uno.cxx | 4 |
2 files changed, 4 insertions, 4 deletions
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()); |