Kaydet (Commit) 74ca0e86 authored tarafından Caolán McNamara's avatar Caolán McNamara

drop some static OUStrings

Change-Id: I41d5df892d8b710b82ed886b2390b53535b8a67b
üst 21ea3725
...@@ -98,10 +98,9 @@ static OUString GetConnectorShapeType( sal_Int32 nType ) ...@@ -98,10 +98,9 @@ static OUString GetConnectorShapeType( sal_Int32 nType )
OUString sType; OUString sType;
switch( nType ) switch( nType )
{ {
case XML_straightConnector1: { case XML_straightConnector1:
static const OUString sStraightConnector1 = CREATE_OUSTRING( "mso-spt32" ); sType = "mso-spt32";
sType = sStraightConnector1; break;
} break;
default: default:
break; break;
} }
......
...@@ -75,15 +75,13 @@ Reference< XFastContextHandler > ShapePropertiesContext::createFastChildContext( ...@@ -75,15 +75,13 @@ Reference< XFastContextHandler > ShapePropertiesContext::createFastChildContext(
// TODO: Move the following checks to a separate place or as a separate function // TODO: Move the following checks to a separate place or as a separate function
if ( nToken == XML_line ) if ( nToken == XML_line )
{ {
static const OUString sLineShape( "com.sun.star.drawing.LineShape" ); mrShape.getServiceName() = "com.sun.star.drawing.LineShape";
mrShape.getServiceName() = sLineShape;
} }
if( ( nToken >= XML_bentConnector2 && nToken <= XML_bentConnector5 ) || if( ( nToken >= XML_bentConnector2 && nToken <= XML_bentConnector5 ) ||
( nToken >= XML_curvedConnector2 && nToken <= XML_curvedConnector5 ) || ( nToken >= XML_curvedConnector2 && nToken <= XML_curvedConnector5 ) ||
nToken == XML_straightConnector1 ) nToken == XML_straightConnector1 )
{ {
static const OUString sCustomShape( "com.sun.star.drawing.CustomShape" ); mrShape.getServiceName() = "com.sun.star.drawing.CustomShape";
mrShape.getServiceName() = sCustomShape;
} }
xRet.set( new PresetShapeGeometryContext( *this, xAttribs, *(mrShape.getCustomShapeProperties()) ) ); xRet.set( new PresetShapeGeometryContext( *this, xAttribs, *(mrShape.getCustomShapeProperties()) ) );
} }
......
...@@ -123,17 +123,11 @@ void applyTableStylePart( oox::drawingml::FillProperties& rFillProperties, ...@@ -123,17 +123,11 @@ void applyTableStylePart( oox::drawingml::FillProperties& rFillProperties,
void applyTableCellProperties( const Reference < ::com::sun::star::table::XCell >& rxCell, const TableCell& rTableCell ) 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 ); Reference< XPropertySet > xPropSet( rxCell, UNO_QUERY_THROW );
xPropSet->setPropertyValue( sTopBorder, Any( static_cast< sal_Int32 >( rTableCell.getTopMargin() / 360 ) ) ); xPropSet->setPropertyValue( "TextUpperDistance", Any( static_cast< sal_Int32 >( rTableCell.getTopMargin() / 360 ) ) );
xPropSet->setPropertyValue( sRightBorder, Any( static_cast< sal_Int32 >( rTableCell.getRightMargin() / 360 ) ) ); xPropSet->setPropertyValue( "TextRightDistance", Any( static_cast< sal_Int32 >( rTableCell.getRightMargin() / 360 ) ) );
xPropSet->setPropertyValue( sLeftBorder, Any( static_cast< sal_Int32 >( rTableCell.getLeftMargin() / 360 ) ) ); xPropSet->setPropertyValue( "TextLeftDistance", Any( static_cast< sal_Int32 >( rTableCell.getLeftMargin() / 360 ) ) );
xPropSet->setPropertyValue( sBottomBorder, Any( static_cast< sal_Int32 >( rTableCell.getBottomMargin() / 360 ) ) ); xPropSet->setPropertyValue( "TextLowerDistance", Any( static_cast< sal_Int32 >( rTableCell.getBottomMargin() / 360 ) ) );
drawing::TextVerticalAdjust eVA; drawing::TextVerticalAdjust eVA;
switch( rTableCell.getAnchorToken() ) switch( rTableCell.getAnchorToken() )
...@@ -145,7 +139,7 @@ void applyTableCellProperties( const Reference < ::com::sun::star::table::XCell ...@@ -145,7 +139,7 @@ void applyTableCellProperties( const Reference < ::com::sun::star::table::XCell
default: default:
case XML_t: eVA = drawing::TextVerticalAdjust_TOP; break; 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, void TableCell::pushToXCell( const ::oox::core::XmlFilterBase& rFilterBase, ::oox::drawingml::TextListStylePtr pMasterTextListStyle,
......
...@@ -58,9 +58,9 @@ void CreateTableRows( uno::Reference< XTableRows > xTableRows, const std::vector ...@@ -58,9 +58,9 @@ void CreateTableRows( uno::Reference< XTableRows > xTableRows, const std::vector
xTableRows->insertByIndex( 0, rvTableRows.size() - 1 ); xTableRows->insertByIndex( 0, rvTableRows.size() - 1 );
std::vector< TableRow >::const_iterator aTableRowIter( rvTableRows.begin() ); std::vector< TableRow >::const_iterator aTableRowIter( rvTableRows.begin() );
uno::Reference< container::XIndexAccess > xIndexAccess( xTableRows, UNO_QUERY_THROW ); uno::Reference< container::XIndexAccess > xIndexAccess( xTableRows, UNO_QUERY_THROW );
const OUString sHeight("Height");
for ( sal_Int32 n = 0; n < xIndexAccess->getCount(); n++ ) for ( sal_Int32 n = 0; n < xIndexAccess->getCount(); n++ )
{ {
static const OUString sHeight("Height");
Reference< XPropertySet > xPropSet( xIndexAccess->getByIndex( n ), UNO_QUERY_THROW ); Reference< XPropertySet > xPropSet( xIndexAccess->getByIndex( n ), UNO_QUERY_THROW );
xPropSet->setPropertyValue( sHeight, Any( static_cast< sal_Int32 >( aTableRowIter->getHeight() / 360 ) ) ); xPropSet->setPropertyValue( sHeight, Any( static_cast< sal_Int32 >( aTableRowIter->getHeight() / 360 ) ) );
++aTableRowIter; ++aTableRowIter;
...@@ -73,9 +73,9 @@ void CreateTableColumns( Reference< XTableColumns > xTableColumns, const std::ve ...@@ -73,9 +73,9 @@ void CreateTableColumns( Reference< XTableColumns > xTableColumns, const std::ve
xTableColumns->insertByIndex( 0, rvTableGrid.size() - 1 ); xTableColumns->insertByIndex( 0, rvTableGrid.size() - 1 );
std::vector< sal_Int32 >::const_iterator aTableGridIter( rvTableGrid.begin() ); std::vector< sal_Int32 >::const_iterator aTableGridIter( rvTableGrid.begin() );
uno::Reference< container::XIndexAccess > xIndexAccess( xTableColumns, UNO_QUERY_THROW ); uno::Reference< container::XIndexAccess > xIndexAccess( xTableColumns, UNO_QUERY_THROW );
const OUString sWidth("Width");
for ( sal_Int32 n = 0; n < xIndexAccess->getCount(); n++ ) for ( sal_Int32 n = 0; n < xIndexAccess->getCount(); n++ )
{ {
static const OUString sWidth("Width");
Reference< XPropertySet > xPropSet( xIndexAccess->getByIndex( n ), UNO_QUERY_THROW ); Reference< XPropertySet > xPropSet( xIndexAccess->getByIndex( n ), UNO_QUERY_THROW );
xPropSet->setPropertyValue( sWidth, Any( static_cast< sal_Int32 >( *aTableGridIter++ / 360 ) ) ); xPropSet->setPropertyValue( sWidth, Any( static_cast< sal_Int32 >( *aTableGridIter++ / 360 ) ) );
} }
......
...@@ -353,27 +353,20 @@ bool PresentationFragmentHandler::importSlide( const FragmentHandlerRef& rxSlide ...@@ -353,27 +353,20 @@ bool PresentationFragmentHandler::importSlide( const FragmentHandlerRef& rxSlide
Reference< XPropertySet > xPropertySet( xSlide, UNO_QUERY ); Reference< XPropertySet > xPropertySet( xSlide, UNO_QUERY );
if ( xPropertySet.is() ) if ( xPropertySet.is() )
{ {
static const OUString sWidth = CREATE_OUSTRING( "Width" );
static const OUString sHeight = CREATE_OUSTRING( "Height" );
awt::Size& rPageSize( pSlidePersistPtr->isNotesPage() ? maNotesSize : maSlideSize ); awt::Size& rPageSize( pSlidePersistPtr->isNotesPage() ? maNotesSize : maSlideSize );
xPropertySet->setPropertyValue( sWidth, Any( rPageSize.Width ) ); xPropertySet->setPropertyValue( "Width", Any( rPageSize.Width ) );
xPropertySet->setPropertyValue( sHeight, Any( rPageSize.Height ) ); xPropertySet->setPropertyValue( "Height", Any( rPageSize.Height ) );
oox::ppt::HeaderFooter aHeaderFooter( pSlidePersistPtr->getHeaderFooter() ); oox::ppt::HeaderFooter aHeaderFooter( pSlidePersistPtr->getHeaderFooter() );
if ( !pSlidePersistPtr->isMasterPage() ) if ( !pSlidePersistPtr->isMasterPage() )
aHeaderFooter.mbSlideNumber = aHeaderFooter.mbHeader = aHeaderFooter.mbFooter = aHeaderFooter.mbDateTime = sal_False; aHeaderFooter.mbSlideNumber = aHeaderFooter.mbHeader = aHeaderFooter.mbFooter = aHeaderFooter.mbDateTime = sal_False;
try 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() ) if ( pSlidePersistPtr->isNotesPage() )
xPropertySet->setPropertyValue( sIsHeaderVisible, Any( aHeaderFooter.mbHeader ) ); xPropertySet->setPropertyValue( "sIsHeaderVisible", Any( aHeaderFooter.mbHeader ) );
xPropertySet->setPropertyValue( sIsFooterVisible, Any( aHeaderFooter.mbFooter ) ); xPropertySet->setPropertyValue( "IsFooterVisible", Any( aHeaderFooter.mbFooter ) );
xPropertySet->setPropertyValue( sIsDateTimeVisible, Any( aHeaderFooter.mbDateTime ) ); xPropertySet->setPropertyValue( "IsDateTimeVisible", Any( aHeaderFooter.mbDateTime ) );
xPropertySet->setPropertyValue( sIsPageNumberVisible, Any( aHeaderFooter.mbSlideNumber ) ); xPropertySet->setPropertyValue( "IsPageNumberVisible", Any( aHeaderFooter.mbSlideNumber ) );
} }
catch( uno::Exception& ) catch( uno::Exception& )
{ {
......
...@@ -129,12 +129,11 @@ bool lclExtractDouble( double& orfValue, sal_Int32& ornEndPos, const OUString& r ...@@ -129,12 +129,11 @@ bool lclExtractDouble( double& orfValue, sal_Int32& ornEndPos, const OUString& r
return 0; return 0;
// process trailing unit, convert to EMU // process trailing unit, convert to EMU
static const OUString saPx = CREATE_OUSTRING( "px" );
OUString aUnit; OUString aUnit;
if( (0 < nEndPos) && (nEndPos < rValue.getLength()) ) if( (0 < nEndPos) && (nEndPos < rValue.getLength()) )
aUnit = rValue.copy( nEndPos ); aUnit = rValue.copy( nEndPos );
else if( bDefaultAsPixel ) else if( bDefaultAsPixel )
aUnit = saPx; aUnit = "px";
// else default is EMU // else default is EMU
if( aUnit.getLength() == 2 ) if( aUnit.getLength() == 2 )
......
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