[Libreoffice-commits] core.git: 2 commits - basic/source configmgr/source extensions/source sdext/source sfx2/source shell/source solenv/gbuild vcl/win

Stephan Bergmann (via logerrit) logerrit at kemper.freedesktop.org
Wed Oct 23 18:34:48 UTC 2019


 basic/source/runtime/dllmgr-x64.cxx              |    6 +++---
 configmgr/source/winreg.cxx                      |    4 ++--
 extensions/source/ole/unoconversionutilities.hxx |    4 ++--
 extensions/source/ole/unoobjw.cxx                |    9 ++++-----
 sdext/source/pdfimport/pdfparse/pdfparse.cxx     |    2 +-
 sfx2/source/appl/shutdownicon.cxx                |    6 ++----
 sfx2/source/appl/shutdowniconw32.cxx             |    6 ++----
 shell/source/win32/spsupp/spsuppHelper.cxx       |    4 ++--
 solenv/gbuild/platform/com_MSC_class.mk          |    2 +-
 vcl/win/app/salinst.cxx                          |    3 +--
 vcl/win/window/salframe.cxx                      |    3 +--
 11 files changed, 21 insertions(+), 28 deletions(-)

New commits:
commit 044eba71e34fd3ac5de20578cc62f85756ad07b4
Author:     Stephan Bergmann <sbergman at redhat.com>
AuthorDate: Wed Oct 23 17:38:41 2019 +0200
Commit:     Stephan Bergmann <sbergman at redhat.com>
CommitDate: Wed Oct 23 20:33:17 2019 +0200

    loplugin:stringadd (clang-cl)
    
    Change-Id: I324496ff7c61d87a83b6b378810aa5c78cd7dba3
    Reviewed-on: https://gerrit.libreoffice.org/81405
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <sbergman at redhat.com>

diff --git a/basic/source/runtime/dllmgr-x64.cxx b/basic/source/runtime/dllmgr-x64.cxx
index aa59c29fc752..d36e7238e20f 100644
--- a/basic/source/runtime/dllmgr-x64.cxx
+++ b/basic/source/runtime/dllmgr-x64.cxx
@@ -647,7 +647,7 @@ ErrCode getProcData(HMODULE handle, OUString const & name, ProcData * proc)
         }
         FARPROC p = GetProcAddress(handle, reinterpret_cast< LPCSTR >(n));
         if (p != nullptr) {
-            proc->name = OString("#") + OString::number(n);
+            proc->name = "#" + OString::number(n);
             proc->proc = p;
             return ERRCODE_NONE;
         }
@@ -673,14 +673,14 @@ ErrCode getProcData(HMODULE handle, OUString const & name, ProcData * proc)
                 return ERRCODE_NONE;
             }
         }
-        OString real(OString("_") + name8);
+        OString real("_" + name8);
         p = GetProcAddress(handle, real.getStr());
         if (p != nullptr) {
             proc->name = real;
             proc->proc = p;
             return ERRCODE_NONE;
         }
-        real = name8 + OString("A");
+        real = name8 + "A";
         p = GetProcAddress(handle, real.getStr());
         if (p != nullptr) {
             proc->name = real;
diff --git a/configmgr/source/winreg.cxx b/configmgr/source/winreg.cxx
index 0fd372aa927a..6e4690500996 100644
--- a/configmgr/source/winreg.cxx
+++ b/configmgr/source/winreg.cxx
@@ -141,9 +141,9 @@ void dumpWindowsRegistryKey(HKEY hKey, OUString const & aKeyName, TempFile &aFil
 
                 //Make up full key name
                 if(aKeyName.isEmpty())
-                    aSubkeyName = aKeyName + OUString(o3tl::toU(buffKeyName));
+                    aSubkeyName = aKeyName + o3tl::toU(buffKeyName);
                 else
-                    aSubkeyName = aKeyName + "\\" + OUString(o3tl::toU(buffKeyName));
+                    aSubkeyName = aKeyName + "\\" + o3tl::toU(buffKeyName);
 
                 //Recursion, until no more subkeys are found
                 dumpWindowsRegistryKey(hKey, aSubkeyName, aFileHandle);
diff --git a/extensions/source/ole/unoconversionutilities.hxx b/extensions/source/ole/unoconversionutilities.hxx
index 0fffbaacb695..90178e2a6a21 100644
--- a/extensions/source/ole/unoconversionutilities.hxx
+++ b/extensions/source/ole/unoconversionutilities.hxx
@@ -1522,8 +1522,8 @@ void UnoConversionUtilities<T>::variantToAny( const VARIANT* pVariant, Any& rAny
                         if (!getType(sName, type))
                         {
                             throw CannotConvertException(
-                                      "[automation bridge]UnoConversionUtilities<T>::variantToAny \n"
-                                      "A UNO type with the name: " + OUString(o3tl::toU(LPCOLESTR(sName))) +
+                                      OUStringLiteral("[automation bridge]UnoConversionUtilities<T>::variantToAny \n"
+                                      "A UNO type with the name: ") + o3tl::toU(LPCOLESTR(sName)) +
                                 "does not exist!",
                                 nullptr, TypeClass_UNKNOWN, FailReason::TYPE_NOT_SUPPORTED,0);
                         }
diff --git a/extensions/source/ole/unoobjw.cxx b/extensions/source/ole/unoobjw.cxx
index 3c95a9c16168..0c67f4813263 100644
--- a/extensions/source/ole/unoobjw.cxx
+++ b/extensions/source/ole/unoobjw.cxx
@@ -1147,15 +1147,14 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP InterfaceOleWrapper::GetIDsOfNames(REFIID /*ri
     if( ! rgdispid)
         return E_POINTER;
 
-    OUString sNames;
-    sNames += "[";
+    OUString sNames("[");
     for (unsigned int i = 0; i < cNames; ++i)
     {
         // Initialise returned rgdispid values.
         rgdispid[i] = DISPID_UNKNOWN;
         if (i > 0)
             sNames += ",";
-        sNames += "\"" + OUString(o3tl::toU(rgszNames[i])) + "\"";
+        sNames += OUStringLiteral("\"") + o3tl::toU(rgszNames[i]) + "\"";
     }
     sNames += "]";
 
@@ -2893,8 +2892,8 @@ HRESULT InterfaceOleWrapper::InvokeGeneral( DISPID dispidMember, unsigned short
             Type type;
             if (!getType(arg.bstrVal, type))
             {
-                writeExcepinfo(pexcepinfo, "[automation bridge] A UNO type with the name " +
-                                           OUString(o3tl::toU(arg.bstrVal)) + " does not exist!");
+                writeExcepinfo(pexcepinfo, OUStringLiteral("[automation bridge] A UNO type with the name ") +
+                                           o3tl::toU(arg.bstrVal) + " does not exist!");
                 return DISP_E_EXCEPTION;
             }
 
diff --git a/sdext/source/pdfimport/pdfparse/pdfparse.cxx b/sdext/source/pdfimport/pdfparse/pdfparse.cxx
index 60ab775ccda5..388beba4ab3a 100644
--- a/sdext/source/pdfimport/pdfparse/pdfparse.cxx
+++ b/sdext/source/pdfimport/pdfparse/pdfparse.cxx
@@ -573,7 +573,7 @@ std::unique_ptr<PDFEntry> PDFReader::read( const char* pBuffer, unsigned int nLe
         OString aTmp;
         unsigned int nElem = aGrammar.m_aObjectStack.size();
         for( unsigned int i = 0; i < nElem; i++ )
-            aTmp += "   " + OString(typeid( *(aGrammar.m_aObjectStack[i]) ).name());
+            aTmp += OStringLiteral("   ") + typeid( *(aGrammar.m_aObjectStack[i]) ).name();
 
         SAL_WARN("sdext.pdfimport.pdfparse", "parse error: " << rError.descriptor << " at buffer pos " << rError.where - pBuffer << ", object stack: " << aTmp);
 #else
diff --git a/sfx2/source/appl/shutdownicon.cxx b/sfx2/source/appl/shutdownicon.cxx
index f56169ecd1ec..ffda878b33c0 100644
--- a/sfx2/source/appl/shutdownicon.cxx
+++ b/sfx2/source/appl/shutdownicon.cxx
@@ -620,12 +620,10 @@ bool ShutdownIcon::IsQuickstarterInstalled()
 OUString ShutdownIcon::getShortcutName()
 {
 #ifdef _WIN32
-    OUString aShortcutName(SfxResId(STR_QUICKSTART_LNKNAME));
-    aShortcutName += ".lnk";
+    OUString aShortcutName(SfxResId(STR_QUICKSTART_LNKNAME) + ".lnk");
 
     OUString aShortcut(GetAutostartFolderNameW32());
-    aShortcut += "\\";
-    aShortcut += aShortcutName;
+    aShortcut += "\\" + aShortcutName;
     return aShortcut;
 #endif // _WIN32
 }
diff --git a/sfx2/source/appl/shutdowniconw32.cxx b/sfx2/source/appl/shutdowniconw32.cxx
index deea7b4373f5..dec949151d5d 100644
--- a/sfx2/source/appl/shutdowniconw32.cxx
+++ b/sfx2/source/appl/shutdowniconw32.cxx
@@ -784,8 +784,7 @@ bool ShutdownIcon::IsQuickstarterInstalled()
     if( i != -1 )
         aOfficepath = aOfficepath.copy(0, i);
 
-    OUString quickstartExe(aOfficepath);
-    quickstartExe += "\\quickstart.exe";
+    OUString quickstartExe(aOfficepath + "\\quickstart.exe");
 
     return FileExistsW( o3tl::toW(quickstartExe.getStr()) );
 }
@@ -800,8 +799,7 @@ void ShutdownIcon::EnableAutostartW32( const OUString &aShortcut )
     if( i != -1 )
         aOfficepath = aOfficepath.copy(0, i);
 
-    OUString quickstartExe(aOfficepath);
-    quickstartExe += "\\quickstart.exe";
+    OUString quickstartExe(aOfficepath + "\\quickstart.exe");
 
     CreateShortcut( quickstartExe, aOfficepath, aShortcut, OUString(), OUString() );
 }
diff --git a/shell/source/win32/spsupp/spsuppHelper.cxx b/shell/source/win32/spsupp/spsuppHelper.cxx
index b60f9dc528da..3f6c9f787961 100644
--- a/shell/source/win32/spsupp/spsuppHelper.cxx
+++ b/shell/source/win32/spsupp/spsuppHelper.cxx
@@ -120,8 +120,8 @@ Answer AskIfUserWantsToEdit(const wchar_t* sFilePath)
 // Returns ERROR_SUCCESS or Win32 error code
 DWORD LOStart(const wchar_t* sModeArg, const wchar_t* sFilePath)
 {
-    OUString sCmdLine = "\"" + GetSofficeExe() + "\" " + OUString(o3tl::toU(sModeArg)) + " \""
-                        + OUString(o3tl::toU(sFilePath)) + "\"";
+    OUString sCmdLine = "\"" + GetSofficeExe() + "\" " + o3tl::toU(sModeArg) + " \""
+                        + o3tl::toU(sFilePath) + "\"";
     LPWSTR pCmdLine = const_cast<LPWSTR>(o3tl::toW(sCmdLine.getStr()));
 
     STARTUPINFOW si = {};
diff --git a/vcl/win/app/salinst.cxx b/vcl/win/app/salinst.cxx
index 2c68ec354bf2..1994a274f8b4 100644
--- a/vcl/win/app/salinst.cxx
+++ b/vcl/win/app/salinst.cxx
@@ -943,8 +943,7 @@ void WinSalInstance::AddToRecentDocumentList(const OUString& rFileUrl, const OUS
 
             if ( !sApplicationName.isEmpty() )
             {
-                OUString sApplicationID("TheDocumentFoundation.LibreOffice.");
-                sApplicationID += sApplicationName;
+                OUString sApplicationID("TheDocumentFoundation.LibreOffice." + sApplicationName);
 
                 SHARDAPPIDINFO info;
                 info.psi = pShellItem;
diff --git a/vcl/win/window/salframe.cxx b/vcl/win/window/salframe.cxx
index efb9f2a5c301..8755c98967fd 100644
--- a/vcl/win/window/salframe.cxx
+++ b/vcl/win/window/salframe.cxx
@@ -4425,8 +4425,7 @@ static LRESULT ImplMeasureItem( HWND hWnd, WPARAM wParam, LPARAM lParam )
         OUString aStr(pSalMenuItem->mText);
         if( pSalMenuItem->mAccelText.getLength() )
         {
-            aStr += " ";
-            aStr += pSalMenuItem->mAccelText;
+            aStr += " " + pSalMenuItem->mAccelText;
         }
         GetTextExtentPoint32W( hdc, o3tl::toW(aStr.getStr()),
                                 aStr.getLength(), &strSize );
commit 732bf455279d1db150c600bb1d2719ddde517480
Author:     Stephan Bergmann <sbergman at redhat.com>
AuthorDate: Wed Oct 23 17:15:50 2019 +0200
Commit:     Stephan Bergmann <sbergman at redhat.com>
CommitDate: Wed Oct 23 20:32:53 2019 +0200

    -W4 must come before -Wno-missing-braces for clang-cl
    
    ...or else -W4 would re-enable that and cause lots of warnings/errors.
    87608490f205b2fbc2b453ad8ded33050ac29b90 "filter arguments to MSVC to avoid the
    annoying D9025 warning" had changed the relative order of those options on the
    command line.
    
    Change-Id: I2ff9de93cdc6e3dc63961af61169f0adf44f7c0b
    Reviewed-on: https://gerrit.libreoffice.org/81403
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <sbergman at redhat.com>

diff --git a/solenv/gbuild/platform/com_MSC_class.mk b/solenv/gbuild/platform/com_MSC_class.mk
index 2673e7d1b009..abfdaa16e1b1 100644
--- a/solenv/gbuild/platform/com_MSC_class.mk
+++ b/solenv/gbuild/platform/com_MSC_class.mk
@@ -45,8 +45,8 @@ endef
 
 # Avoid annoying warning D9025 about overriding command-line arguments.
 gb_Helper_remove_overriden_flags = \
-    $(filter-out -W4 -w -arch:SSE -arch:SSE2 -arch:AVX -arch:AVX2 -Od -O2,$(1)) \
     $(lastword $(filter -W4 -w,$(1))) \
+    $(filter-out -W4 -w -arch:SSE -arch:SSE2 -arch:AVX -arch:AVX2 -Od -O2,$(1)) \
     $(lastword $(filter -Od -O2,$(1))) \
     $(lastword $(filter -arch:SSE -arch:SSE2 -arch:AVX -arch:AVX2,$(1)))
 


More information about the Libreoffice-commits mailing list