cui/source/dialogs/scriptdlg.cxx    |   19 +++++++------------
 dbaccess/source/ui/dlg/dbfindex.cxx |    7 ++-----
 fpicker/source/office/fileview.cxx  |    4 +---
 oox/source/export/drawingml.cxx     |    8 +++-----
 ucb/source/core/ucbstore.cxx        |   13 ++++---------
 5 files changed, 17 insertions(+), 34 deletions(-)

New commits:
commit ae5cb9b75984d9a63b392d8bfc5b3d224f00c741
Author:     Mike Kaganski <mike.kagan...@collabora.com>
AuthorDate: Tue Jun 27 14:45:39 2023 +0300
Commit:     Mike Kaganski <mike.kagan...@collabora.com>
CommitDate: Wed Jun 28 04:38:48 2023 +0200

    Simplify a bit
    
    Change-Id: Iad2564853a2a0d74cd526b1574e421e121fd6986
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153644
    Tested-by: Jenkins
    Reviewed-by: Mike Kaganski <mike.kagan...@collabora.com>

diff --git a/cui/source/dialogs/scriptdlg.cxx b/cui/source/dialogs/scriptdlg.cxx
index f482c540294c..4113f7334a1c 100644
--- a/cui/source/dialogs/scriptdlg.cxx
+++ b/cui/source/dialogs/scriptdlg.cxx
@@ -128,9 +128,6 @@ void SvxScriptOrgDialog::Init( std::u16string_view language 
 )
 
     Sequence< Reference< browse::XBrowseNode > > children;
 
-    OUString userStr("user");
-    static constexpr OUStringLiteral shareStr(u"share");
-
     try
     {
         Reference< browse::XBrowseNodeFactory > xFac = 
browse::theBrowseNodeFactory::get(xCtx);
@@ -155,17 +152,15 @@ void SvxScriptOrgDialog::Init( std::u16string_view 
language  )
         bool app = false;
         OUString uiName = childNode->getName();
         OUString factoryURL;
-        if ( uiName == userStr || uiName == shareStr )
+        if (uiName == "user")
         {
             app = true;
-            if ( uiName == userStr )
-            {
-                uiName = m_sMyMacros;
-            }
-            else
-            {
-                uiName = m_sProdMacros;
-            }
+            uiName = m_sMyMacros;
+        }
+        else if (uiName == "share")
+        {
+            app = true;
+            uiName = m_sProdMacros;
         }
         else
         {
diff --git a/dbaccess/source/ui/dlg/dbfindex.cxx 
b/dbaccess/source/ui/dlg/dbfindex.cxx
index e5f62afc6be3..d0a03b5b238c 100644
--- a/dbaccess/source/ui/dlg/dbfindex.cxx
+++ b/dbaccess/source/ui/dlg/dbfindex.cxx
@@ -254,9 +254,6 @@ void ODbaseIndexDialog::Init()
 
     // first assume for all indexes they're free
 
-    static constexpr OUStringLiteral aIndexExt(u"ndx");
-    static constexpr OUStringLiteral aTableExt(u"dbf");
-
     std::vector< OUString > aUsedIndexes;
 
     aURL.SetSmartProtocol(INetProtocol::File);
@@ -267,11 +264,11 @@ void ODbaseIndexDialog::Init()
         osl::FileBase::getSystemPathFromFileURL(rURL,aName);
         aURL.SetSmartURL(aName);
         OUString aExt = aURL.getExtension();
-        if (aExt == aIndexExt)
+        if (aExt == "ndx")
         {
             m_aFreeIndexList.emplace_back(aURL.getName() );
         }
-        else if (aExt == aTableExt)
+        else if (aExt == "dbf")
         {
             m_aTableInfoList.emplace_back(aURL.getName() );
             OTableInfo& rTabInfo = m_aTableInfoList.back();
diff --git a/fpicker/source/office/fileview.cxx 
b/fpicker/source/office/fileview.cxx
index 9d8d0f347449..ebc3ee3b8b18 100644
--- a/fpicker/source/office/fileview.cxx
+++ b/fpicker/source/office/fileview.cxx
@@ -1499,8 +1499,6 @@ void SvtFileView_Impl::CreateDisplayText_Impl()
 {
     ::osl::MutexGuard aGuard( maMutex );
 
-    static constexpr OUStringLiteral aDateSep( u", " );
-
     for (auto const& elem : maContent)
     {
         // title, type, size, date
@@ -1514,7 +1512,7 @@ void SvtFileView_Impl::CreateDisplayText_Impl()
             SvtSysLocale aSysLocale;
             const LocaleDataWrapper& rLocaleData = aSysLocale.GetLocaleData();
             elem->maDisplayDate = rLocaleData.getDate( elem->maModDate )
-                                  + aDateSep
+                                  + ", "
                                   + rLocaleData.getTime( elem->maModDate, 
false );
         }
 
diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx
index 01328fa2576a..a8c032259476 100644
--- a/oox/source/export/drawingml.cxx
+++ b/oox/source/export/drawingml.cxx
@@ -1512,16 +1512,14 @@ OUString GraphicExport::writeToStorage(const Graphic& 
rGraphic , bool bRelPathTo
         xOutStream->writeBytes(Sequence<sal_Int8>(static_cast<const 
sal_Int8*>(aData), nDataSize));
         xOutStream->closeOutput();
 
-        static constexpr OStringLiteral sRelPathToMedia = "media/image";
-        OString sRelationCompPrefix;
+        const char* sRelationCompPrefix;
         if (bRelPathToMedia)
             sRelationCompPrefix = "../";
         else
             sRelationCompPrefix = getRelationCompPrefix(meDocumentType);
         sPath = OUStringBuffer()
-                    .appendAscii(sRelationCompPrefix.getStr())
-                    .appendAscii(sRelPathToMedia.getStr())
-                    .append(nImageCount)
+                    .appendAscii(sRelationCompPrefix)
+                    .append("media/image" + OUString::number(nImageCount))
                     .appendAscii(pExtension)
                     .makeStringAndClear();
 
diff --git a/ucb/source/core/ucbstore.cxx b/ucb/source/core/ucbstore.cxx
index 52b3a8b4a341..7f04a9a534ab 100644
--- a/ucb/source/core/ucbstore.cxx
+++ b/ucb/source/core/ucbstore.cxx
@@ -681,11 +681,6 @@ void PropertySetRegistry::renamePropertySet( const 
OUString& rOldKey,
 
                         aOldValuesKey += "/";
 
-                        static constexpr OUStringLiteral 
aHandleKey(u"/Handle");
-                        static constexpr OUStringLiteral aValueKey(u"/Value");
-                        static constexpr OUStringLiteral aStateKey(u"/State");
-                        static constexpr OUStringLiteral 
aAttrKey(u"/Attributes");
-
                         for ( const OUString& rPropName : aElems )
                         {
                             // Create new item.
@@ -705,28 +700,28 @@ void PropertySetRegistry::renamePropertySet( const 
OUString& rOldKey,
                             OUString aKey = aOldValuesKey + 
makeHierarchalNameSegment( rPropName );
 
                             // ... handle
-                            OUString aNewKey1 = aKey + aHandleKey;
+                            OUString aNewKey1 = aKey + "/Handle";
                             Any aAny =
                                 xRootHierNameAccess->getByHierarchicalName(
                                     aNewKey1 );
                             xNewPropNameReplace->replaceByName( "Handle", aAny 
);
 
                             // ... value
-                            aNewKey1 = aKey + aValueKey;
+                            aNewKey1 = aKey + "/Value";
                             aAny =
                                 xRootHierNameAccess->getByHierarchicalName(
                                     aNewKey1 );
                             xNewPropNameReplace->replaceByName( "Value", aAny 
);
 
                             // ... state
-                            aNewKey1 = aKey + aStateKey;
+                            aNewKey1 = aKey + "/State";
                             aAny =
                                 xRootHierNameAccess->getByHierarchicalName(
                                     aNewKey1 );
                             xNewPropNameReplace->replaceByName( "State", aAny 
);
 
                             // ... attributes
-                            aNewKey1 = aKey + aAttrKey;
+                            aNewKey1 = aKey + "/Attributes";
                             aAny =
                                 xRootHierNameAccess->getByHierarchicalName(
                                     aNewKey1 );

Reply via email to