diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-03-14 12:28:06 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-03-14 14:20:26 +0100 |
commit | 6ba9daac763baf37c833911be5e5fb97e068bea1 (patch) | |
tree | 12ba4c5402747074f5a4b69a10fc60ab1c3d6603 /sd/qa | |
parent | a342ac91e21dd45640b7dea063bc04b80f0feb6e (diff) |
add TypedWhichId version of QueryState
Change-Id: I95b86fc081847da01e06f50a1b2c7e7f5456c638
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131529
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sd/qa')
-rw-r--r-- | sd/qa/unit/tiledrendering/tiledrendering.cxx | 30 |
1 files changed, 12 insertions, 18 deletions
diff --git a/sd/qa/unit/tiledrendering/tiledrendering.cxx b/sd/qa/unit/tiledrendering/tiledrendering.cxx index 8a4da8dbf301..ebab87741847 100644 --- a/sd/qa/unit/tiledrendering/tiledrendering.cxx +++ b/sd/qa/unit/tiledrendering/tiledrendering.cxx @@ -2201,15 +2201,13 @@ void SdTiledRenderingTest::testDocumentRepair() CPPUNIT_ASSERT(pView1 != pView2); { - std::unique_ptr<SfxPoolItem> xItem1; - pView1->GetViewFrame()->GetBindings().QueryState(SID_DOC_REPAIR, xItem1); - const SfxBoolItem* pItem1 = dynamic_cast<const SfxBoolItem*>(xItem1.get()); + std::unique_ptr<SfxBoolItem> pItem1; + pView1->GetViewFrame()->GetBindings().QueryState(SID_DOC_REPAIR, pItem1); CPPUNIT_ASSERT(pItem1); CPPUNIT_ASSERT_EQUAL(false, pItem1->GetValue()); - std::unique_ptr<SfxPoolItem> xItem2; - pView2->GetViewFrame()->GetBindings().QueryState(SID_DOC_REPAIR, xItem2); - const SfxBoolItem* pItem2 = dynamic_cast<const SfxBoolItem*>(xItem2.get()); + std::unique_ptr<SfxBoolItem> pItem2; + pView2->GetViewFrame()->GetBindings().QueryState(SID_DOC_REPAIR, pItem2); CPPUNIT_ASSERT(pItem2); CPPUNIT_ASSERT_EQUAL(false, pItem2->GetValue()); } @@ -2229,15 +2227,13 @@ void SdTiledRenderingTest::testDocumentRepair() CPPUNIT_ASSERT(!pViewShell2->GetView()->IsTextEdit()); { - std::unique_ptr<SfxPoolItem> xItem1; - pView1->GetViewFrame()->GetBindings().QueryState(SID_DOC_REPAIR, xItem1); - const SfxBoolItem* pItem1 = dynamic_cast<const SfxBoolItem*>(xItem1.get()); + std::unique_ptr<SfxBoolItem> pItem1; + pView1->GetViewFrame()->GetBindings().QueryState(SID_DOC_REPAIR, pItem1); CPPUNIT_ASSERT(pItem1); CPPUNIT_ASSERT_EQUAL(true, pItem1->GetValue()); - std::unique_ptr<SfxPoolItem> xItem2; - pView2->GetViewFrame()->GetBindings().QueryState(SID_DOC_REPAIR, xItem2); - const SfxBoolItem* pItem2 = dynamic_cast<const SfxBoolItem*>(xItem2.get()); + std::unique_ptr<SfxBoolItem> pItem2; + pView2->GetViewFrame()->GetBindings().QueryState(SID_DOC_REPAIR, pItem2); CPPUNIT_ASSERT(pItem2); CPPUNIT_ASSERT_EQUAL(true, pItem2->GetValue()); } @@ -2296,12 +2292,10 @@ void SdTiledRenderingTest::testDefaultView() SdXImpressDocument* pXImpressDocument = createDoc("notes-view.odp"); sd::ViewShell* pView = pXImpressDocument->GetDocShell()->GetViewShell(); { - std::unique_ptr<SfxPoolItem> xItem1; - std::unique_ptr<SfxPoolItem> xItem2; - pView->GetViewFrame()->GetBindings().QueryState(SID_NORMAL_MULTI_PANE_GUI, xItem1); - pView->GetViewFrame()->GetBindings().QueryState(SID_NOTES_MODE, xItem2); - const SfxBoolItem* pImpressView = dynamic_cast< const SfxBoolItem* >(xItem1.get()); - const SfxBoolItem* pNotesView = dynamic_cast< const SfxBoolItem* >(xItem2.get()); + std::unique_ptr<SfxBoolItem> pImpressView; + std::unique_ptr<SfxBoolItem> pNotesView; + pView->GetViewFrame()->GetBindings().QueryState(SID_NORMAL_MULTI_PANE_GUI, pImpressView); + pView->GetViewFrame()->GetBindings().QueryState(SID_NOTES_MODE, pNotesView); CPPUNIT_ASSERT(pImpressView); CPPUNIT_ASSERT(pNotesView); CPPUNIT_ASSERT_EQUAL(true, pImpressView->GetValue()); |