summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2014-12-15 10:13:24 +0100
committerStephan Bergmann <sbergman@redhat.com>2014-12-15 10:13:24 +0100
commit691824acefacddca266ffb8deaa5790520de62e8 (patch)
treebbff67a8561c82f6c234f6fb5d19551423927826
parent73441b0b650df4f9f7f6799f96150630426b79da (diff)
oox: Use appropriate OUString functions on string constants
Change-Id: I55ee581c9d3fc0a17639833a6a034e2addf768d1
-rw-r--r--oox/source/core/filterdetect.cxx28
-rw-r--r--oox/source/core/xmlfilterbase.cxx6
-rw-r--r--oox/source/drawingml/table/tableproperties.cxx6
-rw-r--r--oox/source/drawingml/textfield.cxx2
-rw-r--r--oox/source/ole/olehelper.cxx4
-rw-r--r--oox/source/ppt/animationtypes.cxx4
-rw-r--r--oox/source/ppt/pptshape.cxx2
-rw-r--r--oox/source/ppt/timenodelistcontext.cxx2
-rw-r--r--oox/source/vml/vmldrawing.cxx2
-rw-r--r--oox/source/vml/vmlshape.cxx6
-rw-r--r--oox/source/vml/vmlshapecontext.cxx4
11 files changed, 32 insertions, 34 deletions
diff --git a/oox/source/core/filterdetect.cxx b/oox/source/core/filterdetect.cxx
index c4f7a5db178c..936180d846ca 100644
--- a/oox/source/core/filterdetect.cxx
+++ b/oox/source/core/filterdetect.cxx
@@ -181,35 +181,35 @@ void FilterDetectDocHandler::parseRelationship( const AttributeList& rAttribs )
OUString FilterDetectDocHandler::getFilterNameFromContentType( const OUString& rContentType ) const
{
- if( rContentType.equalsAscii("application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml" ) ||
- rContentType.equalsAscii("application/vnd.ms-word.document.macroEnabled.main+xml" ) )
+ if( rContentType == "application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml" ||
+ rContentType == "application/vnd.ms-word.document.macroEnabled.main+xml" )
return OUString( "writer_MS_Word_2007" );
- if( rContentType.equalsAscii("application/vnd.openxmlformats-officedocument.wordprocessingml.template.main+xml") ||
- rContentType.equalsAscii("application/vnd.ms-word.template.macroEnabledTemplate.main+xml") )
+ if( rContentType == "application/vnd.openxmlformats-officedocument.wordprocessingml.template.main+xml" ||
+ rContentType == "application/vnd.ms-word.template.macroEnabledTemplate.main+xml" )
return OUString( "writer_MS_Word_2007_Template" );
- if( rContentType.equalsAscii("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml") ||
- rContentType.equalsAscii("application/vnd.ms-excel.sheet.macroEnabled.main+xml") )
+ if( rContentType == "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml" ||
+ rContentType == "application/vnd.ms-excel.sheet.macroEnabled.main+xml" )
return OUString( "MS Excel 2007 XML" );
- if( rContentType.equalsAscii("application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml") ||
- rContentType.equalsAscii("application/vnd.ms-excel.template.macroEnabled.main+xml") )
+ if( rContentType == "application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml" ||
+ rContentType == "application/vnd.ms-excel.template.macroEnabled.main+xml" )
return OUString( "MS Excel 2007 XML Template" );
if ( rContentType == "application/vnd.ms-excel.sheet.binary.macroEnabled.main" )
return OUString( "MS Excel 2007 Binary" );
- if( rContentType.equalsAscii("application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml") ||
- rContentType.equalsAscii("application/vnd.ms-powerpoint.presentation.macroEnabled.main+xml") )
+ if( rContentType == "application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml" ||
+ rContentType == "application/vnd.ms-powerpoint.presentation.macroEnabled.main+xml" )
return OUString( "MS PowerPoint 2007 XML" );
- if( rContentType.equalsAscii("application/vnd.openxmlformats-officedocument.presentationml.slideshow.main+xml") ||
- rContentType.equalsAscii("application/vnd.ms-powerpoint.slideshow.macroEnabled.main+xml") )
+ if( rContentType == "application/vnd.openxmlformats-officedocument.presentationml.slideshow.main+xml" ||
+ rContentType == "application/vnd.ms-powerpoint.slideshow.macroEnabled.main+xml" )
return OUString( "MS PowerPoint 2007 XML AutoPlay" );
- if( rContentType.equalsAscii("application/vnd.openxmlformats-officedocument.presentationml.template.main+xml") ||
- rContentType.equalsAscii("application/vnd.ms-powerpoint.template.macroEnabled.main+xml") )
+ if( rContentType == "application/vnd.openxmlformats-officedocument.presentationml.template.main+xml" ||
+ rContentType == "application/vnd.ms-powerpoint.template.macroEnabled.main+xml" )
return OUString( "MS PowerPoint 2007 XML Template" );
return OUString();
diff --git a/oox/source/core/xmlfilterbase.cxx b/oox/source/core/xmlfilterbase.cxx
index 842429d8d062..c54f3fbc0c16 100644
--- a/oox/source/core/xmlfilterbase.cxx
+++ b/oox/source/core/xmlfilterbase.cxx
@@ -448,10 +448,8 @@ Reference< XOutputStream > XmlFilterBase::openFragmentStream( const OUString& rS
FSHelperPtr XmlFilterBase::openFragmentStreamWithSerializer( const OUString& rStreamName, const OUString& rMediaType )
{
- bool bWriteHeader = true;
- if( rMediaType.indexOfAsciiL( "vml", 3 ) >= 0 &&
- rMediaType.indexOfAsciiL( "+xml", 4 ) < 0 )
- bWriteHeader = false;
+ bool bWriteHeader
+ = rMediaType.indexOf( "vml" ) < 0 || rMediaType.indexOf( "+xml" ) >= 0;
return FSHelperPtr( new FastSerializerHelper( openFragmentStream( rStreamName, rMediaType ), bWriteHeader ) );
}
diff --git a/oox/source/drawingml/table/tableproperties.cxx b/oox/source/drawingml/table/tableproperties.cxx
index 80cc6d28e11e..85d758a5fd97 100644
--- a/oox/source/drawingml/table/tableproperties.cxx
+++ b/oox/source/drawingml/table/tableproperties.cxx
@@ -146,7 +146,7 @@ static void SetTableStyleProperties(TableStyle* &pTableStyle , const sal_Int32&
bool CreateTableStyle(TableStyle* &pTableStyle , const OUString& styleId)
{
bool createdTblStyle = false;
- if(styleId.equalsAscii("{5C22544A-7EE6-4342-B048-85BDC9FD1C3A}")){ //Medium Style 2 Accenat 1
+ if(styleId == "{5C22544A-7EE6-4342-B048-85BDC9FD1C3A}") { //Medium Style 2 Accenat 1
pTableStyle = new TableStyle();
createdTblStyle = true;
//first row style
@@ -182,7 +182,7 @@ static void SetTableStyleProperties(TableStyle* &pTableStyle , const sal_Int32&
SetTableStyleProperties(pTableStyle, XML_accent1, XML_dk1, XML_lt1);
}
- else if (styleId.equalsAscii("{21E4AEA4-8DFA-4A89-87EB-49C32662AFE0}")) //Medium Style 2 Accent 2
+ else if (styleId == "{21E4AEA4-8DFA-4A89-87EB-49C32662AFE0}") //Medium Style 2 Accent 2
{
pTableStyle = new TableStyle();
createdTblStyle = true;
@@ -214,7 +214,7 @@ static void SetTableStyleProperties(TableStyle* &pTableStyle , const sal_Int32&
SetTableStyleProperties(pTableStyle, XML_accent2, XML_dk1, XML_lt1);
}
- else if (styleId.equalsAscii("{C4B1156A-380E-4F78-BDF5-A606A8083BF9}")) //Medium Style 4 Accent 4
+ else if (styleId == "{C4B1156A-380E-4F78-BDF5-A606A8083BF9}") //Medium Style 4 Accent 4
{
pTableStyle = new TableStyle();
createdTblStyle = true;
diff --git a/oox/source/drawingml/textfield.cxx b/oox/source/drawingml/textfield.cxx
index 21b47f1407b3..b001728750f5 100644
--- a/oox/source/drawingml/textfield.cxx
+++ b/oox/source/drawingml/textfield.cxx
@@ -120,7 +120,7 @@ void lclCreateTextFields( std::list< Reference< XTextField > > & aFields,
OSL_TRACE( "Exception %s", OUStringToOString( e.Message, RTL_TEXTENCODING_ASCII_US ).getStr() );
}
}
- else if ( sType.equalsAscii( "slidenum" ) )
+ else if ( sType == "slidenum" )
{
xIface = xFactory->createInstance( "com.sun.star.text.TextField.PageNumber" );
aFields.push_back( Reference< XTextField > ( xIface, UNO_QUERY ) );
diff --git a/oox/source/ole/olehelper.cxx b/oox/source/ole/olehelper.cxx
index e6c854c370cf..a87f290cc94e 100644
--- a/oox/source/ole/olehelper.cxx
+++ b/oox/source/ole/olehelper.cxx
@@ -494,8 +494,8 @@ bool MSConvertOCXControls::importControlFromStream( ::oox::BinaryInputStream& rI
{
// Special processing for those html controls
bool bOneOfHtmlControls = false;
- if ( rStrmClassId.toAsciiUpperCase().equalsAscii( HTML_GUID_SELECT )
- || rStrmClassId.toAsciiUpperCase().equalsAscii( HTML_GUID_TEXTBOX ) )
+ if ( rStrmClassId.toAsciiUpperCase() == HTML_GUID_SELECT
+ || rStrmClassId.toAsciiUpperCase() == HTML_GUID_TEXTBOX )
bOneOfHtmlControls = true;
if ( bOneOfHtmlControls )
diff --git a/oox/source/ppt/animationtypes.cxx b/oox/source/ppt/animationtypes.cxx
index 65686813c28b..bf9078014521 100644
--- a/oox/source/ppt/animationtypes.cxx
+++ b/oox/source/ppt/animationtypes.cxx
@@ -33,7 +33,7 @@ namespace oox { namespace ppt {
Any GetTime( const OUString & val )
{
Any aDuration;
- if( val.equalsAscii( "indefinite" ) )
+ if( val == "indefinite" )
{
aDuration <<= Timing_INDEFINITE;
}
@@ -48,7 +48,7 @@ Any GetTime( const OUString & val )
Any GetTimeAnimateValueTime( const OUString & val )
{
Any aPercent;
- if( val.equalsAscii( "indefinite" ) )
+ if( val == "indefinite" )
{
aPercent <<= Timing_INDEFINITE;
}
diff --git a/oox/source/ppt/pptshape.cxx b/oox/source/ppt/pptshape.cxx
index cc94f60ba4bc..cf61562ae6ad 100644
--- a/oox/source/ppt/pptshape.cxx
+++ b/oox/source/ppt/pptshape.cxx
@@ -296,7 +296,7 @@ void PPTShape::addShape(
{
if ( !aMasterTextListStyle.get() )
{
- bool isOther = !getTextBody().get() && !sServiceName.equalsAscii("com.sun.star.drawing.GroupShape");
+ bool isOther = !getTextBody().get() && sServiceName != "com.sun.star.drawing.GroupShape";
TextListStylePtr aSlideStyle = isOther ? rSlidePersist.getOtherTextStyle() : rSlidePersist.getDefaultTextStyle();
// Combine from MasterSlide details as well.
if( rSlidePersist.getMasterPersist().get() )
diff --git a/oox/source/ppt/timenodelistcontext.cxx b/oox/source/ppt/timenodelistcontext.cxx
index 3a89ebc14334..11696210d15d 100644
--- a/oox/source/ppt/timenodelistcontext.cxx
+++ b/oox/source/ppt/timenodelistcontext.cxx
@@ -272,7 +272,7 @@ namespace oox { namespace ppt {
{
nCommand = EffectCommands::PLAY;
}
- else if( msCommand.equalsAscii( "playFrom" ) )
+ else if( msCommand == "playFrom" )
{
const OUString aMediaTime( msCommand.copy( 9, msCommand.getLength() - 10 ) );
rtl_math_ConversionStatus eStatus;
diff --git a/oox/source/vml/vmldrawing.cxx b/oox/source/vml/vmldrawing.cxx
index c808c7f4c316..1a7d2e096376 100644
--- a/oox/source/vml/vmldrawing.cxx
+++ b/oox/source/vml/vmldrawing.cxx
@@ -207,7 +207,7 @@ Reference< XShape > Drawing::createAndInsertXShape( const OUString& rService,
{
Reference< XMultiServiceFactory > xModelFactory( mrFilter.getModelFactory(), UNO_SET_THROW );
xShape.set( xModelFactory->createInstance( rService ), UNO_QUERY_THROW );
- if ( !rService.equalsAscii( "com.sun.star.text.TextFrame" ) )
+ if ( rService != "com.sun.star.text.TextFrame" )
{
// insert shape into passed shape collection (maybe drawpage or group shape)
rxShapes->add( xShape );
diff --git a/oox/source/vml/vmlshape.cxx b/oox/source/vml/vmlshape.cxx
index 1c826a1ee971..1bb21a155846 100644
--- a/oox/source/vml/vmlshape.cxx
+++ b/oox/source/vml/vmlshape.cxx
@@ -551,11 +551,11 @@ Reference< XShape > SimpleShape::implConvertAndInsert( const Reference< XShapes
oRotation.reset(maTypeModel.maRotation.toInt32());
if (!maTypeModel.maFlip.isEmpty())
{
- if (maTypeModel.maFlip.equalsAscii("x"))
+ if (maTypeModel.maFlip == "x")
{
bFlipX = true;
}
- else if (maTypeModel.maFlip.equalsAscii("y"))
+ else if (maTypeModel.maFlip == "y")
{
bFlipY = true;
}
@@ -601,7 +601,7 @@ Reference< XShape > SimpleShape::implConvertAndInsert( const Reference< XShapes
nWrapDistanceBottom = ConversionHelper::decodeMeasureToHmm(rGraphicHelper, maTypeModel.maWrapDistanceBottom, 0, false, true);
PropertySet(xShape).setAnyProperty(PROP_BottomMargin, uno::makeAny(nWrapDistanceBottom));
- if ( maService.equalsAscii( "com.sun.star.text.TextFrame" ) )
+ if ( maService == "com.sun.star.text.TextFrame" )
{
PropertySet( xShape ).setAnyProperty( PROP_FrameIsAutomaticHeight, makeAny( maTypeModel.mbAutoHeight ) );
PropertySet( xShape ).setAnyProperty( PROP_SizeType, makeAny( maTypeModel.mbAutoHeight ? SizeType::MIN : SizeType::FIX ) );
diff --git a/oox/source/vml/vmlshapecontext.cxx b/oox/source/vml/vmlshapecontext.cxx
index 71905bad08df..2f69efe3e7f2 100644
--- a/oox/source/vml/vmlshapecontext.cxx
+++ b/oox/source/vml/vmlshapecontext.cxx
@@ -406,8 +406,8 @@ void ShapeTypeContext::setStyle( const OUString& rStyle )
else if( aName == "mso-fit-shape-to-text" ) mrTypeModel.mbAutoHeight = true;
else if( aName == "rotation" ) mrTypeModel.maRotation = aValue;
else if( aName == "flip" ) mrTypeModel.maFlip = aValue;
- else if( aName.equalsAscii( "visibility" ) )
- mrTypeModel.mbVisible = !aValue.equalsAscii( "hidden" );
+ else if( aName == "visibility" )
+ mrTypeModel.mbVisible = aValue != "hidden";
else if( aName == "mso-wrap-style" ) mrTypeModel.maWrapStyle = aValue;
else if ( aName == "v-text-anchor" ) mrTypeModel.maVTextAnchor = aValue;
else if ( aName == "mso-wrap-distance-left" ) mrTypeModel.maWrapDistanceLeft = aValue;