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 /test | |
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 'test')
-rw-r--r-- | test/source/helper/transferable.cxx | 2 | ||||
-rw-r--r-- | test/source/lokcallback.cxx | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/test/source/helper/transferable.cxx b/test/source/helper/transferable.cxx index 201b3c50e442..81b869be3c86 100644 --- a/test/source/helper/transferable.cxx +++ b/test/source/helper/transferable.cxx @@ -34,7 +34,7 @@ OString OOO_DLLPUBLIC_TEST getTextSelection( } datatransfer::DataFlavor aFlavor; - aFlavor.MimeType = OUString::fromUtf8(mimeType.getStr()); + aFlavor.MimeType = OUString::fromUtf8(mimeType); if (mimeType == "text/plain;charset=utf-16") aFlavor.DataType = cppu::UnoType<OUString>::get(); else diff --git a/test/source/lokcallback.cxx b/test/source/lokcallback.cxx index c426d4fd17fd..767448c771ca 100644 --- a/test/source/lokcallback.cxx +++ b/test/source/lokcallback.cxx @@ -160,7 +160,7 @@ void TestLokCallbackWrapper::flushLOKData() { std::optional<OString> payload = viewShell->getLOKPayload(type, m_viewId); if (payload) - libreOfficeKitViewCallback(type, payload->getStr()); + libreOfficeKitViewCallback(type, *payload); } for (const PerViewIdData& data : updatedTypesPerViewId) { @@ -170,7 +170,7 @@ void TestLokCallbackWrapper::flushLOKData() assert(viewShell != nullptr); std::optional<OString> payload = viewShell->getLOKPayload(data.type, data.viewId); if (payload) - libreOfficeKitViewCallbackWithViewId(data.type, payload->getStr(), data.viewId); + libreOfficeKitViewCallbackWithViewId(data.type, *payload, data.viewId); } } |