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

OUString: avoid temporaries and constify

Change-Id: I13b97154656ee93d4adee0873e932116c6023e70
üst 637100b1
...@@ -295,10 +295,8 @@ uno::Reference < style::XStyle > SwXMLTextStyleContext_Impl::Create() ...@@ -295,10 +295,8 @@ uno::Reference < style::XStyle > SwXMLTextStyleContext_Impl::Create()
uno::UNO_QUERY ); uno::UNO_QUERY );
if( xFactory.is() ) if( xFactory.is() )
{ {
OUString sServiceName(
"com.sun.star.style.ConditionalParagraphStyle" );
uno::Reference < uno::XInterface > xIfc = uno::Reference < uno::XInterface > xIfc =
xFactory->createInstance( sServiceName ); xFactory->createInstance( "com.sun.star.style.ConditionalParagraphStyle" );
if( xIfc.is() ) if( xIfc.is() )
xNewStyle = uno::Reference < style::XStyle >( xIfc, uno::UNO_QUERY ); xNewStyle = uno::Reference < style::XStyle >( xIfc, uno::UNO_QUERY );
} }
...@@ -397,7 +395,7 @@ void SwXMLTextStyleContext_Impl::Finish( bool bOverwrite ) ...@@ -397,7 +395,7 @@ void SwXMLTextStyleContext_Impl::Finish( bool bOverwrite )
for( size_t i = 0; i < nCount; i++ ) for( size_t i = 0; i < nCount; i++ )
{ {
const SwXMLConditionContext_Impl *pCond = (*pConditions)[i]; const SwXMLConditionContext_Impl *pCond = (*pConditions)[i];
OUString aDisplayName( const OUString aDisplayName(
GetImport().GetStyleDisplayName( XML_STYLE_FAMILY_TEXT_PARAGRAPH, GetImport().GetStyleDisplayName( XML_STYLE_FAMILY_TEXT_PARAGRAPH,
pCond->GetApplyStyle() ) ); pCond->GetApplyStyle() ) );
SwStyleNameMapper::FillUIName(aDisplayName, SwStyleNameMapper::FillUIName(aDisplayName,
...@@ -598,7 +596,8 @@ SvXMLImportContext *SwXMLItemSetStyleContext_Impl::CreateChildContext( ...@@ -598,7 +596,8 @@ SvXMLImportContext *SwXMLItemSetStyleContext_Impl::CreateChildContext(
if( !pTextStyle ) if( !pTextStyle )
{ {
SvXMLAttributeList *pTmp = new SvXMLAttributeList; 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() ); pTmp->AddAttribute( aStr, GetName() );
uno::Reference <xml::sax::XAttributeList> xTmpAttrList = pTmp; uno::Reference <xml::sax::XAttributeList> xTmpAttrList = pTmp;
pTextStyle = new SwXMLTextStyleContext_Impl( GetSwImport(), nPrefix, pTextStyle = new SwXMLTextStyleContext_Impl( GetSwImport(), nPrefix,
...@@ -625,10 +624,9 @@ void SwXMLItemSetStyleContext_Impl::ConnectPageDesc() ...@@ -625,10 +624,9 @@ void SwXMLItemSetStyleContext_Impl::ConnectPageDesc()
SwDoc *pDoc = SwImport::GetDocFromXMLImport( GetSwImport() ); SwDoc *pDoc = SwImport::GetDocFromXMLImport( GetSwImport() );
OUString sName;
// #i40788# - first determine the display name of the page style, // #i40788# - first determine the display name of the page style,
// then map this name to the corresponding user interface name. // 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() ); GetMasterPageName() );
SwStyleNameMapper::FillUIName( sName, SwStyleNameMapper::FillUIName( sName,
sName, sName,
...@@ -891,13 +889,10 @@ uno::Reference < container::XNameContainer > SwXMLStylesContext_Impl::GetStylesC ...@@ -891,13 +889,10 @@ uno::Reference < container::XNameContainer > SwXMLStylesContext_Impl::GetStylesC
OUString SwXMLStylesContext_Impl::GetServiceName( sal_uInt16 nFamily ) const OUString SwXMLStylesContext_Impl::GetServiceName( sal_uInt16 nFamily ) const
{ {
OUString sServiceName;
if( XML_STYLE_FAMILY_SD_GRAPHICS_ID == nFamily ) if( XML_STYLE_FAMILY_SD_GRAPHICS_ID == nFamily )
sServiceName = "com.sun.star.style.FrameStyle"; return OUString( "com.sun.star.style.FrameStyle" );
else
sServiceName = SvXMLStylesContext::GetServiceName( nFamily );
return sServiceName; return SvXMLStylesContext::GetServiceName( nFamily );
} }
void SwXMLStylesContext_Impl::EndElement() void SwXMLStylesContext_Impl::EndElement()
......
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