summaryrefslogtreecommitdiff
path: root/oox
diff options
context:
space:
mode:
authorMichael Meeks <michael.meeks@suse.com>2012-06-01 17:19:58 +0100
committerMichael Meeks <michael.meeks@suse.com>2012-06-01 17:40:03 +0100
commitff43ad1a77a89d1d1ebc0c20807bb9ec508fc9fd (patch)
treedaca69d3fceb0a7ec682360418033cf0126a6e95 /oox
parentfcc31f1749e01e4184c4347929a9e1d7e782dee1 (diff)
targetted string cleanup
Change-Id: Iaf77bb427d62d7f3be00a96cba4dfb25a01934ac
Diffstat (limited to 'oox')
-rw-r--r--oox/source/core/xmlfilterbase.cxx2
-rw-r--r--oox/source/drawingml/shape.cxx13
-rw-r--r--oox/source/export/SchXMLSeriesHelper.cxx14
-rw-r--r--oox/source/ppt/pptshape.cxx4
-rw-r--r--oox/source/vml/vmlshapecontext.cxx26
5 files changed, 28 insertions, 31 deletions
diff --git a/oox/source/core/xmlfilterbase.cxx b/oox/source/core/xmlfilterbase.cxx
index 762e2bd35035..04957cfd7ff9 100644
--- a/oox/source/core/xmlfilterbase.cxx
+++ b/oox/source/core/xmlfilterbase.cxx
@@ -210,7 +210,7 @@ static Reference< XComponentContext > lcl_getComponentContext(Reference< XMultiS
{
Reference< XPropertySet > xFactProp( aFactory, UNO_QUERY );
if( xFactProp.is() )
- xFactProp->getPropertyValue( OUString(RTL_CONSTASCII_USTRINGPARAM("DefaultContext")) ) >>= xContext;
+ xFactProp->getPropertyValue( "DefaultContext") >>= xContext;
}
catch( Exception& )
{}
diff --git a/oox/source/drawingml/shape.cxx b/oox/source/drawingml/shape.cxx
index be58314124a4..66a1ee16005d 100644
--- a/oox/source/drawingml/shape.cxx
+++ b/oox/source/drawingml/shape.cxx
@@ -336,17 +336,18 @@ Reference< XShape > Shape::createAndInsert(
awt::Rectangle aShapeRectHmm( maPosition.X / 360, maPosition.Y / 360, maSize.Width / 360, maSize.Height / 360 );
OUString aServiceName;
- if( rServiceName == OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.GraphicObjectShape") ) &&
+ if( rServiceName == "com.sun.star.drawing.GraphicObjectShape" &&
mpGraphicPropertiesPtr && !mpGraphicPropertiesPtr->maAudio.msEmbed.isEmpty() )
{
- aServiceName = finalizeServiceName( rFilterBase, OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.presentation.MediaShape" ) ), aShapeRectHmm );
+ aServiceName = finalizeServiceName( rFilterBase, "com.sun.star.presentation.MediaShape", aShapeRectHmm );
bIsEmbMedia = true;
}
else
{
aServiceName = finalizeServiceName( rFilterBase, rServiceName, aShapeRectHmm );
}
- sal_Bool bIsCustomShape = aServiceName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "com.sun.star.drawing.CustomShape" ) ) || aServiceName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "com.sun.star.drawing.ConnectorShape" ) );
+ sal_Bool bIsCustomShape = ( aServiceName == "com.sun.star.drawing.CustomShape" ||
+ aServiceName == "com.sun.star.drawing.ConnectorShape" );
basegfx::B2DHomMatrix aTransformation;
@@ -529,9 +530,9 @@ Reference< XShape > Shape::createAndInsert(
// applying properties
aShapeProps.assignUsed( getShapeProperties() );
aShapeProps.assignUsed( maDefaultShapeProperties );
- if ( bIsEmbMedia || aServiceName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("com.sun.star.drawing.GraphicObjectShape")) )
+ if ( bIsEmbMedia || aServiceName == "com.sun.star.drawing.GraphicObjectShape" )
mpGraphicPropertiesPtr->pushToPropMap( aShapeProps, rGraphicHelper );
- if ( mpTablePropertiesPtr.get() && aServiceName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("com.sun.star.drawing.TableShape")) )
+ if ( mpTablePropertiesPtr.get() && aServiceName == "com.sun.star.drawing.TableShape" )
mpTablePropertiesPtr->pushToPropSet( rFilterBase, xSet, mpMasterTextListStyle );
aFillProperties.pushToPropMap( aShapeProps, rGraphicHelper, mnRotation, nFillPhClr );
aLineProperties.pushToPropMap( aShapeProps, rGraphicHelper, nLinePhClr );
@@ -546,7 +547,7 @@ Reference< XShape > Shape::createAndInsert(
xSet->setPropertyValue( rPropName, Any( false ) );
// do not set properties at a group shape (this causes assertions from svx)
- if( aServiceName != OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.GroupShape")) )
+ if( aServiceName != "com.sun.star.drawing.GroupShape" )
PropertySet( xSet ).setProperties( aShapeProps );
if( bIsCustomShape )
diff --git a/oox/source/export/SchXMLSeriesHelper.cxx b/oox/source/export/SchXMLSeriesHelper.cxx
index 509c1217b2e3..310566c580dd 100644
--- a/oox/source/export/SchXMLSeriesHelper.cxx
+++ b/oox/source/export/SchXMLSeriesHelper.cxx
@@ -34,7 +34,6 @@
#include <com/sun/star/lang/XInitialization.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
-// header for define RTL_CONSTASCII_USTRINGPARAM
#include <rtl/ustring.h>
// header for define DBG_ERROR1
#include <tools/debug.hxx>
@@ -80,12 +79,9 @@ using ::rtl::OUString;
{
(void)ex; // avoid warning for pro build
- OSL_FAIL( OUStringToOString( OUString(
- OUString( RTL_CONSTASCII_USTRINGPARAM( "Exception caught. Type: " )) +
- OUString::createFromAscii( typeid( ex ).name()) +
- OUString( RTL_CONSTASCII_USTRINGPARAM( ", Message: " )) +
- ex.Message), RTL_TEXTENCODING_ASCII_US ).getStr());
-
+ OSL_FAIL( OUStringToOString( "Exception caught. Type: " +
+ OUString::createFromAscii( typeid( ex ).name() ) +
+ ", Message: " + ex.Message, RTL_TEXTENCODING_ASCII_US ).getStr());
}
return aResult;
@@ -202,7 +198,7 @@ uno::Reference< beans::XPropertySet > SchXMLSeriesHelper::createOldAPISeriesProp
if( xFactory.is() )
{
xRet = uno::Reference< beans::XPropertySet >( xFactory->createInstance(
- OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.chart2.DataSeriesWrapper")) ), uno::UNO_QUERY );
+ "com.sun.star.comp.chart2.DataSeriesWrapper" ), uno::UNO_QUERY );
Reference< lang::XInitialization > xInit( xRet, uno::UNO_QUERY );
if(xInit.is())
{
@@ -239,7 +235,7 @@ uno::Reference< beans::XPropertySet > SchXMLSeriesHelper::createOldAPIDataPointP
if( xFactory.is() )
{
xRet = uno::Reference< beans::XPropertySet >( xFactory->createInstance(
- OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.chart2.DataSeriesWrapper")) ), uno::UNO_QUERY );
+ "com.sun.star.comp.chart2.DataSeriesWrapper" ), uno::UNO_QUERY );
Reference< lang::XInitialization > xInit( xRet, uno::UNO_QUERY );
if(xInit.is())
{
diff --git a/oox/source/ppt/pptshape.cxx b/oox/source/ppt/pptshape.cxx
index 9fa052c46308..3b6625338e95 100644
--- a/oox/source/ppt/pptshape.cxx
+++ b/oox/source/ppt/pptshape.cxx
@@ -139,8 +139,8 @@ void PPTShape::addShape(
Reference< lang::XMultiServiceFactory > xServiceFact( rFilterBase.getModel(), UNO_QUERY_THROW );
sal_Bool bClearText = sal_False;
- if ( sServiceName != OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.GraphicObjectShape")) &&
- sServiceName != OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.OLE2Shape")) )
+ if ( sServiceName != "com.sun.star.drawing.GraphicObjectShape" &&
+ sServiceName != "com.sun.star.drawing.OLE2Shape" )
{
const rtl::OUString sOutlinerShapeService( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.presentation.OutlinerShape" ) );
OSL_TRACE("has master: %p", rSlidePersist.getMasterPersist().get());
diff --git a/oox/source/vml/vmlshapecontext.cxx b/oox/source/vml/vmlshapecontext.cxx
index e6485f3c7927..3134282c06d4 100644
--- a/oox/source/vml/vmlshapecontext.cxx
+++ b/oox/source/vml/vmlshapecontext.cxx
@@ -349,18 +349,18 @@ void ShapeTypeContext::setStyle( const OUString& rStyle )
OUString aName, aValue;
if( ConversionHelper::separatePair( aName, aValue, rStyle.getToken( 0, ';', nIndex ), ':' ) )
{
- if( aName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "position" ) ) ) mrTypeModel.maPosition = aValue;
- else if( aName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "left" ) ) ) mrTypeModel.maLeft = aValue;
- else if( aName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "top" ) ) ) mrTypeModel.maTop = aValue;
- else if( aName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "width" ) ) ) mrTypeModel.maWidth = aValue;
- else if( aName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "height" ) ) ) mrTypeModel.maHeight = aValue;
- else if( aName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "margin-left" ) ) ) mrTypeModel.maMarginLeft = aValue;
- else if( aName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "margin-top" ) ) ) mrTypeModel.maMarginTop = aValue;
- else if( aName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "mso-position-vertical-relative" ) ) ) mrTypeModel.maPositionVerticalRelative = aValue;
+ if( aName == "position" ) mrTypeModel.maPosition = aValue;
+ else if( aName == "left" ) mrTypeModel.maLeft = aValue;
+ else if( aName == "top" ) mrTypeModel.maTop = aValue;
+ else if( aName == "width" ) mrTypeModel.maWidth = aValue;
+ else if( aName == "height" ) mrTypeModel.maHeight = aValue;
+ else if( aName == "margin-left" ) mrTypeModel.maMarginLeft = aValue;
+ else if( aName == "margin-top" ) mrTypeModel.maMarginTop = aValue;
+ else if( aName == "mso-position-vertical-relative" ) mrTypeModel.maPositionVerticalRelative = aValue;
else if( aName == "mso-position-horizontal" ) mrTypeModel.maPositionHorizontal = aValue;
- else if( aName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "mso-fit-shape-to-text" ) ) ) mrTypeModel.mbAutoHeight = sal_True;
- else if( aName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "rotation" ) ) ) mrTypeModel.maRotation = aValue;
- else if( aName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "flip" ) ) ) mrTypeModel.maFlip = aValue;
+ else if( aName == "mso-fit-shape-to-text" ) mrTypeModel.mbAutoHeight = sal_True;
+ else if( aName == "rotation" ) mrTypeModel.maRotation = aValue;
+ else if( aName == "flip" ) mrTypeModel.maFlip = aValue;
}
}
}
@@ -389,7 +389,7 @@ ContextHandlerRef ShapeContext::onCreateContext( sal_Int32 nElement, const Attri
case VML_TOKEN( textbox ):
// Custom shape in Writer with a textbox are transformed into a frame
dynamic_cast<SimpleShape&>( mrShape ).setService(
- OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.text.TextFrame")));
+ "com.sun.star.text.TextFrame");
return new TextBoxContext( *this, mrShapeModel.createTextBox(), rAttribs );
case VMLX_TOKEN( ClientData ):
return new ClientDataContext( *this, mrShapeModel.createClientData(), rAttribs );
@@ -397,7 +397,7 @@ ContextHandlerRef ShapeContext::onCreateContext( sal_Int32 nElement, const Attri
// Force RectangleShape, this is ugly :(
// and is there because of the lines above which change it to TextFrame
dynamic_cast< SimpleShape& >( mrShape ).setService(
- OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.RectangleShape")));
+ "com.sun.star.drawing.RectangleShape");
mrShapeModel.maLegacyDiagramPath = getFragmentPathFromRelId(rAttribs.getString(XML_id, OUString()));
break;
}