summaryrefslogtreecommitdiff
path: root/framework
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2017-02-01 12:24:07 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-02-02 07:48:21 +0000
commitc0f9bdd3e644e3ebf690aff9eb1aeec4f16dbf27 (patch)
treee5bb6d31a17587452dde579803286f68ffc73672 /framework
parent52360bf8dd567598593cb212ac85f0c919315618 (diff)
unnecessary use of OUStringBuffer in throwing exceptions
Change-Id: Iec1473264426f19c31e72260dfce9494389e474f Reviewed-on: https://gerrit.libreoffice.org/33788 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'framework')
-rw-r--r--framework/source/services/autorecovery.cxx7
-rw-r--r--framework/source/services/pathsettings.cxx20
-rw-r--r--framework/source/xml/acceleratorconfigurationreader.cxx6
3 files changed, 10 insertions, 23 deletions
diff --git a/framework/source/services/autorecovery.cxx b/framework/source/services/autorecovery.cxx
index 4739bdc28cd7..fb9f34679d36 100644
--- a/framework/source/services/autorecovery.cxx
+++ b/framework/source/services/autorecovery.cxx
@@ -3477,13 +3477,8 @@ void AutoRecovery::implts_openOneDoc(const OUString& sURL ,
}
// re-throw
- OUStringBuffer sMsg(256);
- sMsg.append("Recovery of \"");
- sMsg.append (sURL );
- sMsg.append("\" failed." );
-
throw css::lang::WrappedTargetException(
- sMsg.makeStringAndClear(),
+ "Recovery of \"" + sURL + "\" failed.",
static_cast< css::frame::XDispatch* >(this),
aCaughtException
);
diff --git a/framework/source/services/pathsettings.cxx b/framework/source/services/pathsettings.cxx
index bd4488e664af..0c632ef8194f 100644
--- a/framework/source/services/pathsettings.cxx
+++ b/framework/source/services/pathsettings.cxx
@@ -1225,12 +1225,10 @@ void PathSettings::impl_setPathValue( sal_Int32 nID ,
{
if (aChangePath.bIsSinglePath)
{
- OUStringBuffer sMsg(256);
- sMsg.append("The path '" );
- sMsg.append (aChangePath.sPathName);
- sMsg.append("' is defined as SINGLE_PATH. It's sub set of internal paths can't be set.");
- throw css::uno::Exception(sMsg.makeStringAndClear(),
- static_cast< ::cppu::OWeakObject* >(this));
+ throw css::uno::Exception(
+ "The path '" + aChangePath.sPathName
+ + "' is defined as SINGLE_PATH. It's sub set of internal paths can't be set.",
+ static_cast< ::cppu::OWeakObject* >(this));
}
css::uno::Sequence<OUString> lTmpList;
@@ -1246,12 +1244,10 @@ void PathSettings::impl_setPathValue( sal_Int32 nID ,
{
if (aChangePath.bIsSinglePath)
{
- OUStringBuffer sMsg(256);
- sMsg.append("The path '" );
- sMsg.append (aChangePath.sPathName);
- sMsg.append("' is defined as SINGLE_PATH. It's sub set of internal paths can't be set.");
- throw css::uno::Exception(sMsg.makeStringAndClear(),
- static_cast< ::cppu::OWeakObject* >(this));
+ throw css::uno::Exception(
+ "The path '" + aChangePath.sPathName
+ + "' is defined as SINGLE_PATH. It's sub set of internal paths can't be set.",
+ static_cast< ::cppu::OWeakObject* >(this));
}
css::uno::Sequence<OUString> lTmpList;
diff --git a/framework/source/xml/acceleratorconfigurationreader.cxx b/framework/source/xml/acceleratorconfigurationreader.cxx
index b73f1f71f02e..ac0afbc4980f 100644
--- a/framework/source/xml/acceleratorconfigurationreader.cxx
+++ b/framework/source/xml/acceleratorconfigurationreader.cxx
@@ -47,12 +47,8 @@ namespace framework{
*/
#define THROW_PARSEEXCEPTION(COMMENT) \
{ \
- OUStringBuffer sMessage(256); \
- sMessage.append (implts_getErrorLineString()); \
- sMessage.append(COMMENT ); \
- \
throw css::xml::sax::SAXException( \
- sMessage.makeStringAndClear(), \
+ implts_getErrorLineString() + COMMENT, \
static_cast< css::xml::sax::XDocumentHandler* >(this), \
css::uno::Any()); \
}