diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2020-08-27 11:40:59 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2020-08-28 08:07:09 +0200 |
commit | 33ecd0d5c4fff9511a8436513936a3f7044a775a (patch) | |
tree | c25809adda140ff89d9f2a2b6dfadba17e188fb0 /basctl | |
parent | 554834484a3323f73b5aeace246bcd9635368967 (diff) |
Change OUStringLiteral from char[] to char16_t[]
This is a prerequisite for making conversion from OUStringLiteral to OUString
more efficient at least for C++20 (by replacing its internals with a constexpr-
generated sal_uString-compatible layout with a SAL_STRING_STATIC_FLAG refCount,
conditionally for C++20 for now).
For a configure-wise bare-bones build on Linux, size reported by `du -bs
instdir` grew by 118792 bytes from 1155636636 to 1155755428.
In most places just a u"..." string literal prefix had to be added. In some
places
char const a[] = "...";
variables have been changed to char16_t, and a few places required even further
changes to code (which prompted the addition of include/o3tl/string_view.hxx
helper function o3tl::equalsIgnoreAsciiCase and the additional
OUString::createFromAscii overload).
For all uses of macros expanding to string literals, the relevant uses have been
rewritten as
u"" MACRO
instead of changing the macro definitions. It should be possible to change at
least some of those macro definitions (and drop the u"" from their call sites)
in follow-up commits.
Change-Id: Iec4ef1a057d412d22443312d40c6a8a290dc6144
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101483
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'basctl')
-rw-r--r-- | basctl/source/basicide/baside2b.cxx | 2 | ||||
-rw-r--r-- | basctl/source/basicide/basidectrlr.cxx | 2 | ||||
-rw-r--r-- | basctl/source/basicide/bastype2.cxx | 4 | ||||
-rw-r--r-- | basctl/source/basicide/bastype3.cxx | 2 | ||||
-rw-r--r-- | basctl/source/basicide/localizationmgr.cxx | 6 | ||||
-rw-r--r-- | basctl/source/basicide/moduldl2.cxx | 2 |
6 files changed, 9 insertions, 9 deletions
diff --git a/basctl/source/basicide/baside2b.cxx b/basctl/source/basicide/baside2b.cxx index 44ee68bfa38b..f129d0066d49 100644 --- a/basctl/source/basicide/baside2b.cxx +++ b/basctl/source/basicide/baside2b.cxx @@ -1417,7 +1417,7 @@ void BreakPointWindow::ShowMarker(vcl::RenderContext& rRenderContext) Size const aOutSz = GetOutputSize(); long const nLineHeight = GetTextHeight(); - Image aMarker = GetImage(bErrorMarker ? OUStringLiteral(RID_BMP_ERRORMARKER) : OUStringLiteral(RID_BMP_STEPMARKER)); + Image aMarker = GetImage(bErrorMarker ? OUStringLiteral(u"" RID_BMP_ERRORMARKER) : OUStringLiteral(u"" RID_BMP_STEPMARKER)); Size aMarkerSz(aMarker.GetSizePixel()); aMarkerSz = rRenderContext.PixelToLogic(aMarkerSz); diff --git a/basctl/source/basicide/basidectrlr.cxx b/basctl/source/basicide/basidectrlr.cxx index c17a3bf60932..da8334f0a093 100644 --- a/basctl/source/basicide/basidectrlr.cxx +++ b/basctl/source/basicide/basidectrlr.cxx @@ -32,7 +32,7 @@ namespace { int const nPropertyIconId = 1; -OUStringLiteral const sPropertyIconId("IconId"); +OUStringLiteral const sPropertyIconId(u"IconId"); } diff --git a/basctl/source/basicide/bastype2.cxx b/basctl/source/basicide/bastype2.cxx index 32c190203f8c..066a01baf68e 100644 --- a/basctl/source/basicide/bastype2.cxx +++ b/basctl/source/basicide/bastype2.cxx @@ -244,9 +244,9 @@ void SbTreeListBox::ImpCreateLibEntries(const weld::TreeIter& rIter, const Scrip // create tree list box entry OUString sId; if ( ( nMode & BrowseMode::Dialogs ) && !( nMode & BrowseMode::Modules ) ) - sId = bLoaded ? OUStringLiteral(RID_BMP_DLGLIB) : OUStringLiteral(RID_BMP_DLGLIBNOTLOADED); + sId = bLoaded ? OUStringLiteral(u"" RID_BMP_DLGLIB) : OUStringLiteral(u"" RID_BMP_DLGLIBNOTLOADED); else - sId = bLoaded ? OUStringLiteral(RID_BMP_MODLIB) : OUStringLiteral(RID_BMP_MODLIBNOTLOADED); + sId = bLoaded ? OUStringLiteral(u"" RID_BMP_MODLIB) : OUStringLiteral(u"" RID_BMP_MODLIBNOTLOADED); std::unique_ptr<weld::TreeIter> xLibRootEntry(m_xControl->make_iterator(&rIter)); bool bLibRootEntry = FindEntry(aLibName, OBJ_TYPE_LIBRARY, *xLibRootEntry); if (bLibRootEntry) diff --git a/basctl/source/basicide/bastype3.cxx b/basctl/source/basicide/bastype3.cxx index 1d1ee1e660ab..6b2a6b0b9777 100644 --- a/basctl/source/basicide/bastype3.cxx +++ b/basctl/source/basicide/bastype3.cxx @@ -101,7 +101,7 @@ IMPL_LINK(SbTreeListBox, RequestingChildrenHdl, const weld::TreeIter&, rEntry, b // exchange image const bool bDlgMode = (nMode & BrowseMode::Dialogs) && !(nMode & BrowseMode::Modules); - auto const aImage(bDlgMode ? OUStringLiteral(RID_BMP_DLGLIB) : OUStringLiteral(RID_BMP_MODLIB)); + auto const aImage(bDlgMode ? OUStringLiteral(u"" RID_BMP_DLGLIB) : OUStringLiteral(u"" RID_BMP_MODLIB)); SetEntryBitmaps(rEntry, aImage); } else diff --git a/basctl/source/basicide/localizationmgr.cxx b/basctl/source/basicide/localizationmgr.cxx index 4c38dba9e8c8..f7783efb6b1d 100644 --- a/basctl/source/basicide/localizationmgr.cxx +++ b/basctl/source/basicide/localizationmgr.cxx @@ -47,9 +47,9 @@ using namespace ::com::sun::star::resource; namespace { -OUStringLiteral const aDot("."); -OUStringLiteral const aEsc("&"); -OUStringLiteral const aSemi(";"); +OUStringLiteral const aDot(u"."); +OUStringLiteral const aEsc(u"&"); +OUStringLiteral const aSemi(u";"); } // namespace diff --git a/basctl/source/basicide/moduldl2.cxx b/basctl/source/basicide/moduldl2.cxx index 3df0a6a3cf0f..b0d6d655c7aa 100644 --- a/basctl/source/basicide/moduldl2.cxx +++ b/basctl/source/basicide/moduldl2.cxx @@ -1349,7 +1349,7 @@ void createLibImpl(weld::Window* pWin, const ScriptDocument& rDocument, BrowseMode nMode = pBasicBox->GetMode(); bool bDlgMode = ( nMode & BrowseMode::Dialogs ) && !( nMode & BrowseMode::Modules ); - const auto sId = bDlgMode ? OUStringLiteral(RID_BMP_DLGLIB) : OUStringLiteral(RID_BMP_MODLIB); + const auto sId = bDlgMode ? OUStringLiteral(u"" RID_BMP_DLGLIB) : OUStringLiteral(u"" RID_BMP_MODLIB); pBasicBox->AddEntry(aLibName, sId, xRootEntry.get(), false, std::make_unique<Entry>(OBJ_TYPE_LIBRARY)); pBasicBox->AddEntry(aModName, RID_BMP_MODULE, xRootEntry.get(), false, std::make_unique<Entry>(OBJ_TYPE_MODULE)); pBasicBox->set_cursor(*xRootEntry); |