diff options
author | Matteo Casalin <matteo.casalin@yahoo.com> | 2017-05-01 18:12:17 +0200 |
---|---|---|
committer | Matteo Casalin <matteo.casalin@yahoo.com> | 2017-05-06 18:08:16 +0200 |
commit | 5e661008a58677e8871abf93209f81200507b29f (patch) | |
tree | baf1dd394570bc51dc302639a0dc9145f5466866 /sfx2 | |
parent | 3908064e9034074c82ed62bf60f5107f27ca4061 (diff) |
OUStrings: constify and reduce temporaries
Change-Id: Id1db5c17a346916a326529b750d2ff0a765af5da
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/doc/iframe.cxx | 4 | ||||
-rw-r--r-- | sfx2/source/doc/objcont.cxx | 7 | ||||
-rw-r--r-- | sfx2/source/doc/objmisc.cxx | 6 |
3 files changed, 8 insertions, 9 deletions
diff --git a/sfx2/source/doc/iframe.cxx b/sfx2/source/doc/iframe.cxx index ad44a090ef2a..8070c90c1e2c 100644 --- a/sfx2/source/doc/iframe.cxx +++ b/sfx2/source/doc/iframe.cxx @@ -327,12 +327,12 @@ uno::Any SAL_CALL IFrameObject::getPropertyValue(const OUString& aPropertyName) { case WID_FRAME_URL: { - aAny <<= OUString( maFrmDescr.GetURL().GetMainURL( INetURLObject::DecodeMechanism::NONE ) ); + aAny <<= maFrmDescr.GetURL().GetMainURL( INetURLObject::DecodeMechanism::NONE ); } break; case WID_FRAME_NAME: { - aAny <<= OUString( maFrmDescr.GetName() ); + aAny <<= maFrmDescr.GetName(); } break; case WID_FRAME_IS_AUTO_SCROLL: diff --git a/sfx2/source/doc/objcont.cxx b/sfx2/source/doc/objcont.cxx index 61d736c027bf..148e265ae524 100644 --- a/sfx2/source/doc/objcont.cxx +++ b/sfx2/source/doc/objcont.cxx @@ -187,7 +187,7 @@ void SfxObjectShell::UpdateDocInfoForSave() } else if ( IsModified() ) { - OUString aUserName = SvtUserOptions().GetFullName(); + const OUString aUserName = SvtUserOptions().GetFullName(); if ( !IsUseUserData() ) { // remove all data pointing to the current user @@ -394,7 +394,7 @@ void SfxObjectShell::UpdateFromTemplate_Impl( ) // created from template? uno::Reference<document::XDocumentProperties> xDocProps(getDocProperties()); - OUString aTemplName( xDocProps->getTemplateName() ); + const OUString aTemplName( xDocProps->getTemplateName() ); OUString aTemplURL( xDocProps->getTemplateURL() ); OUString aFoundName; @@ -462,8 +462,7 @@ void SfxObjectShell::UpdateFromTemplate_Impl( ) bLoad = true; else if ( bCanUpdateFromTemplate == document::UpdateDocMode::ACCORDING_TO_CONFIG ) { - OUString sMessage( SfxResId(STR_QRYTEMPL_MESSAGE).toString() ); - sMessage = sMessage.replaceAll( "$(ARG1)", aTemplName ); + const OUString sMessage( SfxResId(STR_QRYTEMPL_MESSAGE).toString().replaceAll( "$(ARG1)", aTemplName ) ); ScopedVclPtrInstance< sfx2::QueryTemplateBox > aBox(GetDialogParent(), sMessage); if ( RET_YES == aBox->Execute() ) bLoad = true; diff --git a/sfx2/source/doc/objmisc.cxx b/sfx2/source/doc/objmisc.cxx index c91acbf1b401..ab039b5d0e2c 100644 --- a/sfx2/source/doc/objmisc.cxx +++ b/sfx2/source/doc/objmisc.cxx @@ -203,7 +203,7 @@ void SfxObjectShell::FlushDocInfo() SetModified(); uno::Reference<document::XDocumentProperties> xDocProps(getDocProperties()); DoFlushDocInfo(); // call template method - OUString url(xDocProps->getAutoloadURL()); + const OUString url(xDocProps->getAutoloadURL()); sal_Int32 delay(xDocProps->getAutoloadSecs()); SetAutoLoad( INetURLObject(url), delay * 1000, (delay > 0) || !url.isEmpty() ); @@ -758,11 +758,11 @@ OUString SfxObjectShell::GetTitle( sal_uInt16 nMaxLength ) const return pImpl->aTitle; // must it be numbered? - OUString aNoName(SFX2_RESSTR(STR_NONAME)); + const OUString aNoName(SFX2_RESSTR(STR_NONAME)); if (pImpl->bIsNamedVisible) { // Append number - aNoName += " " + OUString::number(pImpl->nVisualDocumentNumber); + return aNoName + " " + OUString::number(pImpl->nVisualDocumentNumber); } // Document called "Untitled" for the time being |