diff options
-rw-r--r-- | starmath/source/cursor.cxx | 4 | ||||
-rw-r--r-- | starmath/source/dialog.cxx | 7 | ||||
-rw-r--r-- | starmath/source/document.cxx | 8 |
3 files changed, 10 insertions, 9 deletions
diff --git a/starmath/source/cursor.cxx b/starmath/source/cursor.cxx index 52621d360c80..d5479ab42765 100644 --- a/starmath/source/cursor.cxx +++ b/starmath/source/cursor.cxx @@ -1315,8 +1315,8 @@ void SmCursor::EndEdit(){ } void SmCursor::RequestRepaint(){ - SmViewShell *pViewSh = SmGetActiveView(); - if( pViewSh ) { + if (SmViewShell *pViewSh = SmGetActiveView()) + { if ( SfxObjectCreateMode::EMBEDDED == mpDocShell->GetCreateMode() ) mpDocShell->Repaint(); else diff --git a/starmath/source/dialog.cxx b/starmath/source/dialog.cxx index 043739cf5c0d..19992b341c36 100644 --- a/starmath/source/dialog.cxx +++ b/starmath/source/dialog.cxx @@ -181,7 +181,8 @@ SmPrintOptionsTabPage::SmPrintOptionsTabPage(weld::Container* pPage, weld::Dialo SmPrintOptionsTabPage::~SmPrintOptionsTabPage() { - SmGetActiveView()->GetEditWindow()->UpdateStatus(); + if (SmViewShell *pViewSh = SmGetActiveView()) + pViewSh->GetEditWindow()->UpdateStatus(); } bool SmPrintOptionsTabPage::FillItemSet(SfxItemSet* rSet) @@ -204,7 +205,9 @@ bool SmPrintOptionsTabPage::FillItemSet(SfxItemSet* rSet) rSet->Put(SfxBoolItem(SID_AUTO_CLOSE_BRACKETS, m_xAutoCloseBrackets->get_active())); rSet->Put(SfxUInt16Item(SID_SMEDITWINDOWZOOM, sal::static_int_cast<sal_uInt16>(m_xSmZoom->get_value(FieldUnit::PERCENT)))); - SmGetActiveView()->GetEditWindow()->UpdateStatus(); + if (SmViewShell *pViewSh = SmGetActiveView()) + pViewSh->GetEditWindow()->UpdateStatus(); + return true; } diff --git a/starmath/source/document.cxx b/starmath/source/document.cxx index 23034ede3e3c..59353879d4e4 100644 --- a/starmath/source/document.cxx +++ b/starmath/source/document.cxx @@ -159,7 +159,7 @@ void SmDocShell::SetText(const OUString& rBuffer) Parse(); SmViewShell *pViewSh = SmGetActiveView(); - if( pViewSh ) + if (pViewSh) { pViewSh->GetViewFrame()->GetBindings().Invalidate(SID_TEXT); if ( SfxObjectCreateMode::EMBEDDED == GetCreateMode() ) @@ -256,8 +256,7 @@ void SmDocShell::ArrangeFormula() // if necessary get another OutputDevice for which we format if (!pOutDev) { - SmViewShell *pView = SmGetActiveView(); - if (pView) + if (SmViewShell *pView = SmGetActiveView()) pOutDev = &pView->GetGraphicWidget().GetDrawingArea()->get_ref_device(); else { @@ -542,8 +541,7 @@ void SmDocShell::Repaint() Size aVisSize = GetSize(); SetVisAreaSize(aVisSize); - SmViewShell* pViewSh = SmGetActiveView(); - if (pViewSh) + if (SmViewShell* pViewSh = SmGetActiveView()) pViewSh->GetGraphicWidget().Invalidate(); if (bIsEnabled) |