diff options
author | Szabolcs Dezsi <dezsiszabi@hotmail.com> | 2012-04-06 19:49:53 +0200 |
---|---|---|
committer | Jan Holesovsky <kendy@suse.cz> | 2012-04-06 20:03:42 +0200 |
commit | d6bc02f8c4cd0f50f0a2631ac7634dab408efc1f (patch) | |
tree | b5a12df1fcae025715633469b75ab4c9b6f6d279 /chart2 | |
parent | 0e1c0587617e0a6e4295a13599e97cdf6d1d2ea9 (diff) |
Replaced equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(...)) with == operator
Diffstat (limited to 'chart2')
10 files changed, 47 insertions, 93 deletions
diff --git a/chart2/source/controller/main/ChartController.cxx b/chart2/source/controller/main/ChartController.cxx index 23566699cc0e..7c4595d5def1 100644 --- a/chart2/source/controller/main/ChartController.cxx +++ b/chart2/source/controller/main/ChartController.cxx @@ -1042,8 +1042,7 @@ bool lcl_isFormatObjectCommand( const rtl::OString& aCommand ) { if ( !m_aLifeTimeManager.impl_isDisposed() && getModel().is() ) { - if( !rTargetFrameName.isEmpty() && - rTargetFrameName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("_self"))) + if( !rTargetFrameName.isEmpty() && rTargetFrameName == "_self" ) return m_aDispatchContainer.getDispatchForURL( rURL ); } return uno::Reference< frame::XDispatch > (); diff --git a/chart2/source/controller/main/ChartDropTargetHelper.cxx b/chart2/source/controller/main/ChartDropTargetHelper.cxx index 17d413aee3be..892de4173820 100644 --- a/chart2/source/controller/main/ChartDropTargetHelper.cxx +++ b/chart2/source/controller/main/ChartDropTargetHelper.cxx @@ -118,8 +118,7 @@ sal_Int8 ChartDropTargetHelper::ExecuteDrop( const ExecuteDropEvent& rEvt ) if( aDataHelper.GetSequence( SOT_FORMATSTR_ID_LINK, aBytes )) { ::std::vector< OUString > aStrings( lcl_getStringsFromByteSequence( aBytes )); - if( aStrings.size() >= 3 && - aStrings[0].equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "soffice" ))) + if( aStrings.size() >= 3 && aStrings[0] == "soffice" ) { OUString aDocName( aStrings[1] ); OUString aRangeString( aStrings[2] ); diff --git a/chart2/source/controller/main/CommandDispatchContainer.cxx b/chart2/source/controller/main/CommandDispatchContainer.cxx index 33af33fd44aa..a9a2d0c5e0b5 100644 --- a/chart2/source/controller/main/CommandDispatchContainer.cxx +++ b/chart2/source/controller/main/CommandDispatchContainer.cxx @@ -97,8 +97,7 @@ Reference< frame::XDispatch > CommandDispatchContainer::getDispatchForURL( { uno::Reference< frame::XModel > xModel( m_xModel ); - if( xModel.is() && (rURL.Path.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Undo" )) - || rURL.Path.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Redo" ))) ) + if( xModel.is() && ( rURL.Path == "Undo" || rURL.Path == "Redo" ) ) { CommandDispatch * pDispatch = new UndoCommandDispatch( m_xContext, xModel ); xResult.set( pDispatch ); @@ -107,8 +106,7 @@ Reference< frame::XDispatch > CommandDispatchContainer::getDispatchForURL( m_aCachedDispatches[ C2U(".uno:Redo") ].set( xResult ); m_aToBeDisposedDispatches.push_back( xResult ); } - else if( xModel.is() && (rURL.Path.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Context" )) - || rURL.Path.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "ModifiedStatus" ))) ) + else if( xModel.is() && ( rURL.Path == "Context" || rURL.Path == "ModifiedStatus" ) ) { Reference< view::XSelectionSupplier > xSelSupp( xModel->getCurrentController(), uno::UNO_QUERY ); CommandDispatch * pDispatch = new StatusBarCommandDispatch( m_xContext, xModel, xSelSupp ); diff --git a/chart2/source/controller/main/ControllerCommandDispatch.cxx b/chart2/source/controller/main/ControllerCommandDispatch.cxx index fa85ff3cce5a..6ce80c3fdaee 100644 --- a/chart2/source/controller/main/ControllerCommandDispatch.cxx +++ b/chart2/source/controller/main/ControllerCommandDispatch.cxx @@ -725,7 +725,7 @@ void ControllerCommandDispatch::fireStatusEvent( const OUString & rURL, const Reference< frame::XStatusListener > & xSingleListener /* = 0 */ ) { - bool bIsChartSelectorURL = rURL.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM(".uno:ChartElementSelector") ); + bool bIsChartSelectorURL = rURL == ".uno:ChartElementSelector"; if( rURL.isEmpty() || bIsChartSelectorURL ) { uno::Any aArg; @@ -742,8 +742,7 @@ void ControllerCommandDispatch::fireStatusEvent( // statusbar. Should be handled by base implementation // @todo: remove if Issue 68864 is fixed - if( rURL.isEmpty() || - rURL.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM(".uno:StatusBarVisible"))) + if( rURL.isEmpty() || rURL == ".uno:StatusBarVisible" ) { bool bIsStatusBarVisible( lcl_isStatusBarVisible( m_xController )); fireStatusEventForURL( C2U(".uno:StatusBarVisible"), uno::makeAny( bIsStatusBarVisible ), true, xSingleListener ); diff --git a/chart2/source/controller/main/StatusBarCommandDispatch.cxx b/chart2/source/controller/main/StatusBarCommandDispatch.cxx index db5a09ca3a11..bc3d6df79953 100644 --- a/chart2/source/controller/main/StatusBarCommandDispatch.cxx +++ b/chart2/source/controller/main/StatusBarCommandDispatch.cxx @@ -77,8 +77,8 @@ void StatusBarCommandDispatch::fireStatusEvent( const Reference< frame::XStatusListener > & xSingleListener /* = 0 */ ) { bool bFireAll( rURL.isEmpty() ); - bool bFireContext( bFireAll || rURL.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM(".uno:Context"))); - bool bFireModified( bFireAll || rURL.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM(".uno:ModifiedStatus"))); + bool bFireContext( bFireAll || rURL == ".uno:Context" ); + bool bFireModified( bFireAll || rURL == ".uno:ModifiedStatus" ); if( bFireContext ) { diff --git a/chart2/source/controller/main/UndoCommandDispatch.cxx b/chart2/source/controller/main/UndoCommandDispatch.cxx index 4c29848813ed..5b9299df9b65 100644 --- a/chart2/source/controller/main/UndoCommandDispatch.cxx +++ b/chart2/source/controller/main/UndoCommandDispatch.cxx @@ -92,9 +92,9 @@ void UndoCommandDispatch::fireStatusEvent( aRedoState <<= ( aRedo + m_xUndoManager->getCurrentRedoActionTitle()); } - if( bFireAll || rURL.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM(".uno:Undo"))) + if( bFireAll || rURL == ".uno:Undo" ) fireStatusEventForURL( C2U(".uno:Undo"), aUndoState, m_xUndoManager->isUndoPossible(), xSingleListener ); - if( bFireAll || rURL.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM(".uno:Redo"))) + if( bFireAll || rURL == ".uno:Redo" ) fireStatusEventForURL( C2U(".uno:Redo"), aRedoState, m_xUndoManager->isRedoPossible(), xSingleListener ); } } diff --git a/chart2/source/model/filter/XMLFilter.cxx b/chart2/source/model/filter/XMLFilter.cxx index 57c7975b8492..2a6e35b3df84 100644 --- a/chart2/source/model/filter/XMLFilter.cxx +++ b/chart2/source/model/filter/XMLFilter.cxx @@ -120,13 +120,7 @@ uno::Reference< embed::XStorage > lcl_getWriteStorage( { // properties understood by storage factory // (see package/source/xstor/xfactory.cxx for details) - if ( rMediaDescriptor[i].Name.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( "InteractionHandler" )) - || rMediaDescriptor[i].Name.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( "Password" )) - || rMediaDescriptor[i].Name.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( "RepairPackage" )) - ) + if ( rMediaDescriptor[i].Name == "InteractionHandler" || rMediaDescriptor[i].Name == "Password" || rMediaDescriptor[i].Name == "RepairPackage" ) { aPropertiesForStorage.push_back( rMediaDescriptor[i] ); } @@ -187,19 +181,12 @@ uno::Reference< embed::XStorage > lcl_getReadStorage( ::std::vector< beans::PropertyValue > aPropertiesForStorage; for( sal_Int32 i=rMediaDescriptor.getLength(); i--; ) { - if( rMediaDescriptor[i].Name.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( "InputStream" ))) + if( rMediaDescriptor[i].Name == "InputStream" ) xStream.set( rMediaDescriptor[i].Value, uno::UNO_QUERY ); // properties understood by storage factory // (see package/source/xstor/xfactory.cxx for details) - if ( rMediaDescriptor[i].Name.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( "InteractionHandler" )) - || rMediaDescriptor[i].Name.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( "Password" )) - || rMediaDescriptor[i].Name.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( "RepairPackage" )) - ) + if ( rMediaDescriptor[i].Name == "InteractionHandler" || rMediaDescriptor[i].Name == "Password" || rMediaDescriptor[i].Name == "RepairPackage" ) { aPropertiesForStorage.push_back( rMediaDescriptor[i] ); } @@ -827,7 +814,7 @@ void XMLFilter::isOasisFormat(const Sequence< beans::PropertyValue >& _rMediaDes { apphelper::MediaDescriptorHelper aMDHelper( _rMediaDescriptor ); if( aMDHelper.ISSET_FilterName ) - rOutOASIS = aMDHelper.FilterName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("chart8")); + rOutOASIS = aMDHelper.FilterName == "chart8"; } // ----------------------------------------------------------------------------- ::rtl::OUString XMLFilter::getMediaType(bool _bOasis) @@ -843,7 +830,7 @@ void XMLReportFilterHelper::isOasisFormat(const Sequence< beans::PropertyValue > { apphelper::MediaDescriptorHelper aMDHelper( _rMediaDescriptor ); if( aMDHelper.ISSET_FilterName ) - rOutOASIS = aMDHelper.FilterName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("StarOffice XML (Base) Report Chart")); + rOutOASIS = aMDHelper.FilterName == "StarOffice XML (Base) Report Chart"; } // ----------------------------------------------------------------------------- ::rtl::OUString XMLReportFilterHelper::getMediaType(bool ) diff --git a/chart2/source/model/template/DataInterpreter.cxx b/chart2/source/model/template/DataInterpreter.cxx index f4354c173e75..3ce9acd008fa 100644 --- a/chart2/source/model/template/DataInterpreter.cxx +++ b/chart2/source/model/template/DataInterpreter.cxx @@ -383,8 +383,7 @@ bool DataInterpreter::HasCategories( GetProperty( rArguments, C2U(("HasCategories"))) >>= bHasCategories; for( sal_Int32 nLSeqIdx=0; ! bHasCategories && nLSeqIdx<rData.getLength(); ++nLSeqIdx ) - bHasCategories = ( rData[nLSeqIdx].is() && - GetRole( rData[nLSeqIdx]->getValues()).equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("categories"))); + bHasCategories = ( rData[nLSeqIdx].is() && GetRole( rData[nLSeqIdx]->getValues() ) == "categories"); return bHasCategories; } diff --git a/chart2/source/tools/ErrorBar.cxx b/chart2/source/tools/ErrorBar.cxx index 4166b7336b85..4c0b1aecbda9 100644 --- a/chart2/source/tools/ErrorBar.cxx +++ b/chart2/source/tools/ErrorBar.cxx @@ -176,8 +176,7 @@ struct StaticErrorBarInfo : public rtl::StaticAggregate< uno::Reference< beans:: bool lcl_isInternalData( const uno::Reference< chart2::data::XLabeledDataSequence > & xLSeq ) { uno::Reference< lang::XServiceInfo > xServiceInfo( xLSeq, uno::UNO_QUERY ); - return ( xServiceInfo.is() && xServiceInfo->getImplementationName().equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM("com.sun.star.comp.chart2.LabeledDataSequence"))); + return ( xServiceInfo.is() && xServiceInfo->getImplementationName() == "com.sun.star.comp.chart2.LabeledDataSequence" ); } } // anonymous namespace diff --git a/chart2/source/tools/RegressionCurveHelper.cxx b/chart2/source/tools/RegressionCurveHelper.cxx index 4566238cb7b8..3988da4fac95 100644 --- a/chart2/source/tools/RegressionCurveHelper.cxx +++ b/chart2/source/tools/RegressionCurveHelper.cxx @@ -101,29 +101,21 @@ Reference< XRegressionCurve > RegressionCurveHelper::createRegressionCurveByServ Reference< XRegressionCurve > xResult; // todo: use factory methods with service name - if( aServiceName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( - "com.sun.star.chart2.LinearRegressionCurve" ))) + if( aServiceName == "com.sun.star.chart2.LinearRegressionCurve" ) { - xResult.set( - new LinearRegressionCurve( xContext )); + xResult.set( new LinearRegressionCurve( xContext ) ); } - else if( aServiceName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( - "com.sun.star.chart2.LogarithmicRegressionCurve" ))) + else if( aServiceName == "com.sun.star.chart2.LogarithmicRegressionCurve" ) { - xResult.set( - new LogarithmicRegressionCurve( xContext )); + xResult.set( new LogarithmicRegressionCurve( xContext ) ); } - else if( aServiceName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( - "com.sun.star.chart2.ExponentialRegressionCurve" ))) + else if( aServiceName == "com.sun.star.chart2.ExponentialRegressionCurve" ) { - xResult.set( - new ExponentialRegressionCurve( xContext )); + xResult.set( new ExponentialRegressionCurve( xContext ) ); } - else if( aServiceName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( - "com.sun.star.chart2.PotentialRegressionCurve" ))) + else if( aServiceName == "com.sun.star.chart2.PotentialRegressionCurve" ) { - xResult.set( - new PotentialRegressionCurve( xContext )); + xResult.set( new PotentialRegressionCurve( xContext ) ); } return xResult; @@ -137,30 +129,25 @@ Reference< XRegressionCurveCalculator > RegressionCurveHelper::createRegressionC Reference< XRegressionCurveCalculator > xResult; // todo: use factory methods with service name - if( aServiceName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( - "com.sun.star.chart2.MeanValueRegressionCurve" ))) + if( aServiceName == "com.sun.star.chart2.MeanValueRegressionCurve" ) { - xResult.set( new MeanValueRegressionCurveCalculator()); + xResult.set( new MeanValueRegressionCurveCalculator() ); } - if( aServiceName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( - "com.sun.star.chart2.LinearRegressionCurve" ))) + if( aServiceName == "com.sun.star.chart2.LinearRegressionCurve" ) { - xResult.set( new LinearRegressionCurveCalculator()); + xResult.set( new LinearRegressionCurveCalculator() ); } - else if( aServiceName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( - "com.sun.star.chart2.LogarithmicRegressionCurve" ))) + else if( aServiceName == "com.sun.star.chart2.LogarithmicRegressionCurve" ) { - xResult.set( new LogarithmicRegressionCurveCalculator()); + xResult.set( new LogarithmicRegressionCurveCalculator() ); } - else if( aServiceName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( - "com.sun.star.chart2.ExponentialRegressionCurve" ))) + else if( aServiceName == "com.sun.star.chart2.ExponentialRegressionCurve" ) { - xResult.set( new ExponentialRegressionCurveCalculator()); + xResult.set( new ExponentialRegressionCurveCalculator() ); } - else if( aServiceName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( - "com.sun.star.chart2.PotentialRegressionCurve" ))) + else if( aServiceName == "com.sun.star.chart2.PotentialRegressionCurve" ) { - xResult.set( new PotentialRegressionCurveCalculator()); + xResult.set( new PotentialRegressionCurveCalculator() ); } return xResult; @@ -192,15 +179,12 @@ void RegressionCurveHelper::initializeCurveCalculator( if( xProp->getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Role" ))) >>= aRole ) { - if( bUseXValuesIfAvailable && - ! bXValuesFound && - aRole.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "values-x" ))) + if( bUseXValuesIfAvailable && !bXValuesFound && aRole == "values-x" ) { aXValues = DataSequenceToDoubleSequence( xSeq ); bXValuesFound = true; } - else if( ! bYValuesFound && - aRole.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "values-y" ))) + else if( !bYValuesFound && aRole == "values-y" ) { aYValues = DataSequenceToDoubleSequence( xSeq ); bYValuesFound = true; @@ -537,28 +521,23 @@ RegressionCurveHelper::tRegressionType RegressionCurveHelper::getRegressionType( { ::rtl::OUString aServiceName( xServName->getServiceName() ); - if( aServiceName.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( "com.sun.star.chart2.LinearRegressionCurve" ))) + if( aServiceName == "com.sun.star.chart2.LinearRegressionCurve" ) { eResult = REGRESSION_TYPE_LINEAR; } - else if( aServiceName.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( "com.sun.star.chart2.LogarithmicRegressionCurve" ))) + else if( aServiceName == "com.sun.star.chart2.LogarithmicRegressionCurve" ) { eResult = REGRESSION_TYPE_LOG; } - else if( aServiceName.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( "com.sun.star.chart2.ExponentialRegressionCurve" ))) + else if( aServiceName == "com.sun.star.chart2.ExponentialRegressionCurve" ) { eResult = REGRESSION_TYPE_EXP; } - else if( aServiceName.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( "com.sun.star.chart2.PotentialRegressionCurve" ))) + else if( aServiceName == "com.sun.star.chart2.PotentialRegressionCurve" ) { eResult = REGRESSION_TYPE_POWER; } - else if( aServiceName.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( "com.sun.star.chart2.MeanValueRegressionCurve" ))) + else if( aServiceName == "com.sun.star.chart2.MeanValueRegressionCurve" ) { eResult = REGRESSION_TYPE_MEAN_VALUE; } @@ -604,28 +583,23 @@ OUString RegressionCurveHelper::getUINameForRegressionCurve( const Reference< XR return aResult; OUString aServiceName( xServiceName->getServiceName()); - if( aServiceName.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( "com.sun.star.chart2.MeanValueRegressionCurve" ))) + if( aServiceName == "com.sun.star.chart2.MeanValueRegressionCurve" ) { aResult = ::chart::SchResId::getResString( STR_REGRESSION_MEAN ); } - else if( aServiceName.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( "com.sun.star.chart2.LinearRegressionCurve" ))) + else if( aServiceName == "com.sun.star.chart2.LinearRegressionCurve" ) { aResult = ::chart::SchResId::getResString( STR_REGRESSION_LINEAR ); } - else if( aServiceName.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( "com.sun.star.chart2.LogarithmicRegressionCurve" ))) + else if( aServiceName == "com.sun.star.chart2.LogarithmicRegressionCurve" ) { aResult = ::chart::SchResId::getResString( STR_REGRESSION_LOG ); } - else if( aServiceName.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( "com.sun.star.chart2.ExponentialRegressionCurve" ))) + else if( aServiceName == "com.sun.star.chart2.ExponentialRegressionCurve" ) { aResult = ::chart::SchResId::getResString( STR_REGRESSION_EXP ); } - else if( aServiceName.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( "com.sun.star.chart2.PotentialRegressionCurve" ))) + else if( aServiceName == "com.sun.star.chart2.PotentialRegressionCurve" ) { aResult = ::chart::SchResId::getResString( STR_REGRESSION_POWER ); } |