summaryrefslogtreecommitdiff
path: root/starmath
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 /starmath
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 'starmath')
-rw-r--r--starmath/inc/view.hxx2
-rw-r--r--starmath/source/SmElementsPanel.cxx2
-rw-r--r--starmath/source/dialog.cxx2
-rw-r--r--starmath/source/document.cxx2
-rw-r--r--starmath/source/edit.cxx4
-rw-r--r--starmath/source/view.cxx42
6 files changed, 27 insertions, 27 deletions
diff --git a/starmath/inc/view.hxx b/starmath/inc/view.hxx
index 662923af0528..bef51e8560e0 100644
--- a/starmath/inc/view.hxx
+++ b/starmath/inc/view.hxx
@@ -296,7 +296,7 @@ public:
SmDocShell * GetDoc() const
{
- return static_cast<SmDocShell *>( GetViewFrame()->GetObjectShell() );
+ return static_cast<SmDocShell *>( GetViewFrame().GetObjectShell() );
}
SmEditWindow * GetEditWindow();
diff --git a/starmath/source/SmElementsPanel.cxx b/starmath/source/SmElementsPanel.cxx
index 08ff6af95ab9..be08091508c0 100644
--- a/starmath/source/SmElementsPanel.cxx
+++ b/starmath/source/SmElementsPanel.cxx
@@ -76,7 +76,7 @@ IMPL_LINK(SmElementsPanel, ElementClickHandler, OUString, ElementSource, void)
if (SmViewShell* pViewSh = GetView())
{
SfxStringItem aInsertCommand(SID_INSERTCOMMANDTEXT, ElementSource);
- pViewSh->GetViewFrame()->GetDispatcher()->ExecuteList(
+ pViewSh->GetViewFrame().GetDispatcher()->ExecuteList(
SID_INSERTCOMMANDTEXT, SfxCallMode::RECORD, { &aInsertCommand });
}
}
diff --git a/starmath/source/dialog.cxx b/starmath/source/dialog.cxx
index 2aedbae19d05..2ffe14a816bf 100644
--- a/starmath/source/dialog.cxx
+++ b/starmath/source/dialog.cxx
@@ -1289,7 +1289,7 @@ IMPL_LINK_NOARG(SmSymbolDialog, GetClickHdl, weld::Button&, void)
{
OUString aText = "%" + pSym->GetName() + " ";
- rViewSh.GetViewFrame()->GetDispatcher()->ExecuteList(
+ rViewSh.GetViewFrame().GetDispatcher()->ExecuteList(
SID_INSERTSPECIAL, SfxCallMode::RECORD,
{ new SfxStringItem(SID_INSERTSPECIAL, aText) });
}
diff --git a/starmath/source/document.cxx b/starmath/source/document.cxx
index 10143dae9afb..0e43fa1d6efb 100644
--- a/starmath/source/document.cxx
+++ b/starmath/source/document.cxx
@@ -152,7 +152,7 @@ void SmDocShell::SetText(const OUString& rBuffer)
SmViewShell *pViewSh = SmGetActiveView();
if( pViewSh )
{
- pViewSh->GetViewFrame()->GetBindings().Invalidate(SID_TEXT);
+ pViewSh->GetViewFrame().GetBindings().Invalidate(SID_TEXT);
if ( SfxObjectCreateMode::EMBEDDED == GetCreateMode() )
{
// have SwOleClient::FormatChanged() to align the modified formula properly
diff --git a/starmath/source/edit.cxx b/starmath/source/edit.cxx
index 1c92b03fb2b1..ca84e648f859 100644
--- a/starmath/source/edit.cxx
+++ b/starmath/source/edit.cxx
@@ -160,7 +160,7 @@ void SmEditTextWindow::StartCursorMove()
void SmEditWindow::InvalidateSlots()
{
- SfxBindings& rBind = GetView()->GetViewFrame()->GetBindings();
+ SfxBindings& rBind = GetView()->GetViewFrame().GetBindings();
rBind.Invalidate(SID_COPY);
rBind.Invalidate(SID_CUT);
rBind.Invalidate(SID_DELETE);
@@ -834,7 +834,7 @@ void SmEditTextWindow::Flush()
if (SmViewShell *pViewSh = mrEditWindow.GetView())
{
std::unique_ptr<SfxStringItem> pTextToFlush = std::make_unique<SfxStringItem>(SID_TEXT, GetText());
- pViewSh->GetViewFrame()->GetDispatcher()->ExecuteList(
+ pViewSh->GetViewFrame().GetDispatcher()->ExecuteList(
SID_TEXT, SfxCallMode::RECORD,
{ pTextToFlush.get() });
}
diff --git a/starmath/source/view.cxx b/starmath/source/view.cxx
index 055805c8cc20..d4f34185af57 100644
--- a/starmath/source/view.cxx
+++ b/starmath/source/view.cxx
@@ -106,7 +106,7 @@ using namespace css::accessibility;
using namespace css::uno;
SmGraphicWindow::SmGraphicWindow(SmViewShell& rShell)
- : InterimItemWindow(&rShell.GetViewFrame()->GetWindow(), "modules/smath/ui/mathwindow.ui", "MathWindow")
+ : InterimItemWindow(&rShell.GetViewFrame().GetWindow(), "modules/smath/ui/mathwindow.ui", "MathWindow")
, nLinePixH(GetSettings().GetStyleSettings().GetScrollBarSize())
, nColumnPixW(nLinePixH)
, nZoom(100)
@@ -771,7 +771,7 @@ bool SmGraphicWidget::KeyInput(const KeyEvent& rKEvt)
bool SmGraphicWidget::Command(const CommandEvent& rCEvt)
{
bool bCallBase = true;
- if (!GetView().GetViewFrame()->GetFrame().IsInPlace())
+ if (!GetView().GetViewFrame().GetFrame().IsInPlace())
{
switch ( rCEvt.GetCommand() )
{
@@ -861,8 +861,8 @@ void SmGraphicWindow::SetZoom(sal_uInt16 Factor)
SetGraphicMapMode(MapMode(SmMapUnit(), Point(), aFraction, aFraction));
mxGraphic->SetTotalSize();
SmViewShell& rViewSh = mxGraphic->GetView();
- rViewSh.GetViewFrame()->GetBindings().Invalidate(SID_ATTR_ZOOM);
- rViewSh.GetViewFrame()->GetBindings().Invalidate(SID_ATTR_ZOOMSLIDER);
+ rViewSh.GetViewFrame().GetBindings().Invalidate(SID_ATTR_ZOOM);
+ rViewSh.GetViewFrame().GetBindings().Invalidate(SID_ATTR_ZOOMSLIDER);
}
void SmGraphicWindow::ZoomToFitInWindow()
@@ -965,7 +965,7 @@ void SmCmdBoxWindow::ShowContextMenu(const Point& rPos)
ToTop();
SmViewShell *pViewSh = GetView();
if (pViewSh)
- pViewSh->GetViewFrame()->GetDispatcher()->ExecutePopup("edit", this, &rPos);
+ pViewSh->GetViewFrame().GetDispatcher()->ExecutePopup("edit", this, &rPos);
}
void SmCmdBoxWindow::Command(const CommandEvent& rCEvt)
@@ -1065,7 +1065,7 @@ IMPL_LINK_NOARG( SmCmdBoxWindow, InitialFocusTimerHdl, Timer *, void )
SmViewShell* pView = GetView();
assert(pView);
- bool bInPlace = pView->GetViewFrame()->GetFrame().IsInPlace();
+ bool bInPlace = pView->GetViewFrame().GetFrame().IsInPlace();
uno::Reference< frame::XFrame > xFrame( GetBindings().GetDispatcher()->GetFrame()->GetFrame().GetFrameInterface());
if ( bInPlace )
{
@@ -1545,7 +1545,7 @@ std::unique_ptr<SfxTabPage> SmViewShell::CreatePrintOptionsPage(weld::Container*
SmEditWindow *SmViewShell::GetEditWindow()
{
SmCmdBoxWrapper* pWrapper = static_cast<SmCmdBoxWrapper*>(
- GetViewFrame()->GetChildWindow(SmCmdBoxWrapper::GetChildWindowId()));
+ GetViewFrame().GetChildWindow(SmCmdBoxWrapper::GetChildWindowId()));
if (pWrapper != nullptr)
{
@@ -1559,7 +1559,7 @@ SmEditWindow *SmViewShell::GetEditWindow()
void SmViewShell::SetStatusText(const OUString& rText)
{
maStatusText = rText;
- GetViewFrame()->GetBindings().Invalidate(SID_TEXTSTATUS);
+ GetViewFrame().GetBindings().Invalidate(SID_TEXTSTATUS);
}
void SmViewShell::ShowError(const SmErrorDesc* pErrorDesc)
@@ -1623,7 +1623,7 @@ void SmViewShell::Insert( SfxMedium& rMedium )
pDoc->Parse();
pDoc->SetModified();
- SfxBindings &rBnd = GetViewFrame()->GetBindings();
+ SfxBindings &rBnd = GetViewFrame().GetBindings();
rBnd.Invalidate(SID_GRAPHIC_SM);
rBnd.Invalidate(SID_TEXT);
}
@@ -1658,7 +1658,7 @@ void SmViewShell::InsertFrom(SfxMedium &rMedium)
pDoc->Parse();
pDoc->SetModified();
- SfxBindings& rBnd = GetViewFrame()->GetBindings();
+ SfxBindings& rBnd = GetViewFrame().GetBindings();
rBnd.Invalidate(SID_GRAPHIC_SM);
rBnd.Invalidate(SID_TEXT);
}
@@ -1768,7 +1768,7 @@ void SmViewShell::Execute(SfxRequest& rReq)
{
if (pWin->IsAllSelected())
{
- GetViewFrame()->GetDispatcher()->ExecuteList(
+ GetViewFrame().GetDispatcher()->ExecuteList(
SID_COPYOBJECT, SfxCallMode::RECORD,
{ new SfxVoidItem(SID_COPYOBJECT) });
}
@@ -1795,7 +1795,7 @@ void SmViewShell::Execute(SfxRequest& rReq)
}
if( bCallExec )
{
- GetViewFrame()->GetDispatcher()->ExecuteList(
+ GetViewFrame().GetDispatcher()->ExecuteList(
SID_PASTEOBJECT, SfxCallMode::RECORD,
{ new SfxVoidItem(SID_PASTEOBJECT) });
}
@@ -1952,7 +1952,7 @@ void SmViewShell::Execute(SfxRequest& rReq)
case SID_ATTR_ZOOM:
{
- if ( !GetViewFrame()->GetFrame().IsInPlace() )
+ if ( !GetViewFrame().GetFrame().IsInPlace() )
{
const SfxItemSet *pSet = rReq.GetArgs();
if ( pSet )
@@ -1964,7 +1964,7 @@ void SmViewShell::Execute(SfxRequest& rReq)
SfxItemSetFixed<SID_ATTR_ZOOM, SID_ATTR_ZOOM> aSet( SmDocShell::GetPool() );
aSet.Put( SvxZoomItem( SvxZoomType::PERCENT, mxGraphicWindow->GetZoom()));
SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
- ScopedVclPtr<AbstractSvxZoomDialog> xDlg(pFact->CreateSvxZoomDialog(GetViewFrame()->GetWindow().GetFrameWeld(), aSet));
+ ScopedVclPtr<AbstractSvxZoomDialog> xDlg(pFact->CreateSvxZoomDialog(GetViewFrame().GetWindow().GetFrameWeld(), aSet));
xDlg->SetLimits( MINZOOM, MAXZOOM );
if (xDlg->Execute() != RET_CANCEL)
ZoomByItemSet(xDlg->GetOutputItemSet());
@@ -1989,11 +1989,11 @@ void SmViewShell::Execute(SfxRequest& rReq)
case SID_ELEMENTSDOCKINGWINDOW:
{
// First make sure that the sidebar is visible
- GetViewFrame()->ShowChildWindow(SID_SIDEBAR);
+ GetViewFrame().ShowChildWindow(SID_SIDEBAR);
sfx2::sidebar::Sidebar::TogglePanel(u"MathElementsPanel",
- GetViewFrame()->GetFrame().GetFrameInterface());
- GetViewFrame()->GetBindings().Invalidate( SID_ELEMENTSDOCKINGWINDOW );
+ GetViewFrame().GetFrame().GetFrameInterface());
+ GetViewFrame().GetBindings().Invalidate( SID_ELEMENTSDOCKINGWINDOW );
rReq.Ignore ();
}
@@ -2103,7 +2103,7 @@ void SmViewShell::GetState(SfxItemSet &rSet)
case SID_ZOOMIN:
case SID_ZOOMOUT:
case SID_ZOOM_OPTIMAL:
- if ( GetViewFrame()->GetFrame().IsInPlace() )
+ if ( GetViewFrame().GetFrame().IsInPlace() )
rSet.DisableItem( nWh );
break;
@@ -2141,7 +2141,7 @@ void SmViewShell::GetState(SfxItemSet &rSet)
case SID_ELEMENTSDOCKINGWINDOW:
{
const bool bState = sfx2::sidebar::Sidebar::IsPanelVisible(
- u"MathElementsPanel", GetViewFrame()->GetFrame().GetFrameInterface());
+ u"MathElementsPanel", GetViewFrame().GetFrame().GetFrameInterface());
rSet.Put(SfxBoolItem(SID_ELEMENTSDOCKINGWINDOW, bState));
}
break;
@@ -2272,7 +2272,7 @@ IMPL_LINK( SmViewShell, DialogClosedHdl, sfx2::FileDialogHelper*, _pFileDlg, voi
pDoc->ArrangeFormula();
pDoc->Repaint();
// adjust window, repaint, increment ModifyCount,...
- GetViewFrame()->GetBindings().Invalidate(SID_GRAPHIC_SM);
+ GetViewFrame().GetBindings().Invalidate(SID_GRAPHIC_SM);
}
}
@@ -2286,7 +2286,7 @@ void SmViewShell::Notify( SfxBroadcaster& , const SfxHint& rHint )
{
case SfxHintId::ModeChanged:
case SfxHintId::DocChanged:
- GetViewFrame()->GetBindings().InvalidateAll(false);
+ GetViewFrame().GetBindings().InvalidateAll(false);
break;
default:
break;