starmath/inc/view.hxx | 1 - starmath/source/view.cxx | 31 +++++++++++++------------------ 2 files changed, 13 insertions(+), 19 deletions(-)
New commits: commit 1b97f2ce4d5f3b3cbfd3a826c12557bbdcc07e1f Author: Mike Kaganski <mike.kagan...@collabora.com> AuthorDate: Tue Jan 18 12:04:01 2022 +0300 Commit: Mike Kaganski <mike.kagan...@collabora.com> CommitDate: Tue Jul 26 10:51:30 2022 +0200 Drop useless indirection Change-Id: I87f26e2a2cf10d3000b0955a6ba2d877ee92bdf1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128547 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kagan...@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137453 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com> diff --git a/starmath/inc/view.hxx b/starmath/inc/view.hxx index a8e02addfba6..993a6dae351e 100644 --- a/starmath/inc/view.hxx +++ b/starmath/inc/view.hxx @@ -137,7 +137,6 @@ private: } void SetCursor(const SmNode *pNode); void SetCursor(const tools::Rectangle &rRect); - static bool IsInlineEditEnabled(); virtual void Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle&) override; virtual bool KeyInput(const KeyEvent& rKEvt) override; diff --git a/starmath/source/view.cxx b/starmath/source/view.cxx index 002a2321c1d1..30778661fe96 100644 --- a/starmath/source/view.cxx +++ b/starmath/source/view.cxx @@ -341,7 +341,7 @@ bool SmGraphicWidget::MouseButtonDown(const MouseEvent& rMEvt) if (!pTree) return true; - if (IsInlineEditEnabled()) { + if (SmViewShell::IsInlineEditEnabled()) { mrViewShell.GetDoc()->GetCursor().MoveTo(&rDevice, aPos, !rMEvt.IsShift()); return true; } @@ -371,7 +371,7 @@ bool SmGraphicWidget::MouseButtonDown(const MouseEvent& rMEvt) bool SmGraphicWidget::MouseMove(const MouseEvent &rMEvt) { - if (rMEvt.IsLeft() && IsInlineEditEnabled()) + if (rMEvt.IsLeft() && SmViewShell::IsInlineEditEnabled()) { OutputDevice& rDevice = GetDrawingArea()->get_ref_device(); Point aPos(rDevice.PixelToLogic(rMEvt.GetPosPixel()) - GetFormulaDrawPos()); @@ -385,14 +385,9 @@ bool SmGraphicWidget::MouseMove(const MouseEvent &rMEvt) return true; } -bool SmGraphicWidget::IsInlineEditEnabled() -{ - return SmViewShell::IsInlineEditEnabled(); -} - void SmGraphicWidget::GetFocus() { - if (!IsInlineEditEnabled()) + if (!SmViewShell::IsInlineEditEnabled()) return; if (mrViewShell.GetEditWindow()) mrViewShell.GetEditWindow()->Flush(); @@ -414,7 +409,7 @@ void SmGraphicWidget::LoseFocus() mxAccessible->LaunchEvent( AccessibleEventId::STATE_CHANGED, aOldValue, aNewValue ); } - if (!IsInlineEditEnabled()) + if (!SmViewShell::IsInlineEditEnabled()) return; SetIsCursorVisible(false); ShowLine(false); @@ -447,7 +442,7 @@ void SmGraphicWidget::CaretBlinkInit() void SmGraphicWidget::CaretBlinkStart() { - if (!IsInlineEditEnabled()) + if (!SmViewShell::IsInlineEditEnabled()) return; if (aCaretBlinkTimer.GetTimeout() != STYLE_CURSOR_NOBLINKTIME) aCaretBlinkTimer.Start(); @@ -455,7 +450,7 @@ void SmGraphicWidget::CaretBlinkStart() void SmGraphicWidget::CaretBlinkStop() { - if (!IsInlineEditEnabled()) + if (!SmViewShell::IsInlineEditEnabled()) return; aCaretBlinkTimer.Stop(); } @@ -463,7 +458,7 @@ void SmGraphicWidget::CaretBlinkStop() // shows or hides the formula-cursor depending on 'bShow' is true or not void SmGraphicWidget::ShowCursor(bool bShow) { - if (IsInlineEditEnabled()) + if (SmViewShell::IsInlineEditEnabled()) return; bool bInvert = bShow != IsCursorVisible(); @@ -478,7 +473,7 @@ void SmGraphicWidget::ShowCursor(bool bShow) void SmGraphicWidget::ShowLine(bool bShow) { - if (!IsInlineEditEnabled()) + if (!SmViewShell::IsInlineEditEnabled()) return; bIsLineVisible = bShow; @@ -486,7 +481,7 @@ void SmGraphicWidget::ShowLine(bool bShow) void SmGraphicWidget::SetCursor(const SmNode *pNode) { - if (IsInlineEditEnabled()) + if (SmViewShell::IsInlineEditEnabled()) return; const SmNode *pTree = mrViewShell.GetDoc()->GetFormulaTree(); @@ -505,7 +500,7 @@ void SmGraphicWidget::SetCursor(const tools::Rectangle &rRect) // The old cursor will be removed, and the new one will be shown if // that is activated in the ConfigItem { - if (IsInlineEditEnabled()) + if (SmViewShell::IsInlineEditEnabled()) return; SmModule *pp = SM_MOD(); @@ -525,7 +520,7 @@ const SmNode * SmGraphicWidget::SetCursorPos(sal_uInt16 nRow, sal_uInt16 nCol) // rectangle. If not the formula-cursor will be hidden. // In any case the search result is being returned. { - if (IsInlineEditEnabled()) + if (SmViewShell::IsInlineEditEnabled()) return nullptr; // find visible node with token at nRow, nCol @@ -550,7 +545,7 @@ void SmGraphicWidget::Paint(vcl::RenderContext& rRenderContext, const tools::Rec rDoc.DrawFormula(rRenderContext, aPoint, true); //! modifies aPoint to be the topleft //! corner of the formula aFormulaDrawPos = aPoint; - if (IsInlineEditEnabled()) + if (SmViewShell::IsInlineEditEnabled()) { //Draw cursor if any... if (mrViewShell.GetDoc()->HasCursor() && IsLineVisible()) @@ -586,7 +581,7 @@ void SmGraphicWidget::SetTotalSize() bool SmGraphicWidget::KeyInput(const KeyEvent& rKEvt) { - if (!IsInlineEditEnabled()) + if (!SmViewShell::IsInlineEditEnabled()) return mrViewShell.KeyInput(rKEvt); bool bConsumed = true;