summaryrefslogtreecommitdiff
path: root/sdext/source
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2020-08-27 11:40:59 +0200
committerStephan Bergmann <sbergman@redhat.com>2020-08-28 08:07:09 +0200
commit33ecd0d5c4fff9511a8436513936a3f7044a775a (patch)
treec25809adda140ff89d9f2a2b6dfadba17e188fb0 /sdext/source
parent554834484a3323f73b5aeace246bcd9635368967 (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 'sdext/source')
-rw-r--r--sdext/source/pdfimport/tree/drawtreevisiting.cxx2
-rw-r--r--sdext/source/pdfimport/tree/writertreevisiting.cxx4
-rw-r--r--sdext/source/presenter/PresenterConfigurationAccess.cxx2
-rw-r--r--sdext/source/presenter/PresenterHelper.cxx12
-rw-r--r--sdext/source/presenter/PresenterNotesView.cxx4
-rw-r--r--sdext/source/presenter/PresenterPaneFactory.cxx14
-rw-r--r--sdext/source/presenter/PresenterViewFactory.cxx12
7 files changed, 25 insertions, 25 deletions
diff --git a/sdext/source/pdfimport/tree/drawtreevisiting.cxx b/sdext/source/pdfimport/tree/drawtreevisiting.cxx
index 61e3905d20ca..305470101cec 100644
--- a/sdext/source/pdfimport/tree/drawtreevisiting.cxx
+++ b/sdext/source/pdfimport/tree/drawtreevisiting.cxx
@@ -1034,7 +1034,7 @@ void DrawXmlFinalizer::visit( PageElement& elem, const std::list< std::unique_pt
aPageLayoutProps[ "fo:margin-right" ] = unitMMString( right_margin );
aPageLayoutProps[ "fo:page-width" ] = unitMMString( page_width );
aPageLayoutProps[ "fo:page-height" ] = unitMMString( page_height );
- aPageLayoutProps[ "style:print-orientation" ]= elem.w < elem.h ? OUStringLiteral("portrait") : OUStringLiteral("landscape");
+ aPageLayoutProps[ "style:print-orientation" ]= elem.w < elem.h ? OUStringLiteral(u"portrait") : OUStringLiteral(u"landscape");
aPageLayoutProps[ "style:writing-mode" ]= "lr-tb";
StyleContainer::Style aStyle( "style:page-layout", aPageProps);
diff --git a/sdext/source/pdfimport/tree/writertreevisiting.cxx b/sdext/source/pdfimport/tree/writertreevisiting.cxx
index f2ffa1c8e6a9..0ef3fe9144e5 100644
--- a/sdext/source/pdfimport/tree/writertreevisiting.cxx
+++ b/sdext/source/pdfimport/tree/writertreevisiting.cxx
@@ -125,7 +125,7 @@ void WriterXmlEmitter::fillFrameProps( DrawElement& rElem,
if (pParaElt)
{
rProps[ "text:anchor-type" ] = rElem.isCharacter
- ? OUStringLiteral("character") : OUStringLiteral("paragraph");
+ ? OUStringLiteral(u"character") : OUStringLiteral(u"paragraph");
}
else
{
@@ -1159,7 +1159,7 @@ void WriterXmlFinalizer::visit( PageElement& elem, const std::list< std::unique_
aPageLayoutProps[ "fo:page-width" ] = unitMMString( page_width );
aPageLayoutProps[ "fo:page-height" ] = unitMMString( page_height );
aPageLayoutProps[ "style:print-orientation" ]
- = elem.w < elem.h ? OUStringLiteral("portrait") : OUStringLiteral("landscape");
+ = elem.w < elem.h ? OUStringLiteral(u"portrait") : OUStringLiteral(u"landscape");
aPageLayoutProps[ "fo:margin-top" ] = unitMMString( top_margin );
aPageLayoutProps[ "fo:margin-bottom" ] = unitMMString( bottom_margin );
aPageLayoutProps[ "fo:margin-left" ] = unitMMString( left_margin );
diff --git a/sdext/source/presenter/PresenterConfigurationAccess.cxx b/sdext/source/presenter/PresenterConfigurationAccess.cxx
index a583429ca96c..81aa31726d0b 100644
--- a/sdext/source/presenter/PresenterConfigurationAccess.cxx
+++ b/sdext/source/presenter/PresenterConfigurationAccess.cxx
@@ -34,7 +34,7 @@ using namespace ::com::sun::star::uno;
namespace sdext::presenter {
const OUStringLiteral PresenterConfigurationAccess::msPresenterScreenRootName =
- "/org.openoffice.Office.PresenterScreen/";
+ u"/org.openoffice.Office.PresenterScreen/";
PresenterConfigurationAccess::PresenterConfigurationAccess (
const Reference<XComponentContext>& rxContext,
diff --git a/sdext/source/presenter/PresenterHelper.cxx b/sdext/source/presenter/PresenterHelper.cxx
index 747e168660de..33c6cda994e8 100644
--- a/sdext/source/presenter/PresenterHelper.cxx
+++ b/sdext/source/presenter/PresenterHelper.cxx
@@ -28,19 +28,19 @@ using namespace ::com::sun::star::presentation;
namespace sdext::presenter {
-const OUStringLiteral PresenterHelper::msPaneURLPrefix( "private:resource/pane/");
+const OUStringLiteral PresenterHelper::msPaneURLPrefix( u"private:resource/pane/");
const OUString PresenterHelper::msCenterPaneURL( msPaneURLPrefix + "CenterPane");
const OUString PresenterHelper::msFullScreenPaneURL( msPaneURLPrefix + "FullScreenPane");
-const OUStringLiteral PresenterHelper::msViewURLPrefix( "private:resource/view/");
+const OUStringLiteral PresenterHelper::msViewURLPrefix( u"private:resource/view/");
const OUString PresenterHelper::msPresenterScreenURL( msViewURLPrefix + "PresenterScreen");
const OUString PresenterHelper::msSlideSorterURL( msViewURLPrefix + "SlideSorter");
-const OUStringLiteral PresenterHelper::msResourceActivationEvent( "ResourceActivation");
-const OUStringLiteral PresenterHelper::msResourceDeactivationEvent( "ResourceDeactivation");
+const OUStringLiteral PresenterHelper::msResourceActivationEvent( u"ResourceActivation");
+const OUStringLiteral PresenterHelper::msResourceDeactivationEvent( u"ResourceDeactivation");
-const OUStringLiteral PresenterHelper::msDefaultPaneStyle ( "DefaultPaneStyle");
-const OUStringLiteral PresenterHelper::msDefaultViewStyle ( "DefaultViewStyle");
+const OUStringLiteral PresenterHelper::msDefaultPaneStyle ( u"DefaultPaneStyle");
+const OUStringLiteral PresenterHelper::msDefaultViewStyle ( u"DefaultViewStyle");
Reference<presentation::XSlideShowController> PresenterHelper::GetSlideShowController (
const Reference<frame::XController>& rxController)
diff --git a/sdext/source/presenter/PresenterNotesView.cxx b/sdext/source/presenter/PresenterNotesView.cxx
index a7006066d6f0..9dfad6d405bc 100644
--- a/sdext/source/presenter/PresenterNotesView.cxx
+++ b/sdext/source/presenter/PresenterNotesView.cxx
@@ -218,9 +218,9 @@ void PresenterNotesView::CreateToolBar (
void PresenterNotesView::SetSlide (const Reference<drawing::XDrawPage>& rxNotesPage)
{
static const OUStringLiteral sNotesShapeName (
- "com.sun.star.presentation.NotesShape");
+ u"com.sun.star.presentation.NotesShape");
static const OUStringLiteral sTextShapeName (
- "com.sun.star.drawing.TextShape");
+ u"com.sun.star.drawing.TextShape");
if (!rxNotesPage.is())
return;
diff --git a/sdext/source/presenter/PresenterPaneFactory.cxx b/sdext/source/presenter/PresenterPaneFactory.cxx
index afb5a2825cae..b1568431febd 100644
--- a/sdext/source/presenter/PresenterPaneFactory.cxx
+++ b/sdext/source/presenter/PresenterPaneFactory.cxx
@@ -34,20 +34,20 @@ using namespace ::com::sun::star::drawing::framework;
namespace sdext::presenter {
const OUStringLiteral PresenterPaneFactory::msCurrentSlidePreviewPaneURL(
- "private:resource/pane/Presenter/Pane1");
+ u"private:resource/pane/Presenter/Pane1");
const OUStringLiteral PresenterPaneFactory::msNextSlidePreviewPaneURL(
- "private:resource/pane/Presenter/Pane2");
+ u"private:resource/pane/Presenter/Pane2");
const OUStringLiteral PresenterPaneFactory::msNotesPaneURL(
- "private:resource/pane/Presenter/Pane3");
+ u"private:resource/pane/Presenter/Pane3");
const OUStringLiteral PresenterPaneFactory::msToolBarPaneURL(
- "private:resource/pane/Presenter/Pane4");
+ u"private:resource/pane/Presenter/Pane4");
const OUStringLiteral PresenterPaneFactory::msSlideSorterPaneURL(
- "private:resource/pane/Presenter/Pane5");
+ u"private:resource/pane/Presenter/Pane5");
const OUStringLiteral PresenterPaneFactory::msHelpPaneURL(
- "private:resource/pane/Presenter/Pane6");
+ u"private:resource/pane/Presenter/Pane6");
const OUStringLiteral PresenterPaneFactory::msOverlayPaneURL(
- "private:resource/pane/Presenter/Overlay");
+ u"private:resource/pane/Presenter/Overlay");
//===== PresenterPaneFactory ==================================================
diff --git a/sdext/source/presenter/PresenterViewFactory.cxx b/sdext/source/presenter/PresenterViewFactory.cxx
index 837e12e64604..0f107fb936b1 100644
--- a/sdext/source/presenter/PresenterViewFactory.cxx
+++ b/sdext/source/presenter/PresenterViewFactory.cxx
@@ -34,17 +34,17 @@ using namespace ::com::sun::star::drawing::framework;
namespace sdext::presenter {
const OUStringLiteral PresenterViewFactory::msCurrentSlidePreviewViewURL(
- "private:resource/view/Presenter/CurrentSlidePreview");
+ u"private:resource/view/Presenter/CurrentSlidePreview");
const OUStringLiteral PresenterViewFactory::msNextSlidePreviewViewURL(
- "private:resource/view/Presenter/NextSlidePreview");
+ u"private:resource/view/Presenter/NextSlidePreview");
const OUStringLiteral PresenterViewFactory::msNotesViewURL(
- "private:resource/view/Presenter/Notes");
+ u"private:resource/view/Presenter/Notes");
const OUStringLiteral PresenterViewFactory::msToolBarViewURL(
- "private:resource/view/Presenter/ToolBar");
+ u"private:resource/view/Presenter/ToolBar");
const OUStringLiteral PresenterViewFactory::msSlideSorterURL(
- "private:resource/view/Presenter/SlideSorter");
+ u"private:resource/view/Presenter/SlideSorter");
const OUStringLiteral PresenterViewFactory::msHelpViewURL(
- "private:resource/view/Presenter/Help");
+ u"private:resource/view/Presenter/Help");
namespace {