summaryrefslogtreecommitdiff
path: root/sw/source/ui/dbui
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2021-09-30 13:54:26 +0200
committerStephan Bergmann <sbergman@redhat.com>2021-10-03 19:50:44 +0200
commitad1557f5d775739230e0e2252c293948977b42a0 (patch)
tree610e2e849d87583888c0c658088044d6dc3966a5 /sw/source/ui/dbui
parent7e7dd7f152bc7457437f541e7ff88d69e9f8e765 (diff)
A more lightweight O[U]StringConcatenation
...compared to a full-blown O[U]String, for temporary objects holding an O[U]StringConcat result that can then be used as a std::[u16]string_view. It's instructive to see how some invocations of operator ==, operator !=, and O[U]StringBuffer::insert with an O[U]StringConcat argument required implicit materialization of an O[U]String temporary, and how that expensive operation has now been made explicit with the explicit O[U]StringConcatenation ctor. (The additional operator == and operator != overloads are necessary because the overloads taking two std::[u16]string_view parameters wouldn't even be found here with ADL. And the OUString-related ones would cause ambiguities in at least sal/qa/rtl/strings/test_oustring_stringliterals.cxx built with RTL_STRING_UNITTEST, so have simply been disabled for that special test-code case.) Change-Id: Id29799fa8da21a09ff9794cbc7cc9b366e6803b8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122890 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'sw/source/ui/dbui')
-rw-r--r--sw/source/ui/dbui/dbinsdlg.cxx2
-rw-r--r--sw/source/ui/dbui/mmaddressblockpage.cxx2
2 files changed, 2 insertions, 2 deletions
diff --git a/sw/source/ui/dbui/dbinsdlg.cxx b/sw/source/ui/dbui/dbinsdlg.cxx
index 058571c2cdcd..8a47a783dbb7 100644
--- a/sw/source/ui/dbui/dbinsdlg.cxx
+++ b/sw/source/ui/dbui/dbinsdlg.cxx
@@ -1612,7 +1612,7 @@ void SwInsertDBColAutoPilot::Load()
for(const OUString& rSubName : aSubNames)
{
Sequence <OUString> aSubNodeNames =
- lcl_CreateSubNames(OUString(sSubNodeName + rSubName));
+ lcl_CreateSubNames(OUStringConcatenation(sSubNodeName + rSubName));
Sequence< Any> aSubProps = GetProperties(aSubNodeNames);
const Any* pSubProps = aSubProps.getConstArray();
diff --git a/sw/source/ui/dbui/mmaddressblockpage.cxx b/sw/source/ui/dbui/mmaddressblockpage.cxx
index b596928f8732..efe108b2d5dc 100644
--- a/sw/source/ui/dbui/mmaddressblockpage.cxx
+++ b/sw/source/ui/dbui/mmaddressblockpage.cxx
@@ -632,7 +632,7 @@ bool SwCustomizeAddressBlockDialog::HasItem(sal_Int32 nUserData)
}
}
//search for this entry in the content
- return m_xDragED->GetText().indexOf(OUString("<" + sEntry + ">")) >= 0;
+ return m_xDragED->GetText().indexOf(OUStringConcatenation("<" + sEntry + ">")) >= 0;
}
IMPL_LINK_NOARG(SwCustomizeAddressBlockDialog, SelectionChangedIdleHdl, Timer*, void)