diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2023-04-07 10:02:18 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2023-04-09 20:51:44 +0200 |
commit | eaf071397a1ff30536616f2ed76051f77fd38ed6 (patch) | |
tree | ce55cdc75a0826c54b6b60458a028251f11fcb78 /sd/source | |
parent | 1e79befa61a08de7a1ddaccb6c435dbb8015c063 (diff) |
new loplugin:unnecessarygetstr
which prevents constructing unnecessary temporaries via getStr()
Change-Id: I9ca70893a10e954b5ee0e6ad6098660ee24c2bef
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150170
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sd/source')
-rw-r--r-- | sd/source/ui/func/fusel.cxx | 2 | ||||
-rw-r--r-- | sd/source/ui/remotecontrol/Communicator.cxx | 2 | ||||
-rw-r--r-- | sd/source/ui/unoidl/unomodel.cxx | 2 | ||||
-rw-r--r-- | sd/source/ui/view/Outliner.cxx | 14 | ||||
-rw-r--r-- | sd/source/ui/view/drviews1.cxx | 2 |
5 files changed, 11 insertions, 11 deletions
diff --git a/sd/source/ui/func/fusel.cxx b/sd/source/ui/func/fusel.cxx index 0a7bb5e90801..4a897e7df7f2 100644 --- a/sd/source/ui/func/fusel.cxx +++ b/sd/source/ui/func/fusel.cxx @@ -280,7 +280,7 @@ bool FuSelection::MouseButtonDown(const MouseEvent& rMEvt) if (comphelper::LibreOfficeKit::isActive()) { SfxViewShell& rSfxViewShell = mpViewShell->GetViewShellBase(); - rSfxViewShell.libreOfficeKitViewCallback(LOK_CALLBACK_HYPERLINK_CLICKED, aVEvt.mpURLField->GetURL().toUtf8().getStr()); + rSfxViewShell.libreOfficeKitViewCallback(LOK_CALLBACK_HYPERLINK_CLICKED, aVEvt.mpURLField->GetURL().toUtf8()); return true; } diff --git a/sd/source/ui/remotecontrol/Communicator.cxx b/sd/source/ui/remotecontrol/Communicator.cxx index 341051a3aa08..65e40925d8a7 100644 --- a/sd/source/ui/remotecontrol/Communicator.cxx +++ b/sd/source/ui/remotecontrol/Communicator.cxx @@ -78,7 +78,7 @@ void Communicator::execute() OUStringToOString( ::comphelper::DocumentInfo::getDocumentTitle( xFrame->getController()->getModel() ), RTL_TEXTENCODING_UTF8 ) + "\n\n"; - pTransmitter->addMessage( aBuffer.getStr(), Transmitter::PRIORITY_LOW ); + pTransmitter->addMessage( aBuffer, Transmitter::PRIORITY_LOW ); } else { diff --git a/sd/source/ui/unoidl/unomodel.cxx b/sd/source/ui/unoidl/unomodel.cxx index e5a231d4d405..37c650d4a465 100644 --- a/sd/source/ui/unoidl/unomodel.cxx +++ b/sd/source/ui/unoidl/unomodel.cxx @@ -2505,7 +2505,7 @@ void SdXImpressDocument::getPostIts(::tools::JsonWriter& rJsonWriter) { sal_uInt32 nID = sd::getAnnotationId(xAnnotation); OString nodeName = "comment" + OString::number(nID); - auto commentNode = rJsonWriter.startNode(nodeName.getStr()); + auto commentNode = rJsonWriter.startNode(nodeName); rJsonWriter.put("id", nID); rJsonWriter.put("author", xAnnotation->getAuthor()); rJsonWriter.put("dateTime", utl::toISO8601(xAnnotation->getDateTime())); diff --git a/sd/source/ui/view/Outliner.cxx b/sd/source/ui/view/Outliner.cxx index 00e495c8b1d4..9f107d1488cc 100644 --- a/sd/source/ui/view/Outliner.cxx +++ b/sd/source/ui/view/Outliner.cxx @@ -661,7 +661,7 @@ bool SdOutliner::SearchAndReplaceAll() std::stringstream aStream; boost::property_tree::write_json(aStream, aTree); OString aPayload = aStream.str().c_str(); - rSfxViewShell.libreOfficeKitViewCallback(LOK_CALLBACK_SEARCH_RESULT_SELECTION, aPayload.getStr()); + rSfxViewShell.libreOfficeKitViewCallback(LOK_CALLBACK_SEARCH_RESULT_SELECTION, aPayload); } } @@ -672,7 +672,7 @@ bool SdOutliner::SearchAndReplaceAll() // Find-all, tiled rendering and we have at least one match. OString aPayload = OString::number(mnStartPageIndex); SfxViewShell& rSfxViewShell = pViewShell->GetViewShellBase(); - rSfxViewShell.libreOfficeKitViewCallback(LOK_CALLBACK_SET_PART, aPayload.getStr()); + rSfxViewShell.libreOfficeKitViewCallback(LOK_CALLBACK_SET_PART, aPayload); // Emit a selection callback here: // 1) The original one is no longer valid, as we there was a SET_PART in between @@ -685,7 +685,7 @@ bool SdOutliner::SearchAndReplaceAll() aRectangles.push_back(rSelection.m_aRectangles); } OString sRectangles = comphelper::string::join("; ", aRectangles); - rSfxViewShell.libreOfficeKitViewCallback(LOK_CALLBACK_TEXT_SELECTION, sRectangles.getStr()); + rSfxViewShell.libreOfficeKitViewCallback(LOK_CALLBACK_TEXT_SELECTION, sRectangles); } mnStartPageIndex = sal_uInt16(-1); @@ -780,7 +780,7 @@ void SdOutliner::sendLOKSearchResultCallback(const std::shared_ptr<sd::ViewShell // notify LibreOfficeKit about changed page OString aPayload = OString::number(maCurrentPosition.mnPageIndex); SfxViewShell& rSfxViewShell = pViewShell->GetViewShellBase(); - rSfxViewShell.libreOfficeKitViewCallback(LOK_CALLBACK_SET_PART, aPayload.getStr()); + rSfxViewShell.libreOfficeKitViewCallback(LOK_CALLBACK_SET_PART, aPayload); // also about search result selections boost::property_tree::ptree aTree; @@ -797,11 +797,11 @@ void SdOutliner::sendLOKSearchResultCallback(const std::shared_ptr<sd::ViewShell std::stringstream aStream; boost::property_tree::write_json(aStream, aTree); aPayload = aStream.str().c_str(); - rSfxViewShell.libreOfficeKitViewCallback(LOK_CALLBACK_SEARCH_RESULT_SELECTION, aPayload.getStr()); + rSfxViewShell.libreOfficeKitViewCallback(LOK_CALLBACK_SEARCH_RESULT_SELECTION, aPayload); if (rVectorGraphicSearchContext.mbCurrentIsVectorGraphic) { - rSfxViewShell.libreOfficeKitViewCallback(LOK_CALLBACK_TEXT_SELECTION, sRectangles.getStr()); + rSfxViewShell.libreOfficeKitViewCallback(LOK_CALLBACK_TEXT_SELECTION, sRectangles); } } else @@ -1403,7 +1403,7 @@ void SdOutliner::ShowEndOfSearchDialog() if (pViewShell) { SfxViewShell& rSfxViewShell = pViewShell->GetViewShellBase(); - rSfxViewShell.libreOfficeKitViewCallback(LOK_CALLBACK_SEARCH_NOT_FOUND, mpSearchItem->GetSearchString().toUtf8().getStr()); + rSfxViewShell.libreOfficeKitViewCallback(LOK_CALLBACK_SEARCH_NOT_FOUND, mpSearchItem->GetSearchString().toUtf8()); } } diff --git a/sd/source/ui/view/drviews1.cxx b/sd/source/ui/view/drviews1.cxx index c920b315466e..bff9f67872bd 100644 --- a/sd/source/ui/view/drviews1.cxx +++ b/sd/source/ui/view/drviews1.cxx @@ -999,7 +999,7 @@ bool DrawViewShell::SwitchPage(sal_uInt16 nSelectedPage, bool bAllowChangeFocus) // notify LibreOfficeKit about changed page OString aPayload = OString::number(nSelectedPage); if (SfxViewShell* pViewShell = GetViewShell()) - pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_SET_PART, aPayload.getStr()); + pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_SET_PART, aPayload); } rtl::Reference< sd::SlideShow > xSlideshow( SlideShow::GetSlideShow( GetDoc() ) ); |