Kaydet (Commit) 56e3df39 authored tarafından Matteo Casalin's avatar Matteo Casalin

Avoid temporary OUStrings

Change-Id: I3f4ad2d94b8438705719c235fd318440406aed8c
üst 62ce3cfe
...@@ -172,7 +172,7 @@ void SwUnoCursorHelper::GetTextFromPam(SwPaM & rPam, OUString & rBuffer) ...@@ -172,7 +172,7 @@ void SwUnoCursorHelper::GetTextFromPam(SwPaM & rPam, OUString & rBuffer)
#endif #endif
WriterRef xWrt; WriterRef xWrt;
// TODO/MBA: looks like a BaseURL doesn't make sense here // TODO/MBA: looks like a BaseURL doesn't make sense here
SwReaderWriter::GetWriter( OUString(FILTER_TEXT_DLG), OUString(), xWrt ); SwReaderWriter::GetWriter( FILTER_TEXT_DLG, OUString(), xWrt );
if( xWrt.Is() ) if( xWrt.Is() )
{ {
SwWriter aWriter( aStream, rPam ); SwWriter aWriter( aStream, rPam );
...@@ -701,8 +701,7 @@ public: ...@@ -701,8 +701,7 @@ public:
SwUnoCrsr & GetCursorOrThrow() { SwUnoCrsr & GetCursorOrThrow() {
SwUnoCrsr *const pUnoCursor( GetCursor() ); SwUnoCrsr *const pUnoCursor( GetCursor() );
if (!pUnoCursor) { if (!pUnoCursor) {
throw uno::RuntimeException(OUString( throw uno::RuntimeException("SwXTextCursor: disposed or invalid", 0);
"SwXTextCursor: disposed or invalid"), 0);
} }
return *pUnoCursor; return *pUnoCursor;
} }
...@@ -1216,8 +1215,8 @@ throw (uno::RuntimeException, std::exception) ...@@ -1216,8 +1215,8 @@ throw (uno::RuntimeException, std::exception)
if (!bNotForced) if (!bNotForced)
{ {
throw uno::RuntimeException( throw uno::RuntimeException(
OUString("gotoRange: parameter range not contained in nesting" "gotoRange: parameter range not contained in nesting"
" text content for which this cursor was created"), " text content for which this cursor was created",
static_cast<text::XWordCursor*>(this)); static_cast<text::XWordCursor*>(this));
} }
} }
...@@ -1800,8 +1799,8 @@ throw (beans::UnknownPropertyException, lang::WrappedTargetException, ...@@ -1800,8 +1799,8 @@ throw (beans::UnknownPropertyException, lang::WrappedTargetException,
if (!pEntry) if (!pEntry)
{ {
throw beans::UnknownPropertyException( throw beans::UnknownPropertyException(
OUString("Unknown property: ") "Unknown property: " + rPropertyName,
+ rPropertyName, static_cast<cppu::OWeakObject *>(0)); static_cast<cppu::OWeakObject *>(0));
} }
beans::PropertyState eTemp; beans::PropertyState eTemp;
...@@ -1967,8 +1966,7 @@ throw (beans::UnknownPropertyException, uno::RuntimeException) ...@@ -1967,8 +1966,7 @@ throw (beans::UnknownPropertyException, uno::RuntimeException)
else else
{ {
throw beans::UnknownPropertyException( throw beans::UnknownPropertyException(
OUString("Unknown property: ") "Unknown property: " + pNames[i],
+ pNames[i],
static_cast<cppu::OWeakObject *>(0)); static_cast<cppu::OWeakObject *>(0));
} }
} }
...@@ -2091,14 +2089,14 @@ throw (beans::UnknownPropertyException, uno::RuntimeException) ...@@ -2091,14 +2089,14 @@ throw (beans::UnknownPropertyException, uno::RuntimeException)
if (!pEntry) if (!pEntry)
{ {
throw beans::UnknownPropertyException( throw beans::UnknownPropertyException(
OUString("Unknown property: ") "Unknown property: " + rPropertyName,
+ rPropertyName, static_cast<cppu::OWeakObject *>(0)); static_cast<cppu::OWeakObject *>(0));
} }
if (pEntry->nFlags & beans::PropertyAttribute::READONLY) if (pEntry->nFlags & beans::PropertyAttribute::READONLY)
{ {
throw uno::RuntimeException(OUString( throw uno::RuntimeException(
"setPropertyToDefault: property is read-only: ") "setPropertyToDefault: property is read-only: "
+ rPropertyName, 0); + rPropertyName, 0);
} }
...@@ -2132,8 +2130,7 @@ throw (beans::UnknownPropertyException, lang::WrappedTargetException, ...@@ -2132,8 +2130,7 @@ throw (beans::UnknownPropertyException, lang::WrappedTargetException,
if (!pEntry) if (!pEntry)
{ {
throw beans::UnknownPropertyException( throw beans::UnknownPropertyException(
OUString("Unknown property: ") "Unknown property: " + rPropertyName, static_cast<cppu::OWeakObject *>(0));
+ rPropertyName, static_cast<cppu::OWeakObject *>(0));
} }
uno::Any aRet; uno::Any aRet;
...@@ -2472,16 +2469,13 @@ throw (beans::UnknownPropertyException, uno::RuntimeException, std::exception) ...@@ -2472,16 +2469,13 @@ throw (beans::UnknownPropertyException, uno::RuntimeException, std::exception)
continue; continue;
} }
throw beans::UnknownPropertyException( throw beans::UnknownPropertyException(
OUString("Unknown property: ") "Unknown property: " + pNames[i],
+ pNames[i],
static_cast<cppu::OWeakObject *>(this)); static_cast<cppu::OWeakObject *>(this));
} }
if (pEntry->nFlags & beans::PropertyAttribute::READONLY) if (pEntry->nFlags & beans::PropertyAttribute::READONLY)
{ {
throw uno::RuntimeException( throw uno::RuntimeException(
OUString( "setPropertiesToDefault: property is read-only: " + pNames[i],
"setPropertiesToDefault: property is read-only: ")
+ pNames[i],
static_cast<cppu::OWeakObject *>(this)); static_cast<cppu::OWeakObject *>(this));
} }
...@@ -2542,8 +2536,7 @@ throw (beans::UnknownPropertyException, lang::WrappedTargetException, ...@@ -2542,8 +2536,7 @@ throw (beans::UnknownPropertyException, lang::WrappedTargetException,
continue; continue;
} }
throw beans::UnknownPropertyException( throw beans::UnknownPropertyException(
OUString("Unknown property: ") "Unknown property: " + pNames[i],
+ pNames[i],
static_cast<cppu::OWeakObject *>(0)); static_cast<cppu::OWeakObject *>(0));
} }
if (pEntry->nWID < RES_FRMATR_END) if (pEntry->nWID < RES_FRMATR_END)
......
...@@ -1680,9 +1680,8 @@ void SwUnoCursorHelper::SetString(SwCursor & rCursor, const OUString& rString) ...@@ -1680,9 +1680,8 @@ void SwUnoCursorHelper::SetString(SwCursor & rCursor, const OUString& rString)
} }
if (!rString.isEmpty()) if (!rString.isEmpty())
{ {
OUString aText(rString);
const bool bSuccess( SwUnoCursorHelper::DocInsertStringSplitCR( const bool bSuccess( SwUnoCursorHelper::DocInsertStringSplitCR(
*pDoc, rCursor, aText, false ) ); *pDoc, rCursor, rString, false ) );
OSL_ENSURE( bSuccess, "DocInsertStringSplitCR" ); OSL_ENSURE( bSuccess, "DocInsertStringSplitCR" );
(void) bSuccess; (void) bSuccess;
SwUnoCursorHelper::SelectPam(rCursor, true); SwUnoCursorHelper::SelectPam(rCursor, true);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment