diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2024-05-15 20:44:33 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2024-05-16 08:49:45 +0200 |
commit | 07b673a1a6fb5edc7d58ed496f4181d59070a2a6 (patch) | |
tree | e255c5a27e2b9752f96c16ba7059d83564f92daf /sdext | |
parent | cb9c3c754c1c13172925974318e853adffda07bc (diff) |
loplugin:ostr in sdext
Change-Id: I0b67b8c8f9dbdf2fdc8192e22b838c15db960cfd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167704
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sdext')
21 files changed, 414 insertions, 414 deletions
diff --git a/sdext/qa/unit/pdfimport.cxx b/sdext/qa/unit/pdfimport.cxx index 462edf2e7772..6351ed999d35 100644 --- a/sdext/qa/unit/pdfimport.cxx +++ b/sdext/qa/unit/pdfimport.cxx @@ -94,7 +94,7 @@ namespace rtl::math::approxEqual(m_aHyperlinkBounds.X2,166.7) ); CPPUNIT_ASSERT_MESSAGE( "Correct hyperlink bounding box", rtl::math::approxEqual(m_aHyperlinkBounds.Y2,406.2) ); - CPPUNIT_ASSERT_EQUAL_MESSAGE( "Correct hyperlink URI", OUString("http://download.openoffice.org/"), m_aURI ); + CPPUNIT_ASSERT_EQUAL_MESSAGE( "Correct hyperlink URI", u"http://download.openoffice.org/"_ustr, m_aURI ); const char* const sText = " \n \nThis is a testtext\nNew paragraph,\nnew line\n" "Hyperlink, this is\n?\nThis is more text\noutline mode\n?\nNew paragraph\n"; @@ -359,9 +359,9 @@ namespace CPPUNIT_ASSERT_EQUAL_MESSAGE( "drawMask received two properties", sal_Int32(3), xBitmap.getLength() ); CPPUNIT_ASSERT_EQUAL_MESSAGE( "drawMask got URL param", - OUString("URL"), xBitmap[0].Name ); + u"URL"_ustr, xBitmap[0].Name ); CPPUNIT_ASSERT_EQUAL_MESSAGE( "drawMask got InputStream param", - OUString("InputStream"), xBitmap[1].Name ); + u"InputStream"_ustr, xBitmap[1].Name ); } virtual void drawImage(const uno::Sequence<beans::PropertyValue>& xBitmap ) override @@ -369,9 +369,9 @@ namespace CPPUNIT_ASSERT_EQUAL_MESSAGE( "drawImage received two properties", sal_Int32(3), xBitmap.getLength() ); CPPUNIT_ASSERT_EQUAL_MESSAGE( "drawImage got URL param", - OUString("URL"), xBitmap[0].Name ); + u"URL"_ustr, xBitmap[0].Name ); CPPUNIT_ASSERT_EQUAL_MESSAGE( "drawImage got InputStream param", - OUString("InputStream"), xBitmap[1].Name ); + u"InputStream"_ustr, xBitmap[1].Name ); m_bImageSeen = true; } @@ -381,9 +381,9 @@ namespace CPPUNIT_ASSERT_EQUAL_MESSAGE( "drawColorMaskedImage received two properties", sal_Int32(3), xBitmap.getLength() ); CPPUNIT_ASSERT_EQUAL_MESSAGE( "drawColorMaskedImage got URL param", - OUString("URL"), xBitmap[0].Name ); + u"URL"_ustr, xBitmap[0].Name ); CPPUNIT_ASSERT_EQUAL_MESSAGE( "drawColorMaskedImage got InputStream param", - OUString("InputStream"), xBitmap[1].Name ); + u"InputStream"_ustr, xBitmap[1].Name ); } virtual void drawMaskedImage(const uno::Sequence<beans::PropertyValue>& xBitmap, @@ -393,16 +393,16 @@ namespace CPPUNIT_ASSERT_EQUAL_MESSAGE( "drawMaskedImage received two properties #1", sal_Int32(3), xBitmap.getLength() ); CPPUNIT_ASSERT_EQUAL_MESSAGE( "drawMaskedImage got URL param #1", - OUString("URL"), xBitmap[0].Name ); + u"URL"_ustr, xBitmap[0].Name ); CPPUNIT_ASSERT_EQUAL_MESSAGE( "drawMaskedImage got InputStream param #1", - OUString("InputStream"), xBitmap[1].Name ); + u"InputStream"_ustr, xBitmap[1].Name ); CPPUNIT_ASSERT_EQUAL_MESSAGE( "drawMaskedImage received two properties #2", sal_Int32(3), xMask.getLength() ); CPPUNIT_ASSERT_EQUAL_MESSAGE( "drawMaskedImage got URL param #2", - OUString("URL"), xMask[0].Name ); + u"URL"_ustr, xMask[0].Name ); CPPUNIT_ASSERT_EQUAL_MESSAGE( "drawMaskedImage got InputStream param #2", - OUString("InputStream"), xMask[1].Name ); + u"InputStream"_ustr, xMask[1].Name ); } virtual void drawAlphaMaskedImage(const uno::Sequence<beans::PropertyValue>& xBitmap, @@ -411,16 +411,16 @@ namespace CPPUNIT_ASSERT_EQUAL_MESSAGE( "drawAlphaMaskedImage received two properties #1", sal_Int32(3), xBitmap.getLength() ); CPPUNIT_ASSERT_EQUAL_MESSAGE( "drawAlphaMaskedImage got URL param #1", - OUString("URL"), xBitmap[0].Name ); + u"URL"_ustr, xBitmap[0].Name ); CPPUNIT_ASSERT_EQUAL_MESSAGE( "drawAlphaMaskedImage got InputStream param #1", - OUString("InputStream"), xBitmap[1].Name ); + u"InputStream"_ustr, xBitmap[1].Name ); CPPUNIT_ASSERT_EQUAL_MESSAGE( "drawAlphaMaskedImage received two properties #2", sal_Int32(3), xMask.getLength() ); CPPUNIT_ASSERT_EQUAL_MESSAGE( "drawAlphaMaskedImage got URL param #2", - OUString("URL"), xMask[0].Name ); + u"URL"_ustr, xMask[0].Name ); CPPUNIT_ASSERT_EQUAL_MESSAGE( "drawAlphaMaskedImage got InputStream param #2", - OUString("InputStream"), xMask[1].Name ); + u"InputStream"_ustr, xMask[1].Name ); } virtual void setTextRenderMode( sal_Int32 ) override @@ -470,7 +470,7 @@ namespace pSink, uno::Reference< task::XInteractionHandler >(), OUString(), - getComponentContext(), "" ) ); + getComponentContext(), u""_ustr ) ); pSink->check(); #endif } @@ -605,7 +605,7 @@ namespace OUStringToOString(styleName, RTL_TEXTENCODING_UTF8) + "\"]/style:text-properties"; // the font-weight and font-style should be normal - assertXPath(pXmlDoc, xpath, "font-weight"_ostr, "normal"); + assertXPath(pXmlDoc, xpath, "font-weight"_ostr, u"normal"_ustr); assertXPathNoAttribute(pXmlDoc, xpath, "font-style"_ostr); /* Test for the 2nd paragraph */ @@ -614,7 +614,7 @@ namespace OUStringToOString(styleName, RTL_TEXTENCODING_UTF8) + "\"]/style:text-properties"; // there should be a font-weight="bold", but no font-style italic - assertXPath(pXmlDoc, xpath, "font-weight"_ostr, "bold"); + assertXPath(pXmlDoc, xpath, "font-weight"_ostr, u"bold"_ustr); assertXPathNoAttribute(pXmlDoc, xpath, "font-style"_ostr); /* Test for the 3rd paragraph */ @@ -623,8 +623,8 @@ namespace OUStringToOString(styleName, RTL_TEXTENCODING_UTF8) + "\"]/style:text-properties"; // there should be a font-style="italic", but no font-weight bold - assertXPath(pXmlDoc, xpath, "font-weight"_ostr, "normal"); - assertXPath(pXmlDoc, xpath, "font-style"_ostr, "italic"); + assertXPath(pXmlDoc, xpath, "font-weight"_ostr, u"normal"_ustr); + assertXPath(pXmlDoc, xpath, "font-style"_ostr, u"italic"_ustr); /* Test for the 4th paragraph */ styleName = getXPath(pXmlDoc, "//draw:frame[4]//text:span[1]"_ostr, "style-name"_ostr); @@ -632,8 +632,8 @@ namespace OUStringToOString(styleName, RTL_TEXTENCODING_UTF8) + "\"]/style:text-properties"; // there should be both font-style="italic" and font-weight="bold" - assertXPath(pXmlDoc, xpath, "font-weight"_ostr, "bold"); - assertXPath(pXmlDoc, xpath, "font-style"_ostr, "italic"); + assertXPath(pXmlDoc, xpath, "font-weight"_ostr, u"bold"_ustr); + assertXPath(pXmlDoc, xpath, "font-style"_ostr, u"italic"_ustr); /* Test for the 5th paragraph */ styleName = getXPath(pXmlDoc, "//draw:frame[5]//text:span[1]"_ostr, "style-name"_ostr); @@ -641,8 +641,8 @@ namespace OUStringToOString(styleName, RTL_TEXTENCODING_UTF8) + "\"]/style:text-properties"; // the font should be Arial and font-weight="bold", no font-style - assertXPath(pXmlDoc, xpath, "font-family"_ostr, "Arial"); - assertXPath(pXmlDoc, xpath, "font-weight"_ostr, "bold"); + assertXPath(pXmlDoc, xpath, "font-family"_ostr, u"Arial"_ustr); + assertXPath(pXmlDoc, xpath, "font-weight"_ostr, u"bold"_ustr); assertXPathNoAttribute(pXmlDoc, xpath, "font-style"_ostr); /* Test for the 6th paragraph */ @@ -651,8 +651,8 @@ namespace OUStringToOString(styleName, RTL_TEXTENCODING_UTF8) + "\"]/style:text-properties"; // the font should be Arial without font-weight and font-style - assertXPath(pXmlDoc, xpath, "font-family"_ostr, "Arial"); - assertXPath(pXmlDoc, xpath, "font-weight"_ostr, "normal"); + assertXPath(pXmlDoc, xpath, "font-family"_ostr, u"Arial"_ustr); + assertXPath(pXmlDoc, xpath, "font-weight"_ostr, u"normal"_ustr); assertXPathNoAttribute(pXmlDoc, xpath, "font-style"_ostr); /* Test for the 7th paragraph */ @@ -661,8 +661,8 @@ namespace OUStringToOString(styleName, RTL_TEXTENCODING_UTF8) + "\"]/style:text-properties"; // the font should be SimSun without font-weight and font-style - assertXPath(pXmlDoc, xpath, "font-family"_ostr, "SimSun"); // TODO: tdf#143095 use localized font name rather than PS name - assertXPath(pXmlDoc, xpath, "font-weight"_ostr, "normal"); + assertXPath(pXmlDoc, xpath, "font-family"_ostr, u"SimSun"_ustr); // TODO: tdf#143095 use localized font name rather than PS name + assertXPath(pXmlDoc, xpath, "font-weight"_ostr, u"normal"_ustr); assertXPathNoAttribute(pXmlDoc, xpath, "font-style"_ostr); /* Test for the 8th paragraph */ @@ -671,8 +671,8 @@ namespace OUStringToOString(styleName, RTL_TEXTENCODING_UTF8) + "\"]/style:text-properties"; // the font should be SimSun and font-weight="bold", no font-style italic - assertXPath(pXmlDoc, xpath, "font-family"_ostr, "SimSun"); - assertXPath(pXmlDoc, xpath, "font-weight"_ostr, "bold"); + assertXPath(pXmlDoc, xpath, "font-family"_ostr, u"SimSun"_ustr); + assertXPath(pXmlDoc, xpath, "font-weight"_ostr, u"bold"_ustr); assertXPathNoAttribute(pXmlDoc, xpath, "font-style"_ostr); /* Test for the 9th paragraph */ @@ -681,8 +681,8 @@ namespace OUStringToOString(styleName, RTL_TEXTENCODING_UTF8) + "\"]/style:text-properties"; // the font should be SimSun, font-weight should be "normal", font-style="italic" - assertXPath(pXmlDoc, xpath, "font-family"_ostr, "SimSun"); - assertXPath(pXmlDoc, xpath, "font-weight"_ostr, "normal"); + assertXPath(pXmlDoc, xpath, "font-family"_ostr, u"SimSun"_ustr); + assertXPath(pXmlDoc, xpath, "font-weight"_ostr, u"normal"_ustr); // FIXME and remove the below comment: // the chinese chars are shown in pdf as faux italic (fake italic). It is currencly imported wrongly as normal font style. // See tdf#78427 for how the faux bold problem was handled. Faux italic may be handled using the transformation pattern. @@ -694,8 +694,8 @@ namespace OUStringToOString(styleName, RTL_TEXTENCODING_UTF8) + "\"]/style:text-properties"; // the font should be SimSun font-weight="bold" and font-style="italic" - assertXPath(pXmlDoc, xpath, "font-family"_ostr, "SimSun"); - assertXPath(pXmlDoc, xpath, "font-weight"_ostr, "bold"); + assertXPath(pXmlDoc, xpath, "font-family"_ostr, u"SimSun"_ustr); + assertXPath(pXmlDoc, xpath, "font-weight"_ostr, u"bold"_ustr); // FIXME: faux italic, see above // assertXPath(pXmlDoc, xpath, "font-style", "italic"); @@ -706,10 +706,10 @@ namespace "\"]/style:text-properties"; // the font should be SimSun and there should be style:text-outline="true" // (i.e., the real "outline" font rather than faux bold / fake bold) - assertXPath(pXmlDoc, xpath, "font-family"_ostr, "SimSun"); - assertXPath(pXmlDoc, xpath, "font-weight"_ostr, "normal"); + assertXPath(pXmlDoc, xpath, "font-family"_ostr, u"SimSun"_ustr); + assertXPath(pXmlDoc, xpath, "font-weight"_ostr, u"normal"_ustr); assertXPathNoAttribute(pXmlDoc, xpath, "font-style"_ostr); - assertXPath(pXmlDoc, xpath, "text-outline"_ostr, "true"); + assertXPath(pXmlDoc, xpath, "text-outline"_ostr, u"true"_ustr); #endif } @@ -736,7 +736,7 @@ namespace OUStringToOString(styleName, RTL_TEXTENCODING_UTF8) + "\"]/style:text-properties"; // the font-weight and font-style should be 600 (Semibold) - assertXPath(pXmlDoc, xpath, "font-weight"_ostr, "600"); + assertXPath(pXmlDoc, xpath, "font-weight"_ostr, u"600"_ustr); // The for the 2nd frame */ styleName = getXPath(pXmlDoc, "//draw:frame[2]//text:span[1]"_ostr, "style-name"_ostr); @@ -744,7 +744,7 @@ namespace OUStringToOString(styleName, RTL_TEXTENCODING_UTF8) + "\"]/style:text-properties"; // the font-weight and font-style should be 300 (Light) - assertXPath(pXmlDoc, xpath, "font-weight"_ostr, "300"); + assertXPath(pXmlDoc, xpath, "font-weight"_ostr, u"300"_ustr); #endif } @@ -768,7 +768,7 @@ namespace OString xpath = "//office:automatic-styles/style:style[@style:name=\"" + OUStringToOString(styleName, RTL_TEXTENCODING_UTF8) + "\"]/style:text-properties"; - CPPUNIT_ASSERT_EQUAL(OUString("TimesNewRoman"), + CPPUNIT_ASSERT_EQUAL(u"TimesNewRoman"_ustr, getXPath(pXmlDoc, xpath, "font-family"_ostr).replaceAll(u" ", u"")); /* Test for the "TOTAL ESTA HOJA USD" paragraph" */ @@ -776,9 +776,9 @@ namespace xpath = "//office:automatic-styles/style:style[@style:name=\"" + OUStringToOString(styleName, RTL_TEXTENCODING_UTF8) + "\"]/style:text-properties"; - CPPUNIT_ASSERT_EQUAL(OUString("TimesNewRoman"), + CPPUNIT_ASSERT_EQUAL(u"TimesNewRoman"_ustr, getXPath(pXmlDoc, xpath, "font-family"_ostr).replaceAll(u" ", u"")); - CPPUNIT_ASSERT_EQUAL(OUString("bold"), + CPPUNIT_ASSERT_EQUAL(u"bold"_ustr, getXPath(pXmlDoc, xpath, "font-weight"_ostr)); #endif } @@ -860,24 +860,24 @@ namespace // thus the 10th text:s should exist and the attribute "text:c" should be "1". OString xpath = "//draw:frame[@draw:z-index='1'][1]/draw:text-box/text:p/text:span/text:s[10]"_ostr; OUString sContent = getXPath(pXmlDoc, xpath, "c"_ostr); - CPPUNIT_ASSERT_EQUAL_MESSAGE(aOutput.getStr(), OUString("1"), sContent); + CPPUNIT_ASSERT_EQUAL_MESSAGE(aOutput.getStr(), u"1"_ustr, sContent); // Tab test: there are 10 tabs. Text before and after the tabs are shown in different draw frames. // With the Liberation Serif font, the horizontal position of the first frame is 20.03mm and the // second frame is 94.12mm. xpath = "//draw:frame[@draw:z-index='2'][1]"_ostr; sContent = getXPath(pXmlDoc, xpath, "transform"_ostr); - CPPUNIT_ASSERT_EQUAL_MESSAGE(aOutput.getStr(), OUString("translate( 20.03mm 25.05mm )"), sContent); + CPPUNIT_ASSERT_EQUAL_MESSAGE(aOutput.getStr(), u"translate( 20.03mm 25.05mm )"_ustr, sContent); xpath = "//draw:frame[@draw:z-index='3'][1]"_ostr; sContent = getXPath(pXmlDoc, xpath, "transform"_ostr); - CPPUNIT_ASSERT_EQUAL_MESSAGE(aOutput.getStr(), OUString("translate( 94.12mm 25.05mm )"), sContent); + CPPUNIT_ASSERT_EQUAL_MESSAGE(aOutput.getStr(), u"translate( 94.12mm 25.05mm )"_ustr, sContent); // Non-breaking space test: there are 10 NBSpaces, which are treated as the same as normal space in PDF, // thus each is expressed as a <text:s text:c="1" ...>. // The 10th text:s should exist and the attribute "text:c" should be "1". xpath = "//draw:frame[@draw:z-index='4'][1]/draw:text-box/text:p/text:span/text:s[10]"_ostr; sContent = getXPath(pXmlDoc, xpath, "c"_ostr); - CPPUNIT_ASSERT_EQUAL_MESSAGE(aOutput.getStr(), OUString("1"), sContent); + CPPUNIT_ASSERT_EQUAL_MESSAGE(aOutput.getStr(), u"1"_ustr, sContent); #endif } diff --git a/sdext/source/minimizer/configurationaccess.cxx b/sdext/source/minimizer/configurationaccess.cxx index 55e60c52ca96..de2a582a93eb 100644 --- a/sdext/source/minimizer/configurationaccess.cxx +++ b/sdext/source/minimizer/configurationaccess.cxx @@ -37,7 +37,7 @@ using namespace ::com::sun::star::container; static OUString GetPathToConfigurationRoot() { - return "org.openoffice.Office.PresentationMinimizer"; + return u"org.openoffice.Office.PresentationMinimizer"_ustr; } void OptimizerSettings::LoadSettingsFromConfiguration( const Reference< XNameAccess >& rSettings ) @@ -83,21 +83,21 @@ void OptimizerSettings::SaveSettingsToConfiguration( const Reference< XNameRepla return; OUString pNames[] = { - OUString("Name"), - OUString("JPEGCompression"), - OUString("JPEGQuality"), - OUString("RemoveCropArea"), - OUString("ImageResolution"), - OUString("EmbedLinkedGraphics"), - OUString("OLEOptimization"), - OUString("OLEOptimizationType"), - OUString("DeleteUnusedMasterPages"), - OUString("DeleteHiddenSlides"), - OUString("DeleteNotesPages"), - OUString("SaveAs"), + u"Name"_ustr, + u"JPEGCompression"_ustr, + u"JPEGQuality"_ustr, + u"RemoveCropArea"_ustr, + u"ImageResolution"_ustr, + u"EmbedLinkedGraphics"_ustr, + u"OLEOptimization"_ustr, + u"OLEOptimizationType"_ustr, + u"DeleteUnusedMasterPages"_ustr, + u"DeleteHiddenSlides"_ustr, + u"DeleteNotesPages"_ustr, + u"SaveAs"_ustr, // OUString("SaveAsURL"), // OUString("FilterName"), - OUString("OpenNewDocument") }; + u"OpenNewDocument"_ustr }; Any pValues[] = { Any( maName ), @@ -170,7 +170,7 @@ void ConfigurationAccess::LoadStrings() Reference< XInterface > xRoot( OpenConfiguration( true ) ); if ( !xRoot.is() ) break; - Reference< container::XNameAccess > xSet( GetConfigurationNode( xRoot, "Strings" ), UNO_QUERY ); + Reference< container::XNameAccess > xSet( GetConfigurationNode( xRoot, u"Strings"_ustr ), UNO_QUERY ); if ( xSet.is() ) { const Sequence< OUString > aElements( xSet->getElementNames() ); @@ -204,13 +204,13 @@ void ConfigurationAccess::LoadConfiguration() Reference< XInterface > xRoot( OpenConfiguration( true ) ); if ( !xRoot.is() ) break; - Reference< container::XNameAccess > xSet( GetConfigurationNode( xRoot, "LastUsedSettings" ), UNO_QUERY ); + Reference< container::XNameAccess > xSet( GetConfigurationNode( xRoot, u"LastUsedSettings"_ustr ), UNO_QUERY ); if ( xSet.is() ) { OptimizerSettings& rCurrent( maSettings.front() ); rCurrent.LoadSettingsFromConfiguration( xSet ); } - xSet.set( GetConfigurationNode( xRoot, "Settings/Templates" ), UNO_QUERY ); + xSet.set( GetConfigurationNode( xRoot, u"Settings/Templates"_ustr ), UNO_QUERY ); if ( xSet.is() ) { const Sequence< OUString > aElements( xSet->getElementNames() ); @@ -248,12 +248,12 @@ void ConfigurationAccess::SaveConfiguration() Reference<util::XChangesBatch> xRoot( OpenConfiguration( false ), UNO_QUERY_THROW ); // storing the last used settings - Reference< container::XNameReplace > xSet( GetConfigurationNode( xRoot, "LastUsedSettings" ), UNO_QUERY_THROW ); + Reference< container::XNameReplace > xSet( GetConfigurationNode( xRoot, u"LastUsedSettings"_ustr ), UNO_QUERY_THROW ); OptimizerSettings& rCurrent( maSettings.front() ); rCurrent.SaveSettingsToConfiguration( xSet ); // updating template elements - xSet.set( GetConfigurationNode( xRoot, "Settings/Templates" ), UNO_QUERY_THROW ); + xSet.set( GetConfigurationNode( xRoot, u"Settings/Templates"_ustr ), UNO_QUERY_THROW ); Reference< container::XNameContainer > xNameContainer( xSet, UNO_QUERY_THROW ); const Sequence< OUString > aElements( xSet->getElementNames() ); @@ -428,21 +428,21 @@ Sequence< PropertyValue > ConfigurationAccess::GetConfigurationSequence() { OptimizerSettings& rSettings( maSettings.front() ); Sequence< PropertyValue > aRet{ - comphelper::makePropertyValue("JPEGCompression", rSettings.mbJPEGCompression), - comphelper::makePropertyValue("JPEGQuality", rSettings.mnJPEGQuality), - comphelper::makePropertyValue("RemoveCropArea", rSettings.mbRemoveCropArea), - comphelper::makePropertyValue("ImageResolution", rSettings.mnImageResolution), - comphelper::makePropertyValue("EmbedLinkedGraphics", rSettings.mbEmbedLinkedGraphics), - comphelper::makePropertyValue("OLEOptimization", rSettings.mbOLEOptimization), - comphelper::makePropertyValue("OLEOptimizationType", rSettings.mnOLEOptimizationType), - comphelper::makePropertyValue("DeleteUnusedMasterPages", rSettings.mbDeleteUnusedMasterPages), - comphelper::makePropertyValue("DeleteHiddenSlides", rSettings.mbDeleteHiddenSlides), - comphelper::makePropertyValue("DeleteNotesPages", rSettings.mbDeleteNotesPages), - comphelper::makePropertyValue("CustomShowName", rSettings.maCustomShowName), - comphelper::makePropertyValue("SaveAsURL", rSettings.maSaveAsURL), - comphelper::makePropertyValue("FilterName", rSettings.maFilterName), - comphelper::makePropertyValue("OpenNewDocument", rSettings.mbOpenNewDocument), - comphelper::makePropertyValue("EstimatedFileSize", rSettings.mnEstimatedFileSize) + comphelper::makePropertyValue(u"JPEGCompression"_ustr, rSettings.mbJPEGCompression), + comphelper::makePropertyValue(u"JPEGQuality"_ustr, rSettings.mnJPEGQuality), + comphelper::makePropertyValue(u"RemoveCropArea"_ustr, rSettings.mbRemoveCropArea), + comphelper::makePropertyValue(u"ImageResolution"_ustr, rSettings.mnImageResolution), + comphelper::makePropertyValue(u"EmbedLinkedGraphics"_ustr, rSettings.mbEmbedLinkedGraphics), + comphelper::makePropertyValue(u"OLEOptimization"_ustr, rSettings.mbOLEOptimization), + comphelper::makePropertyValue(u"OLEOptimizationType"_ustr, rSettings.mnOLEOptimizationType), + comphelper::makePropertyValue(u"DeleteUnusedMasterPages"_ustr, rSettings.mbDeleteUnusedMasterPages), + comphelper::makePropertyValue(u"DeleteHiddenSlides"_ustr, rSettings.mbDeleteHiddenSlides), + comphelper::makePropertyValue(u"DeleteNotesPages"_ustr, rSettings.mbDeleteNotesPages), + comphelper::makePropertyValue(u"CustomShowName"_ustr, rSettings.maCustomShowName), + comphelper::makePropertyValue(u"SaveAsURL"_ustr, rSettings.maSaveAsURL), + comphelper::makePropertyValue(u"FilterName"_ustr, rSettings.maFilterName), + comphelper::makePropertyValue(u"OpenNewDocument"_ustr, rSettings.mbOpenNewDocument), + comphelper::makePropertyValue(u"EstimatedFileSize"_ustr, rSettings.mnEstimatedFileSize) }; return aRet; } diff --git a/sdext/source/minimizer/fileopendialog.cxx b/sdext/source/minimizer/fileopendialog.cxx index 7ae877b13549..3f14b14c2e44 100644 --- a/sdext/source/minimizer/fileopendialog.cxx +++ b/sdext/source/minimizer/fileopendialog.cxx @@ -55,7 +55,7 @@ FileOpenDialog::FileOpenDialog( const Reference< XComponentContext >& rxContext // collecting a list of impress filters Reference< XNameAccess > xFilters( rxContext->getServiceManager()->createInstanceWithContext( - "com.sun.star.document.FilterFactory", rxContext ), UNO_QUERY_THROW ); + u"com.sun.star.document.FilterFactory"_ustr, rxContext ), UNO_QUERY_THROW ); const Sequence< OUString > aFilterList( xFilters->getElementNames() ); for ( const auto& rFilter : aFilterList ) { @@ -103,7 +103,7 @@ FileOpenDialog::FileOpenDialog( const Reference< XComponentContext >& rxContext } Reference< XNameAccess > xTypes( rxContext->getServiceManager()->createInstanceWithContext( - "com.sun.star.document.TypeDetection", rxContext ), UNO_QUERY_THROW ); + u"com.sun.star.document.TypeDetection"_ustr, rxContext ), UNO_QUERY_THROW ); for (auto& rFilterEntry : aFilterEntryList) { diff --git a/sdext/source/minimizer/graphiccollector.cxx b/sdext/source/minimizer/graphiccollector.cxx index c307b04b09a1..ec7171a89ecf 100644 --- a/sdext/source/minimizer/graphiccollector.cxx +++ b/sdext/source/minimizer/graphiccollector.cxx @@ -84,7 +84,7 @@ static void ImpAddGraphicEntity( const Reference< XComponentContext >& rxMSF, Re { Reference< XGraphic > xGraphic; Reference< XPropertySet > xShapePropertySet( rxShape, UNO_QUERY_THROW ); - if ( !(xShapePropertySet->getPropertyValue( "Graphic" ) >>= xGraphic) ) + if ( !(xShapePropertySet->getPropertyValue( u"Graphic"_ustr ) >>= xGraphic) ) return; text::GraphicCrop aGraphicCropLogic( 0, 0, 0, 0 ); @@ -93,7 +93,7 @@ static void ImpAddGraphicEntity( const Reference< XComponentContext >& rxMSF, Re aUser.mxShape = rxShape; aUser.mbFillBitmap = false; aUser.mxGraphic = xGraphic; - xShapePropertySet->getPropertyValue( "GraphicCrop" ) >>= aGraphicCropLogic; + xShapePropertySet->getPropertyValue( u"GraphicCrop"_ustr ) >>= aGraphicCropLogic; awt::Size aLogicalSize( rxShape->getSize() ); // calculating the logical size, as if there were no cropping @@ -123,30 +123,30 @@ static void ImpAddFillBitmapEntity( const Reference< XComponentContext >& rxMSF, try { FillStyle eFillStyle; - if ( rxPropertySet->getPropertyValue( "FillStyle" ) >>= eFillStyle ) + if ( rxPropertySet->getPropertyValue( u"FillStyle"_ustr ) >>= eFillStyle ) { if ( eFillStyle == FillStyle_BITMAP ) { Reference< XBitmap > xFillBitmap; - if ( rxPropertySet->getPropertyValue( "FillBitmap" ) >>= xFillBitmap ) + if ( rxPropertySet->getPropertyValue( u"FillBitmap"_ustr ) >>= xFillBitmap ) { Reference< XGraphic > xGraphic( xFillBitmap, UNO_QUERY_THROW ); awt::Size aLogicalSize( rLogicalSize ); Reference< XPropertySetInfo > axPropSetInfo( rxPropertySet->getPropertySetInfo() ); if ( axPropSetInfo.is() ) { - if ( axPropSetInfo->hasPropertyByName( "FillBitmapMode" ) ) + if ( axPropSetInfo->hasPropertyByName( u"FillBitmapMode"_ustr ) ) { BitmapMode eBitmapMode; - if ( rxPropertySet->getPropertyValue( "FillBitmapMode" ) >>= eBitmapMode ) + if ( rxPropertySet->getPropertyValue( u"FillBitmapMode"_ustr ) >>= eBitmapMode ) { if ( ( eBitmapMode == BitmapMode_REPEAT ) || ( eBitmapMode == BitmapMode_NO_REPEAT ) ) { bool bLogicalSize = false; awt::Size aSize( 0, 0 ); - if ( ( rxPropertySet->getPropertyValue( "FillBitmapLogicalSize" ) >>= bLogicalSize ) - && ( rxPropertySet->getPropertyValue( "FillBitmapSizeX" ) >>= aSize.Width ) - && ( rxPropertySet->getPropertyValue( "FillBitmapSizeY" ) >>= aSize.Height ) ) + if ( ( rxPropertySet->getPropertyValue( u"FillBitmapLogicalSize"_ustr ) >>= bLogicalSize ) + && ( rxPropertySet->getPropertyValue( u"FillBitmapSizeX"_ustr ) >>= aSize.Width ) + && ( rxPropertySet->getPropertyValue( u"FillBitmapSizeY"_ustr ) >>= aSize.Height ) ) { if ( bLogicalSize ) { @@ -191,11 +191,11 @@ static void ImpCollectBackgroundGraphic( const Reference< XComponentContext >& r { awt::Size aLogicalSize( 28000, 21000 ); Reference< XPropertySet > xPropertySet( rxDrawPage, UNO_QUERY_THROW ); - xPropertySet->getPropertyValue( "Width" ) >>= aLogicalSize.Width; - xPropertySet->getPropertyValue( "Height" ) >>= aLogicalSize.Height; + xPropertySet->getPropertyValue( u"Width"_ustr ) >>= aLogicalSize.Width; + xPropertySet->getPropertyValue( u"Height"_ustr ) >>= aLogicalSize.Height; Reference< XPropertySet > xBackgroundPropSet; - if ( xPropertySet->getPropertyValue( "Background" ) >>= xBackgroundPropSet ) + if ( xPropertySet->getPropertyValue( u"Background"_ustr ) >>= xBackgroundPropSet ) ImpAddFillBitmapEntity( rxMSF, xBackgroundPropSet, aLogicalSize, rGraphicEntities, rGraphicSettings, xPropertySet ); } catch( Exception& ) @@ -238,12 +238,12 @@ awt::Size GraphicCollector::GetOriginalSize( const Reference< XComponentContext { awt::Size aSize100thMM( 0, 0 ); Reference< XPropertySet > xGraphicPropertySet( rxGraphic, UNO_QUERY_THROW ); - if ( xGraphicPropertySet->getPropertyValue( "Size100thMM" ) >>= aSize100thMM ) + if ( xGraphicPropertySet->getPropertyValue( u"Size100thMM"_ustr ) >>= aSize100thMM ) { if ( !aSize100thMM.Width && !aSize100thMM.Height ) { // MAPMODE_PIXEL USED :-( awt::Size aSourceSizePixel( 0, 0 ); - if ( xGraphicPropertySet->getPropertyValue( "SizePixel" ) >>= aSourceSizePixel ) + if ( xGraphicPropertySet->getPropertyValue( u"SizePixel"_ustr ) >>= aSourceSizePixel ) { const DeviceInfo& rDeviceInfo( GraphicCollector::GetDeviceInfo( rxMSF ) ); if ( rDeviceInfo.PixelPerMeterX && rDeviceInfo.PixelPerMeterY ) @@ -345,7 +345,7 @@ static void ImpCountGraphicObjects( const Reference< XComponentContext >& rxMSF, // now check for a fillstyle Reference< XPropertySet > xShapePropertySet( xShape, UNO_QUERY_THROW ); FillStyle eFillStyle; - if ( xShapePropertySet->getPropertyValue( "FillStyle" ) >>= eFillStyle ) + if ( xShapePropertySet->getPropertyValue( u"FillStyle"_ustr ) >>= eFillStyle ) { if ( eFillStyle == FillStyle_BITMAP ) { @@ -366,14 +366,14 @@ static void ImpCountBackgroundGraphic( { awt::Size aLogicalSize( 28000, 21000 ); Reference< XPropertySet > xPropertySet( rxDrawPage, UNO_QUERY_THROW ); - xPropertySet->getPropertyValue( "Width" ) >>= aLogicalSize.Width; - xPropertySet->getPropertyValue( "Height" ) >>= aLogicalSize.Height; + xPropertySet->getPropertyValue( u"Width"_ustr ) >>= aLogicalSize.Width; + xPropertySet->getPropertyValue( u"Height"_ustr ) >>= aLogicalSize.Height; Reference< XPropertySet > xBackgroundPropSet; - if ( xPropertySet->getPropertyValue( "Background" ) >>= xBackgroundPropSet ) + if ( xPropertySet->getPropertyValue( u"Background"_ustr ) >>= xBackgroundPropSet ) { FillStyle eFillStyle; - if ( xBackgroundPropSet->getPropertyValue( "FillStyle" ) >>= eFillStyle ) + if ( xBackgroundPropSet->getPropertyValue( u"FillStyle"_ustr ) >>= eFillStyle ) { if ( eFillStyle == FillStyle_BITMAP ) { diff --git a/sdext/source/minimizer/impoptimizer.cxx b/sdext/source/minimizer/impoptimizer.cxx index abf54e296a77..aba148cc6f39 100644 --- a/sdext/source/minimizer/impoptimizer.cxx +++ b/sdext/source/minimizer/impoptimizer.cxx @@ -110,7 +110,7 @@ static void ImpDeleteHiddenSlides( const Reference< XModel >& rxModel ) Reference< XPropertySet > xPropSet( xDrawPage, UNO_QUERY_THROW ); bool bVisible = true; - if ( xPropSet->getPropertyValue( "Visible" ) >>= bVisible ) + if ( xPropSet->getPropertyValue( u"Visible"_ustr ) >>= bVisible ) { if (!bVisible ) { @@ -140,7 +140,7 @@ static void ImpDeleteNotesPages( const Reference< XModel >& rxModel ) while( xShapes->getCount() ) xShapes->remove( Reference< XShape >( xShapes->getByIndex( xShapes->getCount() - 1 ), UNO_QUERY_THROW ) ); - xPropSet->setPropertyValue( "Layout", Any( sal_Int16(21) ) ); + xPropSet->setPropertyValue( u"Layout"_ustr, Any( sal_Int16(21) ) ); } } catch( Exception& ) @@ -168,23 +168,23 @@ static void ImpConvertOLE( const Reference< XModel >& rxModel, sal_Int32 nOLEOpt if ( nOLEOptimizationType == 1 ) { bool bIsInternal = true; - xPropSet->getPropertyValue( "IsInternal" ) >>= bIsInternal; + xPropSet->getPropertyValue( u"IsInternal"_ustr ) >>= bIsInternal; bConvertOLE = !bIsInternal; } if ( bConvertOLE ) { Reference< XGraphic > xGraphic; - if ( xPropSet->getPropertyValue( "Graphic" ) >>= xGraphic ) + if ( xPropSet->getPropertyValue( u"Graphic"_ustr ) >>= xGraphic ) { Reference< XMultiServiceFactory > xFact( rxModel, UNO_QUERY_THROW ); - Reference< XShape > xShape2( xFact->createInstance( "com.sun.star.drawing.GraphicObjectShape" ), UNO_QUERY_THROW ); + Reference< XShape > xShape2( xFact->createInstance( u"com.sun.star.drawing.GraphicObjectShape"_ustr ), UNO_QUERY_THROW ); xShapes->add( xShape2 ); xShape2->setPosition( xShape->getPosition() ); xShape2->setSize( xShape->getSize() ); Reference< XPropertySet > xPropSet2( xShape2, UNO_QUERY_THROW ); - xPropSet2->setPropertyValue( "Graphic", Any( xGraphic ) ); + xPropSet2->setPropertyValue( u"Graphic"_ustr, Any( xGraphic ) ); xShapes->remove( xShape ); - xPropSet2->setPropertyValue( "ZOrder", Any( j ) ); + xPropSet2->setPropertyValue( u"ZOrder"_ustr, Any( j ) ); } } } @@ -204,20 +204,20 @@ static void ImpCompressGraphic( Reference< XGraphicProvider > const & rxGraphicP if ( rxGraphicProvider.is() && rxOutputStream.is() ) { Sequence< PropertyValue > aFilterData{ - comphelper::makePropertyValue("ImageResolution", nImageResolution), - comphelper::makePropertyValue("ColorMode", sal_Int32(0)), // todo: jpeg color mode (0->true color, 1->greyscale) - comphelper::makePropertyValue("Quality", nJPEGQuality), // quality that is used if we export to jpeg - comphelper::makePropertyValue("Compression", sal_Int32(6)), // compression that is used if we export to png - comphelper::makePropertyValue("Interlaced", sal_Int32(0)), // interlaced is turned off if we export to png - comphelper::makePropertyValue("LogicalSize", rLogicalSize), - comphelper::makePropertyValue("RemoveCropArea", bRemoveCropping), - comphelper::makePropertyValue("GraphicCropLogic", rGraphicCropLogic) + comphelper::makePropertyValue(u"ImageResolution"_ustr, nImageResolution), + comphelper::makePropertyValue(u"ColorMode"_ustr, sal_Int32(0)), // todo: jpeg color mode (0->true color, 1->greyscale) + comphelper::makePropertyValue(u"Quality"_ustr, nJPEGQuality), // quality that is used if we export to jpeg + comphelper::makePropertyValue(u"Compression"_ustr, sal_Int32(6)), // compression that is used if we export to png + comphelper::makePropertyValue(u"Interlaced"_ustr, sal_Int32(0)), // interlaced is turned off if we export to png + comphelper::makePropertyValue(u"LogicalSize"_ustr, rLogicalSize), + comphelper::makePropertyValue(u"RemoveCropArea"_ustr, bRemoveCropping), + comphelper::makePropertyValue(u"GraphicCropLogic"_ustr, rGraphicCropLogic) }; Sequence< PropertyValue > aArgs{ - comphelper::makePropertyValue("MimeType", rDestMimeType), // the GraphicProvider is using "MimeType", the GraphicExporter "MediaType"... - comphelper::makePropertyValue("OutputStream", rxOutputStream), - comphelper::makePropertyValue("FilterData", aFilterData) + comphelper::makePropertyValue(u"MimeType"_ustr, rDestMimeType), // the GraphicProvider is using "MimeType", the GraphicExporter "MediaType"... + comphelper::makePropertyValue(u"OutputStream"_ustr, rxOutputStream), + comphelper::makePropertyValue(u"FilterData"_ustr, aFilterData) }; rxGraphicProvider->storeGraphic( rxGraphic, aArgs ); @@ -237,7 +237,7 @@ static Reference< XGraphic > ImpCompressGraphic( const Reference< XComponentCont { OUString aSourceMimeType; Reference< XPropertySet > xGraphicPropertySet( xGraphic, UNO_QUERY_THROW ); - if ( xGraphicPropertySet->getPropertyValue( "MimeType" ) >>= aSourceMimeType ) + if ( xGraphicPropertySet->getPropertyValue( u"MimeType"_ustr ) >>= aSourceMimeType ) { sal_Int8 nGraphicType( xGraphic->getType() ); if ( nGraphicType == css::graphic::GraphicType::PIXEL ) @@ -249,10 +249,10 @@ static Reference< XGraphic > ImpCompressGraphic( const Reference< XComponentCont awt::Size aSourceSizePixel( 0, 0 ); text::GraphicCrop aGraphicCropPixel( 0, 0, 0, 0 ); - if ( ( xGraphicPropertySet->getPropertyValue( "SizePixel" ) >>= aSourceSizePixel ) && - ( xGraphicPropertySet->getPropertyValue( "Transparent" ) >>= bTransparent ) && - ( xGraphicPropertySet->getPropertyValue( "Alpha" ) >>= bAlpha ) && - ( xGraphicPropertySet->getPropertyValue( "Animated" ) >>= bAnimated ) ) + if ( ( xGraphicPropertySet->getPropertyValue( u"SizePixel"_ustr ) >>= aSourceSizePixel ) && + ( xGraphicPropertySet->getPropertyValue( u"Transparent"_ustr ) >>= bTransparent ) && + ( xGraphicPropertySet->getPropertyValue( u"Alpha"_ustr ) >>= bAlpha ) && + ( xGraphicPropertySet->getPropertyValue( u"Animated"_ustr ) >>= bAnimated ) ) { awt::Size aDestSizePixel( aSourceSizePixel ); if ( !bAnimated ) @@ -286,7 +286,7 @@ static Reference< XGraphic > ImpCompressGraphic( const Reference< XComponentCont } if ( ( aSourceSizePixel.Width > 0 ) && ( aSourceSizePixel.Height > 0 ) ) { - OUString aDestMimeType( "image/png" ); + OUString aDestMimeType( u"image/png"_ustr ); if (rGraphicSettings.mbJPEGCompression && !bTransparent && !bAlpha) { aDestMimeType = "image/jpeg"; @@ -321,7 +321,7 @@ static Reference< XGraphic > ImpCompressGraphic( const Reference< XComponentCont Reference< XSeekable > xSeekable( xInputStream, UNO_QUERY_THROW ); xSeekable->seek( 0 ); Sequence< PropertyValue > aArgs{ comphelper::makePropertyValue( - "InputStream", xInputStream) }; + u"InputStream"_ustr, xInputStream) }; xNewGraphic = xGraphicProvider->queryGraphic( aArgs ); } } @@ -338,7 +338,7 @@ static Reference< XGraphic > ImpCompressGraphic( const Reference< XComponentCont Reference< XInputStream > xInputStream( xTempFile->getInputStream() ); Reference< XSeekable > xSeekable( xInputStream, UNO_QUERY_THROW ); xSeekable->seek( 0 ); - Sequence< PropertyValue > aArgs{ comphelper::makePropertyValue("InputStream", + Sequence< PropertyValue > aArgs{ comphelper::makePropertyValue(u"InputStream"_ustr, xInputStream) }; xNewGraphic = xGraphicProvider->queryGraphic( aArgs ); } @@ -372,13 +372,13 @@ static void CompressGraphics( ImpOptimizer& rOptimizer, const Reference< XCompon if ( rGraphic.maUser[ 0 ].mbFillBitmap && rGraphic.maUser[ 0 ].mxPropertySet.is() ) { Reference< rendering::XBitmap > xFillBitmap; - if ( rGraphic.maUser[ 0 ].mxPropertySet->getPropertyValue( "FillBitmap" ) >>= xFillBitmap ) + if ( rGraphic.maUser[ 0 ].mxPropertySet->getPropertyValue( u"FillBitmap"_ustr ) >>= xFillBitmap ) xGraphic.set( xFillBitmap, UNO_QUERY_THROW ); } else if ( rGraphic.maUser[ 0 ].mxShape.is() ) { Reference< XPropertySet > xShapePropertySet( rGraphic.maUser[ 0 ].mxShape, UNO_QUERY_THROW ); - xShapePropertySet->getPropertyValue( "Graphic" ) >>= xGraphic; + xShapePropertySet->getPropertyValue( u"Graphic"_ustr ) >>= xGraphic; } if ( xGraphic.is() ) { @@ -393,7 +393,7 @@ static void CompressGraphics( ImpOptimizer& rOptimizer, const Reference< XCompon if ( rGraphicUser.mxShape.is() ) { Reference< XPropertySet > xShapePropertySet( rGraphicUser.mxShape, UNO_QUERY_THROW ); - xShapePropertySet->setPropertyValue( "Graphic", Any( xNewGraphic ) ); + xShapePropertySet->setPropertyValue( u"Graphic"_ustr, Any( xNewGraphic ) ); if ( rGraphicUser.maGraphicCropLogic.Left || rGraphicUser.maGraphicCropLogic.Top || rGraphicUser.maGraphicCropLogic.Right || rGraphicUser.maGraphicCropLogic.Bottom ) @@ -407,7 +407,7 @@ static void CompressGraphics( ImpOptimizer& rOptimizer, const Reference< XCompon aGraphicCropLogic.Right = static_cast<sal_Int32>(static_cast<double>(rGraphicUser.maGraphicCropLogic.Right) * (static_cast<double>(aNewSize.Width) / static_cast<double>(aSize100thMM.Width))); aGraphicCropLogic.Bottom = static_cast<sal_Int32>(static_cast<double>(rGraphicUser.maGraphicCropLogic.Bottom) * (static_cast<double>(aNewSize.Height) / static_cast<double>(aSize100thMM.Height))); } - xShapePropertySet->setPropertyValue( "GraphicCrop", Any( aGraphicCropLogic ) ); + xShapePropertySet->setPropertyValue( u"GraphicCrop"_ustr, Any( aGraphicCropLogic ) ); } } else if ( rGraphicUser.mxPropertySet.is() ) @@ -419,20 +419,20 @@ static void CompressGraphics( ImpOptimizer& rOptimizer, const Reference< XCompon bool bLogicalSize; Reference< XPropertySet >& rxPropertySet( rGraphicUser.mxPropertySet ); - rxPropertySet->setPropertyValue( "FillBitmap", Any( xFillBitmap ) ); - if ( ( rxPropertySet->getPropertyValue( "FillBitmapLogicalSize" ) >>= bLogicalSize ) - && ( rxPropertySet->getPropertyValue( "FillBitmapSizeX" ) >>= aSize.Width ) - && ( rxPropertySet->getPropertyValue( "FillBitmapSizeY" ) >>= aSize.Height ) ) + rxPropertySet->setPropertyValue( u"FillBitmap"_ustr, Any( xFillBitmap ) ); + if ( ( rxPropertySet->getPropertyValue( u"FillBitmapLogicalSize"_ustr ) >>= bLogicalSize ) + && ( rxPropertySet->getPropertyValue( u"FillBitmapSizeX"_ustr ) >>= aSize.Width ) + && ( rxPropertySet->getPropertyValue( u"FillBitmapSizeY"_ustr ) >>= aSize.Height ) ) { if ( !aSize.Width || !aSize.Height ) { - rxPropertySet->setPropertyValue( "FillBitmapLogicalSize", Any( true ) ); - rxPropertySet->setPropertyValue( "FillBitmapSizeX", Any( rGraphicUser.maLogicalSize.Width ) ); - rxPropertySet->setPropertyValue( "FillBitmapSizeY", Any( rGraphicUser.maLogicalSize.Height ) ); + rxPropertySet->setPropertyValue( u"FillBitmapLogicalSize"_ustr, Any( true ) ); + rxPropertySet->setPropertyValue( u"FillBitmapSizeX"_ustr, Any( rGraphicUser.maLogicalSize.Width ) ); + rxPropertySet->setPropertyValue( u"FillBitmapSizeY"_ustr, Any( rGraphicUser.maLogicalSize.Height ) ); } } if ( rGraphicUser.mxPagePropertySet.is() ) - rGraphicUser.mxPagePropertySet->setPropertyValue( "Background", Any( rxPropertySet ) ); + rGraphicUser.mxPagePropertySet->setPropertyValue( u"Background"_ustr, Any( rxPropertySet ) ); } } } @@ -491,14 +491,14 @@ void ImpOptimizer::Optimize() if ( mbDeleteHiddenSlides ) { SetStatusValue( TK_Progress, Any( static_cast< sal_Int32 >( 40 ) ) ); - SetStatusValue( TK_Status, Any( OUString("STR_DELETING_SLIDES") ) ); + SetStatusValue( TK_Status, Any( u"STR_DELETING_SLIDES"_ustr ) ); DispatchStatus(); ImpDeleteHiddenSlides( mxModel ); } if ( mbDeleteNotesPages ) { - SetStatusValue( TK_Status, Any( OUString("STR_DELETING_SLIDES") ) ); + SetStatusValue( TK_Status, Any( u"STR_DELETING_SLIDES"_ustr ) ); DispatchStatus(); ImpDeleteNotesPages( mxModel ); } @@ -506,7 +506,7 @@ void ImpOptimizer::Optimize() if ( mbDeleteUnusedMasterPages ) { SetStatusValue( TK_Progress, Any( static_cast< sal_Int32 >( 40 ) ) ); - SetStatusValue( TK_Status, Any( OUString("STR_DELETING_SLIDES") ) ); + SetStatusValue( TK_Status, Any( u"STR_DELETING_SLIDES"_ustr ) ); DispatchStatus(); ImpDeleteUnusedMasterPages( mxModel ); } @@ -514,7 +514,7 @@ void ImpOptimizer::Optimize() if ( mbOLEOptimization ) { SetStatusValue( TK_Progress, Any( static_cast< sal_Int32 >( 45 ) ) ); - SetStatusValue( TK_Status, Any( OUString("STR_CREATING_OLE_REPLACEMENTS") ) ); + SetStatusValue( TK_Status, Any( u"STR_CREATING_OLE_REPLACEMENTS"_ustr ) ); DispatchStatus(); ImpConvertOLE( mxModel, mnOLEOptimizationType ); } @@ -522,7 +522,7 @@ void ImpOptimizer::Optimize() if ( mbJPEGCompression || mbRemoveCropArea || mnImageResolution ) { SetStatusValue( TK_Progress, Any( static_cast< sal_Int32 >( 50 ) ) ); - SetStatusValue( TK_Status, Any( OUString("STR_OPTIMIZING_GRAPHICS") ) ); + SetStatusValue( TK_Status, Any( u"STR_OPTIMIZING_GRAPHICS"_ustr ) ); DispatchStatus(); std::vector< GraphicCollector::GraphicEntity > aGraphicList; @@ -610,7 +610,7 @@ void ImpOptimizer::Optimize( const Sequence< PropertyValue >& rArguments ) { SetStatusValue( TK_Progress, Any( static_cast< sal_Int32 >( 10 ) ) ); - SetStatusValue( TK_Status, Any( OUString("STR_DUPLICATING_PRESENTATION") ) ); + SetStatusValue( TK_Status, Any( u"STR_DUPLICATING_PRESENTATION"_ustr ) ); DispatchStatus(); Reference< XStorable >xStorable( mxModel, UNO_QUERY ); @@ -633,16 +633,16 @@ void ImpOptimizer::Optimize( const Sequence< PropertyValue >& rArguments ) nSourceSize = PPPOptimizer::GetFileSize( maSaveAsURL ); SetStatusValue( TK_Progress, Any( static_cast< sal_Int32 >( 30 ) ) ); - SetStatusValue( TK_Status, Any( OUString("STR_DUPLICATING_PRESENTATION") ) ); + SetStatusValue( TK_Status, Any( u"STR_DUPLICATING_PRESENTATION"_ustr ) ); DispatchStatus(); Reference< XDesktop2 > xDesktop = Desktop::create( mxContext ); - xSelf = xDesktop->findFrame( "_blank", FrameSearchFlag::CREATE ); + xSelf = xDesktop->findFrame( u"_blank"_ustr, FrameSearchFlag::CREATE ); Reference< XComponentLoader > xComponentLoader( xSelf, UNO_QUERY ); - Sequence< PropertyValue > aLoadProps{ comphelper::makePropertyValue("Hidden", true) }; + Sequence< PropertyValue > aLoadProps{ comphelper::makePropertyValue(u"Hidden"_ustr, true) }; mxModel.set( xComponentLoader->loadComponentFromURL( - maSaveAsURL, "_self", 0, aLoadProps ), UNO_QUERY ); + maSaveAsURL, u"_self"_ustr, 0, aLoadProps ), UNO_QUERY ); } } @@ -658,7 +658,7 @@ void ImpOptimizer::Optimize( const Sequence< PropertyValue >& rArguments ) Reference< XFrame > xFrame( xSelf.is() ? xSelf : mxDocumentFrame ); if ( xFrame.is() ) { - DispatchURL(mxContext, ".uno:ClearUndoStack", xFrame); + DispatchURL(mxContext, u".uno:ClearUndoStack"_ustr, xFrame); } } diff --git a/sdext/source/minimizer/informationdialog.cxx b/sdext/source/minimizer/informationdialog.cxx index 9872990a0f45..252863231bff 100644 --- a/sdext/source/minimizer/informationdialog.cxx +++ b/sdext/source/minimizer/informationdialog.cxx @@ -92,8 +92,8 @@ void InformationDialog::InitDialog() OUString sSecondary( getString( eInfoString ) ); static constexpr OUString aOldSizePlaceholder( u"%OLDFILESIZE"_ustr ); static constexpr OUString aNewSizePlaceholder( u"%NEWFILESIZE"_ustr ); - const OUString aTitlePlaceholder( !aTitle.isEmpty() ? OUString("%TITLE" ) - : OUString("'%TITLE'") ); + const OUString aTitlePlaceholder( !aTitle.isEmpty() ? u"%TITLE"_ustr + : u"'%TITLE'"_ustr ); sal_Int32 i = sSecondary.indexOf( aOldSizePlaceholder ); if ( i >= 0 ) @@ -116,9 +116,9 @@ void InformationDialog::InitDialog() InformationDialog::InformationDialog(const Reference< XComponentContext > &rxContext, const Reference<XWindow>& rxDialogParent, const OUString& rSaveAsURL, bool& rbOpenNewDocument, sal_Int64 rSourceSize, sal_Int64 rDestSize, sal_Int64 rApproxSize) - : MessageDialogController(Application::GetFrameWeld(rxDialogParent), "modules/simpress/ui/pminfodialog.ui", "PMInfoDialog", "ask") + : MessageDialogController(Application::GetFrameWeld(rxDialogParent), u"modules/simpress/ui/pminfodialog.ui"_ustr, u"PMInfoDialog"_ustr, u"ask"_ustr) , ConfigurationAccess(rxContext) - , mxCheckBox(m_xBuilder->weld_check_button("ask")) + , mxCheckBox(m_xBuilder->weld_check_button(u"ask"_ustr)) , mnSourceSize(rSourceSize) , mnDestSize(rDestSize) , mnApproxSize(rApproxSize) diff --git a/sdext/source/minimizer/optimizerdialog.cxx b/sdext/source/minimizer/optimizerdialog.cxx index 7efef618af9b..8c85d14fcaec 100644 --- a/sdext/source/minimizer/optimizerdialog.cxx +++ b/sdext/source/minimizer/optimizerdialog.cxx @@ -53,10 +53,10 @@ using namespace ::com::sun::star::frame; using namespace ::com::sun::star::beans; IntroPage::IntroPage(weld::Container* pPage, OptimizerDialog& rOptimizerDialog) - : vcl::OWizardPage(pPage, &rOptimizerDialog, "modules/simpress/ui/pmintropage.ui", "PMIntroPage") + : vcl::OWizardPage(pPage, &rOptimizerDialog, u"modules/simpress/ui/pmintropage.ui"_ustr, u"PMIntroPage"_ustr) , mrOptimizerDialog(rOptimizerDialog) - , mxComboBox(m_xBuilder->weld_combo_box("LB_SETTINGS")) - , mxButton(m_xBuilder->weld_button("STR_REMOVE")) + , mxComboBox(m_xBuilder->weld_combo_box(u"LB_SETTINGS"_ustr)) + , mxButton(m_xBuilder->weld_button(u"STR_REMOVE"_ustr)) { rOptimizerDialog.SetIntroPage(this); mxComboBox->connect_changed(LINK(this, IntroPage, ComboBoxActionPerformed)); @@ -73,13 +73,13 @@ void IntroPage::UpdateControlStates(const std::vector<OUString>& rItemList, int } SlidesPage::SlidesPage(weld::Container* pPage, OptimizerDialog& rOptimizerDialog) - : vcl::OWizardPage(pPage, &rOptimizerDialog, "modules/simpress/ui/pmslidespage.ui", "PMSlidesPage") + : vcl::OWizardPage(pPage, &rOptimizerDialog, u"modules/simpress/ui/pmslidespage.ui"_ustr, u"PMSlidesPage"_ustr) , mrOptimizerDialog(rOptimizerDialog) - , mxMasterSlides(m_xBuilder->weld_check_button("STR_DELETE_MASTER_PAGES")) - , mxHiddenSlides(m_xBuilder->weld_check_button("STR_DELETE_HIDDEN_SLIDES")) - , mxUnusedSlides(m_xBuilder->weld_check_button("STR_CUSTOM_SHOW")) - , mxComboBox(m_xBuilder->weld_combo_box("LB_SLIDES")) - , mxClearNodes(m_xBuilder->weld_check_button("STR_DELETE_NOTES_PAGES")) + , mxMasterSlides(m_xBuilder->weld_check_button(u"STR_DELETE_MASTER_PAGES"_ustr)) + , mxHiddenSlides(m_xBuilder->weld_check_button(u"STR_DELETE_HIDDEN_SLIDES"_ustr)) + , mxUnusedSlides(m_xBuilder->weld_check_button(u"STR_CUSTOM_SHOW"_ustr)) + , mxComboBox(m_xBuilder->weld_combo_box(u"LB_SLIDES"_ustr)) + , mxClearNodes(m_xBuilder->weld_check_button(u"STR_DELETE_NOTES_PAGES"_ustr)) { rOptimizerDialog.SetSlidesPage(this); mxMasterSlides->connect_toggled(LINK(this, SlidesPage, UnusedMasterPagesActionPerformed)); @@ -105,15 +105,15 @@ void SlidesPage::UpdateControlStates(bool bDeleteUnusedMasterPages, bool bDelete } ImagesPage::ImagesPage(weld::Container* pPage, OptimizerDialog& rOptimizerDialog) - : vcl::OWizardPage(pPage, &rOptimizerDialog, "modules/simpress/ui/pmimagespage.ui", "PMImagesPage") + : vcl::OWizardPage(pPage, &rOptimizerDialog, u"modules/simpress/ui/pmimagespage.ui"_ustr, u"PMImagesPage"_ustr) , mrOptimizerDialog(rOptimizerDialog) - , m_xLossLessCompression(m_xBuilder->weld_radio_button("STR_LOSSLESS_COMPRESSION")) - , m_xQualityLabel(m_xBuilder->weld_label("STR_QUALITY")) - , m_xQuality(m_xBuilder->weld_spin_button("SB_QUALITY")) - , m_xJpegCompression(m_xBuilder->weld_radio_button("STR_JPEG_COMPRESSION")) - , m_xResolution(m_xBuilder->weld_combo_box("LB_RESOLUTION")) - , m_xRemoveCropArea(m_xBuilder->weld_check_button("STR_REMOVE_CROP_AREA")) - , m_xEmbedLinkedGraphics(m_xBuilder->weld_check_button("STR_EMBED_LINKED_GRAPHICS")) + , m_xLossLessCompression(m_xBuilder->weld_radio_button(u"STR_LOSSLESS_COMPRESSION"_ustr)) + , m_xQualityLabel(m_xBuilder->weld_label(u"STR_QUALITY"_ustr)) + , m_xQuality(m_xBuilder->weld_spin_button(u"SB_QUALITY"_ustr)) + , m_xJpegCompression(m_xBuilder->weld_radio_button(u"STR_JPEG_COMPRESSION"_ustr)) + , m_xResolution(m_xBuilder->weld_combo_box(u"LB_RESOLUTION"_ustr)) + , m_xRemoveCropArea(m_xBuilder->weld_check_button(u"STR_REMOVE_CROP_AREA"_ustr)) + , m_xEmbedLinkedGraphics(m_xBuilder->weld_check_button(u"STR_EMBED_LINKED_GRAPHICS"_ustr)) { rOptimizerDialog.SetImagesPage(this); m_xRemoveCropArea->connect_toggled(LINK(this, ImagesPage, RemoveCropAreaActionPerformed)); @@ -139,12 +139,12 @@ void ImagesPage::UpdateControlStates(bool bJPEGCompression, int nJPEGQuality, bo } ObjectsPage::ObjectsPage(weld::Container* pPage, OptimizerDialog& rOptimizerDialog) - : vcl::OWizardPage(pPage, &rOptimizerDialog, "modules/simpress/ui/pmobjectspage.ui", "PMObjectsPage") + : vcl::OWizardPage(pPage, &rOptimizerDialog, u"modules/simpress/ui/pmobjectspage.ui"_ustr, u"PMObjectsPage"_ustr) , mrOptimizerDialog(rOptimizerDialog) - , m_xCreateStaticImage(m_xBuilder->weld_check_button("STR_OLE_REPLACE")) - , m_xAllOLEObjects(m_xBuilder->weld_radio_button("STR_ALL_OLE_OBJECTS")) - , m_xForeignOLEObjects(m_xBuilder->weld_radio_button("STR_ALIEN_OLE_OBJECTS_ONLY")) - , m_xLabel(m_xBuilder->weld_label("STR_OLE_OBJECTS_DESC")) + , m_xCreateStaticImage(m_xBuilder->weld_check_button(u"STR_OLE_REPLACE"_ustr)) + , m_xAllOLEObjects(m_xBuilder->weld_radio_button(u"STR_ALL_OLE_OBJECTS"_ustr)) + , m_xForeignOLEObjects(m_xBuilder->weld_radio_button(u"STR_ALIEN_OLE_OBJECTS_ONLY"_ustr)) + , m_xLabel(m_xBuilder->weld_label(u"STR_OLE_OBJECTS_DESC"_ustr)) { rOptimizerDialog.SetObjectsPage(this); m_xCreateStaticImage->connect_toggled(LINK(this, ObjectsPage, OLEOptimizationActionPerformed)); @@ -167,19 +167,19 @@ void ObjectsPage::UpdateControlStates(bool bConvertOLEObjects, int nOLEOptimizat } SummaryPage::SummaryPage(weld::Container* pPage, OptimizerDialog& rOptimizerDialog) - : vcl::OWizardPage(pPage, &rOptimizerDialog, "modules/simpress/ui/pmsummarypage.ui", "PMSummaryPage") + : vcl::OWizardPage(pPage, &rOptimizerDialog, u"modules/simpress/ui/pmsummarypage.ui"_ustr, u"PMSummaryPage"_ustr) , mrOptimizerDialog(rOptimizerDialog) - , m_xLabel1(m_xBuilder->weld_label("LABEL1")) - , m_xLabel2(m_xBuilder->weld_label("LABEL2")) - , m_xLabel3(m_xBuilder->weld_label("LABEL3")) - , m_xCurrentSize(m_xBuilder->weld_label("CURRENT_FILESIZE")) - , m_xEstimatedSize(m_xBuilder->weld_label("ESTIMATED_FILESIZE")) - , m_xStatus(m_xBuilder->weld_label("STR_STATUS")) - , m_xProgress(m_xBuilder->weld_progress_bar("PROGRESS")) - , m_xApplyToCurrent(m_xBuilder->weld_radio_button("STR_APPLY_TO_CURRENT")) - , m_xSaveToNew(m_xBuilder->weld_radio_button("STR_SAVE_AS")) - , m_xComboBox(m_xBuilder->weld_combo_box("MY_SETTINGS")) - , m_xSaveSettings(m_xBuilder->weld_check_button("STR_SAVE_SETTINGS")) + , m_xLabel1(m_xBuilder->weld_label(u"LABEL1"_ustr)) + , m_xLabel2(m_xBuilder->weld_label(u"LABEL2"_ustr)) + , m_xLabel3(m_xBuilder->weld_label(u"LABEL3"_ustr)) + , m_xCurrentSize(m_xBuilder->weld_label(u"CURRENT_FILESIZE"_ustr)) + , m_xEstimatedSize(m_xBuilder->weld_label(u"ESTIMATED_FILESIZE"_ustr)) + , m_xStatus(m_xBuilder->weld_label(u"STR_STATUS"_ustr)) + , m_xProgress(m_xBuilder->weld_progress_bar(u"PROGRESS"_ustr)) + , m_xApplyToCurrent(m_xBuilder->weld_radio_button(u"STR_APPLY_TO_CURRENT"_ustr)) + , m_xSaveToNew(m_xBuilder->weld_radio_button(u"STR_SAVE_AS"_ustr)) + , m_xComboBox(m_xBuilder->weld_combo_box(u"MY_SETTINGS"_ustr)) + , m_xSaveSettings(m_xBuilder->weld_check_button(u"STR_SAVE_SETTINGS"_ustr)) { rOptimizerDialog.SetSummaryPage(this); m_xApplyToCurrent->connect_toggled(LINK(this, SummaryPage, SaveAsNewActionPerformed)); @@ -244,7 +244,7 @@ void OptimizerDialog::InitRoadmap() ITEM_ID_SUMMARY} ); - m_xAssistant->set_page_side_image(BMP_PRESENTATION_MINIMIZER); + m_xAssistant->set_page_side_image(u"" BMP_PRESENTATION_MINIMIZER ""_ustr); } void OptimizerDialog::UpdateConfiguration() @@ -579,10 +579,10 @@ bool OptimizerDialog::onFinish() aURL.Path = "optimize"; Sequence< PropertyValue > lArguments{ - comphelper::makePropertyValue("Settings", GetConfigurationSequence()), - comphelper::makePropertyValue("StatusDispatcher", GetStatusDispatcher()), - comphelper::makePropertyValue("DocumentFrame", GetFrame()), - comphelper::makePropertyValue("DialogParentWindow", m_xAssistant->GetXWindow()) + comphelper::makePropertyValue(u"Settings"_ustr, GetConfigurationSequence()), + comphelper::makePropertyValue(u"StatusDispatcher"_ustr, GetStatusDispatcher()), + comphelper::makePropertyValue(u"DocumentFrame"_ustr, GetFrame()), + comphelper::makePropertyValue(u"DialogParentWindow"_ustr, m_xAssistant->GetXWindow()) }; ErrCode errorCode; diff --git a/sdext/source/minimizer/optimizerdialogcontrols.cxx b/sdext/source/minimizer/optimizerdialogcontrols.cxx index d2c4e49f3b95..99f7740be9fa 100644 --- a/sdext/source/minimizer/optimizerdialogcontrols.cxx +++ b/sdext/source/minimizer/optimizerdialogcontrols.cxx @@ -211,7 +211,7 @@ void OptimizerDialog::UpdateControlStatesPage4() Reference< XPropertySet > xPropSet( xDrawPage, UNO_QUERY_THROW ); bool bVisible = true; - if ( xPropSet->getPropertyValue( "Visible" ) >>= bVisible ) + if ( xPropSet->getPropertyValue( u"Visible"_ustr ) >>= bVisible ) { if (!bVisible ) nDeletedSlides++; @@ -230,7 +230,7 @@ void OptimizerDialog::UpdateControlStatesPage4() if ( nDeletedSlides > 1 ) { OUString aStr( getString( STR_DELETE_SLIDES ) ); - OUString aPlaceholder( "%SLIDES" ); + OUString aPlaceholder( u"%SLIDES"_ustr ); sal_Int32 i = aStr.indexOf( aPlaceholder ); if ( i >= 0 ) aStr = aStr.replaceAt( i, aPlaceholder.getLength(), OUString::number( nDeletedSlides ) ); @@ -248,9 +248,9 @@ void OptimizerDialog::UpdateControlStatesPage4() if ( nGraphics > 1 ) { OUString aStr( getString( STR_OPTIMIZE_IMAGES ) ); - OUString aImagePlaceholder( "%IMAGES" ); - OUString aQualityPlaceholder( "%QUALITY" ); - OUString aResolutionPlaceholder( "%RESOLUTION" ); + OUString aImagePlaceholder( u"%IMAGES"_ustr ); + OUString aQualityPlaceholder( u"%QUALITY"_ustr ); + OUString aResolutionPlaceholder( u"%RESOLUTION"_ustr ); sal_Int32 i = aStr.indexOf( aImagePlaceholder ); if ( i >= 0 ) aStr = aStr.replaceAt( i, aImagePlaceholder.getLength(), OUString::number( nGraphics ) ); @@ -284,7 +284,7 @@ void OptimizerDialog::UpdateControlStatesPage4() if ( nOLEReplacements > 1 ) { OUString aStr( getString( STR_CREATE_REPLACEMENT ) ); - OUString aPlaceholder( "%OLE" ); + OUString aPlaceholder( u"%OLE"_ustr ); sal_Int32 i = aStr.indexOf( aPlaceholder ); if ( i >= 0 ) aStr = aStr.replaceAt( i, aPlaceholder.getLength(), OUString::number( nOLEReplacements ) ); diff --git a/sdext/source/minimizer/pppoptimizerdialog.cxx b/sdext/source/minimizer/pppoptimizerdialog.cxx index 74a89bfbac1a..889bf3a85190 100644 --- a/sdext/source/minimizer/pppoptimizerdialog.cxx +++ b/sdext/source/minimizer/pppoptimizerdialog.cxx @@ -51,7 +51,7 @@ void SAL_CALL PPPOptimizerDialog::initialize( const Sequence< Any >& aArguments OUString SAL_CALL PPPOptimizerDialog::getImplementationName() { - return "com.sun.star.comp.PresentationMinimizerImp"; + return u"com.sun.star.comp.PresentationMinimizerImp"_ustr; } sal_Bool SAL_CALL PPPOptimizerDialog::supportsService( const OUString& ServiceName ) @@ -61,7 +61,7 @@ sal_Bool SAL_CALL PPPOptimizerDialog::supportsService( const OUString& ServiceNa Sequence< OUString > SAL_CALL PPPOptimizerDialog::getSupportedServiceNames() { - return { "com.sun.star.comp.PresentationMinimizer" }; + return { u"com.sun.star.comp.PresentationMinimizer"_ustr }; } Reference< css::frame::XDispatch > SAL_CALL PPPOptimizerDialog::queryDispatch( diff --git a/sdext/source/pdfimport/filterdet.cxx b/sdext/source/pdfimport/filterdet.cxx index d9fdcc03c6ab..3a5e0f2ec480 100644 --- a/sdext/source/pdfimport/filterdet.cxx +++ b/sdext/source/pdfimport/filterdet.cxx @@ -197,7 +197,7 @@ sal_Int32 fillAttributes(uno::Sequence<beans::PropertyValue> const& rFilterData, sal_Int32 nAttribs = rFilterData.getLength(); for (sal_Int32 i = 0; i < nAttribs; i++) { - OUString aVal( "<no string>" ); + OUString aVal( u"<no string>"_ustr ); pAttribs[i].Value >>= aVal; SAL_INFO("sdext.pdfimport", "doDetection: Attrib: " + pAttribs[i].Name + " = " + aVal); @@ -411,15 +411,15 @@ OUString SAL_CALL PDFDetector::detect( uno::Sequence< beans::PropertyValue >& rF switch (nDocumentType) { case 0: - pFilterData[nFilterNamePos].Value <<= OUString( "draw_pdf_import" ); + pFilterData[nFilterNamePos].Value <<= u"draw_pdf_import"_ustr; break; case 1: - pFilterData[nFilterNamePos].Value <<= OUString( "impress_pdf_import" ); + pFilterData[nFilterNamePos].Value <<= u"impress_pdf_import"_ustr; break; case 2: - pFilterData[nFilterNamePos].Value <<= OUString( "writer_pdf_import" ); + pFilterData[nFilterNamePos].Value <<= u"writer_pdf_import"_ustr; break; default: @@ -435,7 +435,7 @@ OUString SAL_CALL PDFDetector::detect( uno::Sequence< beans::PropertyValue >& rF OUString PDFDetector::getImplementationName() { - return "org.libreoffice.comp.documents.PDFDetector"; + return u"org.libreoffice.comp.documents.PDFDetector"_ustr; } sal_Bool PDFDetector::supportsService(OUString const & ServiceName) @@ -445,7 +445,7 @@ sal_Bool PDFDetector::supportsService(OUString const & ServiceName) css::uno::Sequence<OUString> PDFDetector::getSupportedServiceNames() { - return {"com.sun.star.document.ImportFilter"}; + return {u"com.sun.star.document.ImportFilter"_ustr}; } bool checkDocChecksum( const OUString& rInPDFFileURL, diff --git a/sdext/source/pdfimport/inc/pdfihelper.hxx b/sdext/source/pdfimport/inc/pdfihelper.hxx index c6be1a6ba73e..1b6ba6b0ca04 100644 --- a/sdext/source/pdfimport/inc/pdfihelper.hxx +++ b/sdext/source/pdfimport/inc/pdfihelper.hxx @@ -155,11 +155,11 @@ namespace pdfi { default: case css::rendering::PathJoinType::MITER: - return "miter"; + return u"miter"_ustr; case css::rendering::PathJoinType::ROUND: - return "round"; + return u"round"_ustr; case css::rendering::PathJoinType::BEVEL: - return "bevel"; + return u"bevel"_ustr; } } @@ -169,11 +169,11 @@ namespace pdfi { default: case css::rendering::PathCapType::BUTT: - return "butt"; + return u"butt"_ustr; case css::rendering::PathCapType::ROUND: - return "round"; + return u"round"_ustr; case css::rendering::PathCapType::SQUARE: - return "square"; + return u"square"_ustr; } } diff --git a/sdext/source/pdfimport/misc/pdfihelper.cxx b/sdext/source/pdfimport/misc/pdfihelper.cxx index 8268be6b9d46..b30624025faa 100644 --- a/sdext/source/pdfimport/misc/pdfihelper.cxx +++ b/sdext/source/pdfimport/misc/pdfihelper.cxx @@ -46,8 +46,8 @@ void pdfi::FillDashStyleProps(PropertyMap& props, const std::vector<double>& das distance += dashArray[i * 2 + 1]; distance /= pairCount; - props["draw:style"] = "rect"; - props["draw:distance"] = convertPixelToUnitString(distance * scale); + props[u"draw:style"_ustr] = "rect"; + props[u"draw:distance"_ustr] = convertPixelToUnitString(distance * scale); int dotStage = 0; int dotCounts[3] = {0, 0, 0}; diff --git a/sdext/source/pdfimport/odf/odfemitter.cxx b/sdext/source/pdfimport/odf/odfemitter.cxx index 1ff92deb73a4..c4ee6df310b2 100644 --- a/sdext/source/pdfimport/odf/odfemitter.cxx +++ b/sdext/source/pdfimport/odf/odfemitter.cxx @@ -57,7 +57,7 @@ OdfEmitter::OdfEmitter( uno::Reference<io::XOutputStream> xOutput ) : { OSL_PRECOND(m_xOutput.is(), "OdfEmitter(): invalid output stream"); - write("<?xml version=\"1.0\" encoding=\"UTF-8\"?>"); + write(u"<?xml version=\"1.0\" encoding=\"UTF-8\"?>"_ustr); } void OdfEmitter::beginTag( const char* pTag, const PropertyMap& rProperties ) diff --git a/sdext/source/pdfimport/pdfiadaptor.cxx b/sdext/source/pdfimport/pdfiadaptor.cxx index 0d5bad2d6373..136f6d586d61 100644 --- a/sdext/source/pdfimport/pdfiadaptor.cxx +++ b/sdext/source/pdfimport/pdfiadaptor.cxx @@ -64,7 +64,7 @@ sal_Bool SAL_CALL PDFIHybridAdaptor::filter( const uno::Sequence< beans::Propert SAL_INFO("sdext.pdfimport", "filter: Attrib: " << pAttribs[i].Name << " = " << (pAttribs[i].Value.has<OUString>() ? pAttribs[i].Value.get<OUString>() - : OUString("<no string>")) + : u"<no string>"_ustr) << "\n"); if ( pAttribs[i].Name == "EmbeddedSubstream" ) pAttribs[i].Value >>= xSubStream; @@ -135,7 +135,7 @@ sal_Bool SAL_CALL PDFIHybridAdaptor::filter( const uno::Sequence< beans::Propert try { xSubFilter.set( m_xContext->getServiceManager()->createInstanceWithArgumentsAndContext( - "com.sun.star.document.OwnSubFilter", + u"com.sun.star.document.OwnSubFilter"_ustr, aArgs, m_xContext ), uno::UNO_QUERY ); @@ -188,7 +188,7 @@ void SAL_CALL PDFIHybridAdaptor::setTargetDocument( const uno::Reference< lang:: OUString PDFIHybridAdaptor::getImplementationName() { - return "org.libreoffice.comp.documents.HybridPDFImport"; + return u"org.libreoffice.comp.documents.HybridPDFImport"_ustr; } sal_Bool PDFIHybridAdaptor::supportsService(OUString const & ServiceName) @@ -198,7 +198,7 @@ sal_Bool PDFIHybridAdaptor::supportsService(OUString const & ServiceName) css::uno::Sequence<OUString> PDFIHybridAdaptor::getSupportedServiceNames() { - return {"com.sun.star.document.ImportFilter"}; + return {u"com.sun.star.document.ImportFilter"_ustr}; } PDFIRawAdaptor::PDFIRawAdaptor( OUString const & implementationName, const uno::Reference< uno::XComponentContext >& xContext ) : @@ -246,7 +246,7 @@ bool PDFIRawAdaptor::odfConvert( const OUString& rURL, const bool bSuccess = parse(uno::Reference<io::XInputStream>(), uno::Reference<task::XInteractionHandler>(), OUString(), - xStatus,pEmitter,rURL, ""); + xStatus,pEmitter,rURL, u""_ustr); // tell input stream that it is no longer needed xOutput->closeOutput(); @@ -317,7 +317,7 @@ sal_Bool PDFIRawAdaptor::supportsService(OUString const & ServiceName) css::uno::Sequence<OUString> PDFIRawAdaptor::getSupportedServiceNames() { - return {"com.sun.star.document.ImportFilter"}; + return {u"com.sun.star.document.ImportFilter"_ustr}; } @@ -326,7 +326,7 @@ extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface* sdext_PDFIRawAdaptor_Writer_get_implementation( css::uno::XComponentContext* context , css::uno::Sequence<css::uno::Any> const&) { - rtl::Reference<pdfi::PDFIRawAdaptor> pAdaptor = new pdfi::PDFIRawAdaptor( "org.libreoffice.comp.documents.WriterPDFImport", context ); + rtl::Reference<pdfi::PDFIRawAdaptor> pAdaptor = new pdfi::PDFIRawAdaptor( u"org.libreoffice.comp.documents.WriterPDFImport"_ustr, context ); pAdaptor->setTreeVisitorFactory(pdfi::createWriterTreeVisitorFactory()); pAdaptor->acquire(); return getXWeak(pAdaptor.get()); @@ -336,7 +336,7 @@ extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface* sdext_PDFIRawAdaptor_Draw_get_implementation( css::uno::XComponentContext* context , css::uno::Sequence<css::uno::Any> const&) { - rtl::Reference<pdfi::PDFIRawAdaptor> pAdaptor = new pdfi::PDFIRawAdaptor( "org.libreoffice.comp.documents.DrawPDFImport", context ); + rtl::Reference<pdfi::PDFIRawAdaptor> pAdaptor = new pdfi::PDFIRawAdaptor( u"org.libreoffice.comp.documents.DrawPDFImport"_ustr, context ); pAdaptor->setTreeVisitorFactory(pdfi::createDrawTreeVisitorFactory()); pAdaptor->acquire(); return getXWeak(pAdaptor.get()); @@ -346,7 +346,7 @@ extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface* sdext_PDFIRawAdaptor_Impress_get_implementation( css::uno::XComponentContext* context , css::uno::Sequence<css::uno::Any> const&) { - rtl::Reference<pdfi::PDFIRawAdaptor> pAdaptor = new pdfi::PDFIRawAdaptor( "org.libreoffice.comp.documents.ImpressPDFImport", context ); + rtl::Reference<pdfi::PDFIRawAdaptor> pAdaptor = new pdfi::PDFIRawAdaptor( u"org.libreoffice.comp.documents.ImpressPDFImport"_ustr, context ); pAdaptor->setTreeVisitorFactory(pdfi::createImpressTreeVisitorFactory()); pAdaptor->acquire(); return getXWeak(pAdaptor.get()); diff --git a/sdext/source/pdfimport/pdfparse/pdfentries.cxx b/sdext/source/pdfimport/pdfparse/pdfentries.cxx index 03f4537080d7..856dc373bf36 100644 --- a/sdext/source/pdfimport/pdfparse/pdfentries.cxx +++ b/sdext/source/pdfimport/pdfparse/pdfentries.cxx @@ -1405,7 +1405,7 @@ PDFFileImplData* PDFFile::impl_getData() const SAL_INFO("sdext.pdfimport.pdfparse", "p entry is " << m_pData->m_nPEntry ); } - SAL_INFO("sdext.pdfimport.pdfparse", "Encryption dict: sec handler: " << (pFilter ? pFilter->getFilteredName() : OUString("<unknown>")) << ", version = " << static_cast<int>(m_pData->m_nAlgoVersion) << ", revision = " << static_cast<int>(m_pData->m_nStandardRevision) << ", key length = " << m_pData->m_nKeyLength ); + SAL_INFO("sdext.pdfimport.pdfparse", "Encryption dict: sec handler: " << (pFilter ? pFilter->getFilteredName() : u"<unknown>"_ustr) << ", version = " << static_cast<int>(m_pData->m_nAlgoVersion) << ", revision = " << static_cast<int>(m_pData->m_nStandardRevision) << ", key length = " << m_pData->m_nKeyLength ); break; } } diff --git a/sdext/source/pdfimport/tree/drawtreevisiting.cxx b/sdext/source/pdfimport/tree/drawtreevisiting.cxx index e7586a0cf942..16142cd532c9 100644 --- a/sdext/source/pdfimport/tree/drawtreevisiting.cxx +++ b/sdext/source/pdfimport/tree/drawtreevisiting.cxx @@ -73,10 +73,10 @@ void DrawXmlEmitter::visit( HyperlinkElement& elem, const std::list< std::unique const char* pType = dynamic_cast<DrawElement*>(elem.Children.front().get()) ? "draw:a" : "text:a"; PropertyMap aProps; - aProps[ "xlink:type" ] = "simple"; - aProps[ "xlink:href" ] = elem.URI; - aProps[ "office:target-frame-name" ] = "_blank"; - aProps[ "xlink:show" ] = "new"; + aProps[ u"xlink:type"_ustr ] = "simple"; + aProps[ u"xlink:href"_ustr ] = elem.URI; + aProps[ u"office:target-frame-name"_ustr ] = "_blank"; + aProps[ u"xlink:show"_ustr ] = "new"; m_rEmitContext.rEmitter.beginTag( pType, aProps ); auto this_it = elem.Children.begin(); @@ -99,7 +99,7 @@ void DrawXmlEmitter::visit( TextElement& elem, const std::list< std::unique_ptr< PropertyMap aProps; if( elem.StyleId != -1 ) { - aProps[ OUString( "text:style-name" ) ] = + aProps[ u"text:style-name"_ustr ] = m_rEmitContext.rStyles.getStyleName( elem.StyleId ); } @@ -138,7 +138,7 @@ void DrawXmlEmitter::visit( TextElement& elem, const std::list< std::unique_ptr< OUString strToken= str.copy(i,1) ; if( strSpace == strToken || strNbSpace == strToken ) { - aProps[ "text:c" ] = "1"; + aProps[ u"text:c"_ustr ] = "1"; m_rEmitContext.rEmitter.beginTag( "text:s", aProps ); m_rEmitContext.rEmitter.endTag( "text:s"); } @@ -171,7 +171,7 @@ void DrawXmlEmitter::visit( ParagraphElement& elem, const std::list< std::unique PropertyMap aProps; if( elem.StyleId != -1 ) { - aProps[ "text:style-name" ] = m_rEmitContext.rStyles.getStyleName( elem.StyleId ); + aProps[ u"text:style-name"_ustr ] = m_rEmitContext.rStyles.getStyleName( elem.StyleId ); } const char* pTagType = "text:p"; if( elem.Type == ParagraphElement::Headline ) @@ -332,12 +332,12 @@ void DrawXmlEmitter::visit( PolyPolyElement& elem, const std::list< std::unique_ // so we need to tell fillFrameProps here that the transformation for // a PolyPolyElement was already applied (aside from translation) fillFrameProps( elem, aProps, m_rEmitContext, true ); - aProps[ "svg:viewBox" ] = + aProps[ u"svg:viewBox"_ustr ] = "0 0 " + OUString::number( convPx2mmPrec2(elem.w)*100.0 ) + " " + OUString::number( convPx2mmPrec2(elem.h)*100.0 ); - aProps[ "svg:d" ] = basegfx::utils::exportToSvgD( elem.PolyPoly, false, true, false ); + aProps[ u"svg:d"_ustr ] = basegfx::utils::exportToSvgD( elem.PolyPoly, false, true, false ); m_rEmitContext.rEmitter.beginTag( "draw:path", aProps ); m_rEmitContext.rEmitter.endTag( "draw:path" ); @@ -356,7 +356,7 @@ void DrawXmlEmitter::visit( ImageElement& elem, const std::list< std::unique_ptr void DrawXmlEmitter::visit( PageElement& elem, const std::list< std::unique_ptr<Element> >::const_iterator& ) { PropertyMap aPageProps; - aPageProps[ "draw:master-page-name" ] = m_rEmitContext.rStyles.getStyleName( elem.StyleId ); + aPageProps[ u"draw:master-page-name"_ustr ] = m_rEmitContext.rStyles.getStyleName( elem.StyleId ); m_rEmitContext.rEmitter.beginTag("draw:page", aPageProps); @@ -781,8 +781,8 @@ void DrawXmlFinalizer::visit( PolyPolyElement& elem, const std::list< std::uniqu const GraphicsContext& rGC = m_rProcessor.getGraphicsContext(elem.GCId ); PropertyMap aProps; - aProps[ "style:family" ] = "graphic"; - aProps[ "style:parent-style-name" ] = "standard"; + aProps[ u"style:family"_ustr ] = "graphic"; + aProps[ u"style:parent-style-name"_ustr ] = "standard"; // generate standard graphic style if necessary m_rStyleContainer.getStandardStyleId( "graphic" ); @@ -792,7 +792,7 @@ void DrawXmlFinalizer::visit( PolyPolyElement& elem, const std::list< std::uniqu double scale = GetAverageTransformationScale(rGC.Transformation); if (rGC.DashArray.size() < 2) { - aGCProps[ "draw:stroke" ] = "solid"; + aGCProps[ u"draw:stroke"_ustr ] = "solid"; } else { @@ -800,22 +800,22 @@ void DrawXmlFinalizer::visit( PolyPolyElement& elem, const std::list< std::uniqu FillDashStyleProps(props, rGC.DashArray, scale); StyleContainer::Style style("draw:stroke-dash"_ostr, std::move(props)); - aGCProps[ "draw:stroke" ] = "dash"; - aGCProps[ "draw:stroke-dash" ] = + aGCProps[ u"draw:stroke"_ustr ] = "dash"; + aGCProps[ u"draw:stroke-dash"_ustr ] = m_rStyleContainer.getStyleName( m_rStyleContainer.getStyleId(style)); } - aGCProps[ "svg:stroke-color" ] = getColorString(rGC.LineColor); + aGCProps[ u"svg:stroke-color"_ustr ] = getColorString(rGC.LineColor); if (rGC.LineColor.Alpha != 1.0) - aGCProps["svg:stroke-opacity"] = getPercentString(rGC.LineColor.Alpha * 100.0); - aGCProps[ "svg:stroke-width" ] = convertPixelToUnitString(rGC.LineWidth * scale); - aGCProps[ "draw:stroke-linejoin" ] = rGC.GetLineJoinString(); - aGCProps[ "svg:stroke-linecap" ] = rGC.GetLineCapString(); + aGCProps[u"svg:stroke-opacity"_ustr] = getPercentString(rGC.LineColor.Alpha * 100.0); + aGCProps[ u"svg:stroke-width"_ustr ] = convertPixelToUnitString(rGC.LineWidth * scale); + aGCProps[ u"draw:stroke-linejoin"_ustr ] = rGC.GetLineJoinString(); + aGCProps[ u"svg:stroke-linecap"_ustr ] = rGC.GetLineCapString(); } else { - aGCProps[ "draw:stroke" ] = "none"; + aGCProps[ u"draw:stroke"_ustr ] = "none"; } if (elem.FillImage != -1) @@ -824,11 +824,11 @@ void DrawXmlFinalizer::visit( PolyPolyElement& elem, const std::list< std::uniqu // The image isn't actually in a prop, it's in an extra chunk inside. StyleContainer::Style style("draw:fill-image"_ostr, std::move(props)); style.Contents = m_rProcessor.getImages().asBase64EncodedString(elem.FillImage); - aGCProps[ "draw:fill-image-name" ] = + aGCProps[ u"draw:fill-image-name"_ustr ] = m_rStyleContainer.getStyleName( m_rStyleContainer.getStyleId(style)); - aGCProps[ "draw:fill-image-width" ] = unitMMString(convPx2mm(elem.TileWidth)); - aGCProps[ "draw:fill-image-height" ] = unitMMString(convPx2mm(elem.TileHeight)); + aGCProps[ u"draw:fill-image-width"_ustr ] = unitMMString(convPx2mm(elem.TileWidth)); + aGCProps[ u"draw:fill-image-height"_ustr ] = unitMMString(convPx2mm(elem.TileHeight)); } @@ -837,19 +837,19 @@ void DrawXmlFinalizer::visit( PolyPolyElement& elem, const std::list< std::uniqu { if (elem.FillImage == -1) { - aGCProps[ "draw:fill" ] = "solid"; + aGCProps[ u"draw:fill"_ustr ] = "solid"; } else { - aGCProps[ "draw:fill" ] = "bitmap"; + aGCProps[ u"draw:fill"_ustr ] = "bitmap"; } - aGCProps[ "draw:fill-color" ] = getColorString(rGC.FillColor); + aGCProps[ u"draw:fill-color"_ustr ] = getColorString(rGC.FillColor); if (rGC.FillColor.Alpha != 1.0) - aGCProps["draw:opacity"] = getPercentString(rGC.FillColor.Alpha * 100.0); + aGCProps[u"draw:opacity"_ustr] = getPercentString(rGC.FillColor.Alpha * 100.0); } else { - aGCProps[ "draw:fill" ] = "none"; + aGCProps[ u"draw:fill"_ustr ] = "none"; } StyleContainer::Style aStyle( "style:style"_ostr, std::move(aProps) ); @@ -866,57 +866,57 @@ void DrawXmlFinalizer::visit( HyperlinkElement&, const std::list< std::unique_pt static void SetFontsizeProperties(PropertyMap& props, double fontSize) { OUString aFSize = OUString::number(fontSize * 72 / PDFI_OUTDEV_RESOLUTION) + "pt"; - props["fo:font-size"] = aFSize; - props["style:font-size-asian"] = aFSize; - props["style:font-size-complex"] = aFSize; + props[u"fo:font-size"_ustr] = aFSize; + props[u"style:font-size-asian"_ustr] = aFSize; + props[u"style:font-size-complex"_ustr] = aFSize; } void DrawXmlFinalizer::visit( TextElement& elem, const std::list< std::unique_ptr<Element> >::const_iterator& ) { const FontAttributes& rFont = m_rProcessor.getFont( elem.FontId ); PropertyMap aProps; - aProps[ "style:family" ] = "text"; + aProps[ u"style:family"_ustr ] = "text"; PropertyMap aFontProps; // family name // TODO: tdf#143095: use system font name rather than PSName SAL_INFO("sdext.pdfimport", "The font used in xml is: " << rFont.familyName); - aFontProps[ "fo:font-family" ] = rFont.familyName; - aFontProps[ "style:font-family-asian" ] = rFont.familyName; - aFontProps[ "style:font-family-complex" ] = rFont.familyName; + aFontProps[ u"fo:font-family"_ustr ] = rFont.familyName; + aFontProps[ u"style:font-family-asian"_ustr ] = rFont.familyName; + aFontProps[ u"style:font-family-complex"_ustr ] = rFont.familyName; // bold - aFontProps[ "fo:font-weight" ] = rFont.fontWeight; - aFontProps[ "style:font-weight-asian" ] = rFont.fontWeight; - aFontProps[ "style:font-weight-complex" ] = rFont.fontWeight; + aFontProps[ u"fo:font-weight"_ustr ] = rFont.fontWeight; + aFontProps[ u"style:font-weight-asian"_ustr ] = rFont.fontWeight; + aFontProps[ u"style:font-weight-complex"_ustr ] = rFont.fontWeight; // italic if( rFont.isItalic ) { - aFontProps[ "fo:font-style" ] = "italic"; - aFontProps[ "style:font-style-asian" ] = "italic"; - aFontProps[ "style:font-style-complex" ] = "italic"; + aFontProps[ u"fo:font-style"_ustr ] = "italic"; + aFontProps[ u"style:font-style-asian"_ustr ] = "italic"; + aFontProps[ u"style:font-style-complex"_ustr ] = "italic"; } // underline if( rFont.isUnderline ) { - aFontProps[ "style:text-underline-style" ] = "solid"; - aFontProps[ "style:text-underline-width" ] = "auto"; - aFontProps[ "style:text-underline-color" ] = "font-color"; + aFontProps[ u"style:text-underline-style"_ustr ] = "solid"; + aFontProps[ u"style:text-underline-width"_ustr ] = "auto"; + aFontProps[ u"style:text-underline-color"_ustr ] = "font-color"; } // outline if( rFont.isOutline ) - aFontProps[ "style:text-outline" ] = "true"; + aFontProps[ u"style:text-outline"_ustr ] = "true"; // size SetFontsizeProperties(aFontProps, rFont.size); // color const GraphicsContext& rGC = m_rProcessor.getGraphicsContext( elem.GCId ); - aFontProps[ "fo:color" ] = getColorString( rFont.isOutline ? rGC.LineColor : rGC.FillColor ); + aFontProps[ u"fo:color"_ustr ] = getColorString( rFont.isOutline ? rGC.LineColor : rGC.FillColor ); // scale double fRotate, fShearX; @@ -926,7 +926,7 @@ void DrawXmlFinalizer::visit( TextElement& elem, const std::list< std::unique_pt if (((textScale >= 1) && (textScale <= 99)) || ((textScale >= 101) && (textScale <= 999))) { - aFontProps[ "style:text-scale" ] = getPercentString(textScale); + aFontProps[ u"style:text-scale"_ustr ] = getPercentString(textScale); } StyleContainer::Style aStyle( "style:style"_ostr, std::move(aProps) ); @@ -939,17 +939,17 @@ void DrawXmlFinalizer::visit( ParagraphElement& elem, const std::list< std::uniq { PropertyMap aProps; - aProps[ "style:family" ] = "paragraph"; + aProps[ u"style:family"_ustr ] = "paragraph"; // generate standard paragraph style if necessary m_rStyleContainer.getStandardStyleId( "paragraph" ); PropertyMap aParProps; - aParProps[ "fo:text-align"] = "start"; + aParProps[ u"fo:text-align"_ustr] = "start"; if (elem.bRtl) - aParProps[ "style:writing-mode"] = "rl-tb"; + aParProps[ u"style:writing-mode"_ustr] = "rl-tb"; else - aParProps[ "style:writing-mode"] = "lr-tb"; + aParProps[ u"style:writing-mode"_ustr] = "lr-tb"; StyleContainer::Style aStyle( "style:style"_ostr, std::move(aProps) ); StyleContainer::Style aSubStyle( "style:paragraph-properties"_ostr, std::move(aParProps) ); @@ -963,25 +963,25 @@ void DrawXmlFinalizer::visit( ParagraphElement& elem, const std::list< std::uniq void DrawXmlFinalizer::visit( FrameElement& elem, const std::list< std::unique_ptr<Element> >::const_iterator&) { PropertyMap props1; - props1[ "style:family" ] = "graphic"; - props1[ "style:parent-style-name" ] = "standard"; + props1[ u"style:family"_ustr ] = "graphic"; + props1[ u"style:parent-style-name"_ustr ] = "standard"; // generate standard graphic style if necessary m_rStyleContainer.getStandardStyleId( "graphic" ); PropertyMap aGCProps; - aGCProps[ "draw:stroke" ] = "none"; - aGCProps[ "draw:fill" ] = "none"; - aGCProps[ "draw:auto-grow-height" ] = "true"; - aGCProps[ "draw:auto-grow-width" ] = "true"; - aGCProps[ "draw:textarea-horizontal-align" ] = "left"; - aGCProps[ "draw:textarea-vertical-align" ] = "top"; - aGCProps[ "fo:min-height"] = "0cm"; - aGCProps[ "fo:min-width"] = "0cm"; - aGCProps[ "fo:padding-top" ] = "0cm"; - aGCProps[ "fo:padding-left" ] = "0cm"; - aGCProps[ "fo:padding-right" ] = "0cm"; - aGCProps[ "fo:padding-bottom" ] = "0cm"; + aGCProps[ u"draw:stroke"_ustr ] = "none"; + aGCProps[ u"draw:fill"_ustr ] = "none"; + aGCProps[ u"draw:auto-grow-height"_ustr ] = "true"; + aGCProps[ u"draw:auto-grow-width"_ustr ] = "true"; + aGCProps[ u"draw:textarea-horizontal-align"_ustr ] = "left"; + aGCProps[ u"draw:textarea-vertical-align"_ustr ] = "top"; + aGCProps[ u"fo:min-height"_ustr] = "0cm"; + aGCProps[ u"fo:min-width"_ustr] = "0cm"; + aGCProps[ u"fo:padding-top"_ustr ] = "0cm"; + aGCProps[ u"fo:padding-left"_ustr ] = "0cm"; + aGCProps[ u"fo:padding-right"_ustr ] = "0cm"; + aGCProps[ u"fo:padding-bottom"_ustr ] = "0cm"; StyleContainer::Style style1( "style:style"_ostr, std::move(props1) ); StyleContainer::Style subStyle1( "style:graphic-properties"_ostr, std::move(aGCProps) ); @@ -992,7 +992,7 @@ void DrawXmlFinalizer::visit( FrameElement& elem, const std::list< std::unique_p if (elem.IsForText) { PropertyMap props2; - props2["style:family"] = "paragraph"; + props2[u"style:family"_ustr] = "paragraph"; PropertyMap textProps; SetFontsizeProperties(textProps, elem.FontSize); @@ -1082,14 +1082,14 @@ void DrawXmlFinalizer::visit( PageElement& elem, const std::list< std::unique_pt // get styles for paragraphs PropertyMap aPageProps; PropertyMap aPageLayoutProps; - aPageLayoutProps[ "fo:margin-top" ] = unitMMString( top_margin ); - aPageLayoutProps[ "fo:margin-bottom" ] = unitMMString( bottom_margin ); - aPageLayoutProps[ "fo:margin-left" ] = unitMMString( left_margin ); - 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 ? std::u16string_view(u"portrait") : std::u16string_view(u"landscape"); - aPageLayoutProps[ "style:writing-mode" ]= "lr-tb"; + aPageLayoutProps[ u"fo:margin-top"_ustr ] = unitMMString( top_margin ); + aPageLayoutProps[ u"fo:margin-bottom"_ustr ] = unitMMString( bottom_margin ); + aPageLayoutProps[ u"fo:margin-left"_ustr ] = unitMMString( left_margin ); + aPageLayoutProps[ u"fo:margin-right"_ustr ] = unitMMString( right_margin ); + aPageLayoutProps[ u"fo:page-width"_ustr ] = unitMMString( page_width ); + aPageLayoutProps[ u"fo:page-height"_ustr ] = unitMMString( page_height ); + aPageLayoutProps[ u"style:print-orientation"_ustr ]= elem.w < elem.h ? std::u16string_view(u"portrait") : std::u16string_view(u"landscape"); + aPageLayoutProps[ u"style:writing-mode"_ustr ]= "lr-tb"; StyleContainer::Style aStyle( "style:page-layout"_ostr, std::move(aPageProps)); StyleContainer::Style aSubStyle( "style:page-layout-properties"_ostr, std::move(aPageLayoutProps)); @@ -1098,7 +1098,7 @@ void DrawXmlFinalizer::visit( PageElement& elem, const std::list< std::unique_pt // create master page OUString aMasterPageLayoutName = m_rStyleContainer.getStyleName( nPageStyle ); - aPageProps[ "style:page-layout-name" ] = aMasterPageLayoutName; + aPageProps[ u"style:page-layout-name"_ustr ] = aMasterPageLayoutName; StyleContainer::Style aMPStyle( "style:master-page"_ostr, std::move(aPageProps)); diff --git a/sdext/source/pdfimport/tree/imagecontainer.cxx b/sdext/source/pdfimport/tree/imagecontainer.cxx index b9f7ef52e061..1445d13b20af 100644 --- a/sdext/source/pdfimport/tree/imagecontainer.cxx +++ b/sdext/source/pdfimport/tree/imagecontainer.cxx @@ -159,14 +159,14 @@ OUString ImageContainer::asBase64EncodedString( ImageId nId ) const if (pValue == pAry + nLen ) { SAL_WARN("sdext.pdfimport", "InputSequence not found"); - return ""; + return u""_ustr; } uno::Sequence<sal_Int8> aData; if( !(pValue->Value >>= aData) ) { SAL_WARN("sdext.pdfimport", "Wrong data type"); - return ""; + return u""_ustr; } return encodeBase64( aData.getConstArray(), aData.getLength() ); diff --git a/sdext/source/pdfimport/tree/pdfiprocessor.cxx b/sdext/source/pdfimport/tree/pdfiprocessor.cxx index d60431dbce09..72d3ddd38592 100644 --- a/sdext/source/pdfimport/tree/pdfiprocessor.cxx +++ b/sdext/source/pdfimport/tree/pdfiprocessor.cxx @@ -586,7 +586,7 @@ void PDFIProcessor::startPage( const geometry::RealSize2D& rSize ) if( m_xStatusIndicator.is() ) { if( nNextPageNr == 1 ) - startIndicator( " " ); + startIndicator( u" "_ustr ); m_xStatusIndicator->setValue( nNextPageNr ); } m_pCurPage = ElementFactory::createPageElement(m_pDocument.get(), nNextPageNr); @@ -608,7 +608,7 @@ void PDFIProcessor::emit( XmlEmitter& rEmitter, ElementTreeVisitorSharedPtr optimizingVisitor( rVisitorFactory.createOptimizingVisitor(*this)); // FIXME: localization - startIndicator( " " ); + startIndicator( u" "_ustr ); m_pDocument->visitedBy( *optimizingVisitor, std::list<std::unique_ptr<Element>>::const_iterator()); #if OSL_DEBUG_LEVEL > 0 @@ -630,25 +630,25 @@ void PDFIProcessor::emit( XmlEmitter& rEmitter, PropertyMap aProps; // document prolog #define OASIS_STR "urn:oasis:names:tc:opendocument:xmlns:" - aProps[ "xmlns:office" ] = OASIS_STR "office:1.0" ; - aProps[ "xmlns:style" ] = OASIS_STR "style:1.0" ; - aProps[ "xmlns:text" ] = OASIS_STR "text:1.0" ; - aProps[ "xmlns:svg" ] = OASIS_STR "svg-compatible:1.0" ; - aProps[ "xmlns:table" ] = OASIS_STR "table:1.0" ; - aProps[ "xmlns:draw" ] = OASIS_STR "drawing:1.0" ; - aProps[ "xmlns:fo" ] = OASIS_STR "xsl-fo-compatible:1.0" ; - aProps[ "xmlns:xlink"] = "http://www.w3.org/1999/xlink"; - aProps[ "xmlns:dc"] = "http://purl.org/dc/elements/1.1/"; - aProps[ "xmlns:number"] = OASIS_STR "datastyle:1.0" ; - aProps[ "xmlns:presentation"] = OASIS_STR "presentation:1.0" ; - aProps[ "xmlns:math"] = "http://www.w3.org/1998/Math/MathML"; - aProps[ "xmlns:form"] = OASIS_STR "form:1.0" ; - aProps[ "xmlns:script"] = OASIS_STR "script:1.0" ; - aProps[ "xmlns:dom"] = "http://www.w3.org/2001/xml-events"; - aProps[ "xmlns:xforms"] = "http://www.w3.org/2002/xforms"; - aProps[ "xmlns:xsd"] = "http://www.w3.org/2001/XMLSchema"; - aProps[ "xmlns:xsi"] = "http://www.w3.org/2001/XMLSchema-instance"; - aProps[ "office:version" ] = "1.0"; + aProps[ u"xmlns:office"_ustr ] = OASIS_STR "office:1.0" ; + aProps[ u"xmlns:style"_ustr ] = OASIS_STR "style:1.0" ; + aProps[ u"xmlns:text"_ustr ] = OASIS_STR "text:1.0" ; + aProps[ u"xmlns:svg"_ustr ] = OASIS_STR "svg-compatible:1.0" ; + aProps[ u"xmlns:table"_ustr ] = OASIS_STR "table:1.0" ; + aProps[ u"xmlns:draw"_ustr ] = OASIS_STR "drawing:1.0" ; + aProps[ u"xmlns:fo"_ustr ] = OASIS_STR "xsl-fo-compatible:1.0" ; + aProps[ u"xmlns:xlink"_ustr] = "http://www.w3.org/1999/xlink"; + aProps[ u"xmlns:dc"_ustr] = "http://purl.org/dc/elements/1.1/"; + aProps[ u"xmlns:number"_ustr] = OASIS_STR "datastyle:1.0" ; + aProps[ u"xmlns:presentation"_ustr] = OASIS_STR "presentation:1.0" ; + aProps[ u"xmlns:math"_ustr] = "http://www.w3.org/1998/Math/MathML"; + aProps[ u"xmlns:form"_ustr] = OASIS_STR "form:1.0" ; + aProps[ u"xmlns:script"_ustr] = OASIS_STR "script:1.0" ; + aProps[ u"xmlns:dom"_ustr] = "http://www.w3.org/2001/xml-events"; + aProps[ u"xmlns:xforms"_ustr] = "http://www.w3.org/2002/xforms"; + aProps[ u"xmlns:xsd"_ustr] = "http://www.w3.org/2001/XMLSchema"; + aProps[ u"xmlns:xsi"_ustr] = "http://www.w3.org/2001/XMLSchema-instance"; + aProps[ u"office:version"_ustr ] = "1.0"; aContext.rEmitter.beginTag( "office:document", aProps ); diff --git a/sdext/source/pdfimport/tree/style.cxx b/sdext/source/pdfimport/tree/style.cxx index 969fdc0e9648..9ed2281421c8 100644 --- a/sdext/source/pdfimport/tree/style.cxx +++ b/sdext/source/pdfimport/tree/style.cxx @@ -76,8 +76,8 @@ sal_Int32 StyleContainer::impl_getStyleId( const Style& rStyle, bool bSubStyle ) sal_Int32 StyleContainer::getStandardStyleId( std::string_view rName ) { PropertyMap aProps; - aProps[ "style:family" ] = OStringToOUString( rName, RTL_TEXTENCODING_UTF8 ); - aProps[ "style:name" ] = "standard"; + aProps[ u"style:family"_ustr ] = OStringToOUString( rName, RTL_TEXTENCODING_UTF8 ); + aProps[ u"style:name"_ustr ] = "standard"; Style aStyle( "style:style"_ostr, std::move(aProps) ); return getStyleId( aStyle ); @@ -153,12 +153,12 @@ OUString StyleContainer::getStyleName( sal_Int32 nStyle ) const { const HashedStyle& rStyle = style_it->second.style; - PropertyMap::const_iterator name_it = rStyle.Properties.find( "style:name" ); + PropertyMap::const_iterator name_it = rStyle.Properties.find( u"style:name"_ustr ); if( name_it != rStyle.Properties.end() ) aRet.append( name_it->second ); else { - PropertyMap::const_iterator fam_it = rStyle.Properties.find( "style:family" ); + PropertyMap::const_iterator fam_it = rStyle.Properties.find( u"style:family"_ustr ); OUString aStyleName; if( fam_it != rStyle.Properties.end() ) { @@ -189,9 +189,9 @@ void StyleContainer::impl_emitStyle( sal_Int32 nStyleId, const HashedStyle& rStyle = it->second.style; PropertyMap aProps( rStyle.Properties ); if( !rStyle.IsSubStyle ) - aProps[ "style:name" ] = getStyleName( nStyleId ); + aProps[ u"style:name"_ustr ] = getStyleName( nStyleId ); if (rStyle.Name == "draw:stroke-dash" || rStyle.Name == "draw:fill-image") - aProps[ "draw:name" ] = aProps[ "style:name" ]; + aProps[ u"draw:name"_ustr ] = aProps[ u"style:name"_ustr ]; rContext.rEmitter.beginTag( rStyle.Name.getStr(), aProps ); for(sal_Int32 nSubStyle : rStyle.SubStyles) diff --git a/sdext/source/pdfimport/tree/writertreevisiting.cxx b/sdext/source/pdfimport/tree/writertreevisiting.cxx index f7e1edb6a37d..1c5e4c903dce 100644 --- a/sdext/source/pdfimport/tree/writertreevisiting.cxx +++ b/sdext/source/pdfimport/tree/writertreevisiting.cxx @@ -70,10 +70,10 @@ void WriterXmlEmitter::visit( HyperlinkElement& elem, const std::list< std::uniq const char* pType = dynamic_cast<DrawElement*>(elem.Children.front().get()) ? "draw:a" : "text:a"; PropertyMap aProps; - aProps[ "xlink:type" ] = "simple"; - aProps[ "xlink:href" ] = elem.URI; - aProps[ "office:target-frame-name" ] = "_blank"; - aProps[ "xlink:show" ] = "new"; + aProps[ u"xlink:type"_ustr ] = "simple"; + aProps[ u"xlink:href"_ustr ] = elem.URI; + aProps[ u"office:target-frame-name"_ustr ] = "_blank"; + aProps[ u"xlink:show"_ustr ] = "new"; m_rEmitContext.rEmitter.beginTag( pType, aProps ); auto this_it = elem.Children.begin(); @@ -97,7 +97,7 @@ void WriterXmlEmitter::visit( TextElement& elem, const std::list< std::unique_pt if( elem.StyleId != -1 ) { - aProps[ OUString( "text:style-name" ) ] = + aProps[ u"text:style-name"_ustr ] = m_rEmitContext.rStyles.getStyleName( elem.StyleId ); } @@ -136,7 +136,7 @@ void WriterXmlEmitter::visit( TextElement& elem, const std::list< std::unique_pt strToken = str[i]; if (strToken == strSpace || strToken == strNbSpace) { - aProps["text:c"] = "1"; + aProps[u"text:c"_ustr] = "1"; m_rEmitContext.rEmitter.beginTag("text:s", aProps); m_rEmitContext.rEmitter.endTag("text:s"); } @@ -164,7 +164,7 @@ void WriterXmlEmitter::visit( ParagraphElement& elem, const std::list< std::uniq PropertyMap aProps; if( elem.StyleId != -1 ) { - aProps[ "text:style-name" ] = m_rEmitContext.rStyles.getStyleName( elem.StyleId ); + aProps[ u"text:style-name"_ustr ] = m_rEmitContext.rStyles.getStyleName( elem.StyleId ); } const char* pTagType = "text:p"; if( elem.Type == ParagraphElement::Headline ) @@ -202,23 +202,23 @@ void WriterXmlEmitter::fillFrameProps( DrawElement& rElem, { if (pParaElt) { - rProps[ "text:anchor-type" ] = rElem.isCharacter + rProps[ u"text:anchor-type"_ustr ] = rElem.isCharacter ? std::u16string_view(u"character") : std::u16string_view(u"paragraph"); } else { assert(pPage); // guaranteed by the while loop above - rProps[ "text:anchor-type" ] = "page"; - rProps[ "text:anchor-page-number" ] = OUString::number(pPage->PageNumber); + rProps[ u"text:anchor-type"_ustr ] = "page"; + rProps[ u"text:anchor-page-number"_ustr ] = OUString::number(pPage->PageNumber); } rel_x -= pAnchor->x; rel_y -= pAnchor->y; } - rProps[ "draw:z-index" ] = OUString::number( rElem.ZOrder ); - rProps[ "draw:style-name"] = rEmitContext.rStyles.getStyleName( rElem.StyleId ); - rProps[ "svg:width" ] = convertPixelToUnitString( rElem.w ); - rProps[ "svg:height" ] = convertPixelToUnitString( rElem.h ); + rProps[ u"draw:z-index"_ustr ] = OUString::number( rElem.ZOrder ); + rProps[ u"draw:style-name"_ustr] = rEmitContext.rStyles.getStyleName( rElem.StyleId ); + rProps[ u"svg:width"_ustr ] = convertPixelToUnitString( rElem.w ); + rProps[ u"svg:height"_ustr ] = convertPixelToUnitString( rElem.h ); const GraphicsContext& rGC = rEmitContext.rProcessor.getGraphicsContext( rElem.GCId ); @@ -226,8 +226,8 @@ void WriterXmlEmitter::fillFrameProps( DrawElement& rElem, { if( !rElem.isCharacter ) { - rProps[ "svg:x" ] = convertPixelToUnitString( rel_x ); - rProps[ "svg:y" ] = convertPixelToUnitString( rel_y ); + rProps[ u"svg:x"_ustr ] = convertPixelToUnitString( rel_x ); + rProps[ u"svg:y"_ustr ] = convertPixelToUnitString( rel_y ); } } else @@ -274,7 +274,7 @@ void WriterXmlEmitter::fillFrameProps( DrawElement& rElem, + " )" ); } - rProps[ "draw:transform" ] = aBuf.makeStringAndClear(); + rProps[ u"draw:transform"_ustr ] = aBuf.makeStringAndClear(); } } @@ -354,12 +354,12 @@ void WriterXmlEmitter::visit( PolyPolyElement& elem, const std::list< std::uniqu PropertyMap aProps; fillFrameProps( elem, aProps, m_rEmitContext ); - aProps[ "svg:viewBox" ] = + aProps[ u"svg:viewBox"_ustr ] = "0 0 " + OUString::number(convPx2mmPrec2(elem.w)*100.0) + " " + OUString::number( convPx2mmPrec2(elem.h)*100.0 ); - aProps[ "svg:d" ] = basegfx::utils::exportToSvgD( elem.PolyPoly, true, true, false ); + aProps[ u"svg:d"_ustr ] = basegfx::utils::exportToSvgD( elem.PolyPoly, true, true, false ); m_rEmitContext.rEmitter.beginTag( "draw:path", aProps ); m_rEmitContext.rEmitter.endTag( "draw:path" ); @@ -964,7 +964,7 @@ void WriterXmlFinalizer::visit( PolyPolyElement& elem, const std::list< std::uni // xxx TODO copied from DrawElement const GraphicsContext& rGC = m_rProcessor.getGraphicsContext(elem.GCId ); PropertyMap aProps; - aProps[ "style:family" ] = "graphic"; + aProps[ u"style:family"_ustr ] = "graphic"; PropertyMap aGCProps; if (elem.Action & PATH_STROKE) @@ -972,7 +972,7 @@ void WriterXmlFinalizer::visit( PolyPolyElement& elem, const std::list< std::uni double scale = GetAverageTransformationScale(rGC.Transformation); if (rGC.DashArray.size() < 2) { - aGCProps[ "draw:stroke" ] = "solid"; + aGCProps[ u"draw:stroke"_ustr ] = "solid"; } else { @@ -980,20 +980,20 @@ void WriterXmlFinalizer::visit( PolyPolyElement& elem, const std::list< std::uni FillDashStyleProps(props, rGC.DashArray, scale); StyleContainer::Style style("draw:stroke-dash"_ostr, std::move(props)); - aGCProps[ "draw:stroke" ] = "dash"; - aGCProps[ "draw:stroke-dash" ] = + aGCProps[ u"draw:stroke"_ustr ] = "dash"; + aGCProps[ u"draw:stroke-dash"_ustr ] = m_rStyleContainer.getStyleName( m_rStyleContainer.getStyleId(style)); } - aGCProps[ "svg:stroke-color" ] = getColorString(rGC.LineColor); - aGCProps[ "svg:stroke-width" ] = convertPixelToUnitString(rGC.LineWidth * scale); - aGCProps[ "draw:stroke-linejoin" ] = rGC.GetLineJoinString(); - aGCProps[ "svg:stroke-linecap" ] = rGC.GetLineCapString(); + aGCProps[ u"svg:stroke-color"_ustr ] = getColorString(rGC.LineColor); + aGCProps[ u"svg:stroke-width"_ustr ] = convertPixelToUnitString(rGC.LineWidth * scale); + aGCProps[ u"draw:stroke-linejoin"_ustr ] = rGC.GetLineJoinString(); + aGCProps[ u"svg:stroke-linecap"_ustr ] = rGC.GetLineCapString(); } else { - aGCProps[ "draw:stroke" ] = "none"; + aGCProps[ u"draw:stroke"_ustr ] = "none"; } if (elem.FillImage != -1) @@ -1002,11 +1002,11 @@ void WriterXmlFinalizer::visit( PolyPolyElement& elem, const std::list< std::uni // The image isn't actually in a prop, it's in an extra chunk inside. StyleContainer::Style style("draw:fill-image"_ostr, std::move(props)); style.Contents = m_rProcessor.getImages().asBase64EncodedString(elem.FillImage); - aGCProps[ "draw:fill-image-name" ] = + aGCProps[ u"draw:fill-image-name"_ustr ] = m_rStyleContainer.getStyleName( m_rStyleContainer.getStyleId(style)); - aGCProps[ "draw:fill-image-width" ] = unitMMString(convPx2mm(elem.TileWidth)); - aGCProps[ "draw:fill-image-height" ] = unitMMString(convPx2mm(elem.TileHeight)); + aGCProps[ u"draw:fill-image-width"_ustr ] = unitMMString(convPx2mm(elem.TileWidth)); + aGCProps[ u"draw:fill-image-height"_ustr ] = unitMMString(convPx2mm(elem.TileHeight)); } // TODO(F1): check whether stuff could be emulated by gradient/bitmap/hatch @@ -1014,17 +1014,17 @@ void WriterXmlFinalizer::visit( PolyPolyElement& elem, const std::list< std::uni { if (elem.FillImage == -1) { - aGCProps[ "draw:fill" ] = "solid"; + aGCProps[ u"draw:fill"_ustr ] = "solid"; } else { - aGCProps[ "draw:fill" ] = "bitmap"; + aGCProps[ u"draw:fill"_ustr ] = "bitmap"; } - aGCProps[ "draw:fill-color" ] = getColorString( rGC.FillColor ); + aGCProps[ u"draw:fill-color"_ustr ] = getColorString( rGC.FillColor ); } else { - aGCProps[ "draw:fill" ] = "none"; + aGCProps[ u"draw:fill"_ustr ] = "none"; } StyleContainer::Style aStyle( "style:style"_ostr, std::move(aProps) ); @@ -1042,51 +1042,51 @@ void WriterXmlFinalizer::visit( TextElement& elem, const std::list< std::unique_ { const FontAttributes& rFont = m_rProcessor.getFont( elem.FontId ); PropertyMap aProps; - aProps[ "style:family" ] = "text"; + aProps[ u"style:family"_ustr ] = "text"; PropertyMap aFontProps; // family name // TODO: tdf#143095: use system font name rather than PSName SAL_INFO("sdext.pdfimport", "The font used in xml is: " << rFont.familyName); - aFontProps[ "fo:font-family" ] = rFont.familyName; - aFontProps[ "style:font-family-asian" ] = rFont.familyName; - aFontProps[ "style:font-family-complex" ] = rFont.familyName; + aFontProps[ u"fo:font-family"_ustr ] = rFont.familyName; + aFontProps[ u"style:font-family-asian"_ustr ] = rFont.familyName; + aFontProps[ u"style:font-family-complex"_ustr ] = rFont.familyName; // bold - aFontProps[ "fo:font-weight" ] = rFont.fontWeight; - aFontProps[ "style:font-weight-asian" ] = rFont.fontWeight; - aFontProps[ "style:font-weight-complex" ] = rFont.fontWeight; + aFontProps[ u"fo:font-weight"_ustr ] = rFont.fontWeight; + aFontProps[ u"style:font-weight-asian"_ustr ] = rFont.fontWeight; + aFontProps[ u"style:font-weight-complex"_ustr ] = rFont.fontWeight; // italic if( rFont.isItalic ) { - aFontProps[ "fo:font-style" ] = "italic"; - aFontProps[ "style:font-style-asian" ] = "italic"; - aFontProps[ "style:font-style-complex" ] = "italic"; + aFontProps[ u"fo:font-style"_ustr ] = "italic"; + aFontProps[ u"style:font-style-asian"_ustr ] = "italic"; + aFontProps[ u"style:font-style-complex"_ustr ] = "italic"; } // underline if( rFont.isUnderline ) { - aFontProps[ "style:text-underline-style" ] = "solid"; - aFontProps[ "style:text-underline-width" ] = "auto"; - aFontProps[ "style:text-underline-color" ] = "font-color"; + aFontProps[ u"style:text-underline-style"_ustr ] = "solid"; + aFontProps[ u"style:text-underline-width"_ustr ] = "auto"; + aFontProps[ u"style:text-underline-color"_ustr ] = "font-color"; } // outline if( rFont.isOutline ) - aFontProps[ "style:text-outline" ] = "true"; + aFontProps[ u"style:text-outline"_ustr ] = "true"; // size OUString aFSize = OUString::number( rFont.size*72/PDFI_OUTDEV_RESOLUTION ) + "pt"; - aFontProps[ "fo:font-size" ] = aFSize; - aFontProps[ "style:font-size-asian" ] = aFSize; - aFontProps[ "style:font-size-complex" ] = aFSize; + aFontProps[ u"fo:font-size"_ustr ] = aFSize; + aFontProps[ u"style:font-size-asian"_ustr ] = aFSize; + aFontProps[ u"style:font-size-complex"_ustr ] = aFSize; // color const GraphicsContext& rGC = m_rProcessor.getGraphicsContext( elem.GCId ); - aFontProps[ "fo:color" ] = getColorString( rFont.isOutline ? rGC.LineColor : rGC.FillColor ); + aFontProps[ u"fo:color"_ustr ] = getColorString( rFont.isOutline ? rGC.LineColor : rGC.FillColor ); StyleContainer::Style aStyle( "style:style"_ostr, std::move(aProps) ); StyleContainer::Style aSubStyle( "style:text-properties"_ostr, std::move(aFontProps) ); @@ -1123,13 +1123,13 @@ void WriterXmlFinalizer::visit( ParagraphElement& elem, const std::list< std::un (pPage && fabs( elem.x+elem.w/2 - (pPage->x + pPage->w/2) ) < delta) ) { bIsCenter = true; - aParaProps[ "fo:text-align" ] = "center"; + aParaProps[ u"fo:text-align"_ustr ] = "center"; } } if( ! bIsCenter && elem.x > p_x + p_w/10 ) { // indent - aParaProps[ "fo:margin-left" ] = OUString::number(convPx2mm( elem.x - p_x )) + "mm"; + aParaProps[ u"fo:margin-left"_ustr ] = OUString::number(convPx2mm( elem.x - p_x )) + "mm"; } // check whether to leave some space to next paragraph @@ -1142,7 +1142,7 @@ void WriterXmlFinalizer::visit( ParagraphElement& elem, const std::list< std::un { if( pNextPara->y - (elem.y+elem.h) > convmm2Px( 10 ) ) { - aParaProps[ "fo:margin-bottom" ] = + aParaProps[ u"fo:margin-bottom"_ustr ] = OUString::number( convPx2mm( pNextPara->y - (elem.y+elem.h) ) ) + "mm"; } } @@ -1151,7 +1151,7 @@ void WriterXmlFinalizer::visit( ParagraphElement& elem, const std::list< std::un if( ! aParaProps.empty() ) { PropertyMap aProps; - aProps[ "style:family" ] = "paragraph"; + aProps[ u"style:family"_ustr ] = "paragraph"; StyleContainer::Style aStyle( "style:style"_ostr, std::move(aProps) ); StyleContainer::Style aSubStyle( "style:paragraph-properties"_ostr, std::move(aParaProps) ); aStyle.SubStyles.push_back( &aSubStyle ); @@ -1164,22 +1164,22 @@ void WriterXmlFinalizer::visit( ParagraphElement& elem, const std::list< std::un void WriterXmlFinalizer::visit( FrameElement& elem, const std::list< std::unique_ptr<Element> >::const_iterator&) { PropertyMap aProps; - aProps[ "style:family" ] = "graphic"; + aProps[ u"style:family"_ustr ] = "graphic"; PropertyMap aGCProps; - aGCProps[ "draw:stroke" ] = "none"; - aGCProps[ "draw:fill" ] = "none"; - aGCProps[ "draw:auto-grow-height" ] = "true"; - aGCProps[ "draw:auto-grow-width" ] = "true"; - aGCProps[ "draw:textarea-horizontal-align" ] = "left"; - aGCProps[ "draw:textarea-vertical-align" ] = "top"; - aGCProps[ "fo:min-height"] = "0cm"; - aGCProps[ "fo:min-width"] = "0cm"; - aGCProps[ "fo:padding-top" ] = "0cm"; - aGCProps[ "fo:padding-left" ] = "0cm"; - aGCProps[ "fo:padding-right" ] = "0cm"; - aGCProps[ "fo:padding-bottom" ] = "0cm"; + aGCProps[ u"draw:stroke"_ustr ] = "none"; + aGCProps[ u"draw:fill"_ustr ] = "none"; + aGCProps[ u"draw:auto-grow-height"_ustr ] = "true"; + aGCProps[ u"draw:auto-grow-width"_ustr ] = "true"; + aGCProps[ u"draw:textarea-horizontal-align"_ustr ] = "left"; + aGCProps[ u"draw:textarea-vertical-align"_ustr ] = "top"; + aGCProps[ u"fo:min-height"_ustr] = "0cm"; + aGCProps[ u"fo:min-width"_ustr] = "0cm"; + aGCProps[ u"fo:padding-top"_ustr ] = "0cm"; + aGCProps[ u"fo:padding-left"_ustr ] = "0cm"; + aGCProps[ u"fo:padding-right"_ustr ] = "0cm"; + aGCProps[ u"fo:padding-bottom"_ustr ] = "0cm"; StyleContainer::Style aStyle( "style:style"_ostr, std::move(aProps) ); StyleContainer::Style aSubStyle( "style:graphic-properties"_ostr, std::move(aGCProps) ); @@ -1205,8 +1205,8 @@ void WriterXmlFinalizer::setFirstOnPage( ParagraphElement& rElem, aProps = *pProps; } - aProps[ "style:family" ] = "paragraph"; - aProps[ "style:master-page-name" ] = rMasterPageName; + aProps[ u"style:family"_ustr ] = "paragraph"; + aProps[ u"style:master-page-name"_ustr ] = rMasterPageName; if( rElem.StyleId != -1 ) rElem.StyleId = rStyles.setProperties( rElem.StyleId, std::move(aProps) ); @@ -1307,15 +1307,15 @@ void WriterXmlFinalizer::visit( PageElement& elem, const std::list< std::unique_ // get styles for paragraphs PropertyMap aPageProps; PropertyMap aPageLayoutProps; - aPageLayoutProps[ "fo:page-width" ] = unitMMString( page_width ); - aPageLayoutProps[ "fo:page-height" ] = unitMMString( page_height ); - aPageLayoutProps[ "style:print-orientation" ] + aPageLayoutProps[ u"fo:page-width"_ustr ] = unitMMString( page_width ); + aPageLayoutProps[ u"fo:page-height"_ustr ] = unitMMString( page_height ); + aPageLayoutProps[ u"style:print-orientation"_ustr ] = elem.w < elem.h ? std::u16string_view(u"portrait") : std::u16string_view(u"landscape"); - aPageLayoutProps[ "fo:margin-top" ] = unitMMString( top_margin ); - aPageLayoutProps[ "fo:margin-bottom" ] = unitMMString( bottom_margin ); - aPageLayoutProps[ "fo:margin-left" ] = unitMMString( left_margin ); - aPageLayoutProps[ "fo:margin-right" ] = unitMMString( right_margin ); - aPageLayoutProps[ "style:writing-mode" ]= "lr-tb"; + aPageLayoutProps[ u"fo:margin-top"_ustr ] = unitMMString( top_margin ); + aPageLayoutProps[ u"fo:margin-bottom"_ustr ] = unitMMString( bottom_margin ); + aPageLayoutProps[ u"fo:margin-left"_ustr ] = unitMMString( left_margin ); + aPageLayoutProps[ u"fo:margin-right"_ustr ] = unitMMString( right_margin ); + aPageLayoutProps[ u"style:writing-mode"_ustr ]= "lr-tb"; StyleContainer::Style aStyle( "style:page-layout"_ostr, std::move(aPageProps)); StyleContainer::Style aSubStyle( "style:page-layout-properties"_ostr, std::move(aPageLayoutProps)); @@ -1324,7 +1324,7 @@ void WriterXmlFinalizer::visit( PageElement& elem, const std::list< std::unique_ // create master page OUString aMasterPageLayoutName = m_rStyleContainer.getStyleName( nPageStyle ); - aPageProps[ "style:page-layout-name" ] = aMasterPageLayoutName; + aPageProps[ u"style:page-layout-name"_ustr ] = aMasterPageLayoutName; StyleContainer::Style aMPStyle( "style:master-page"_ostr, std::move(aPageProps) ); StyleContainer::Style aHeaderStyle( "style:header"_ostr, PropertyMap() ); StyleContainer::Style aFooterStyle( "style:footer"_ostr, PropertyMap() ); diff --git a/sdext/source/pdfimport/wrapper/wrapper.cxx b/sdext/source/pdfimport/wrapper/wrapper.cxx index 11932746aeb6..6ecf0c14d7a9 100644 --- a/sdext/source/pdfimport/wrapper/wrapper.cxx +++ b/sdext/source/pdfimport/wrapper/wrapper.cxx @@ -720,7 +720,7 @@ uno::Sequence<beans::PropertyValue> LineParser::readImageImpl() uno::Reference< uno::XComponentContext > xContext( m_parser.m_xContext, uno::UNO_SET_THROW ); uno::Reference< lang::XMultiComponentFactory > xFactory( xContext->getServiceManager(), uno::UNO_SET_THROW ); uno::Reference< io::XInputStream > xDataStream( - xFactory->createInstanceWithArgumentsAndContext( "com.sun.star.io.SequenceInputStream", aStreamCreationArgs, m_parser.m_xContext ), + xFactory->createInstanceWithArgumentsAndContext( u"com.sun.star.io.SequenceInputStream"_ustr, aStreamCreationArgs, m_parser.m_xContext ), uno::UNO_QUERY_THROW ); uno::Sequence<beans::PropertyValue> aSequence( comphelper::InitPropertySequence({ @@ -1077,7 +1077,7 @@ bool xpdf_ImportFromFile(const OUString& rURL, } // Determine xpdfimport executable URL: - OUString converterURL("$BRAND_BASE_DIR/" LIBO_BIN_FOLDER "/xpdfimport"); + OUString converterURL(u"$BRAND_BASE_DIR/" LIBO_BIN_FOLDER "/xpdfimport"_ustr); rtl::Bootstrap::expandMacros(converterURL); //TODO: detect failure // spawn separate process to keep LGPL/GPL code apart. |