summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorMatteo Casalin <matteo.casalin@yahoo.com>2017-04-17 18:56:24 +0200
committerMatteo Casalin <matteo.casalin@yahoo.com>2017-04-18 17:55:28 +0200
commit429c7a4958b11da43f2ada79adde778464a745b3 (patch)
treeed300e7a07287a823750a471f2ae615f3ae4cc29 /sfx2
parent9f1046587a26a3f673b465ad8dfe911905e71c5f (diff)
OUStrings: constify and avoid temporaries
Change-Id: I8ba379d2418eec012de62354dab474e6e7c8a1c6
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/source/view/viewfrm.cxx18
1 files changed, 9 insertions, 9 deletions
diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx
index 465bd904ba1a..af0eedd07ba7 100644
--- a/sfx2/source/view/viewfrm.cxx
+++ b/sfx2/source/view/viewfrm.cxx
@@ -274,7 +274,7 @@ void SfxViewFrame::ExecReload_Impl( SfxRequest& rReq )
SfxAllItemSet aSet( pApp->GetPool() );
aSet.Put( SfxStringItem( SID_FILE_NAME, pMed->GetURLObject().GetMainURL(INetURLObject::DecodeMechanism::NONE) ) );
aSet.Put( SfxBoolItem( SID_TEMPLATE, true ) );
- aSet.Put( SfxStringItem( SID_TARGETNAME, OUString("_blank") ) );
+ aSet.Put( SfxStringItem( SID_TARGETNAME, "_blank" ) );
const SfxStringItem* pReferer = SfxItemSet::GetItem<SfxStringItem>(pMed->GetItemSet(), SID_REFERER, false);
if ( pReferer )
aSet.Put( *pReferer );
@@ -322,7 +322,7 @@ void SfxViewFrame::ExecReload_Impl( SfxRequest& rReq )
&& ( pSh->GetModifyPasswordHash() || pSh->GetModifyPasswordInfo().getLength() )
&& !pSh->IsModifyPasswordEntered() )
{
- OUString aDocumentName = INetURLObject( pMed->GetOrigURL() ).GetMainURL( INetURLObject::DecodeMechanism::WithCharset );
+ const OUString aDocumentName = INetURLObject( pMed->GetOrigURL() ).GetMainURL( INetURLObject::DecodeMechanism::WithCharset );
if( !AskPasswordToModify_Impl( pMed->GetInteractionHandler(), aDocumentName, pMed->GetOrigFilter(), pSh->GetModifyPasswordHash(), pSh->GetModifyPasswordInfo() ) )
{
// this is a read-only document, if it has "Password to modify"
@@ -364,9 +364,9 @@ void SfxViewFrame::ExecReload_Impl( SfxRequest& rReq )
// doing
- OUString aTemp;
- osl::FileBase::getFileURLFromSystemPath( pMed->GetPhysicalName(), aTemp );
- INetURLObject aPhysObj( aTemp );
+ OUString sTemp;
+ osl::FileBase::getFileURLFromSystemPath( pMed->GetPhysicalName(), sTemp );
+ INetURLObject aPhysObj( sTemp );
const SfxInt16Item* pVersionItem = SfxItemSet::GetItem<SfxInt16Item>(pSh->GetMedium()->GetItemSet(), SID_VERSION, false);
INetURLObject aMedObj( pMed->GetName() );
@@ -1881,7 +1881,7 @@ void SfxViewFrame::SaveCurrentViewData_Impl( const SfxInterfaceId i_nNewViewId )
for ( sal_Int32 i=0; i<nCount; ++i )
{
const ::comphelper::NamedValueCollection aCurViewData( xViewData->getByIndex(i) );
- OUString sViewId( aCurViewData.getOrDefault( "ViewId", OUString() ) );
+ const OUString sViewId( aCurViewData.getOrDefault( "ViewId", OUString() ) );
if ( sViewId.isEmpty() )
continue;
@@ -2376,8 +2376,8 @@ void SfxViewFrame::AddDispatchMacroToBasic_Impl( const OUString& sMacro )
if ( xUrl.is() )
{
// get name
- OUString aName = xUrl->getName();
- sal_Unicode cTok = '.';
+ const OUString aName = xUrl->getName();
+ const sal_Unicode cTok = '.';
sal_Int32 nIndex = 0;
aLibName = aName.getToken( 0, cTok, nIndex );
if ( nIndex != -1 )
@@ -2457,7 +2457,6 @@ void SfxViewFrame::AddDispatchMacroToBasic_Impl( const OUString& sMacro )
}
// pack the macro as direct usable "sub" routine
- OUString sCode;
OUStringBuffer sRoutine(10000);
bool bReplace = false;
@@ -2470,6 +2469,7 @@ void SfxViewFrame::AddDispatchMacroToBasic_Impl( const OUString& sMacro )
}
else
{
+ OUString sCode;
aTemp = xLib->getByName(aModuleName);
aTemp >>= sCode;
sRoutine.append( sCode );