From 74ca0e86063f698c8d36d935cd2b791c6b2874b4 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Fri, 7 Dec 2012 13:27:42 +0000 Subject: drop some static OUStrings Change-Id: I41d5df892d8b710b82ed886b2390b53535b8a67b --- oox/source/drawingml/customshapeproperties.cxx | 7 +++---- oox/source/drawingml/shapepropertiescontext.cxx | 6 ++---- oox/source/drawingml/table/tablecell.cxx | 16 +++++----------- oox/source/drawingml/table/tableproperties.cxx | 4 ++-- oox/source/ppt/presentationfragmenthandler.cxx | 19 ++++++------------- oox/source/vml/vmlformatting.cxx | 3 +-- 6 files changed, 19 insertions(+), 36 deletions(-) (limited to 'oox') diff --git a/oox/source/drawingml/customshapeproperties.cxx b/oox/source/drawingml/customshapeproperties.cxx index 8f313a0f0193..ea5dc1f32de9 100644 --- a/oox/source/drawingml/customshapeproperties.cxx +++ b/oox/source/drawingml/customshapeproperties.cxx @@ -98,10 +98,9 @@ static OUString GetConnectorShapeType( sal_Int32 nType ) OUString sType; switch( nType ) { - case XML_straightConnector1: { - static const OUString sStraightConnector1 = CREATE_OUSTRING( "mso-spt32" ); - sType = sStraightConnector1; - } break; + case XML_straightConnector1: + sType = "mso-spt32"; + break; default: break; } diff --git a/oox/source/drawingml/shapepropertiescontext.cxx b/oox/source/drawingml/shapepropertiescontext.cxx index a10b8eab9e5e..e0fe19f450a4 100644 --- a/oox/source/drawingml/shapepropertiescontext.cxx +++ b/oox/source/drawingml/shapepropertiescontext.cxx @@ -75,15 +75,13 @@ Reference< XFastContextHandler > ShapePropertiesContext::createFastChildContext( // TODO: Move the following checks to a separate place or as a separate function if ( nToken == XML_line ) { - static const OUString sLineShape( "com.sun.star.drawing.LineShape" ); - mrShape.getServiceName() = sLineShape; + mrShape.getServiceName() = "com.sun.star.drawing.LineShape"; } if( ( nToken >= XML_bentConnector2 && nToken <= XML_bentConnector5 ) || ( nToken >= XML_curvedConnector2 && nToken <= XML_curvedConnector5 ) || nToken == XML_straightConnector1 ) { - static const OUString sCustomShape( "com.sun.star.drawing.CustomShape" ); - mrShape.getServiceName() = sCustomShape; + mrShape.getServiceName() = "com.sun.star.drawing.CustomShape"; } xRet.set( new PresetShapeGeometryContext( *this, xAttribs, *(mrShape.getCustomShapeProperties()) ) ); } diff --git a/oox/source/drawingml/table/tablecell.cxx b/oox/source/drawingml/table/tablecell.cxx index 7394acb1abcf..d81f35012f5e 100644 --- a/oox/source/drawingml/table/tablecell.cxx +++ b/oox/source/drawingml/table/tablecell.cxx @@ -123,17 +123,11 @@ void applyTableStylePart( oox::drawingml::FillProperties& rFillProperties, void applyTableCellProperties( const Reference < ::com::sun::star::table::XCell >& rxCell, const TableCell& rTableCell ) { - static const OUString sTopBorder( RTL_CONSTASCII_USTRINGPARAM( "TextUpperDistance" ) ); - static const OUString sBottomBorder( RTL_CONSTASCII_USTRINGPARAM( "TextLowerDistance" ) ); - static const OUString sLeftBorder( RTL_CONSTASCII_USTRINGPARAM( "TextLeftDistance" ) ); - static const OUString sRightBorder( RTL_CONSTASCII_USTRINGPARAM( "TextRightDistance" ) ); - static const OUString sVerticalAdjust( RTL_CONSTASCII_USTRINGPARAM( "TextVerticalAdjust" ) ); - Reference< XPropertySet > xPropSet( rxCell, UNO_QUERY_THROW ); - xPropSet->setPropertyValue( sTopBorder, Any( static_cast< sal_Int32 >( rTableCell.getTopMargin() / 360 ) ) ); - xPropSet->setPropertyValue( sRightBorder, Any( static_cast< sal_Int32 >( rTableCell.getRightMargin() / 360 ) ) ); - xPropSet->setPropertyValue( sLeftBorder, Any( static_cast< sal_Int32 >( rTableCell.getLeftMargin() / 360 ) ) ); - xPropSet->setPropertyValue( sBottomBorder, Any( static_cast< sal_Int32 >( rTableCell.getBottomMargin() / 360 ) ) ); + xPropSet->setPropertyValue( "TextUpperDistance", Any( static_cast< sal_Int32 >( rTableCell.getTopMargin() / 360 ) ) ); + xPropSet->setPropertyValue( "TextRightDistance", Any( static_cast< sal_Int32 >( rTableCell.getRightMargin() / 360 ) ) ); + xPropSet->setPropertyValue( "TextLeftDistance", Any( static_cast< sal_Int32 >( rTableCell.getLeftMargin() / 360 ) ) ); + xPropSet->setPropertyValue( "TextLowerDistance", Any( static_cast< sal_Int32 >( rTableCell.getBottomMargin() / 360 ) ) ); drawing::TextVerticalAdjust eVA; switch( rTableCell.getAnchorToken() ) @@ -145,7 +139,7 @@ void applyTableCellProperties( const Reference < ::com::sun::star::table::XCell default: case XML_t: eVA = drawing::TextVerticalAdjust_TOP; break; } - xPropSet->setPropertyValue( sVerticalAdjust, Any( eVA ) ); + xPropSet->setPropertyValue( "TextVerticalAdjust", Any( eVA ) ); } void TableCell::pushToXCell( const ::oox::core::XmlFilterBase& rFilterBase, ::oox::drawingml::TextListStylePtr pMasterTextListStyle, diff --git a/oox/source/drawingml/table/tableproperties.cxx b/oox/source/drawingml/table/tableproperties.cxx index d480cc60e390..e9d7e5ee8c86 100644 --- a/oox/source/drawingml/table/tableproperties.cxx +++ b/oox/source/drawingml/table/tableproperties.cxx @@ -58,9 +58,9 @@ void CreateTableRows( uno::Reference< XTableRows > xTableRows, const std::vector xTableRows->insertByIndex( 0, rvTableRows.size() - 1 ); std::vector< TableRow >::const_iterator aTableRowIter( rvTableRows.begin() ); uno::Reference< container::XIndexAccess > xIndexAccess( xTableRows, UNO_QUERY_THROW ); + const OUString sHeight("Height"); for ( sal_Int32 n = 0; n < xIndexAccess->getCount(); n++ ) { - static const OUString sHeight("Height"); Reference< XPropertySet > xPropSet( xIndexAccess->getByIndex( n ), UNO_QUERY_THROW ); xPropSet->setPropertyValue( sHeight, Any( static_cast< sal_Int32 >( aTableRowIter->getHeight() / 360 ) ) ); ++aTableRowIter; @@ -73,9 +73,9 @@ void CreateTableColumns( Reference< XTableColumns > xTableColumns, const std::ve xTableColumns->insertByIndex( 0, rvTableGrid.size() - 1 ); std::vector< sal_Int32 >::const_iterator aTableGridIter( rvTableGrid.begin() ); uno::Reference< container::XIndexAccess > xIndexAccess( xTableColumns, UNO_QUERY_THROW ); + const OUString sWidth("Width"); for ( sal_Int32 n = 0; n < xIndexAccess->getCount(); n++ ) { - static const OUString sWidth("Width"); Reference< XPropertySet > xPropSet( xIndexAccess->getByIndex( n ), UNO_QUERY_THROW ); xPropSet->setPropertyValue( sWidth, Any( static_cast< sal_Int32 >( *aTableGridIter++ / 360 ) ) ); } diff --git a/oox/source/ppt/presentationfragmenthandler.cxx b/oox/source/ppt/presentationfragmenthandler.cxx index 4ae067c94be0..c92cdad3441c 100644 --- a/oox/source/ppt/presentationfragmenthandler.cxx +++ b/oox/source/ppt/presentationfragmenthandler.cxx @@ -353,27 +353,20 @@ bool PresentationFragmentHandler::importSlide( const FragmentHandlerRef& rxSlide Reference< XPropertySet > xPropertySet( xSlide, UNO_QUERY ); if ( xPropertySet.is() ) { - static const OUString sWidth = CREATE_OUSTRING( "Width" ); - static const OUString sHeight = CREATE_OUSTRING( "Height" ); awt::Size& rPageSize( pSlidePersistPtr->isNotesPage() ? maNotesSize : maSlideSize ); - xPropertySet->setPropertyValue( sWidth, Any( rPageSize.Width ) ); - xPropertySet->setPropertyValue( sHeight, Any( rPageSize.Height ) ); + xPropertySet->setPropertyValue( "Width", Any( rPageSize.Width ) ); + xPropertySet->setPropertyValue( "Height", Any( rPageSize.Height ) ); oox::ppt::HeaderFooter aHeaderFooter( pSlidePersistPtr->getHeaderFooter() ); if ( !pSlidePersistPtr->isMasterPage() ) aHeaderFooter.mbSlideNumber = aHeaderFooter.mbHeader = aHeaderFooter.mbFooter = aHeaderFooter.mbDateTime = sal_False; try { - static const OUString sIsHeaderVisible = CREATE_OUSTRING( "IsHeaderVisible" ); - static const OUString sIsFooterVisible = CREATE_OUSTRING( "IsFooterVisible" ); - static const OUString sIsDateTimeVisible = CREATE_OUSTRING( "IsDateTimeVisible" ); - static const OUString sIsPageNumberVisible = CREATE_OUSTRING( "IsPageNumberVisible" ); - if ( pSlidePersistPtr->isNotesPage() ) - xPropertySet->setPropertyValue( sIsHeaderVisible, Any( aHeaderFooter.mbHeader ) ); - xPropertySet->setPropertyValue( sIsFooterVisible, Any( aHeaderFooter.mbFooter ) ); - xPropertySet->setPropertyValue( sIsDateTimeVisible, Any( aHeaderFooter.mbDateTime ) ); - xPropertySet->setPropertyValue( sIsPageNumberVisible, Any( aHeaderFooter.mbSlideNumber ) ); + xPropertySet->setPropertyValue( "sIsHeaderVisible", Any( aHeaderFooter.mbHeader ) ); + xPropertySet->setPropertyValue( "IsFooterVisible", Any( aHeaderFooter.mbFooter ) ); + xPropertySet->setPropertyValue( "IsDateTimeVisible", Any( aHeaderFooter.mbDateTime ) ); + xPropertySet->setPropertyValue( "IsPageNumberVisible", Any( aHeaderFooter.mbSlideNumber ) ); } catch( uno::Exception& ) { diff --git a/oox/source/vml/vmlformatting.cxx b/oox/source/vml/vmlformatting.cxx index ed6355b45921..528cc06db6b6 100644 --- a/oox/source/vml/vmlformatting.cxx +++ b/oox/source/vml/vmlformatting.cxx @@ -129,12 +129,11 @@ bool lclExtractDouble( double& orfValue, sal_Int32& ornEndPos, const OUString& r return 0; // process trailing unit, convert to EMU - static const OUString saPx = CREATE_OUSTRING( "px" ); OUString aUnit; if( (0 < nEndPos) && (nEndPos < rValue.getLength()) ) aUnit = rValue.copy( nEndPos ); else if( bDefaultAsPixel ) - aUnit = saPx; + aUnit = "px"; // else default is EMU if( aUnit.getLength() == 2 ) -- cgit