diff options
author | Noel Grandin <noel@peralex.com> | 2013-11-22 11:13:17 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2013-11-22 11:23:05 +0200 |
commit | fc87d57f04132658e1c3481e92fe36e1183423ed (patch) | |
tree | 473a9dd4861e878cdc6e49f394b298df8732c3a3 /reportdesign | |
parent | cdb1981b2d33571b986376e77955045417a46aad (diff) |
replace OUString::reverseCompareTo("xxx") with operator==
operator== with OUString and literal internally does a reverse-compare
(via OUString::equalsAsciiL) anyway, so no need to keep explicit calls
to OUString::reverseCompareTo with literal argument
Change-Id: I799d9bcd0d5c308a9547ce7cacb2db6042fdb643
Diffstat (limited to 'reportdesign')
-rw-r--r-- | reportdesign/source/core/api/ReportDefinition.cxx | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/reportdesign/source/core/api/ReportDefinition.cxx b/reportdesign/source/core/api/ReportDefinition.cxx index 023b0a9de781..1afdeb6b805d 100644 --- a/reportdesign/source/core/api/ReportDefinition.cxx +++ b/reportdesign/source/core/api/ReportDefinition.cxx @@ -2236,9 +2236,9 @@ uno::Reference< uno::XInterface > SAL_CALL OReportDefinition::createInstance( co { xShape.set(m_aProps->m_xContext->getServiceManager()->createInstanceWithContext(aServiceSpecifier,m_aProps->m_xContext),uno::UNO_QUERY); } - else if ( aServiceSpecifier.reverseCompareTo( "com.sun.star.style.PageStyle" ) == 0 || - aServiceSpecifier.reverseCompareTo( "com.sun.star.style.FrameStyle" ) == 0 || - aServiceSpecifier.reverseCompareTo( "com.sun.star.style.GraphicStyle" ) == 0 + else if ( aServiceSpecifier == "com.sun.star.style.PageStyle" || + aServiceSpecifier == "com.sun.star.style.FrameStyle" || + aServiceSpecifier == "com.sun.star.style.GraphicStyle" ) { uno::Reference< style::XStyle> xStyle = new OStyle(); @@ -2249,72 +2249,72 @@ uno::Reference< uno::XInterface > SAL_CALL OReportDefinition::createInstance( co return xStyle.get(); } - else if ( aServiceSpecifier.reverseCompareTo( "com.sun.star.document.Settings" ) == 0 ) + else if ( aServiceSpecifier == "com.sun.star.document.Settings" ) { uno::Reference<beans::XPropertySet> xProp = new OStyle(); return xProp.get(); } - else if ( aServiceSpecifier.reverseCompareTo( "com.sun.star.drawing.Defaults" ) == 0 ) + else if ( aServiceSpecifier == "com.sun.star.drawing.Defaults" ) { uno::Reference<beans::XPropertySet> xProp = new OStyle(); return xProp.get(); } - else if ( aServiceSpecifier.reverseCompareTo( "com.sun.star.drawing.GradientTable" ) == 0 ) + else if ( aServiceSpecifier == "com.sun.star.drawing.GradientTable" ) { if ( !m_pImpl->m_xGradientTable.is() ) m_pImpl->m_xGradientTable.set(SvxUnoGradientTable_createInstance(m_pImpl->m_pReportModel.get()),uno::UNO_QUERY); return m_pImpl->m_xGradientTable; } - else if ( aServiceSpecifier.reverseCompareTo( "com.sun.star.drawing.HatchTable" ) == 0 ) + else if ( aServiceSpecifier == "com.sun.star.drawing.HatchTable" ) { if ( !m_pImpl->m_xHatchTable.is() ) m_pImpl->m_xHatchTable.set(SvxUnoHatchTable_createInstance(m_pImpl->m_pReportModel.get()),uno::UNO_QUERY); return m_pImpl->m_xHatchTable; } - else if ( aServiceSpecifier.reverseCompareTo( "com.sun.star.drawing.BitmapTable" ) == 0 ) + else if ( aServiceSpecifier == "com.sun.star.drawing.BitmapTable" ) { if ( !m_pImpl->m_xBitmapTable.is() ) m_pImpl->m_xBitmapTable.set(SvxUnoBitmapTable_createInstance(m_pImpl->m_pReportModel.get()),uno::UNO_QUERY); return m_pImpl->m_xBitmapTable; } - else if ( aServiceSpecifier.reverseCompareTo( "com.sun.star.drawing.TransparencyGradientTable" ) == 0 ) + else if ( aServiceSpecifier == "com.sun.star.drawing.TransparencyGradientTable" ) { if ( !m_pImpl->m_xTransparencyGradientTable.is() ) m_pImpl->m_xTransparencyGradientTable.set(SvxUnoTransGradientTable_createInstance(m_pImpl->m_pReportModel.get()),uno::UNO_QUERY); return m_pImpl->m_xTransparencyGradientTable; } - else if ( aServiceSpecifier.reverseCompareTo( "com.sun.star.drawing.DashTable" ) == 0 ) + else if ( aServiceSpecifier == "com.sun.star.drawing.DashTable" ) { if ( !m_pImpl->m_xDashTable.is() ) m_pImpl->m_xDashTable.set(SvxUnoDashTable_createInstance(m_pImpl->m_pReportModel.get()),uno::UNO_QUERY); return m_pImpl->m_xDashTable; } - else if( 0 == aServiceSpecifier.reverseCompareTo( "com.sun.star.drawing.MarkerTable" ) ) + else if( aServiceSpecifier == "com.sun.star.drawing.MarkerTable" ) { if( !m_pImpl->m_xMarkerTable.is() ) m_pImpl->m_xMarkerTable.set(SvxUnoMarkerTable_createInstance( m_pImpl->m_pReportModel.get() ),uno::UNO_QUERY); return m_pImpl->m_xMarkerTable; } - else if ( aServiceSpecifier.reverseCompareTo( "com.sun.star.document.ImportEmbeddedObjectResolver" ) == 0 ) + else if ( aServiceSpecifier == "com.sun.star.document.ImportEmbeddedObjectResolver" ) return static_cast< ::cppu::OWeakObject* >(SvXMLEmbeddedObjectHelper::Create( m_pImpl->m_xStorage,*this, EMBEDDEDOBJECTHELPER_MODE_READ )); - else if ( aServiceSpecifier.reverseCompareTo( "com.sun.star.document.ExportEmbeddedObjectResolver" ) == 0 ) + else if ( aServiceSpecifier == "com.sun.star.document.ExportEmbeddedObjectResolver" ) return static_cast< ::cppu::OWeakObject* >(SvXMLEmbeddedObjectHelper::Create( m_pImpl->m_xStorage,*this, EMBEDDEDOBJECTHELPER_MODE_WRITE )); - else if ( aServiceSpecifier.reverseCompareTo( "com.sun.star.document.ImportGraphicObjectResolver" ) == 0 ) + else if ( aServiceSpecifier == "com.sun.star.document.ImportGraphicObjectResolver" ) { SvXMLGraphicHelper* pGraphicHelper = SvXMLGraphicHelper::Create(m_pImpl->m_xStorage,GRAPHICHELPER_MODE_WRITE); uno::Reference< uno::XInterface> xRet(static_cast< ::cppu::OWeakObject* >(pGraphicHelper)); pGraphicHelper->release(); return xRet; } - else if ( aServiceSpecifier.reverseCompareTo( "com.sun.star.document.ExportGraphicObjectResolver" ) == 0 ) + else if ( aServiceSpecifier == "com.sun.star.document.ExportGraphicObjectResolver" ) { SvXMLGraphicHelper* pGraphicHelper = SvXMLGraphicHelper::Create(m_pImpl->m_xStorage,GRAPHICHELPER_MODE_WRITE); uno::Reference< uno::XInterface> xRet(static_cast< ::cppu::OWeakObject* >(pGraphicHelper)); pGraphicHelper->release(); return xRet; } - else if ( aServiceSpecifier.reverseCompareTo( "com.sun.star.chart2.data.DataProvider" ) == 0 ) + else if ( aServiceSpecifier == "com.sun.star.chart2.data.DataProvider" ) { uno::Reference<chart2::data::XDatabaseDataProvider> xDataProvider(chart2::data::DatabaseDataProvider::createWithConnection( m_aProps->m_xContext, m_pImpl->m_xActiveConnection )); xDataProvider->setRowLimit(10); @@ -2323,7 +2323,7 @@ uno::Reference< uno::XInterface > SAL_CALL OReportDefinition::createInstance( co xChild->setParent(*this); return uno::Reference< uno::XInterface >(xDataProvider,uno::UNO_QUERY); } - else if ( aServiceSpecifier.reverseCompareTo( "com.sun.star.xml.NamespaceMap" ) == 0 ) + else if ( aServiceSpecifier == "com.sun.star.xml.NamespaceMap" ) { if ( !m_pImpl->m_xXMLNamespaceMap.is() ) m_pImpl->m_xXMLNamespaceMap = comphelper::NameContainer_createInstance( ::getCppuType( (const OUString*) 0 ) ).get(); |