Kaydet (Commit) 691824ac authored tarafından Stephan Bergmann's avatar Stephan Bergmann

oox: Use appropriate OUString functions on string constants

Change-Id: I55ee581c9d3fc0a17639833a6a034e2addf768d1
üst 73441b0b
...@@ -181,35 +181,35 @@ void FilterDetectDocHandler::parseRelationship( const AttributeList& rAttribs ) ...@@ -181,35 +181,35 @@ void FilterDetectDocHandler::parseRelationship( const AttributeList& rAttribs )
OUString FilterDetectDocHandler::getFilterNameFromContentType( const OUString& rContentType ) const OUString FilterDetectDocHandler::getFilterNameFromContentType( const OUString& rContentType ) const
{ {
if( rContentType.equalsAscii("application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml" ) || if( rContentType == "application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml" ||
rContentType.equalsAscii("application/vnd.ms-word.document.macroEnabled.main+xml" ) ) rContentType == "application/vnd.ms-word.document.macroEnabled.main+xml" )
return OUString( "writer_MS_Word_2007" ); return OUString( "writer_MS_Word_2007" );
if( rContentType.equalsAscii("application/vnd.openxmlformats-officedocument.wordprocessingml.template.main+xml") || if( rContentType == "application/vnd.openxmlformats-officedocument.wordprocessingml.template.main+xml" ||
rContentType.equalsAscii("application/vnd.ms-word.template.macroEnabledTemplate.main+xml") ) rContentType == "application/vnd.ms-word.template.macroEnabledTemplate.main+xml" )
return OUString( "writer_MS_Word_2007_Template" ); return OUString( "writer_MS_Word_2007_Template" );
if( rContentType.equalsAscii("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml") || if( rContentType == "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml" ||
rContentType.equalsAscii("application/vnd.ms-excel.sheet.macroEnabled.main+xml") ) rContentType == "application/vnd.ms-excel.sheet.macroEnabled.main+xml" )
return OUString( "MS Excel 2007 XML" ); return OUString( "MS Excel 2007 XML" );
if( rContentType.equalsAscii("application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml") || if( rContentType == "application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml" ||
rContentType.equalsAscii("application/vnd.ms-excel.template.macroEnabled.main+xml") ) rContentType == "application/vnd.ms-excel.template.macroEnabled.main+xml" )
return OUString( "MS Excel 2007 XML Template" ); return OUString( "MS Excel 2007 XML Template" );
if ( rContentType == "application/vnd.ms-excel.sheet.binary.macroEnabled.main" ) if ( rContentType == "application/vnd.ms-excel.sheet.binary.macroEnabled.main" )
return OUString( "MS Excel 2007 Binary" ); return OUString( "MS Excel 2007 Binary" );
if( rContentType.equalsAscii("application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml") || if( rContentType == "application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml" ||
rContentType.equalsAscii("application/vnd.ms-powerpoint.presentation.macroEnabled.main+xml") ) rContentType == "application/vnd.ms-powerpoint.presentation.macroEnabled.main+xml" )
return OUString( "MS PowerPoint 2007 XML" ); return OUString( "MS PowerPoint 2007 XML" );
if( rContentType.equalsAscii("application/vnd.openxmlformats-officedocument.presentationml.slideshow.main+xml") || if( rContentType == "application/vnd.openxmlformats-officedocument.presentationml.slideshow.main+xml" ||
rContentType.equalsAscii("application/vnd.ms-powerpoint.slideshow.macroEnabled.main+xml") ) rContentType == "application/vnd.ms-powerpoint.slideshow.macroEnabled.main+xml" )
return OUString( "MS PowerPoint 2007 XML AutoPlay" ); return OUString( "MS PowerPoint 2007 XML AutoPlay" );
if( rContentType.equalsAscii("application/vnd.openxmlformats-officedocument.presentationml.template.main+xml") || if( rContentType == "application/vnd.openxmlformats-officedocument.presentationml.template.main+xml" ||
rContentType.equalsAscii("application/vnd.ms-powerpoint.template.macroEnabled.main+xml") ) rContentType == "application/vnd.ms-powerpoint.template.macroEnabled.main+xml" )
return OUString( "MS PowerPoint 2007 XML Template" ); return OUString( "MS PowerPoint 2007 XML Template" );
return OUString(); return OUString();
......
...@@ -448,10 +448,8 @@ Reference< XOutputStream > XmlFilterBase::openFragmentStream( const OUString& rS ...@@ -448,10 +448,8 @@ Reference< XOutputStream > XmlFilterBase::openFragmentStream( const OUString& rS
FSHelperPtr XmlFilterBase::openFragmentStreamWithSerializer( const OUString& rStreamName, const OUString& rMediaType ) FSHelperPtr XmlFilterBase::openFragmentStreamWithSerializer( const OUString& rStreamName, const OUString& rMediaType )
{ {
bool bWriteHeader = true; bool bWriteHeader
if( rMediaType.indexOfAsciiL( "vml", 3 ) >= 0 && = rMediaType.indexOf( "vml" ) < 0 || rMediaType.indexOf( "+xml" ) >= 0;
rMediaType.indexOfAsciiL( "+xml", 4 ) < 0 )
bWriteHeader = false;
return FSHelperPtr( new FastSerializerHelper( openFragmentStream( rStreamName, rMediaType ), bWriteHeader ) ); return FSHelperPtr( new FastSerializerHelper( openFragmentStream( rStreamName, rMediaType ), bWriteHeader ) );
} }
......
...@@ -146,7 +146,7 @@ static void SetTableStyleProperties(TableStyle* &pTableStyle , const sal_Int32& ...@@ -146,7 +146,7 @@ static void SetTableStyleProperties(TableStyle* &pTableStyle , const sal_Int32&
bool CreateTableStyle(TableStyle* &pTableStyle , const OUString& styleId) bool CreateTableStyle(TableStyle* &pTableStyle , const OUString& styleId)
{ {
bool createdTblStyle = false; 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(); pTableStyle = new TableStyle();
createdTblStyle = true; createdTblStyle = true;
//first row style //first row style
...@@ -182,7 +182,7 @@ static void SetTableStyleProperties(TableStyle* &pTableStyle , const sal_Int32& ...@@ -182,7 +182,7 @@ static void SetTableStyleProperties(TableStyle* &pTableStyle , const sal_Int32&
SetTableStyleProperties(pTableStyle, XML_accent1, XML_dk1, XML_lt1); 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(); pTableStyle = new TableStyle();
createdTblStyle = true; createdTblStyle = true;
...@@ -214,7 +214,7 @@ static void SetTableStyleProperties(TableStyle* &pTableStyle , const sal_Int32& ...@@ -214,7 +214,7 @@ static void SetTableStyleProperties(TableStyle* &pTableStyle , const sal_Int32&
SetTableStyleProperties(pTableStyle, XML_accent2, XML_dk1, XML_lt1); 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(); pTableStyle = new TableStyle();
createdTblStyle = true; createdTblStyle = true;
......
...@@ -120,7 +120,7 @@ void lclCreateTextFields( std::list< Reference< XTextField > > & aFields, ...@@ -120,7 +120,7 @@ void lclCreateTextFields( std::list< Reference< XTextField > > & aFields,
OSL_TRACE( "Exception %s", OUStringToOString( e.Message, RTL_TEXTENCODING_ASCII_US ).getStr() ); 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" ); xIface = xFactory->createInstance( "com.sun.star.text.TextField.PageNumber" );
aFields.push_back( Reference< XTextField > ( xIface, UNO_QUERY ) ); aFields.push_back( Reference< XTextField > ( xIface, UNO_QUERY ) );
......
...@@ -494,8 +494,8 @@ bool MSConvertOCXControls::importControlFromStream( ::oox::BinaryInputStream& rI ...@@ -494,8 +494,8 @@ bool MSConvertOCXControls::importControlFromStream( ::oox::BinaryInputStream& rI
{ {
// Special processing for those html controls // Special processing for those html controls
bool bOneOfHtmlControls = false; bool bOneOfHtmlControls = false;
if ( rStrmClassId.toAsciiUpperCase().equalsAscii( HTML_GUID_SELECT ) if ( rStrmClassId.toAsciiUpperCase() == HTML_GUID_SELECT
|| rStrmClassId.toAsciiUpperCase().equalsAscii( HTML_GUID_TEXTBOX ) ) || rStrmClassId.toAsciiUpperCase() == HTML_GUID_TEXTBOX )
bOneOfHtmlControls = true; bOneOfHtmlControls = true;
if ( bOneOfHtmlControls ) if ( bOneOfHtmlControls )
......
...@@ -33,7 +33,7 @@ namespace oox { namespace ppt { ...@@ -33,7 +33,7 @@ namespace oox { namespace ppt {
Any GetTime( const OUString & val ) Any GetTime( const OUString & val )
{ {
Any aDuration; Any aDuration;
if( val.equalsAscii( "indefinite" ) ) if( val == "indefinite" )
{ {
aDuration <<= Timing_INDEFINITE; aDuration <<= Timing_INDEFINITE;
} }
...@@ -48,7 +48,7 @@ Any GetTime( const OUString & val ) ...@@ -48,7 +48,7 @@ Any GetTime( const OUString & val )
Any GetTimeAnimateValueTime( const OUString & val ) Any GetTimeAnimateValueTime( const OUString & val )
{ {
Any aPercent; Any aPercent;
if( val.equalsAscii( "indefinite" ) ) if( val == "indefinite" )
{ {
aPercent <<= Timing_INDEFINITE; aPercent <<= Timing_INDEFINITE;
} }
......
...@@ -296,7 +296,7 @@ void PPTShape::addShape( ...@@ -296,7 +296,7 @@ void PPTShape::addShape(
{ {
if ( !aMasterTextListStyle.get() ) 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(); TextListStylePtr aSlideStyle = isOther ? rSlidePersist.getOtherTextStyle() : rSlidePersist.getDefaultTextStyle();
// Combine from MasterSlide details as well. // Combine from MasterSlide details as well.
if( rSlidePersist.getMasterPersist().get() ) if( rSlidePersist.getMasterPersist().get() )
......
...@@ -272,7 +272,7 @@ namespace oox { namespace ppt { ...@@ -272,7 +272,7 @@ namespace oox { namespace ppt {
{ {
nCommand = EffectCommands::PLAY; nCommand = EffectCommands::PLAY;
} }
else if( msCommand.equalsAscii( "playFrom" ) ) else if( msCommand == "playFrom" )
{ {
const OUString aMediaTime( msCommand.copy( 9, msCommand.getLength() - 10 ) ); const OUString aMediaTime( msCommand.copy( 9, msCommand.getLength() - 10 ) );
rtl_math_ConversionStatus eStatus; rtl_math_ConversionStatus eStatus;
......
...@@ -207,7 +207,7 @@ Reference< XShape > Drawing::createAndInsertXShape( const OUString& rService, ...@@ -207,7 +207,7 @@ Reference< XShape > Drawing::createAndInsertXShape( const OUString& rService,
{ {
Reference< XMultiServiceFactory > xModelFactory( mrFilter.getModelFactory(), UNO_SET_THROW ); Reference< XMultiServiceFactory > xModelFactory( mrFilter.getModelFactory(), UNO_SET_THROW );
xShape.set( xModelFactory->createInstance( rService ), UNO_QUERY_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) // insert shape into passed shape collection (maybe drawpage or group shape)
rxShapes->add( xShape ); rxShapes->add( xShape );
......
...@@ -551,11 +551,11 @@ Reference< XShape > SimpleShape::implConvertAndInsert( const Reference< XShapes ...@@ -551,11 +551,11 @@ Reference< XShape > SimpleShape::implConvertAndInsert( const Reference< XShapes
oRotation.reset(maTypeModel.maRotation.toInt32()); oRotation.reset(maTypeModel.maRotation.toInt32());
if (!maTypeModel.maFlip.isEmpty()) if (!maTypeModel.maFlip.isEmpty())
{ {
if (maTypeModel.maFlip.equalsAscii("x")) if (maTypeModel.maFlip == "x")
{ {
bFlipX = true; bFlipX = true;
} }
else if (maTypeModel.maFlip.equalsAscii("y")) else if (maTypeModel.maFlip == "y")
{ {
bFlipY = true; bFlipY = true;
} }
...@@ -601,7 +601,7 @@ Reference< XShape > SimpleShape::implConvertAndInsert( const Reference< XShapes ...@@ -601,7 +601,7 @@ Reference< XShape > SimpleShape::implConvertAndInsert( const Reference< XShapes
nWrapDistanceBottom = ConversionHelper::decodeMeasureToHmm(rGraphicHelper, maTypeModel.maWrapDistanceBottom, 0, false, true); nWrapDistanceBottom = ConversionHelper::decodeMeasureToHmm(rGraphicHelper, maTypeModel.maWrapDistanceBottom, 0, false, true);
PropertySet(xShape).setAnyProperty(PROP_BottomMargin, uno::makeAny(nWrapDistanceBottom)); 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_FrameIsAutomaticHeight, makeAny( maTypeModel.mbAutoHeight ) );
PropertySet( xShape ).setAnyProperty( PROP_SizeType, makeAny( maTypeModel.mbAutoHeight ? SizeType::MIN : SizeType::FIX ) ); PropertySet( xShape ).setAnyProperty( PROP_SizeType, makeAny( maTypeModel.mbAutoHeight ? SizeType::MIN : SizeType::FIX ) );
......
...@@ -406,8 +406,8 @@ void ShapeTypeContext::setStyle( const OUString& rStyle ) ...@@ -406,8 +406,8 @@ void ShapeTypeContext::setStyle( const OUString& rStyle )
else if( aName == "mso-fit-shape-to-text" ) mrTypeModel.mbAutoHeight = true; else if( aName == "mso-fit-shape-to-text" ) mrTypeModel.mbAutoHeight = true;
else if( aName == "rotation" ) mrTypeModel.maRotation = aValue; else if( aName == "rotation" ) mrTypeModel.maRotation = aValue;
else if( aName == "flip" ) mrTypeModel.maFlip = aValue; else if( aName == "flip" ) mrTypeModel.maFlip = aValue;
else if( aName.equalsAscii( "visibility" ) ) else if( aName == "visibility" )
mrTypeModel.mbVisible = !aValue.equalsAscii( "hidden" ); mrTypeModel.mbVisible = aValue != "hidden";
else if( aName == "mso-wrap-style" ) mrTypeModel.maWrapStyle = aValue; else if( aName == "mso-wrap-style" ) mrTypeModel.maWrapStyle = aValue;
else if ( aName == "v-text-anchor" ) mrTypeModel.maVTextAnchor = aValue; else if ( aName == "v-text-anchor" ) mrTypeModel.maVTextAnchor = aValue;
else if ( aName == "mso-wrap-distance-left" ) mrTypeModel.maWrapDistanceLeft = aValue; else if ( aName == "mso-wrap-distance-left" ) mrTypeModel.maWrapDistanceLeft = aValue;
......
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