summaryrefslogtreecommitdiff
path: root/sfx2/source/appl/appopen.cxx
diff options
context:
space:
mode:
authorMatteo Casalin <matteo.casalin@yahoo.com>2018-08-05 00:16:34 +0200
committerMatteo Casalin <matteo.casalin@yahoo.com>2018-08-10 22:03:33 +0200
commitd20dc73be974dfc0a8524a3bad52e7874783fb34 (patch)
tree507c09c872495e358e08393de4248a0463c17529 /sfx2/source/appl/appopen.cxx
parent227f52f0bde15e64d068903d36c8c8f91beb22a0 (diff)
Reduce OUString operations
Change-Id: I379cc523587da41ee270ac90e8cfdc00526a2745
Diffstat (limited to 'sfx2/source/appl/appopen.cxx')
-rw-r--r--sfx2/source/appl/appopen.cxx24
1 files changed, 10 insertions, 14 deletions
diff --git a/sfx2/source/appl/appopen.cxx b/sfx2/source/appl/appopen.cxx
index 25c7ca3f3bfa..2b3f496cb02c 100644
--- a/sfx2/source/appl/appopen.cxx
+++ b/sfx2/source/appl/appopen.cxx
@@ -309,8 +309,8 @@ ErrCode SfxApplication::LoadTemplate( SfxObjectShellLock& xDoc, const OUString &
{
DBG_ASSERT( !xDoc.Is(), "Sorry, not implemented!" );
SfxStringItem aName( SID_FILE_NAME, rFileName );
- SfxStringItem aReferer( SID_REFERER, OUString("private:user") );
- SfxStringItem aFlags( SID_OPTIONS, OUString("T") );
+ SfxStringItem aReferer( SID_REFERER, "private:user" );
+ SfxStringItem aFlags( SID_OPTIONS, "T" );
SfxBoolItem aHidden( SID_HIDDEN, true );
const SfxPoolItem *pRet = GetDispatcher_Impl()->ExecuteList(
SID_OPENDOC, SfxCallMode::SYNCHRON,
@@ -406,11 +406,9 @@ void SfxApplication::NewDocDirectExec_Impl( SfxRequest& rReq )
aFactName = SvtModuleOptions().GetDefaultModuleName();
SfxRequest aReq( SID_OPENDOC, SfxCallMode::SYNCHRON, GetPool() );
- OUString aFact("private:factory/");
- aFact += aFactName;
- aReq.AppendItem( SfxStringItem( SID_FILE_NAME, aFact ) );
+ aReq.AppendItem( SfxStringItem( SID_FILE_NAME, "private:factory/" + aFactName ) );
aReq.AppendItem( SfxFrameItem( SID_DOCFRAME, GetFrame() ) );
- aReq.AppendItem( SfxStringItem( SID_TARGETNAME, OUString( "_default" ) ) );
+ aReq.AppendItem( SfxStringItem( SID_TARGETNAME, "_default" ) );
// TODO/LATER: Should the other arguments be transferred as well?
const SfxStringItem* pDefaultPathItem = rReq.GetArg<SfxStringItem>(SID_DEFAULTFILEPATH);
@@ -656,7 +654,7 @@ void SfxApplication::OpenDocExec_Impl( SfxRequest& rReq )
rReq.SetArgs( *static_cast<SfxAllItemSet*>(pSet) );
if ( !aFilter.isEmpty() )
rReq.AppendItem( SfxStringItem( SID_FILTER_NAME, aFilter ) );
- rReq.AppendItem( SfxStringItem( SID_TARGETNAME, OUString("_default") ) );
+ rReq.AppendItem( SfxStringItem( SID_TARGETNAME, "_default" ) );
rReq.AppendItem( SfxStringItem( SID_REFERER, "private:user" ) );
delete pSet;
@@ -778,8 +776,7 @@ void SfxApplication::OpenDocExec_Impl( SfxRequest& rReq )
const SfxStringItem* pFileFlagsItem = rReq.GetArg<SfxStringItem>(SID_OPTIONS);
if ( pFileFlagsItem )
{
- OUString aFileFlags = pFileFlagsItem->GetValue();
- aFileFlags = aFileFlags.toAsciiUpperCase();
+ const OUString aFileFlags = pFileFlagsItem->GetValue().toAsciiUpperCase();
if ( -1 != aFileFlags.indexOf( 0x0054 ) ) // T = 54h
{
rReq.RemoveItem( SID_TEMPLATE );
@@ -816,7 +813,6 @@ void SfxApplication::OpenDocExec_Impl( SfxRequest& rReq )
if ( xTypeDetection.is() )
{
URL aURL;
- OUString aTypeName;
aURL.Complete = aFileName;
Reference< util::XURLTransformer > xTrans( util::URLTransformer::create( ::comphelper::getProcessComponentContext() ) );
@@ -838,7 +834,7 @@ void SfxApplication::OpenDocExec_Impl( SfxRequest& rReq )
return;
}
- aTypeName = xTypeDetection->queryTypeByURL( aURL.Main );
+ const OUString aTypeName { xTypeDetection->queryTypeByURL( aURL.Main ) };
SfxFilterMatcher& rMatcher = SfxGetpApp()->GetFilterMatcher();
std::shared_ptr<const SfxFilter> pFilter = rMatcher.GetFilter4EA( aTypeName );
if (!pFilter || !lcl_isFilterNativelySupported(*pFilter))
@@ -848,7 +844,7 @@ void SfxApplication::OpenDocExec_Impl( SfxRequest& rReq )
{
// don't dispatch mailto hyperlink to desktop dispatcher
rReq.RemoveItem( SID_TARGETNAME );
- rReq.AppendItem( SfxStringItem( SID_TARGETNAME, OUString("_self") ) );
+ rReq.AppendItem( SfxStringItem( SID_TARGETNAME, "_self" ) );
}
else if ( aINetProtocol == INetProtocol::Ftp ||
aINetProtocol == INetProtocol::Http ||
@@ -907,7 +903,7 @@ void SfxApplication::OpenDocExec_Impl( SfxRequest& rReq )
catch ( css::system::SystemShellExecuteException& )
{
rReq.RemoveItem( SID_TARGETNAME );
- rReq.AppendItem( SfxStringItem( SID_TARGETNAME, OUString("_default") ) );
+ rReq.AppendItem( SfxStringItem( SID_TARGETNAME, "_default" ) );
bLoadInternal = true;
}
if ( !bLoadInternal )
@@ -919,7 +915,7 @@ void SfxApplication::OpenDocExec_Impl( SfxRequest& rReq )
{
// hyperlink document must be loaded into a new frame
rReq.RemoveItem( SID_TARGETNAME );
- rReq.AppendItem( SfxStringItem( SID_TARGETNAME, OUString("_default") ) );
+ rReq.AppendItem( SfxStringItem( SID_TARGETNAME, "_default" ) );
}
}
}