summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2021-03-25 09:53:33 +0300
committerMike Kaganski <mike.kaganski@collabora.com>2021-03-25 10:06:26 +0100
commita0656ec6fc2b41e65f1b40dbd64f546175e2762f (patch)
treec0d3443a27d9dc10266760110e96b50cce46ef02 /sfx2
parente9c6fd6b4d09ee59b6a86942cbf001f2ba9782e6 (diff)
const OUString -> const OUStringLiteral
Mostly automated rewrite Change-Id: Ie020a083f898bc126b8fb039d4ecb2e687172da1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112965 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/source/appl/sfxhelp.cxx2
-rw-r--r--sfx2/source/dialog/dinfdlg.cxx2
-rw-r--r--sfx2/source/dialog/mailmodel.cxx2
-rw-r--r--sfx2/source/doc/docmacromode.cxx4
-rw-r--r--sfx2/source/doc/doctemplates.cxx6
-rw-r--r--sfx2/source/doc/doctemplateslocal.cxx4
-rw-r--r--sfx2/source/doc/guisaveas.cxx14
-rw-r--r--sfx2/source/doc/objstor.cxx30
-rw-r--r--sfx2/source/doc/sfxbasemodel.cxx10
-rw-r--r--sfx2/source/view/viewfrm.cxx4
10 files changed, 39 insertions, 39 deletions
diff --git a/sfx2/source/appl/sfxhelp.cxx b/sfx2/source/appl/sfxhelp.cxx
index e16d5cab7865..8df199b55649 100644
--- a/sfx2/source/appl/sfxhelp.cxx
+++ b/sfx2/source/appl/sfxhelp.cxx
@@ -206,7 +206,7 @@ static OUString const & HelpLocaleString()
if (!aLocaleStr.isEmpty())
return aLocaleStr;
- const OUString aEnglish("en-US");
+ static const OUStringLiteral aEnglish(u"en-US");
// detect installed locale
aLocaleStr = utl::ConfigManager::getUILocale();
diff --git a/sfx2/source/dialog/dinfdlg.cxx b/sfx2/source/dialog/dinfdlg.cxx
index 5e63fa018c00..c08c0dfa5cd8 100644
--- a/sfx2/source/dialog/dinfdlg.cxx
+++ b/sfx2/source/dialog/dinfdlg.cxx
@@ -150,7 +150,7 @@ OUString ConvertDateTime_Impl( const OUString& rName,
{
Date aD(uDT);
tools::Time aT(uDT);
- const OUString aDelim( ", " );
+ static const OUStringLiteral aDelim( u", " );
OUString aStr = rWrapper.getDate( aD )
+ aDelim
+ rWrapper.getTime( aT );
diff --git a/sfx2/source/dialog/mailmodel.cxx b/sfx2/source/dialog/mailmodel.cxx
index 87ad643da40d..5e5d079fd934 100644
--- a/sfx2/source/dialog/mailmodel.cxx
+++ b/sfx2/source/dialog/mailmodel.cxx
@@ -462,7 +462,7 @@ SfxMailModel::SaveResult SfxMailModel::SaveDocumentAsFormat(
OUString aFileURL = aFilePathObj.GetMainURL( INetURLObject::DecodeMechanism::NONE );
sal_Int32 nNumArgs(0);
- const OUString aPasswordPropName( "Password" );
+ static const OUStringLiteral aPasswordPropName( u"Password" );
css::uno::Sequence< css::beans::PropertyValue > aArgs( ++nNumArgs );
aArgs[nNumArgs-1].Name = "FilterName";
aArgs[nNumArgs-1].Value <<= aFilterName;
diff --git a/sfx2/source/doc/docmacromode.cxx b/sfx2/source/doc/docmacromode.cxx
index 6bc0af19f2c5..0e1ad424831e 100644
--- a/sfx2/source/doc/docmacromode.cxx
+++ b/sfx2/source/doc/docmacromode.cxx
@@ -327,8 +327,8 @@ namespace sfx2
bHasMacroLib = false;
else
{
- const OUString aStdLibName( "Standard" );
- const OUString aVBAProject( "VBAProject" );
+ static const OUStringLiteral aStdLibName( u"Standard" );
+ static const OUStringLiteral aVBAProject( u"VBAProject" );
const Sequence< OUString > aElements = xContainer->getElementNames();
for( const OUString& aElement : aElements )
{
diff --git a/sfx2/source/doc/doctemplates.cxx b/sfx2/source/doc/doctemplates.cxx
index 4c1e99bde06d..ae7d21d2728f 100644
--- a/sfx2/source/doc/doctemplates.cxx
+++ b/sfx2/source/doc/doctemplates.cxx
@@ -543,8 +543,8 @@ void SfxDocTplService_Impl::getDirList()
maTemplateDirs = Sequence< OUString >( nCount );
uno::Reference< util::XMacroExpander > xExpander = util::theMacroExpander::get(mxContext);
- const OUString aPrefix(
- "vnd.sun.star.expand:" );
+ static const OUStringLiteral aPrefix(
+ u"vnd.sun.star.expand:" );
sal_Int32 nIdx{ 0 };
for (auto& rTemplateDir : maTemplateDirs)
@@ -1950,7 +1950,7 @@ bool SfxDocTplService_Impl::addTemplate( const OUString& rGroupName,
Content aResultContent;
if ( Content::create( aNewTemplateTargetURL, xEnv, comphelper::getProcessComponentContext(), aResultContent ) )
{
- const OUString aPropertyName( "IsReadOnly" );
+ static const OUStringLiteral aPropertyName( u"IsReadOnly" );
uno::Any aProperty;
bool bReadOnly = false;
if ( getProperty( aResultContent, aPropertyName, aProperty ) && ( aProperty >>= bReadOnly ) && bReadOnly )
diff --git a/sfx2/source/doc/doctemplateslocal.cxx b/sfx2/source/doc/doctemplateslocal.cxx
index 41561925bd6b..5a55df72a45a 100644
--- a/sfx2/source/doc/doctemplateslocal.cxx
+++ b/sfx2/source/doc/doctemplateslocal.cxx
@@ -58,8 +58,8 @@ void DocTemplLocaleHelper::WriteGroupLocalizationSequence( const uno::Reference<
xWriterHandler->setOutputStream( xOutStream );
- const OUString aCDATAString( "CDATA" );
- const OUString aWhiteSpace( " " );
+ static const OUStringLiteral aCDATAString( u"CDATA" );
+ static const OUStringLiteral aWhiteSpace( u" " );
// write the namespace
rtl::Reference<::comphelper::AttributeList> pRootAttrList = new ::comphelper::AttributeList;
diff --git a/sfx2/source/doc/guisaveas.cxx b/sfx2/source/doc/guisaveas.cxx
index 9def55f25e67..e2a2209e7b38 100644
--- a/sfx2/source/doc/guisaveas.cxx
+++ b/sfx2/source/doc/guisaveas.cxx
@@ -648,13 +648,13 @@ sal_Int8 ModelData_Impl::CheckStateForSave()
// check acceptable entries for media descriptor
::comphelper::SequenceAsHashMap aAcceptedArgs;
- const OUString aVersionCommentString("VersionComment");
- const OUString aAuthorString("Author");
- const OUString aDontTerminateEdit("DontTerminateEdit");
- const OUString aInteractionHandlerString("InteractionHandler");
- const OUString aStatusIndicatorString("StatusIndicator");
- const OUString aFailOnWarningString("FailOnWarning");
- const OUString aNoFileSync("NoFileSync");
+ static const OUStringLiteral aVersionCommentString(u"VersionComment");
+ static const OUStringLiteral aAuthorString(u"Author");
+ static const OUStringLiteral aDontTerminateEdit(u"DontTerminateEdit");
+ static const OUStringLiteral aInteractionHandlerString(u"InteractionHandler");
+ static const OUStringLiteral aStatusIndicatorString(u"StatusIndicator");
+ static const OUStringLiteral aFailOnWarningString(u"FailOnWarning");
+ static const OUStringLiteral aNoFileSync(u"NoFileSync");
if ( GetMediaDescr().find( aVersionCommentString ) != GetMediaDescr().end() )
aAcceptedArgs[ aVersionCommentString ] = GetMediaDescr()[ aVersionCommentString ];
diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx
index 653ea8877a94..f303bc6e5e97 100644
--- a/sfx2/source/doc/objstor.cxx
+++ b/sfx2/source/doc/objstor.cxx
@@ -723,7 +723,7 @@ bool SfxObjectShell::DoLoad( SfxMedium *pMed )
&& !bPdfiumImport)
{
uno::Reference < beans::XPropertySet > xSet( GetModel(), uno::UNO_QUERY );
- const OUString sLockUpdates("LockUpdates");
+ static const OUStringLiteral sLockUpdates(u"LockUpdates");
bool bSetProperty = true;
try
{
@@ -765,9 +765,9 @@ bool SfxObjectShell::DoLoad( SfxMedium *pMed )
css::uno::Reference < XPropertySetInfo > xProps = aContent.getProperties();
if ( xProps.is() )
{
- const OUString aAuthor( "Author" );
- const OUString aKeywords( "Keywords" );
- const OUString aSubject( "Subject" );
+ static const OUStringLiteral aAuthor( u"Author" );
+ static const OUStringLiteral aKeywords( u"Keywords" );
+ static const OUStringLiteral aSubject( u"Subject" );
Any aAny;
OUString aValue;
uno::Reference<document::XDocumentPropertiesSupplier> xDPS(
@@ -1029,8 +1029,8 @@ bool SfxObjectShell::DoSave()
if ( !xTmpStorage.is() )
throw uno::RuntimeException();
- const OUString aBasicStorageName( "Basic" );
- const OUString aDialogsStorageName( "Dialogs" );
+ static const OUStringLiteral aBasicStorageName( u"Basic" );
+ static const OUStringLiteral aDialogsStorageName( u"Dialogs" );
if ( GetMedium()->GetStorage()->hasByName( aBasicStorageName ) )
GetMedium()->GetStorage()->copyElementTo( aBasicStorageName, xTmpStorage, aBasicStorageName );
if ( GetMedium()->GetStorage()->hasByName( aDialogsStorageName ) )
@@ -1464,7 +1464,7 @@ bool SfxObjectShell::SaveTo_Impl
if ( aVersions.hasElements() )
{
// copy the version streams
- const OUString aVersionsName( "Versions" );
+ static const OUStringLiteral aVersionsName( u"Versions" );
uno::Reference< embed::XStorage > xNewVerStor = xMedStorage->openStorageElement(
aVersionsName,
embed::ElementModes::READWRITE );
@@ -1701,9 +1701,9 @@ bool SfxObjectShell::SaveTo_Impl
css::uno::Reference < XPropertySetInfo > xProps = aContent.getProperties();
if ( xProps.is() )
{
- const OUString aAuthor( "Author" );
- const OUString aKeywords( "Keywords" );
- const OUString aSubject( "Subject" );
+ static const OUStringLiteral aAuthor( u"Author" );
+ static const OUStringLiteral aKeywords( u"Keywords" );
+ static const OUStringLiteral aSubject( u"Subject" );
uno::Reference<document::XDocumentPropertiesSupplier> xDPS(
GetModel(), uno::UNO_QUERY_THROW);
@@ -2205,7 +2205,7 @@ bool SfxObjectShell::ImportFrom(SfxMedium& rMedium,
css::uno::Sequence < css::beans::PropertyValue > aArgs ( lDescriptor.getLength() );
css::beans::PropertyValue * pNewValue = aArgs.getArray();
const css::beans::PropertyValue * pOldValue = lDescriptor.getConstArray();
- const OUString sInputStream ( "InputStream" );
+ static const OUStringLiteral sInputStream ( u"InputStream" );
bool bHasInputStream = false;
bool bHasBaseURL = false;
@@ -2385,8 +2385,8 @@ bool SfxObjectShell::ExportTo( SfxMedium& rMedium )
css::beans::PropertyValue * pNewValue = aArgs.getArray();
// put in the REAL file name, and copy all PropertyValues
- const OUString sOutputStream ( "OutputStream" );
- const OUString sStream ( "StreamForOutput" );
+ static const OUStringLiteral sOutputStream ( u"OutputStream" );
+ static const OUStringLiteral sStream ( u"StreamForOutput" );
bool bHasOutputStream = false;
bool bHasStream = false;
bool bHasBaseURL = false;
@@ -3346,7 +3346,7 @@ static bool StoragesOfUnknownMediaTypeAreCopied_Impl( const uno::Reference< embe
if ( xSource->isStorageElement( rSubElement ) )
{
OUString aMediaType;
- const OUString aMediaTypePropName( "MediaType" );
+ static const OUStringLiteral aMediaTypePropName( u"MediaType" );
bool bGotMediaType = false;
try
@@ -3483,7 +3483,7 @@ bool SfxObjectShell::CopyStoragesOfUnknownMediaType(const uno::Reference< embed:
else if (xSource->isStorageElement(rSubElement))
{
OUString aMediaType;
- const OUString aMediaTypePropName( "MediaType" );
+ static const OUStringLiteral aMediaTypePropName( u"MediaType" );
bool bGotMediaType = false;
try
diff --git a/sfx2/source/doc/sfxbasemodel.cxx b/sfx2/source/doc/sfxbasemodel.cxx
index 5971b7729413..fa5d405dfdd0 100644
--- a/sfx2/source/doc/sfxbasemodel.cxx
+++ b/sfx2/source/doc/sfxbasemodel.cxx
@@ -2692,7 +2692,7 @@ void SfxBaseModel::loadCmisProperties( )
utl::UCBContentHelper::getDefaultCommandEnvironment(),
comphelper::getProcessComponentContext() );
Reference < beans::XPropertySetInfo > xProps = aContent.getProperties();
- const OUString aCmisProps( "CmisProperties" );
+ static const OUStringLiteral aCmisProps( u"CmisProperties" );
if ( xProps->hasPropertyByName( aCmisProps ) )
{
Sequence< document::CmisProperty> aCmisProperties;
@@ -2796,7 +2796,7 @@ void SfxBaseModel::Notify( SfxBroadcaster& rBC ,
&& m_pData->m_pObjectShell->GetCreateMode() != SfxObjectCreateMode::EMBEDDED )
{
Reference< embed::XStorage > xConfigStorage;
- const OUString aUIConfigFolderName( "Configurations2" );
+ static const OUStringLiteral aUIConfigFolderName( u"Configurations2" );
xConfigStorage = getDocumentSubStorage( aUIConfigFolderName, embed::ElementModes::READWRITE );
if ( !xConfigStorage.is() )
@@ -2965,7 +2965,7 @@ void SfxBaseModel::impl_store( const OUString& sURL
// this is the same file URL as the current document location, try to use storeOwn if possible
::comphelper::SequenceAsHashMap aArgHash( seqArguments );
- const OUString aFilterString( "FilterName" );
+ static const OUStringLiteral aFilterString( u"FilterName" );
const OUString aFilterName( aArgHash.getUnpackedValueOrDefault( aFilterString, OUString() ) );
if ( !aFilterName.isEmpty() )
{
@@ -3551,7 +3551,7 @@ Reference< ui::XUIConfigurationManager2 > SfxBaseModel::getUIConfigurationManage
xConfigStorage = getDocumentSubStorage( aUIConfigFolderName, embed::ElementModes::READWRITE );
if ( xConfigStorage.is() )
{
- const OUString aMediaTypeProp( "MediaType" );
+ static const OUStringLiteral aMediaTypeProp( u"MediaType" );
OUString aMediaType;
Reference< beans::XPropertySet > xPropSet( xConfigStorage, UNO_QUERY );
Any a = xPropSet->getPropertyValue( aMediaTypeProp );
@@ -3936,7 +3936,7 @@ OUString SAL_CALL SfxBaseModel::getTitle()
= aContent.getProperties();
if ( xProps.is() )
{
- const OUString aServerTitle( "TitleOnServer" );
+ static const OUStringLiteral aServerTitle( u"TitleOnServer" );
if ( xProps->hasPropertyByName( aServerTitle ) )
{
Any aAny = aContent.getPropertyValue( aServerTitle );
diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx
index 170ce543da3b..360ed8f75adb 100644
--- a/sfx2/source/view/viewfrm.cxx
+++ b/sfx2/source/view/viewfrm.cxx
@@ -2811,7 +2811,7 @@ void SfxViewFrame::MiscExec_Impl( SfxRequest& rReq )
case SID_RECORDMACRO :
{
// try to find any active recorder on this frame
- const OUString sProperty("DispatchRecorderSupplier");
+ static const OUStringLiteral sProperty(u"DispatchRecorderSupplier");
css::uno::Reference< css::frame::XFrame > xFrame =
GetFrame().GetFrameInterface();
@@ -2890,7 +2890,7 @@ void SfxViewFrame::MiscExec_Impl( SfxRequest& rReq )
if ( xLayoutManager.is() )
{
- const OUString aStatusbarResString( "private:resource/statusbar/statusbar" );
+ static const OUStringLiteral aStatusbarResString( u"private:resource/statusbar/statusbar" );
// Evaluate parameter.
const SfxBoolItem* pShowItem = rReq.GetArg<SfxBoolItem>(rReq.GetSlot());
bool bShow( true );