desktop/source/lib/init.cxx | 14 +++++++------- sc/source/ui/view/gridwin4.cxx | 4 ++-- sc/source/ui/view/viewfunc.cxx | 10 +++++----- 3 files changed, 14 insertions(+), 14 deletions(-)
New commits: commit 0261aea9d821bda69eef67d5fc6725e8c1cda483 Author: Caolán McNamara <caolan.mcnam...@collabora.com> AuthorDate: Fri Feb 9 14:05:17 2024 +0000 Commit: Andras Timar <andras.ti...@collabora.com> CommitDate: Fri Feb 9 17:52:16 2024 +0100 fix various loplugin warnings Change-Id: I84c6487b025738f7e4fb8b38d731e19a91ce4451 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163168 Tested-by: Andras Timar <andras.ti...@collabora.com> Reviewed-by: Andras Timar <andras.ti...@collabora.com> diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index 0085b2609800..0fd3e62a571c 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -7551,18 +7551,18 @@ static void preloadData() #pragma GCC diagnostic pop #endif - static const OUString preloadComponents[] = { - "private:factory/swriter", - "private:factory/scalc", - "private:factory/simpress", - "private:factory/sdraw" + static constexpr OUString preloadComponents[] = { + u"private:factory/swriter"_ustr, + u"private:factory/scalc"_ustr, + u"private:factory/simpress"_ustr, + u"private:factory/sdraw"_ustr }; // getting the remote LibreOffice service manager - uno::Reference<frame::XDesktop2> xCompLoader(frame::Desktop::create(xContext), uno::UNO_QUERY); + uno::Reference<frame::XDesktop2> xCompLoader(frame::Desktop::create(xContext)); // Preload and close each of the main components once to initialize global state uno::Sequence<css::beans::PropertyValue> szEmptyArgs(0); - for (auto component : preloadComponents) + for (const auto& component : preloadComponents) { auto xComp = xCompLoader->loadComponentFromURL(component, "_blank", 0, szEmptyArgs); xComp->dispose(); diff --git a/sc/source/ui/view/gridwin4.cxx b/sc/source/ui/view/gridwin4.cxx index 1d747f709e50..4a9e92668b7e 100644 --- a/sc/source/ui/view/gridwin4.cxx +++ b/sc/source/ui/view/gridwin4.cxx @@ -1153,8 +1153,8 @@ void ScGridWindow::DrawContent(OutputDevice &rDevice, const ScTableInfo& rTableI // keep into account the zoom factor static const double twipFactor = 15 * 1.76388889; // 26.45833335 - Point aNewOrigin = Point((aOriginAbsPx.getX() * twipFactor) / static_cast<double>(aDrawMode.GetScaleX()), - (aOriginAbsPx.getY() * twipFactor) / static_cast<double>(aDrawMode.GetScaleY())); + Point aNewOrigin((aOriginAbsPx.getX() * twipFactor) / static_cast<double>(aDrawMode.GetScaleX()), + (aOriginAbsPx.getY() * twipFactor) / static_cast<double>(aDrawMode.GetScaleY())); MapMode aNewMM = rDevice.GetMapMode(); aNewMM.SetOrigin(aNewOrigin); diff --git a/sc/source/ui/view/viewfunc.cxx b/sc/source/ui/view/viewfunc.cxx index 5d5d07b215c6..94cbb305c64e 100644 --- a/sc/source/ui/view/viewfunc.cxx +++ b/sc/source/ui/view/viewfunc.cxx @@ -134,6 +134,8 @@ ScViewFunc::~ScViewFunc() { } +namespace { + struct FormulaProcessingContext { std::shared_ptr<ScAddress> aPos; @@ -174,8 +176,6 @@ struct FormulaProcessingContext } }; -namespace { - void collectUIInformation(std::map<OUString, OUString>&& aParameters, const OUString& rAction) { EventDescription aDescription; @@ -442,7 +442,7 @@ namespace { void runAutoCorrectQueryAsync(std::shared_ptr<FormulaProcessingContext> context); - void performAutoFormatAndUpdate(const OUString& rString, const ScMarkData& rMark, SCCOL nCol, + void performAutoFormatAndUpdate(std::u16string_view rString, const ScMarkData& rMark, SCCOL nCol, SCROW nRow, SCTAB nTab, bool bNumFmtChanged, bool bRecord, const std::shared_ptr<ScDocShellModificator>& pModificator, ScViewFunc& rViewFunc) @@ -456,7 +456,7 @@ namespace ScDocShell* pDocSh = rViewData.GetDocShell(); pDocSh->UpdateOle(rViewData); - const OUString aType(rString.isEmpty() ? u"delete-content" : u"cell-change"); + const OUString aType(rString.empty() ? u"delete-content" : u"cell-change"); HelperNotifyChanges::NotifyIfChangesListeners(*pDocSh, rMark, nCol, nRow, aType); if (bRecord) @@ -630,7 +630,7 @@ namespace void runAutoCorrectQueryAsync(std::shared_ptr<FormulaProcessingContext> context) { auto aQueryBox = std::make_shared<AutoCorrectQuery>(context->GetViewData().GetDialogParent(), context->aCorrectedFormula); - aQueryBox->runAsync(aQueryBox, [context] (int nResult) + weld::DialogController::runAsync(aQueryBox, [context] (int nResult) { if (nResult == RET_YES) { context->aFormula = context->aCorrectedFormula;