diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2014-12-15 10:16:06 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2014-12-15 10:16:06 +0100 |
commit | fc6e89ef5004bbc6f39e70d42a97c3c97c2050f4 (patch) | |
tree | c8be20491420968e3ea85ea7498a4b6714d3d95b /sd | |
parent | fe17eb9448f6da0e8fab6aca02f49c7cf597e2b0 (diff) |
sd: Use appropriate OUString functions on string constants
Change-Id: I853f0c45e606297c966cd50d7086646c867596ec
Diffstat (limited to 'sd')
-rw-r--r-- | sd/qa/unit/export-tests.cxx | 2 | ||||
-rw-r--r-- | sd/source/filter/ppt/pptinanimations.cxx | 4 | ||||
-rw-r--r-- | sd/source/ui/app/optsitem.cxx | 28 | ||||
-rw-r--r-- | sd/source/ui/dlg/dlgass.cxx | 4 | ||||
-rw-r--r-- | sd/source/ui/framework/factories/FullScreenPane.cxx | 2 | ||||
-rw-r--r-- | sd/source/ui/inc/unokywds.hxx | 9 | ||||
-rw-r--r-- | sd/source/ui/presenter/PresenterTextView.cxx | 4 | ||||
-rw-r--r-- | sd/source/ui/unoidl/unolayer.cxx | 8 | ||||
-rw-r--r-- | sd/source/ui/unoidl/unopage.cxx | 4 | ||||
-rw-r--r-- | sd/source/ui/unoidl/unopback.cxx | 2 |
10 files changed, 28 insertions, 39 deletions
diff --git a/sd/qa/unit/export-tests.cxx b/sd/qa/unit/export-tests.cxx index 2641b71edb9a..4c4cf0908d84 100644 --- a/sd/qa/unit/export-tests.cxx +++ b/sd/qa/unit/export-tests.cxx @@ -260,7 +260,7 @@ void SdExportTest::testN828390_4() const SvxFontItem *pFont = dynamic_cast<const SvxFontItem *>((*it).pAttr); if( pFont ) { - CPPUNIT_ASSERT_MESSAGE( "Font is wrong", pFont->GetFamilyName().equalsAscii("Arial")); + CPPUNIT_ASSERT_MESSAGE( "Font is wrong", pFont->GetFamilyName() == "Arial"); bPassed = true; } const SvxWeightItem *pWeight = dynamic_cast<const SvxWeightItem *>((*it).pAttr); diff --git a/sd/source/filter/ppt/pptinanimations.cxx b/sd/source/filter/ppt/pptinanimations.cxx index 62d1b4e6b695..35e28a1a1cf0 100644 --- a/sd/source/filter/ppt/pptinanimations.cxx +++ b/sd/source/filter/ppt/pptinanimations.cxx @@ -893,7 +893,7 @@ bool AnimationImporter::convertAnimationValue( MS_AttributeNames eAttribute, Any rValue <<= (sal_Int32)aColor.GetColor(); bRet = true; } - else if( aString.matchAsciiL( "rgb(", 4, 0 ) ) + else if( aString.startsWith( "rgb(" ) ) { aString = aString.copy( 4, aString.getLength() - 5 ); Color aColor; @@ -904,7 +904,7 @@ bool AnimationImporter::convertAnimationValue( MS_AttributeNames eAttribute, Any rValue <<= (sal_Int32)aColor.GetColor(); bRet = true; } - else if( aString.matchAsciiL( "hsl(", 4, 0 ) ) + else if( aString.startsWith( "hsl(" ) ) { sal_Int32 index = 0; sal_Int32 nA = aString.getToken( 0, (sal_Unicode)',', index ).toInt32(); diff --git a/sd/source/ui/app/optsitem.cxx b/sd/source/ui/app/optsitem.cxx index 182cb3dc5ddc..c3f85efe3f44 100644 --- a/sd/source/ui/app/optsitem.cxx +++ b/sd/source/ui/app/optsitem.cxx @@ -31,8 +31,6 @@ using namespace ::utl; using namespace ::com::sun::star::uno; -#define B2U(_def_aStr) (OUString::createFromAscii(_def_aStr)) - template< class T > T getSafeValue( const Any& rAny ) { T value = T(); @@ -176,8 +174,8 @@ bool SdOptionsGeneric::isMetricSystem() SdOptionsLayout::SdOptionsLayout( sal_uInt16 nConfigId, bool bUseConfig ) : SdOptionsGeneric( nConfigId, bUseConfig ? ( ( SDCFG_DRAW == nConfigId ) ? - B2U( "Office.Draw/Layout" ) : - B2U( "Office.Impress/Layout" ) ) : + OUString( "Office.Draw/Layout" ) : + OUString( "Office.Impress/Layout" ) ) : OUString() ), bRuler( true ), bMoveOutline( true ), @@ -336,8 +334,8 @@ void SdOptionsLayoutItem::SetOptions( SdOptions* pOpts ) const SdOptionsContents::SdOptionsContents( sal_uInt16 nConfigId, bool bUseConfig ) : SdOptionsGeneric( nConfigId, bUseConfig ? ( ( SDCFG_DRAW == nConfigId ) ? - B2U( "Office.Draw/Content" ) : - B2U( "Office.Impress/Content" ) ) : + OUString( "Office.Draw/Content" ) : + OUString( "Office.Impress/Content" ) ) : OUString() ) { EnableModify( true ); @@ -415,8 +413,8 @@ void SdOptionsContentsItem::SetOptions(SdOptions*) const SdOptionsMisc::SdOptionsMisc( sal_uInt16 nConfigId, bool bUseConfig ) : SdOptionsGeneric( nConfigId, bUseConfig ? ( ( SDCFG_DRAW == nConfigId ) ? - B2U( "Office.Draw/Misc" ) : - B2U( "Office.Impress/Misc" ) ) : + OUString( "Office.Draw/Misc" ) : + OUString( "Office.Impress/Misc" ) ) : OUString() ), nDefaultObjectSizeWidth(8000), nDefaultObjectSizeHeight(5000), @@ -751,8 +749,8 @@ void SdOptionsMiscItem::SetOptions( SdOptions* pOpts ) const SdOptionsSnap::SdOptionsSnap( sal_uInt16 nConfigId, bool bUseConfig ) : SdOptionsGeneric( nConfigId, bUseConfig ? ( ( SDCFG_DRAW == nConfigId ) ? - B2U( "Office.Draw/Snap" ) : - B2U( "Office.Impress/Snap" ) ) : + OUString( "Office.Draw/Snap" ) : + OUString( "Office.Impress/Snap" ) ) : OUString() ), bSnapHelplines( true ), bSnapBorder( true ), @@ -916,7 +914,7 @@ void SdOptionsSnapItem::SetOptions( SdOptions* pOpts ) const SdOptionsZoom::SdOptionsZoom( sal_uInt16 nConfigId, bool bUseConfig ) : SdOptionsGeneric( nConfigId, ( bUseConfig && ( SDCFG_DRAW == nConfigId ) ) ? - B2U( "Office.Draw/Zoom" ) : + OUString( "Office.Draw/Zoom" ) : OUString() ), nX( 1 ), nY( 1 ) @@ -981,8 +979,8 @@ bool SdOptionsZoom::WriteData( Any* pValues ) const SdOptionsGrid::SdOptionsGrid( sal_uInt16 nConfigId, bool bUseConfig ) : SdOptionsGeneric( nConfigId, bUseConfig ? ( ( SDCFG_DRAW == nConfigId ) ? - B2U( "Office.Draw/Grid" ) : - B2U( "Office.Impress/Grid" ) ) : + OUString( "Office.Draw/Grid" ) : + OUString( "Office.Impress/Grid" ) ) : OUString() ) { EnableModify( false ); @@ -1166,8 +1164,8 @@ void SdOptionsGridItem::SetOptions( SdOptions* pOpts ) const SdOptionsPrint::SdOptionsPrint( sal_uInt16 nConfigId, bool bUseConfig ) : SdOptionsGeneric( nConfigId, bUseConfig ? ( ( SDCFG_DRAW == nConfigId ) ? - B2U( "Office.Draw/Print" ) : - B2U( "Office.Impress/Print" ) ) : + OUString( "Office.Draw/Print" ) : + OUString( "Office.Impress/Print" ) ) : OUString() ), bDraw( true ), bNotes( false ), diff --git a/sd/source/ui/dlg/dlgass.cxx b/sd/source/ui/dlg/dlgass.cxx index 60f63631f02e..294892de5ef4 100644 --- a/sd/source/ui/dlg/dlgass.cxx +++ b/sd/source/ui/dlg/dlgass.cxx @@ -728,9 +728,9 @@ void AssistentDlgImpl::ScanDocmenu (void) OUString sFactoryName; for( sal_Int32 i=0; i<nPropCount; ++i ) { - if( lProps[i].Name.equalsAscii( "DocumentService" ) && + if( lProps[i].Name == "DocumentService" && (lProps[i].Value >>= sFactoryName) && - sFactoryName.equalsAscii( "com.sun.star.presentation.PresentationDocument" ) ) + sFactoryName == "com.sun.star.presentation.PresentationDocument" ) { // yes, it's an impress document INetURLObject aURL; diff --git a/sd/source/ui/framework/factories/FullScreenPane.cxx b/sd/source/ui/framework/factories/FullScreenPane.cxx index 15d39127335c..ae8698c4f503 100644 --- a/sd/source/ui/framework/factories/FullScreenPane.cxx +++ b/sd/source/ui/framework/factories/FullScreenPane.cxx @@ -238,7 +238,7 @@ void FullScreenPane::ExtractArguments ( const OUString sKey = aToken.copy(0, nAssign); const OUString sValue = aToken.copy(nAssign+1); - if (sKey.equalsAscii("ScreenNumber")) + if (sKey == "ScreenNumber") { rnScreenNumberReturnValue = sValue.toInt32(); } diff --git a/sd/source/ui/inc/unokywds.hxx b/sd/source/ui/inc/unokywds.hxx index c0514db60c86..8e1f90254b4d 100644 --- a/sd/source/ui/inc/unokywds.hxx +++ b/sd/source/ui/inc/unokywds.hxx @@ -71,14 +71,7 @@ const char sUNO_StyleName_measure[] = "measure"; // SdUnoGraphicStyle const char sUNO_SdUnoGraphicStyle[] = "SdUnoGraphicStyle"; -// SdUnoPageBackground -const char sUNO_SdUnoPageBackground[] = "SdUnoPageBackground"; - -// SdLayerManager -const char sUNO_SdLayerManager[] = "SdUnoLayerManager"; - // SdLayer -const char sUNO_SdLayer[] = "SdUnoLayer"; const char sUNO_LayerName_background[] = "background"; const char sUNO_LayerName_background_objects[] = "backgroundobjects"; const char sUNO_LayerName_layout[] = "layout"; @@ -104,8 +97,6 @@ const char sUNO_Service_ShadowProperties[] = UNO_PREFIX "drawing.ShadowPropertie const char sUNO_Service_ConnectorProperties[] = UNO_PREFIX "drawing.ConnectorProperties"; const char sUNO_Service_MeasureProperties[] = UNO_PREFIX "drawing.MeasureProperties"; const char sUNO_Service_PageBackground[] = UNO_PREFIX "drawing.PageBackground"; -const char sUNO_Service_DrawingLayer[] = UNO_PREFIX "drawing.Layer"; -const char sUNO_Service_DrawingLayerManager[] = UNO_PREFIX "drawing.LayerManager"; const char sUNO_Service_GraphicObjectShape[] = UNO_PREFIX "drawing.GraphicObjectShape"; const char sUNO_Service_ImageMapRectangleObject[] = UNO_PREFIX "image.ImageMapRectangleObject"; const char sUNO_Service_ImageMapCircleObject[] = UNO_PREFIX "image.ImageMapCircleObject"; diff --git a/sd/source/ui/presenter/PresenterTextView.cxx b/sd/source/ui/presenter/PresenterTextView.cxx index 5b2fe7a52146..4f2e6ca3882a 100644 --- a/sd/source/ui/presenter/PresenterTextView.cxx +++ b/sd/source/ui/presenter/PresenterTextView.cxx @@ -452,11 +452,11 @@ sal_Int32 PresenterTextView::Implementation::ParseDistance (const OUString& rsDi { DBG_ASSERT(mpEditEngine!=NULL, "EditEngine missing"); sal_Int32 nDistance (0); - if (rsDistance.endsWithAsciiL("px", 2)) + if (rsDistance.endsWith("px")) { nDistance = rsDistance.copy(0,rsDistance.getLength()-2).toInt32(); } - else if (rsDistance.endsWithAsciiL("l", 1)) + else if (rsDistance.endsWith("l")) { const sal_Int32 nLines (rsDistance.copy(0,rsDistance.getLength()-1).toInt32()); // Take the height of the first line as the height of every line. diff --git a/sd/source/ui/unoidl/unolayer.cxx b/sd/source/ui/unoidl/unolayer.cxx index 659a09ffe86f..9ce0982330f4 100644 --- a/sd/source/ui/unoidl/unolayer.cxx +++ b/sd/source/ui/unoidl/unolayer.cxx @@ -152,7 +152,7 @@ UNO3_GETIMPLEMENTATION_IMPL( SdLayer ); OUString SAL_CALL SdLayer::getImplementationName() throw(uno::RuntimeException, std::exception) { - return OUString( OUString::createFromAscii(sUNO_SdLayer) ); + return OUString("SdUnoLayer"); } sal_Bool SAL_CALL SdLayer::supportsService( const OUString& ServiceName ) @@ -164,7 +164,7 @@ sal_Bool SAL_CALL SdLayer::supportsService( const OUString& ServiceName ) uno::Sequence< OUString > SAL_CALL SdLayer::getSupportedServiceNames() throw(uno::RuntimeException, std::exception) { - OUString aServiceName( OUString::createFromAscii(sUNO_Service_DrawingLayer) ); + OUString aServiceName(UNO_PREFIX "drawing.Layer"); uno::Sequence< OUString > aSeq( &aServiceName, 1 ); return aSeq; } @@ -466,7 +466,7 @@ void SAL_CALL SdLayerManager::removeEventListener( const uno::Reference< lang::X OUString SAL_CALL SdLayerManager::getImplementationName() throw(uno::RuntimeException, std::exception) { - return OUString( OUString::createFromAscii(sUNO_SdLayerManager) ); + return OUString("SdUnoLayerManager"); } sal_Bool SAL_CALL SdLayerManager::supportsService( const OUString& ServiceName ) @@ -478,7 +478,7 @@ sal_Bool SAL_CALL SdLayerManager::supportsService( const OUString& ServiceName ) uno::Sequence< OUString > SAL_CALL SdLayerManager::getSupportedServiceNames() throw(uno::RuntimeException, std::exception) { - OUString aServiceName( OUString::createFromAscii(sUNO_Service_DrawingLayerManager) ); + OUString aServiceName(UNO_PREFIX "drawing.LayerManager"); uno::Sequence< OUString > aSeq( &aServiceName, 1 ); return aSeq; } diff --git a/sd/source/ui/unoidl/unopage.cxx b/sd/source/ui/unoidl/unopage.cxx index 09f15ca83046..4993a2e28c0c 100644 --- a/sd/source/ui/unoidl/unopage.cxx +++ b/sd/source/ui/unoidl/unopage.cxx @@ -2866,7 +2866,7 @@ void SdMasterPage::setBackground( const Any& rValue ) Reference< container::XNameAccess > xFamily( xFamilies->getByName( getName() ), UNO_QUERY_THROW ) ; if( xFamily.is() ) { - OUString aStyleName( OUString::createFromAscii(sUNO_PseudoSheet_Background) ); + OUString aStyleName(sUNO_PseudoSheet_Background); Reference< beans::XPropertySet > xStyleSet( xFamily->getByName( aStyleName ), UNO_QUERY_THROW ); @@ -2965,7 +2965,7 @@ void SdMasterPage::getBackground( Any& rValue ) throw() Reference< container::XNameAccess > xFamilies( GetModel()->getStyleFamilies(), UNO_QUERY_THROW ); Reference< container::XNameAccess > xFamily( xFamilies->getByName( getName() ), UNO_QUERY_THROW ); - const OUString aStyleName( OUString::createFromAscii(sUNO_PseudoSheet_Background) ); + const OUString aStyleName(sUNO_PseudoSheet_Background); rValue <<= Reference< beans::XPropertySet >( xFamily->getByName( aStyleName ), UNO_QUERY_THROW ); } else diff --git a/sd/source/ui/unoidl/unopback.cxx b/sd/source/ui/unoidl/unopback.cxx index f9b2cccadbe0..0bd323a8f3f0 100644 --- a/sd/source/ui/unoidl/unopback.cxx +++ b/sd/source/ui/unoidl/unopback.cxx @@ -183,7 +183,7 @@ void SdUnoPageBackground::fillItemSet( SdDrawDocument* pDoc, SfxItemSet& rSet ) OUString SAL_CALL SdUnoPageBackground::getImplementationName() throw(uno::RuntimeException, std::exception) { - return OUString::createFromAscii( sUNO_SdUnoPageBackground ); + return OUString("SdUnoPageBackground"); } sal_Bool SAL_CALL SdUnoPageBackground::supportsService( const OUString& ServiceName ) |