summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2023-02-16 10:42:06 +0000
committerCaolán McNamara <caolanm@redhat.com>2023-02-16 15:13:21 +0000
commit0908c7c1184ab7acb7b6f6740a82c2f12c296fae (patch)
tree7bfe09dce871f6f2bc59a81b689d7ab5a3a6f3ea /sd
parente71080e19365aa074c56d1136dad2b09783949a2 (diff)
SfxViewShell::GetViewFrame never returns null, change to a reference
various null checks can be seen to be redundant and removed Change-Id: Icf49c1de4b0302795d2769a370af3abceaad0221 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147147 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sd')
-rw-r--r--sd/qa/unit/tiledrendering/tiledrendering.cxx28
-rw-r--r--sd/source/ui/docshell/docshell.cxx8
-rw-r--r--sd/source/ui/framework/factories/BasicViewFactory.cxx4
-rw-r--r--sd/source/ui/framework/factories/ChildWindowPane.cxx37
-rw-r--r--sd/source/ui/sidebar/LayoutMenu.cxx13
-rw-r--r--sd/source/ui/sidebar/MasterPagesSelector.cxx6
-rw-r--r--sd/source/ui/slideshow/SlideShowRestarter.cxx4
-rw-r--r--sd/source/ui/table/tablefunction.cxx2
-rw-r--r--sd/source/ui/view/ToolBarManager.cxx4
-rw-r--r--sd/source/ui/view/ViewShellBase.cxx21
-rw-r--r--sd/source/ui/view/ViewShellImplementation.cxx2
-rw-r--r--sd/source/ui/view/ViewTabBar.cxx4
-rw-r--r--sd/source/ui/view/drviews1.cxx4
-rw-r--r--sd/source/ui/view/viewshe2.cxx12
-rw-r--r--sd/source/ui/view/viewshel.cxx4
15 files changed, 68 insertions, 85 deletions
diff --git a/sd/qa/unit/tiledrendering/tiledrendering.cxx b/sd/qa/unit/tiledrendering/tiledrendering.cxx
index 36ead01c3fb4..6b74588b7ea9 100644
--- a/sd/qa/unit/tiledrendering/tiledrendering.cxx
+++ b/sd/qa/unit/tiledrendering/tiledrendering.cxx
@@ -2107,8 +2107,8 @@ void SdTiledRenderingTest::testDisableUndoRepair()
{
std::unique_ptr<SfxPoolItem> pItem1;
std::unique_ptr<SfxPoolItem> pItem2;
- CPPUNIT_ASSERT_EQUAL(SfxItemState::DISABLED, pView1->GetViewFrame()->GetBindings().QueryState(SID_UNDO, pItem1));
- CPPUNIT_ASSERT_EQUAL(SfxItemState::DISABLED, pView2->GetViewFrame()->GetBindings().QueryState(SID_UNDO, pItem2));
+ CPPUNIT_ASSERT_EQUAL(SfxItemState::DISABLED, pView1->GetViewFrame().GetBindings().QueryState(SID_UNDO, pItem1));
+ CPPUNIT_ASSERT_EQUAL(SfxItemState::DISABLED, pView2->GetViewFrame().GetBindings().QueryState(SID_UNDO, pItem2));
}
// Insert a character in the first view.
@@ -2127,12 +2127,12 @@ void SdTiledRenderingTest::testDisableUndoRepair()
// Check
{
std::unique_ptr<SfxPoolItem> xItem1;
- pView1->GetViewFrame()->GetBindings().QueryState(SID_UNDO, xItem1);
+ pView1->GetViewFrame().GetBindings().QueryState(SID_UNDO, xItem1);
const auto* pUInt32Item1 = dynamic_cast<const SfxUInt32Item*>(xItem1.get());
CPPUNIT_ASSERT(!pUInt32Item1);
std::unique_ptr<SfxPoolItem> xItem2;
- pView2->GetViewFrame()->GetBindings().QueryState(SID_UNDO, xItem2);
+ pView2->GetViewFrame().GetBindings().QueryState(SID_UNDO, xItem2);
const auto* pUInt32Item2 = dynamic_cast<const SfxUInt32Item*>(xItem2.get());
CPPUNIT_ASSERT(pUInt32Item2);
CPPUNIT_ASSERT_EQUAL(static_cast<sal_uInt32>(SID_REPAIRPACKAGE), pUInt32Item2->GetValue());
@@ -2155,13 +2155,13 @@ void SdTiledRenderingTest::testDisableUndoRepair()
// Check
{
std::unique_ptr<SfxPoolItem> xItem1;
- pView1->GetViewFrame()->GetBindings().QueryState(SID_UNDO, xItem1);
+ pView1->GetViewFrame().GetBindings().QueryState(SID_UNDO, xItem1);
const SfxUInt32Item* pUInt32Item = dynamic_cast<const SfxUInt32Item*>(xItem1.get());
CPPUNIT_ASSERT(pUInt32Item);
CPPUNIT_ASSERT_EQUAL(static_cast<sal_uInt32>(SID_REPAIRPACKAGE), pUInt32Item->GetValue());
std::unique_ptr<SfxPoolItem> xItem2;
- pView2->GetViewFrame()->GetBindings().QueryState(SID_UNDO, xItem2);
+ pView2->GetViewFrame().GetBindings().QueryState(SID_UNDO, xItem2);
CPPUNIT_ASSERT(!dynamic_cast< const SfxUInt32Item* >(xItem2.get()));
}
}
@@ -2184,12 +2184,12 @@ void SdTiledRenderingTest::testDocumentRepair()
CPPUNIT_ASSERT(pView1 != pView2);
{
std::unique_ptr<SfxBoolItem> pItem1;
- pView1->GetViewFrame()->GetBindings().QueryState(SID_DOC_REPAIR, pItem1);
+ pView1->GetViewFrame().GetBindings().QueryState(SID_DOC_REPAIR, pItem1);
CPPUNIT_ASSERT(pItem1);
CPPUNIT_ASSERT_EQUAL(false, pItem1->GetValue());
std::unique_ptr<SfxBoolItem> pItem2;
- pView2->GetViewFrame()->GetBindings().QueryState(SID_DOC_REPAIR, pItem2);
+ pView2->GetViewFrame().GetBindings().QueryState(SID_DOC_REPAIR, pItem2);
CPPUNIT_ASSERT(pItem2);
CPPUNIT_ASSERT_EQUAL(false, pItem2->GetValue());
}
@@ -2210,12 +2210,12 @@ void SdTiledRenderingTest::testDocumentRepair()
{
std::unique_ptr<SfxBoolItem> pItem1;
- pView1->GetViewFrame()->GetBindings().QueryState(SID_DOC_REPAIR, pItem1);
+ pView1->GetViewFrame().GetBindings().QueryState(SID_DOC_REPAIR, pItem1);
CPPUNIT_ASSERT(pItem1);
CPPUNIT_ASSERT_EQUAL(true, pItem1->GetValue());
std::unique_ptr<SfxBoolItem> pItem2;
- pView2->GetViewFrame()->GetBindings().QueryState(SID_DOC_REPAIR, pItem2);
+ pView2->GetViewFrame().GetBindings().QueryState(SID_DOC_REPAIR, pItem2);
CPPUNIT_ASSERT(pItem2);
CPPUNIT_ASSERT_EQUAL(true, pItem2->GetValue());
}
@@ -2231,8 +2231,8 @@ void SdTiledRenderingTest::testLanguageStatus()
{
std::unique_ptr<SfxPoolItem> xItem1;
std::unique_ptr<SfxPoolItem> xItem2;
- pView1->GetViewFrame()->GetBindings().QueryState(SID_LANGUAGE_STATUS, xItem1);
- pView2->GetViewFrame()->GetBindings().QueryState(SID_LANGUAGE_STATUS, xItem2);
+ pView1->GetViewFrame().GetBindings().QueryState(SID_LANGUAGE_STATUS, xItem1);
+ pView2->GetViewFrame().GetBindings().QueryState(SID_LANGUAGE_STATUS, xItem2);
auto pStringItem = dynamic_cast<const SfxStringItem*>(xItem1.get());
CPPUNIT_ASSERT(pStringItem);
@@ -2455,7 +2455,7 @@ void SdTiledRenderingTest::testTdf115873()
SdXImpressDocument* pXImpressDocument = createDoc("tdf115873.fodp");
SfxViewShell* pViewShell = SfxViewShell::Current();
CPPUNIT_ASSERT(pViewShell);
- SfxBindings& rBindings = pViewShell->GetViewFrame()->GetBindings();
+ SfxBindings& rBindings = pViewShell->GetViewFrame().GetBindings();
auto xNavigator = std::make_unique<SdNavigatorWin>(nullptr, &rBindings, nullptr);
xNavigator->InitTreeLB(pXImpressDocument->GetDoc());
SdPageObjsTLV& rObjects = xNavigator->GetObjects();
@@ -2488,7 +2488,7 @@ void SdTiledRenderingTest::testTdf115873Group()
SdXImpressDocument* pXImpressDocument = createDoc("tdf115873-group.fodp");
SfxViewShell* pViewShell = SfxViewShell::Current();
CPPUNIT_ASSERT(pViewShell);
- SfxBindings& rBindings = pViewShell->GetViewFrame()->GetBindings();
+ SfxBindings& rBindings = pViewShell->GetViewFrame().GetBindings();
auto xNavigator = std::make_unique<SdNavigatorWin>(nullptr, &rBindings, nullptr);
xNavigator->InitTreeLB(pXImpressDocument->GetDoc());
SdPageObjsTLV& rObjects = xNavigator->GetObjects();
diff --git a/sd/source/ui/docshell/docshell.cxx b/sd/source/ui/docshell/docshell.cxx
index 4237aa8af7af..a8ec35e21cb7 100644
--- a/sd/source/ui/docshell/docshell.cxx
+++ b/sd/source/ui/docshell/docshell.cxx
@@ -399,12 +399,10 @@ void DrawDocShell::ApplySlotFilter() const
while( pTestViewShell )
{
- if( pTestViewShell->GetObjectShell()
- == this
- && pTestViewShell->GetViewFrame()
- && pTestViewShell->GetViewFrame()->GetDispatcher() )
+ if( pTestViewShell->GetObjectShell() == this
+ && pTestViewShell->GetViewFrame().GetDispatcher() )
{
- SfxDispatcher* pDispatcher = pTestViewShell->GetViewFrame()->GetDispatcher();
+ SfxDispatcher* pDispatcher = pTestViewShell->GetViewFrame().GetDispatcher();
if( !mpFilterSIDs.empty() )
pDispatcher->SetSlotFilter( mbFilterEnable ? SfxSlotFilterState::ENABLED : SfxSlotFilterState::DISABLED, mpFilterSIDs );
diff --git a/sd/source/ui/framework/factories/BasicViewFactory.cxx b/sd/source/ui/framework/factories/BasicViewFactory.cxx
index 313edb6627ec..3ea7e37f1f93 100644
--- a/sd/source/ui/framework/factories/BasicViewFactory.cxx
+++ b/sd/source/ui/framework/factories/BasicViewFactory.cxx
@@ -174,7 +174,7 @@ Reference<XResource> SAL_CALL BasicViewFactory::createResource (
// Get the view frame.
SfxViewFrame* pFrame = nullptr;
if (mpBase != nullptr)
- pFrame = mpBase->GetViewFrame();
+ pFrame = &mpBase->GetViewFrame();
if (pFrame != nullptr && mpBase!=nullptr && pWindow!=nullptr)
{
@@ -483,7 +483,7 @@ void BasicViewFactory::ActivateCenterView (
// have to request a resize now.
rpDescriptor->mpViewShell->UIFeatureChanged();
if (mpBase->GetDocShell()->IsInPlaceActive())
- mpBase->GetViewFrame()->Resize(true);
+ mpBase->GetViewFrame().Resize(true);
mpBase->GetDrawController()->SetSubController(
rpDescriptor->mpViewShell->CreateSubController());
diff --git a/sd/source/ui/framework/factories/ChildWindowPane.cxx b/sd/source/ui/framework/factories/ChildWindowPane.cxx
index 8fc184c0578b..1eaf0f0aeeb2 100644
--- a/sd/source/ui/framework/factories/ChildWindowPane.cxx
+++ b/sd/source/ui/framework/factories/ChildWindowPane.cxx
@@ -50,19 +50,17 @@ ChildWindowPane::ChildWindowPane (
{
mrViewShellBase.GetViewShellManager()->ActivateShell(mpShell.get());
- SfxViewFrame* pViewFrame = mrViewShellBase.GetViewFrame();
- if (pViewFrame == nullptr)
- return;
+ SfxViewFrame& rViewFrame = mrViewShellBase.GetViewFrame();
if (mrViewShellBase.IsActive())
{
- if (pViewFrame->KnowsChildWindow(mnChildWindowId))
+ if (rViewFrame.KnowsChildWindow(mnChildWindowId))
{
- if (pViewFrame->HasChildWindow(mnChildWindowId))
+ if (rViewFrame.HasChildWindow(mnChildWindowId))
{
// The ViewShellBase has already been activated. Make
// the child window visible as soon as possible.
- pViewFrame->SetChildWindow(mnChildWindowId, true);
+ rViewFrame.SetChildWindow(mnChildWindowId, true);
}
else
{
@@ -82,7 +80,7 @@ ChildWindowPane::ChildWindowPane (
// The ViewShellBase has not yet been activated. Hide the
// window and wait a little before it is made visible. See
// comments in the GetWindow() method for an explanation.
- pViewFrame->SetChildWindow(mnChildWindowId, false);
+ rViewFrame.SetChildWindow(mnChildWindowId, false);
}
}
@@ -92,11 +90,10 @@ ChildWindowPane::~ChildWindowPane()
void ChildWindowPane::Hide()
{
- SfxViewFrame* pViewFrame = mrViewShellBase.GetViewFrame();
- if (pViewFrame != nullptr)
- if (pViewFrame->KnowsChildWindow(mnChildWindowId))
- if (pViewFrame->HasChildWindow(mnChildWindowId))
- pViewFrame->SetChildWindow(mnChildWindowId, false);
+ SfxViewFrame& rViewFrame = mrViewShellBase.GetViewFrame();
+ if (rViewFrame.KnowsChildWindow(mnChildWindowId))
+ if (rViewFrame.HasChildWindow(mnChildWindowId))
+ rViewFrame.SetChildWindow(mnChildWindowId, false);
// Release the window because when the child window is shown again it
// may use a different window.
@@ -137,25 +134,23 @@ vcl::Window* ChildWindowPane::GetWindow()
break;
mbHasBeenActivated = true;
- SfxViewFrame* pViewFrame = mrViewShellBase.GetViewFrame();
- if (pViewFrame == nullptr)
- break;
+ SfxViewFrame& rViewFrame = mrViewShellBase.GetViewFrame();
// The view frame has to know the child window. This can be the
// case, when for example the document is in read-only mode: the
// task pane is then not available.
- if ( ! pViewFrame->KnowsChildWindow(mnChildWindowId))
+ if ( ! rViewFrame.KnowsChildWindow(mnChildWindowId))
break;
- pViewFrame->SetChildWindow(mnChildWindowId, true);
- SfxChildWindow* pChildWindow = pViewFrame->GetChildWindow(mnChildWindowId);
+ rViewFrame.SetChildWindow(mnChildWindowId, true);
+ SfxChildWindow* pChildWindow = rViewFrame.GetChildWindow(mnChildWindowId);
if (pChildWindow == nullptr)
- if (pViewFrame->HasChildWindow(mnChildWindowId))
+ if (rViewFrame.HasChildWindow(mnChildWindowId))
{
// The child window is not yet visible. Ask the view frame
// to show it and try again to get access to the child
// window.
- pViewFrame->ShowChildWindow(mnChildWindowId);
- pChildWindow = pViewFrame->GetChildWindow(mnChildWindowId);
+ rViewFrame.ShowChildWindow(mnChildWindowId);
+ pChildWindow = rViewFrame.GetChildWindow(mnChildWindowId);
}
// When the child window is still not visible then we have to try later.
diff --git a/sd/source/ui/sidebar/LayoutMenu.cxx b/sd/source/ui/sidebar/LayoutMenu.cxx
index bb808be34ebb..563df318211c 100644
--- a/sd/source/ui/sidebar/LayoutMenu.cxx
+++ b/sd/source/ui/sidebar/LayoutMenu.cxx
@@ -321,11 +321,8 @@ void LayoutMenu::InsertPageWithLayout (AutoLayout aLayout)
if (pViewShell == nullptr)
return;
- SfxViewFrame* pViewFrame = mrBase.GetViewFrame();
- if (pViewFrame == nullptr)
- return;
-
- SfxDispatcher* pDispatcher = pViewFrame->GetDispatcher();
+ SfxViewFrame& rViewFrame = mrBase.GetViewFrame();
+ SfxDispatcher* pDispatcher = rViewFrame.GetDispatcher();
if (pDispatcher == nullptr)
return;
@@ -452,7 +449,7 @@ void LayoutMenu::AssignLayoutToSelectedSlides (AutoLayout aLayout)
continue;
// Call the SID_ASSIGN_LAYOUT slot with all the necessary parameters.
- SfxRequest aRequest (mrBase.GetViewFrame(), SID_ASSIGN_LAYOUT);
+ SfxRequest aRequest(&mrBase.GetViewFrame(), SID_ASSIGN_LAYOUT);
aRequest.AppendItem(SfxUInt32Item (ID_VAL_WHATPAGE, (rpPage->GetPageNum()-1)/2));
aRequest.AppendItem(SfxUInt32Item (ID_VAL_WHATLAYOUT, aLayout));
pMainViewShell->ExecuteSlot (aRequest, false);
@@ -465,7 +462,7 @@ SfxRequest LayoutMenu::CreateRequest (
sal_uInt16 nSlotId,
AutoLayout aLayout)
{
- SfxRequest aRequest (mrBase.GetViewFrame(), nSlotId);
+ SfxRequest aRequest(&mrBase.GetViewFrame(), nSlotId);
do
{
@@ -599,7 +596,7 @@ void LayoutMenu::ShowContextMenu(const Point* pPos)
// the document is read-only.
const SfxPoolItem* pItem = nullptr;
const SfxItemState aState (
- mrBase.GetViewFrame()->GetDispatcher()->QueryState(SID_INSERTPAGE, pItem));
+ mrBase.GetViewFrame().GetDispatcher()->QueryState(SID_INSERTPAGE, pItem));
if (aState == SfxItemState::DISABLED)
xMenu->set_sensitive("insert", false);
diff --git a/sd/source/ui/sidebar/MasterPagesSelector.cxx b/sd/source/ui/sidebar/MasterPagesSelector.cxx
index 4dfc5f30bfc9..ac66cf362593 100644
--- a/sd/source/ui/sidebar/MasterPagesSelector.cxx
+++ b/sd/source/ui/sidebar/MasterPagesSelector.cxx
@@ -250,10 +250,10 @@ void MasterPagesSelector::ExecuteCommand(const OString &rIdent)
assert(pMasterPage); //rhbz#902884
if (pMasterPage)
xSelectedMaster.set(pMasterPage->getUnoPage(), uno::UNO_QUERY);
- SfxViewFrame* pViewFrame = mrBase.GetViewFrame();
- if (pViewFrame != nullptr && xSelectedMaster.is())
+ SfxViewFrame& rViewFrame = mrBase.GetViewFrame();
+ if (xSelectedMaster.is())
{
- SfxDispatcher* pDispatcher = pViewFrame->GetDispatcher();
+ SfxDispatcher* pDispatcher = rViewFrame.GetDispatcher();
if (pDispatcher != nullptr)
{
sal_uInt16 nIndex = mxPreviewValueSet->GetSelectedItemId();
diff --git a/sd/source/ui/slideshow/SlideShowRestarter.cxx b/sd/source/ui/slideshow/SlideShowRestarter.cxx
index b46d1b3d0b84..a9b53acf119d 100644
--- a/sd/source/ui/slideshow/SlideShowRestarter.cxx
+++ b/sd/source/ui/slideshow/SlideShowRestarter.cxx
@@ -46,7 +46,7 @@ SlideShowRestarter::SlideShowRestarter (
mpSlideShow(std::move(pSlideShow)),
mpViewShellBase(pViewShellBase),
mnDisplayCount(Application::GetScreenCount()),
- mpDispatcher(pViewShellBase->GetViewFrame()->GetDispatcher()),
+ mpDispatcher(pViewShellBase->GetViewFrame().GetDispatcher()),
mnCurrentSlideNumber(0)
{
}
@@ -136,7 +136,7 @@ void SlideShowRestarter::StartPresentation()
return;
if (mpDispatcher == nullptr && mpViewShellBase!=nullptr)
- mpDispatcher = mpViewShellBase->GetViewFrame()->GetDispatcher();
+ mpDispatcher = mpViewShellBase->GetViewFrame().GetDispatcher();
// Start the slide show on the saved current slide.
if (mpDispatcher != nullptr)
diff --git a/sd/source/ui/table/tablefunction.cxx b/sd/source/ui/table/tablefunction.cxx
index d3a26e41a872..14080fafbbc0 100644
--- a/sd/source/ui/table/tablefunction.cxx
+++ b/sd/source/ui/table/tablefunction.cxx
@@ -227,7 +227,7 @@ void DrawViewShell::FuTable(SfxRequest& rReq)
rReq.Ignore();
SfxViewShell* pViewShell = GetViewShell();
OSL_ASSERT (pViewShell!=nullptr);
- SfxBindings& rBindings = pViewShell->GetViewFrame()->GetBindings();
+ SfxBindings& rBindings = pViewShell->GetViewFrame().GetBindings();
rBindings.Invalidate( SID_INSERT_TABLE, true );
break;
}
diff --git a/sd/source/ui/view/ToolBarManager.cxx b/sd/source/ui/view/ToolBarManager.cxx
index 503b28fb2634..edd39c73110b 100644
--- a/sd/source/ui/view/ToolBarManager.cxx
+++ b/sd/source/ui/view/ToolBarManager.cxx
@@ -547,9 +547,7 @@ void ToolBarManager::Implementation::SetValid (bool bValid)
mbIsValid = bValid;
if (mbIsValid)
{
- Reference<frame::XFrame> xFrame;
- if (mrBase.GetViewFrame() != nullptr)
- xFrame = mrBase.GetViewFrame()->GetFrame().GetFrameInterface();
+ Reference<frame::XFrame> xFrame = mrBase.GetViewFrame().GetFrame().GetFrameInterface();
try
{
Reference<beans::XPropertySet> xFrameProperties (xFrame, UNO_QUERY_THROW);
diff --git a/sd/source/ui/view/ViewShellBase.cxx b/sd/source/ui/view/ViewShellBase.cxx
index a4af703afb38..64d0950c366c 100644
--- a/sd/source/ui/view/ViewShellBase.cxx
+++ b/sd/source/ui/view/ViewShellBase.cxx
@@ -233,7 +233,7 @@ ViewShellBase::ViewShellBase (
_rFrame.GetWindow().SetBackground(Application::GetSettings().GetStyleSettings().GetLightColor());
// Set up the members in the correct order.
- if (auto pDrawDocShell = dynamic_cast< DrawDocShell *>( GetViewFrame()->GetObjectShell() ))
+ if (auto pDrawDocShell = dynamic_cast< DrawDocShell *>( GetViewFrame().GetObjectShell() ))
mpDocShell = pDrawDocShell;
if (mpDocShell != nullptr)
mpDocument = mpDocShell->GetDoc();
@@ -280,7 +280,7 @@ ViewShellBase::~ViewShellBase()
mpImpl->mpToolBarManager->Shutdown();
mpImpl->mpViewShellManager->Shutdown();
- EndListening(*GetViewFrame());
+ EndListening(GetViewFrame());
EndListening(*GetDocShell());
SetWindow(nullptr);
@@ -290,7 +290,7 @@ ViewShellBase::~ViewShellBase()
void ViewShellBase::LateInit (const OUString& rsDefaultView)
{
- StartListening(*GetViewFrame(), DuplicateHandling::Prevent);
+ StartListening(GetViewFrame(), DuplicateHandling::Prevent);
StartListening(*GetDocShell(), DuplicateHandling::Prevent);
mpImpl->LateInit();
InitializeFramework();
@@ -409,11 +409,8 @@ void ViewShellBase::Notify(SfxBroadcaster& rBC, const SfxHint& rHint)
case SfxEventHintId::OpenDoc:
if( GetDocument() && GetDocument()->IsStartWithPresentation() )
{
- if( GetViewFrame() )
- {
- GetViewFrame()->GetDispatcher()->Execute(
- SID_PRESENTATION, SfxCallMode::ASYNCHRON );
- }
+ GetViewFrame().GetDispatcher()->Execute(
+ SID_PRESENTATION, SfxCallMode::ASYNCHRON );
}
break;
@@ -428,7 +425,7 @@ void ViewShellBase::Notify(SfxBroadcaster& rBC, const SfxHint& rHint)
{
case SfxHintId::LanguageChanged:
{
- GetViewFrame()->GetBindings().Invalidate(SID_LANGUAGE_STATUS);
+ GetViewFrame().GetBindings().Invalidate(SID_LANGUAGE_STATUS);
}
break;
@@ -487,8 +484,6 @@ void ViewShellBase::OuterResizePixel (const Point& rOrigin, const Size &rSize)
void ViewShellBase::Rearrange()
{
- OSL_ASSERT(GetViewFrame()!=nullptr);
-
// There is a bug in the communication between embedded objects and the
// framework::LayoutManager that leads to missing resize updates. The
// following workaround enforces such an update by cycling the border to
@@ -503,7 +498,7 @@ void ViewShellBase::Rearrange()
SAL_WARN("sd.view", "Rearrange: window missing");
}
- GetViewFrame()->Resize(true);
+ GetViewFrame().Resize(true);
}
ErrCode ViewShellBase::DoVerb(sal_Int32 nVerb)
@@ -677,7 +672,7 @@ void ViewShellBase::GetState (SfxItemSet& rSet)
{
mpImpl->GetSlotState(rSet);
- FuBullet::GetSlotState( rSet, nullptr, GetViewFrame() );
+ FuBullet::GetSlotState( rSet, nullptr, &GetViewFrame() );
}
void ViewShellBase::WriteUserDataSequence (
diff --git a/sd/source/ui/view/ViewShellImplementation.cxx b/sd/source/ui/view/ViewShellImplementation.cxx
index fb4598e048c0..fc617fa2d6a2 100644
--- a/sd/source/ui/view/ViewShellImplementation.cxx
+++ b/sd/source/ui/view/ViewShellImplementation.cxx
@@ -262,7 +262,7 @@ void ViewShell::Implementation::AssignLayout ( SfxRequest const & rRequest, Page
else
aVisibleLayers = pPage->TRG_GetMasterPageVisibleLayers();
- SfxRequest aRequest (mrViewShell.GetViewShellBase().GetViewFrame(), SID_MODIFYPAGE);
+ SfxRequest aRequest(&mrViewShell.GetViewShellBase().GetViewFrame(), SID_MODIFYPAGE);
aRequest.AppendItem(SfxStringItem (ID_VAL_PAGENAME, pPage->GetName()));
aRequest.AppendItem(SfxUInt32Item (ID_VAL_WHATLAYOUT, eLayout));
aRequest.AppendItem(SfxBoolItem(ID_VAL_ISPAGEBACK, aVisibleLayers.IsSet(aBackground)));
diff --git a/sd/source/ui/view/ViewTabBar.cxx b/sd/source/ui/view/ViewTabBar.cxx
index 81f71b12638e..d612d7560d32 100644
--- a/sd/source/ui/view/ViewTabBar.cxx
+++ b/sd/source/ui/view/ViewTabBar.cxx
@@ -147,8 +147,8 @@ vcl::Window* ViewTabBar::GetAnchorWindow(
&& rxViewTabBarId->isBoundToURL(
FrameworkHelper::msCenterPaneURL, AnchorBindingMode_DIRECT))
{
- if (pBase != nullptr && pBase->GetViewFrame() != nullptr)
- pWindow = &pBase->GetViewFrame()->GetWindow();
+ if (pBase != nullptr)
+ pWindow = &pBase->GetViewFrame().GetWindow();
}
// The rest is (at the moment) just for the emergency case.
diff --git a/sd/source/ui/view/drviews1.cxx b/sd/source/ui/view/drviews1.cxx
index ed0e84516849..a889ecc6937d 100644
--- a/sd/source/ui/view/drviews1.cxx
+++ b/sd/source/ui/view/drviews1.cxx
@@ -531,7 +531,7 @@ VclPtr<SvxRuler> DrawViewShell::CreateHRuler (::sd::Window* pWin)
sal_uInt16 nMetric = static_cast<sal_uInt16>(GetDoc()->GetUIUnit());
if( nMetric == 0xffff )
- nMetric = static_cast<sal_uInt16>(GetViewShellBase().GetViewFrame()->GetDispatcher()->GetModule()->GetFieldUnit());
+ nMetric = static_cast<sal_uInt16>(GetViewShellBase().GetViewFrame().GetDispatcher()->GetModule()->GetFieldUnit());
pRuler->SetUnit( FieldUnit( nMetric ) );
@@ -562,7 +562,7 @@ VclPtr<SvxRuler> DrawViewShell::CreateVRuler(::sd::Window* pWin)
sal_uInt16 nMetric = static_cast<sal_uInt16>(GetDoc()->GetUIUnit());
if( nMetric == 0xffff )
- nMetric = static_cast<sal_uInt16>(GetViewShellBase().GetViewFrame()->GetDispatcher()->GetModule()->GetFieldUnit());
+ nMetric = static_cast<sal_uInt16>(GetViewShellBase().GetViewFrame().GetDispatcher()->GetModule()->GetFieldUnit());
pRuler->SetUnit( FieldUnit( nMetric ) );
diff --git a/sd/source/ui/view/viewshe2.cxx b/sd/source/ui/view/viewshe2.cxx
index abb9b5f1db7a..fd4d2649b4fd 100644
--- a/sd/source/ui/view/viewshe2.cxx
+++ b/sd/source/ui/view/viewshe2.cxx
@@ -493,7 +493,7 @@ void ViewShell::SetPageSizeAndBorder(PageKind ePageKind, const Size& rNewSize,
// handed over undo group to undo manager
if (pViewShell)
{
- pViewShell->GetViewFrame()->GetObjectShell()->GetUndoManager()->AddUndoAction(std::move(pUndoGroup));
+ pViewShell->GetViewFrame().GetObjectShell()->GetUndoManager()->AddUndoAction(std::move(pUndoGroup));
}
// calculate View-Sizes
@@ -529,9 +529,9 @@ void ViewShell::SetPageSizeAndBorder(PageKind ePageKind, const Size& rNewSize,
if(nullptr != pViewShell)
{
- pViewShell->GetViewFrame()->GetBindings().Invalidate(SID_RULER_NULL_OFFSET);
+ pViewShell->GetViewFrame().GetBindings().Invalidate(SID_RULER_NULL_OFFSET);
// zoom onto (new) page size
- pViewShell->GetViewFrame()->GetDispatcher()->Execute(SID_SIZE_PAGE, SfxCallMode::ASYNCHRON | SfxCallMode::RECORD);
+ pViewShell->GetViewFrame().GetDispatcher()->Execute(SID_SIZE_PAGE, SfxCallMode::ASYNCHRON | SfxCallMode::RECORD);
}
Broadcast(ViewShellHint(ViewShellHint::HINT_PAGE_RESIZE_END));
@@ -668,7 +668,7 @@ bool ViewShell::ActivateObject(SdrOle2Obj* pObj, sal_Int32 nVerb)
// call dialog "insert OLE object"
GetDocSh()->SetWaitCursor( false );
- pViewShell->GetViewFrame()->GetDispatcher()->Execute(
+ pViewShell->GetViewFrame().GetDispatcher()->Execute(
SID_INSERT_OBJECT,
SfxCallMode::SYNCHRON | SfxCallMode::RECORD);
xObj = pObj->GetObjRef();
@@ -771,7 +771,7 @@ bool ViewShell::ActivateObject(SdrOle2Obj* pObj, sal_Int32 nVerb)
}
pSdClient->DoVerb(nVerb); // if necessary, ErrCode is outputted by Sfx
- pViewShell->GetViewFrame()->GetBindings().Invalidate(
+ pViewShell->GetViewFrame().GetBindings().Invalidate(
SID_NAVIGATOR_STATE, true);
}
@@ -798,7 +798,7 @@ const ::tools::Rectangle& ViewShell::GetAllWindowRect()
void ViewShell::ReadUserData()
{
// zoom onto VisArea from FrameView
- GetViewShell()->GetViewFrame()->GetDispatcher()->Execute(SID_SIZE_VISAREA,
+ GetViewShell()->GetViewFrame().GetDispatcher()->Execute(SID_SIZE_VISAREA,
SfxCallMode::ASYNCHRON | SfxCallMode::RECORD);
}
diff --git a/sd/source/ui/view/viewshel.cxx b/sd/source/ui/view/viewshel.cxx
index a3cbfe8d896d..8a7d6f482c82 100644
--- a/sd/source/ui/view/viewshel.cxx
+++ b/sd/source/ui/view/viewshel.cxx
@@ -120,7 +120,7 @@ SfxViewFrame* ViewShell::GetViewFrame() const
const SfxViewShell* pViewShell = GetViewShell();
if (pViewShell != nullptr)
{
- return pViewShell->GetViewFrame();
+ return &pViewShell->GetViewFrame();
}
else
{
@@ -312,7 +312,7 @@ void ViewShell::Activate(bool bIsMDIActivate)
SfxViewShell* pViewShell = GetViewShell();
OSL_ASSERT (pViewShell!=nullptr);
- SfxBindings& rBindings = pViewShell->GetViewFrame()->GetBindings();
+ SfxBindings& rBindings = pViewShell->GetViewFrame().GetBindings();
rBindings.Invalidate( SID_3D_STATE, true );
rtl::Reference< SlideShow > xSlideShow( SlideShow::GetSlideShow( GetViewShellBase() ) );