summaryrefslogtreecommitdiff
path: root/sw/source/filter/xml/xmlfmt.cxx
diff options
context:
space:
mode:
authorMatteo Casalin <matteo.casalin@yahoo.com>2014-04-23 08:37:03 +0200
committerMatteo Casalin <matteo.casalin@yahoo.com>2014-04-27 14:00:46 +0200
commitb4d36ef43eb40801cb8d4e10aaa35c98aa9538ee (patch)
treedd16cb6fbe8a97f145ca5d17d28cf2951d8ff78c /sw/source/filter/xml/xmlfmt.cxx
parent637100b15d09610d97f4f60cff51c7a17c871511 (diff)
OUString: avoid temporaries and constify
Change-Id: I13b97154656ee93d4adee0873e932116c6023e70
Diffstat (limited to 'sw/source/filter/xml/xmlfmt.cxx')
-rw-r--r--sw/source/filter/xml/xmlfmt.cxx19
1 files changed, 7 insertions, 12 deletions
diff --git a/sw/source/filter/xml/xmlfmt.cxx b/sw/source/filter/xml/xmlfmt.cxx
index b99bf351fdb4..479954cb8c23 100644
--- a/sw/source/filter/xml/xmlfmt.cxx
+++ b/sw/source/filter/xml/xmlfmt.cxx
@@ -295,10 +295,8 @@ uno::Reference < style::XStyle > SwXMLTextStyleContext_Impl::Create()
uno::UNO_QUERY );
if( xFactory.is() )
{
- OUString sServiceName(
- "com.sun.star.style.ConditionalParagraphStyle" );
uno::Reference < uno::XInterface > xIfc =
- xFactory->createInstance( sServiceName );
+ xFactory->createInstance( "com.sun.star.style.ConditionalParagraphStyle" );
if( xIfc.is() )
xNewStyle = uno::Reference < style::XStyle >( xIfc, uno::UNO_QUERY );
}
@@ -397,7 +395,7 @@ void SwXMLTextStyleContext_Impl::Finish( bool bOverwrite )
for( size_t i = 0; i < nCount; i++ )
{
const SwXMLConditionContext_Impl *pCond = (*pConditions)[i];
- OUString aDisplayName(
+ const OUString aDisplayName(
GetImport().GetStyleDisplayName( XML_STYLE_FAMILY_TEXT_PARAGRAPH,
pCond->GetApplyStyle() ) );
SwStyleNameMapper::FillUIName(aDisplayName,
@@ -598,7 +596,8 @@ SvXMLImportContext *SwXMLItemSetStyleContext_Impl::CreateChildContext(
if( !pTextStyle )
{
SvXMLAttributeList *pTmp = new SvXMLAttributeList;
- OUString aStr = GetImport().GetNamespaceMap().GetQNameByKey( nPrefix, GetXMLToken(XML_NAME) );
+ const OUString aStr = GetImport().GetNamespaceMap().GetQNameByKey(
+ nPrefix, GetXMLToken(XML_NAME) );
pTmp->AddAttribute( aStr, GetName() );
uno::Reference <xml::sax::XAttributeList> xTmpAttrList = pTmp;
pTextStyle = new SwXMLTextStyleContext_Impl( GetSwImport(), nPrefix,
@@ -625,10 +624,9 @@ void SwXMLItemSetStyleContext_Impl::ConnectPageDesc()
SwDoc *pDoc = SwImport::GetDocFromXMLImport( GetSwImport() );
- OUString sName;
// #i40788# - first determine the display name of the page style,
// then map this name to the corresponding user interface name.
- sName = GetImport().GetStyleDisplayName( XML_STYLE_FAMILY_MASTER_PAGE,
+ OUString sName = GetImport().GetStyleDisplayName( XML_STYLE_FAMILY_MASTER_PAGE,
GetMasterPageName() );
SwStyleNameMapper::FillUIName( sName,
sName,
@@ -891,13 +889,10 @@ uno::Reference < container::XNameContainer > SwXMLStylesContext_Impl::GetStylesC
OUString SwXMLStylesContext_Impl::GetServiceName( sal_uInt16 nFamily ) const
{
- OUString sServiceName;
if( XML_STYLE_FAMILY_SD_GRAPHICS_ID == nFamily )
- sServiceName = "com.sun.star.style.FrameStyle";
- else
- sServiceName = SvXMLStylesContext::GetServiceName( nFamily );
+ return OUString( "com.sun.star.style.FrameStyle" );
- return sServiceName;
+ return SvXMLStylesContext::GetServiceName( nFamily );
}
void SwXMLStylesContext_Impl::EndElement()