[Libreoffice-commits] core.git: extensions/source vcl/win
Stephan Bergmann (via logerrit)
logerrit at kemper.freedesktop.org
Wed Oct 23 19:06:04 UTC 2019
extensions/source/ole/oleobjw.cxx | 17 ++++++-----------
vcl/win/app/salinfo.cxx | 8 +-------
2 files changed, 7 insertions(+), 18 deletions(-)
New commits:
commit f573b1affdd7fd543eb25139620a82f72e0419a4
Author: Stephan Bergmann <sbergman at redhat.com>
AuthorDate: Wed Oct 23 17:47:17 2019 +0200
Commit: Stephan Bergmann <sbergman at redhat.com>
CommitDate: Wed Oct 23 21:04:47 2019 +0200
loplugin:bufferadd (clang-cl)
Change-Id: I854e1d4e6acef1c59842fe3921a42e95d0c8fd38
Reviewed-on: https://gerrit.libreoffice.org/81407
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman at redhat.com>
diff --git a/extensions/source/ole/oleobjw.cxx b/extensions/source/ole/oleobjw.cxx
index 16755415ab2a..c3f81bfa5df5 100644
--- a/extensions/source/ole/oleobjw.cxx
+++ b/extensions/source/ole/oleobjw.cxx
@@ -18,7 +18,6 @@
*/
#include "ole2uno.hxx"
-#include <rtl/ustrbuf.hxx>
#include <sal/log.hxx>
#include <o3tl/char16_t2wchar_t.hxx>
@@ -1700,9 +1699,8 @@ Any IUnknownWrapper::invokeWithDispIdComTlb(FuncDesc& aFuncDesc,
//check if there are not too many arguments supplied
if (::sal::static_int_cast< sal_uInt32, int >( nUnoArgs ) > dispparams.cArgs)
{
- OUStringBuffer buf(256);
- buf.append("[automation bridge] There are too many arguments for this method");
- throw IllegalArgumentException( buf.makeStringAndClear(),
+ throw IllegalArgumentException(
+ "[automation bridge] There are too many arguments for this method",
Reference<XInterface>(), static_cast<sal_Int16>(dispparams.cArgs));
}
@@ -1818,13 +1816,10 @@ Any IUnknownWrapper::invokeWithDispIdComTlb(FuncDesc& aFuncDesc,
// it's a UNO programming error.
if (i >= nUnoArgs && !(paramFlags & PARAMFLAG_FOPT))
{
- OUStringBuffer buf(256);
- buf.append("ole automation bridge: The called function expects an argument at"
- "position: "); //a different number of arguments")),
- buf.append(OUString::number(i));
- buf.append(" (index starting at 0).");
- throw IllegalArgumentException( buf.makeStringAndClear(),
- Reference<XInterface>(), static_cast<sal_Int16>(i));
+ throw IllegalArgumentException(
+ ("ole automation bridge: The called function expects an argument at position: "
+ + OUString::number(i) + " (index starting at 0)."),
+ Reference<XInterface>(), static_cast<sal_Int16>(i));
}
// Property Put arguments
diff --git a/vcl/win/app/salinfo.cxx b/vcl/win/app/salinfo.cxx
index 90fa81b04d0e..ccb6d3806f95 100644
--- a/vcl/win/app/salinfo.cxx
+++ b/vcl/win/app/salinfo.cxx
@@ -18,7 +18,6 @@
*/
#include <svsys.h>
-#include <rtl/ustrbuf.hxx>
#include <o3tl/char16_t2wchar_t.hxx>
#include <vcl/window.hxx>
@@ -133,12 +132,7 @@ bool WinSalSystem::initMonitors()
if( aDeviceStringCount[ rDev ] > 1 )
{
int nInstance = aDeviceStringCount[ rDev ] - (-- aDevCount[ rDev ] );
- OUStringBuffer aBuf( rDev.getLength() + 8 );
- aBuf.append( rDev );
- aBuf.append( " (" );
- aBuf.append( sal_Int32( nInstance ) );
- aBuf.append( ')' );
- m_aMonitors[ i ].m_aName = aBuf.makeStringAndClear();
+ m_aMonitors[ i ].m_aName = rDev + " (" + OUString::number( nInstance ) + ")";
}
}
}
More information about the Libreoffice-commits
mailing list