summaryrefslogtreecommitdiff
path: root/sc/source/ui/app
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2021-10-21 12:31:03 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-10-21 14:58:51 +0200
commit29489b33b435683021b72cb2bce27aba8cb7a430 (patch)
tree8e4e1c59d56d5ed0d0ca4d088419067041e4553a /sc/source/ui/app
parenta4244c0f05b95ded277a3a7ed217bf0451daa996 (diff)
loplugin:flatten
Change-Id: I3b4226a9d089ec9aedab95d96e50a068f57a76c7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123991 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sc/source/ui/app')
-rw-r--r--sc/source/ui/app/inputhdl.cxx50
-rw-r--r--sc/source/ui/app/inputwin.cxx32
2 files changed, 41 insertions, 41 deletions
diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx
index 97c86b34b00d..01f2b9e9d1d6 100644
--- a/sc/source/ui/app/inputhdl.cxx
+++ b/sc/source/ui/app/inputhdl.cxx
@@ -1735,36 +1735,36 @@ void ScInputHandler::LOKPasteFunctionData(const OUString& rFunctionName)
EditView* pEditView = pTopView ? pTopView : pTableView;
- if (pActiveViewSh && pEditView)
+ if (!pActiveViewSh || !pEditView)
+ return;
+
+ bool bEdit = false;
+ OUString aFormula;
+ const EditEngine* pEditEngine = pEditView->GetEditEngine();
+ if (pEditEngine)
{
- bool bEdit = false;
- OUString aFormula;
- const EditEngine* pEditEngine = pEditView->GetEditEngine();
- if (pEditEngine)
- {
- aFormula = pEditEngine->GetText(0);
- bEdit = aFormula.getLength() > 1 && (aFormula[0] == '=' || aFormula[0] == '+' || aFormula[0] == '-');
- }
+ aFormula = pEditEngine->GetText(0);
+ bEdit = aFormula.getLength() > 1 && (aFormula[0] == '=' || aFormula[0] == '+' || aFormula[0] == '-');
+ }
- if ( !bEdit )
- {
- OUString aNewFormula('=');
- if ( aFormula.startsWith("=") )
- aNewFormula = aFormula;
+ if ( !bEdit )
+ {
+ OUString aNewFormula('=');
+ if ( aFormula.startsWith("=") )
+ aNewFormula = aFormula;
- InputReplaceSelection( aNewFormula );
- }
+ InputReplaceSelection( aNewFormula );
+ }
- if (pFormulaData)
- {
- OUString aNew;
- ScTypedCaseStrSet::const_iterator aPos = findText(*pFormulaData, pFormulaData->begin(), rFunctionName, aNew, /* backward = */false);
+ if (pFormulaData)
+ {
+ OUString aNew;
+ ScTypedCaseStrSet::const_iterator aPos = findText(*pFormulaData, pFormulaData->begin(), rFunctionName, aNew, /* backward = */false);
- if (aPos != pFormulaData->end())
- {
- miAutoPosFormula = aPos;
- PasteFunctionData();
- }
+ if (aPos != pFormulaData->end())
+ {
+ miAutoPosFormula = aPos;
+ PasteFunctionData();
}
}
}
diff --git a/sc/source/ui/app/inputwin.cxx b/sc/source/ui/app/inputwin.cxx
index 1747639c611a..32412c39b1be 100644
--- a/sc/source/ui/app/inputwin.cxx
+++ b/sc/source/ui/app/inputwin.cxx
@@ -1314,25 +1314,25 @@ void ScTextWnd::Paint( vcl::RenderContext& rRenderContext, const tools::Rectangl
else
WeldEditView::Paint(rRenderContext, rRect);
- if (comphelper::LibreOfficeKit::isActive())
+ if (!comphelper::LibreOfficeKit::isActive())
+ return;
+
+ bool bIsFocused = false;
+ if (HasFocus())
{
- bool bIsFocused = false;
- if (HasFocus())
- {
- vcl::Cursor* pCursor = m_xEditView->GetCursor();
- if (pCursor)
- bIsFocused = true;
- }
+ vcl::Cursor* pCursor = m_xEditView->GetCursor();
+ if (pCursor)
+ bIsFocused = true;
+ }
- VclPtr<vcl::Window> pParent = mrGroupBar.GetVclParent().GetParentWithLOKNotifier();
- if (!pParent)
- return;
+ VclPtr<vcl::Window> pParent = mrGroupBar.GetVclParent().GetParentWithLOKNotifier();
+ if (!pParent)
+ return;
- const vcl::ILibreOfficeKitNotifier* pNotifier = pParent->GetLOKNotifier();
- std::vector<vcl::LOKPayloadItem> aItems;
- aItems.emplace_back("visible", bIsFocused ? "true" : "false");
- pNotifier->notifyWindow(pParent->GetLOKWindowId(), "cursor_visible", aItems);
- }
+ const vcl::ILibreOfficeKitNotifier* pNotifier = pParent->GetLOKNotifier();
+ std::vector<vcl::LOKPayloadItem> aItems;
+ aItems.emplace_back("visible", bIsFocused ? "true" : "false");
+ pNotifier->notifyWindow(pParent->GetLOKWindowId(), "cursor_visible", aItems);
}
EditView* ScTextWnd::GetEditView() const