diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2021-10-01 09:09:45 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2021-10-11 14:22:22 +0200 |
commit | 4f5b3e4bd53d6d61df1f65f496f7bc8dc525c8a1 (patch) | |
tree | e0ac44b8f22f944f3303bac8e494da41d6c7b164 /jvmfwk/inc/fwkutil.hxx | |
parent | 5f84c44e3d5ff19b800b6358e61228546e318d4f (diff) |
In O[U]StringBuffer, make string_view params replacements for OUString ones
...for LIBO_INTERNAL_ONLY, instead of having them as additional overloads. That
way, loplugin:bufferadd and loplugin:stringviewparam found many further
opportunities for simplification (all addressed here). Some notes:
* There is no longer an implicit conversion from O[U]String to O[U]StringBuffer
(as that goes via user-defined conversions through string_view now), which was
most noticeable in copy initializations like
OStringBuffer buf = someStr;
that had to be changed to direct initialization,
OStringBuffer buf(someStr);
But then again, it wasn't too many places that were affected and I think we can
live with that.
* I made the O[U]StringBuffer ctors taking string_view non-explicit, mainly to
get them in line with their counterparts taking O[U]String.
* I added an OUStringBuffer::lastIndexOf string_view overload that was missing
(relative to OUStringBuffer::indexOf).
* loplugin:stringconstant needed some addition to keep the
compilerplugins/clang/test/stringconstant.cxx checks related to
OStringBuffer::append and OStringBuffer::insert working.
* loplugin:stringviewparam no longer needs the special O[U]StringBuffer-related
code that had been introduced in 1250aecd71fabde4dba990bfceb61bbe8e06b8ea
"loplugin:stringviewparam extend to new.."
Change-Id: Ib1bb8c4632d99b744e742605a9fef6eae959fd72
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122904
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'jvmfwk/inc/fwkutil.hxx')
-rw-r--r-- | jvmfwk/inc/fwkutil.hxx | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/jvmfwk/inc/fwkutil.hxx b/jvmfwk/inc/fwkutil.hxx index 60ffa9fe89d0..fdef421f664f 100644 --- a/jvmfwk/inc/fwkutil.hxx +++ b/jvmfwk/inc/fwkutil.hxx @@ -25,7 +25,6 @@ #include <sal/log.hxx> #include <rtl/bootstrap.hxx> #include <rtl/instance.hxx> -#include <rtl/ustrbuf.hxx> #include <rtl/byteseq.hxx> namespace osl { class Mutex; } @@ -44,15 +43,13 @@ OUString getLibraryLocation(); struct Bootstrap : public ::rtl::StaticWithInit< const rtl::Bootstrap *, Bootstrap > { const rtl::Bootstrap * operator () () { - OUStringBuffer buf(256); - buf.append(getLibraryLocation()); + OUString sIni = getLibraryLocation() + #ifdef MACOSX - // For some reason the jvmfwk3rc file is traditionally in - // LIBO_URE_ETC_FOLDER - buf.append( "/../" LIBO_URE_ETC_FOLDER ); + // For some reason the jvmfwk3rc file is traditionally in + // LIBO_URE_ETC_FOLDER + "/../" LIBO_URE_ETC_FOLDER #endif - buf.append(SAL_CONFIGFILE("/jvmfwk3")); - OUString sIni = buf.makeStringAndClear(); + SAL_CONFIGFILE("/jvmfwk3"); ::rtl::Bootstrap * bootstrap = new ::rtl::Bootstrap(sIni); SAL_INFO("jfw.level2", "Using configuration file " << sIni); return bootstrap; |