From b93b23fe10917881e185750d294fc42fe2c92424 Mon Sep 17 00:00:00 2001 From: Ádám Csaba Király Date: Thu, 28 Feb 2013 19:28:03 +0100 Subject: Replace rtl::O(U)String with O(U)String Other changes include: in bridges/test/testcomp.cxx duplicate 'using namespace ::test' removed, 'using namespace ::rtl' replaced with 'using ::rtl::OUString' and 'using ::rtl::OUStringToOString' Change-Id: I67a5952afd305adeb07f728c9074620ecba8e9fc Reviewed-on: https://gerrit.libreoffice.org/2475 Reviewed-by: Andras Timar Tested-by: Andras Timar --- canvas/source/simplecanvas/simplecanvasimpl.cxx | 4 +-- canvas/source/tools/cachedprimitivebase.cxx | 3 +- canvas/source/tools/parametricpolypolygon.cxx | 5 ++-- canvas/source/tools/propertysethelper.cxx | 14 +++++----- canvas/source/vcl/canvas.cxx | 7 ++--- canvas/source/vcl/canvasbitmap.cxx | 2 +- canvas/source/vcl/canvascustomsprite.cxx | 3 +- canvas/source/vcl/canvasfont.cxx | 2 +- canvas/source/vcl/spritecanvashelper.cxx | 7 ++--- canvas/source/vcl/spritehelper.cxx | 2 +- canvas/source/vcl/textlayout.cxx | 3 +- canvas/workben/canvasdemo.cxx | 37 ++++++++++++------------- 12 files changed, 41 insertions(+), 48 deletions(-) (limited to 'canvas') diff --git a/canvas/source/simplecanvas/simplecanvasimpl.cxx b/canvas/source/simplecanvas/simplecanvasimpl.cxx index eaadad5df330..f04b811e59a8 100644 --- a/canvas/source/simplecanvas/simplecanvasimpl.cxx +++ b/canvas/source/simplecanvas/simplecanvasimpl.cxx @@ -176,13 +176,13 @@ namespace private: // Ifc XServiceName - virtual ::rtl::OUString SAL_CALL getServiceName( ) throw (uno::RuntimeException) + virtual OUString SAL_CALL getServiceName( ) throw (uno::RuntimeException) { return OUString( SERVICE_NAME ); } // Ifc XSimpleCanvas - virtual void SAL_CALL selectFont( const ::rtl::OUString& sFontName, + virtual void SAL_CALL selectFont( const OUString& sFontName, double size, ::sal_Bool bold, ::sal_Bool italic ) throw (uno::RuntimeException) diff --git a/canvas/source/tools/cachedprimitivebase.cxx b/canvas/source/tools/cachedprimitivebase.cxx index 69e92f11af37..63a62b52c2c4 100644 --- a/canvas/source/tools/cachedprimitivebase.cxx +++ b/canvas/source/tools/cachedprimitivebase.cxx @@ -26,7 +26,6 @@ #include #include - using namespace ::com::sun::star; #define IMPLEMENTATION_NAME "canvas::CachedPrimitiveBase" @@ -87,7 +86,7 @@ namespace canvas return OUString( IMPLEMENTATION_NAME ); } - sal_Bool SAL_CALL CachedPrimitiveBase::supportsService( const ::rtl::OUString& ServiceName ) throw (uno::RuntimeException) + sal_Bool SAL_CALL CachedPrimitiveBase::supportsService( const OUString& ServiceName ) throw (uno::RuntimeException) { return ServiceName == SERVICE_NAME; } diff --git a/canvas/source/tools/parametricpolypolygon.cxx b/canvas/source/tools/parametricpolypolygon.cxx index afce14a3f6cb..11ca7ed0b59c 100644 --- a/canvas/source/tools/parametricpolypolygon.cxx +++ b/canvas/source/tools/parametricpolypolygon.cxx @@ -35,7 +35,6 @@ #include - using namespace ::com::sun::star; namespace canvas @@ -52,7 +51,7 @@ namespace canvas ParametricPolyPolygon* ParametricPolyPolygon::create( const uno::Reference< rendering::XGraphicDevice >& rDevice, - const ::rtl::OUString& rServiceName, + const OUString& rServiceName, const uno::Sequence< uno::Any >& rArgs ) { uno::Sequence< uno::Sequence< double > > colorSequence(2); @@ -208,7 +207,7 @@ namespace canvas return OUString( IMPLEMENTATION_NAME ); } - sal_Bool SAL_CALL ParametricPolyPolygon::supportsService( const ::rtl::OUString& ServiceName ) throw (uno::RuntimeException) + sal_Bool SAL_CALL ParametricPolyPolygon::supportsService( const OUString& ServiceName ) throw (uno::RuntimeException) { return ServiceName == SERVICE_NAME; } diff --git a/canvas/source/tools/propertysethelper.cxx b/canvas/source/tools/propertysethelper.cxx index eabbe89b7670..2cdee08d4d37 100644 --- a/canvas/source/tools/propertysethelper.cxx +++ b/canvas/source/tools/propertysethelper.cxx @@ -85,7 +85,7 @@ namespace canvas initProperties( aMerged ); } - bool PropertySetHelper::isPropertyName( const ::rtl::OUString& aPropertyName ) const + bool PropertySetHelper::isPropertyName( const OUString& aPropertyName ) const { if( !mpMap.get() ) return false; @@ -101,7 +101,7 @@ namespace canvas return uno::Reference< beans::XPropertySetInfo >(); } - void PropertySetHelper::setPropertyValue( const ::rtl::OUString& aPropertyName, + void PropertySetHelper::setPropertyValue( const OUString& aPropertyName, const uno::Any& aValue ) { Callbacks aCallbacks; @@ -118,7 +118,7 @@ namespace canvas aCallbacks.setter(aValue); } - uno::Any PropertySetHelper::getPropertyValue( const ::rtl::OUString& aPropertyName ) const + uno::Any PropertySetHelper::getPropertyValue( const OUString& aPropertyName ) const { Callbacks aCallbacks; if( !mpMap.get() || @@ -136,7 +136,7 @@ namespace canvas return uno::Any(); } - void PropertySetHelper::addPropertyChangeListener( const ::rtl::OUString& aPropertyName, + void PropertySetHelper::addPropertyChangeListener( const OUString& aPropertyName, const uno::Reference< beans::XPropertyChangeListener >& /*xListener*/ ) { // check validity of property, but otherwise ignore the @@ -145,13 +145,13 @@ namespace canvas throwUnknown( aPropertyName ); } - void PropertySetHelper::removePropertyChangeListener( const ::rtl::OUString& /*aPropertyName*/, + void PropertySetHelper::removePropertyChangeListener( const OUString& /*aPropertyName*/, const uno::Reference< beans::XPropertyChangeListener >& /*xListener*/ ) { // ignore request, no listener added in the first place } - void PropertySetHelper::addVetoableChangeListener( const ::rtl::OUString& aPropertyName, + void PropertySetHelper::addVetoableChangeListener( const OUString& aPropertyName, const uno::Reference< beans::XVetoableChangeListener >& /*xListener*/ ) { // check validity of property, but otherwise ignore the @@ -160,7 +160,7 @@ namespace canvas throwUnknown( aPropertyName ); } - void PropertySetHelper::removeVetoableChangeListener( const ::rtl::OUString& /*aPropertyName*/, + void PropertySetHelper::removeVetoableChangeListener( const OUString& /*aPropertyName*/, const uno::Reference< beans::XVetoableChangeListener >& /*xListener*/ ) { // ignore request, no listener added in the first place diff --git a/canvas/source/vcl/canvas.cxx b/canvas/source/vcl/canvas.cxx index 4b59cef867e7..5a44e4016307 100644 --- a/canvas/source/vcl/canvas.cxx +++ b/canvas/source/vcl/canvas.cxx @@ -40,7 +40,6 @@ #include "canvas.hxx" #include "windowoutdevholder.hxx" - using namespace ::com::sun::star; namespace vclcanvas @@ -101,7 +100,7 @@ namespace vclcanvas OutputDevice* pOutDev = reinterpret_cast(nPtr); if( !pOutDev ) throw lang::NoSupportException( - ::rtl::OUString( "Passed OutDev invalid!" ), + OUString( "Passed OutDev invalid!" ), NULL); OutDevProviderSharedPtr pOutdevProvider( new OutDevHolder(*pOutDev) ); @@ -131,9 +130,9 @@ namespace vclcanvas CanvasBaseT::disposeThis(); } - ::rtl::OUString SAL_CALL Canvas::getServiceName( ) throw (::com::sun::star::uno::RuntimeException) + OUString SAL_CALL Canvas::getServiceName( ) throw (::com::sun::star::uno::RuntimeException) { - return ::rtl::OUString( CANVAS_SERVICE_NAME ); + return OUString( CANVAS_SERVICE_NAME ); } bool Canvas::repaint( const GraphicObjectSharedPtr& rGrf, diff --git a/canvas/source/vcl/canvasbitmap.cxx b/canvas/source/vcl/canvasbitmap.cxx index b941eb18f806..a469e448ed41 100644 --- a/canvas/source/vcl/canvasbitmap.cxx +++ b/canvas/source/vcl/canvasbitmap.cxx @@ -79,7 +79,7 @@ namespace vclcanvas return OUString( IMPLEMENTATION_NAME ); } - sal_Bool SAL_CALL CanvasBitmap::supportsService( const ::rtl::OUString& ServiceName ) throw (uno::RuntimeException) + sal_Bool SAL_CALL CanvasBitmap::supportsService( const OUString& ServiceName ) throw (uno::RuntimeException) { return ServiceName == SERVICE_NAME; } diff --git a/canvas/source/vcl/canvascustomsprite.cxx b/canvas/source/vcl/canvascustomsprite.cxx index a45221278c42..9dead83713de 100644 --- a/canvas/source/vcl/canvascustomsprite.cxx +++ b/canvas/source/vcl/canvascustomsprite.cxx @@ -42,7 +42,6 @@ #include "canvascustomsprite.hxx" - using namespace ::com::sun::star; @@ -126,7 +125,7 @@ namespace vclcanvas return OUString( IMPLEMENTATION_NAME ); } - sal_Bool SAL_CALL CanvasCustomSprite::supportsService( const ::rtl::OUString& ServiceName ) throw( uno::RuntimeException ) + sal_Bool SAL_CALL CanvasCustomSprite::supportsService( const OUString& ServiceName ) throw( uno::RuntimeException ) { return ServiceName == SERVICE_NAME; } diff --git a/canvas/source/vcl/canvasfont.cxx b/canvas/source/vcl/canvasfont.cxx index 8f422f73b358..c314e5d3298c 100644 --- a/canvas/source/vcl/canvasfont.cxx +++ b/canvas/source/vcl/canvasfont.cxx @@ -158,7 +158,7 @@ namespace vclcanvas return OUString( IMPLEMENTATION_NAME ); } - sal_Bool SAL_CALL CanvasFont::supportsService( const ::rtl::OUString& ServiceName ) throw( uno::RuntimeException ) + sal_Bool SAL_CALL CanvasFont::supportsService( const OUString& ServiceName ) throw( uno::RuntimeException ) { return ServiceName == SERVICE_NAME; } diff --git a/canvas/source/vcl/spritecanvashelper.cxx b/canvas/source/vcl/spritecanvashelper.cxx index dc663954d254..d9a77f22212e 100644 --- a/canvas/source/vcl/spritecanvashelper.cxx +++ b/canvas/source/vcl/spritecanvashelper.cxx @@ -36,7 +36,6 @@ #include "spritecanvashelper.hxx" #include "canvascustomsprite.hxx" - using namespace ::com::sun::star; #define FPS_BOUNDS Rectangle(0,0,130,90) @@ -158,7 +157,7 @@ namespace vclcanvas } void renderInfoText( OutputDevice& rOutDev, - const ::rtl::OUString& rStr, + const OUString& rStr, const Point& rPos ) { Font aVCLFont; @@ -641,8 +640,8 @@ namespace vclcanvas sal_Int32 nCount(0); mpRedrawManager->forEachSprite( makeAdder(nCount,sal_Int32(1)) ); - ::rtl::OUString text( - ::rtl::OUString::valueOf( + OUString text( + OUString::valueOf( // disambiguate overload... static_cast(nCount) ) ); diff --git a/canvas/source/vcl/spritehelper.cxx b/canvas/source/vcl/spritehelper.cxx index 534e0cb9e9f6..541115884f29 100644 --- a/canvas/source/vcl/spritehelper.cxx +++ b/canvas/source/vcl/spritehelper.cxx @@ -396,7 +396,7 @@ namespace vclcanvas rTargetSurface.SetTextColor( COL_RED ); rTargetSurface.SetFont( aVCLFont ); - ::rtl::OUString text( ::rtl::math::doubleToUString( getPriority(), + OUString text( ::rtl::math::doubleToUString( getPriority(), rtl_math_StringFormat_F, 2,'.',NULL,' ') ); diff --git a/canvas/source/vcl/textlayout.cxx b/canvas/source/vcl/textlayout.cxx index 72ede12ae85b..d8a0b14fbed5 100644 --- a/canvas/source/vcl/textlayout.cxx +++ b/canvas/source/vcl/textlayout.cxx @@ -37,7 +37,6 @@ #include - using namespace ::com::sun::star; namespace vclcanvas @@ -471,7 +470,7 @@ namespace vclcanvas return OUString( IMPLEMENTATION_NAME ); } - sal_Bool SAL_CALL TextLayout::supportsService( const ::rtl::OUString& ServiceName ) throw( uno::RuntimeException ) + sal_Bool SAL_CALL TextLayout::supportsService( const OUString& ServiceName ) throw( uno::RuntimeException ) { return ServiceName == SERVICE_NAME; } diff --git a/canvas/workben/canvasdemo.cxx b/canvas/workben/canvasdemo.cxx index a1e142d01dce..fe55c5721b54 100644 --- a/canvas/workben/canvasdemo.cxx +++ b/canvas/workben/canvasdemo.cxx @@ -56,7 +56,6 @@ #include #include - // never import whole leaf namespaces, since this will result in // absolutely weird effects during (Koenig) name lookup using namespace ::com::sun::star; @@ -79,7 +78,7 @@ class TestWindow : public Dialog public: TestWindow() : Dialog( (Window *) NULL ) { - SetText( rtl::OUString( "Canvas test" ) ); + SetText( OUString( "Canvas test" ) ); SetSizePixel( Size( 600, 450 ) ); EnablePaint( true ); Show(); @@ -139,8 +138,8 @@ class DemoRenderer lang::Locale aLocale; rendering::FontInfo aFontInfo; - aFontInfo.FamilyName = ::rtl::OUString( "Swiss" ); - aFontInfo.StyleName = ::rtl::OUString( "SansSerif" ); + aFontInfo.FamilyName = OUString( "Swiss" ); + aFontInfo.StyleName = OUString( "SansSerif" ); geometry::Matrix2D aFontMatrix( 1, 0, 0, 1 ); rendering::FontRequest aFontRequest( aFontInfo, 12.0, 0.0, aLocale ); @@ -164,10 +163,10 @@ class DemoRenderer maViewState, maRenderState ); } - void drawStringAt( ::rtl::OString aString, double x, double y ) + void drawStringAt( OString aString, double x, double y ) { rendering::StringContext aText; - aText.Text = ::rtl::OStringToOUString( aString, RTL_TEXTENCODING_UTF8 ); + aText.Text = OStringToOUString( aString, RTL_TEXTENCODING_UTF8 ); aText.StartPosition = 0; aText.Length = aString.getLength(); rendering::RenderState aRenderState( maRenderState ); @@ -290,7 +289,7 @@ class DemoRenderer //mxCanvas->drawPolyPolygon( xPP, maViewState, aRenderState ); } - void drawTitle( rtl::OString aTitle ) + void drawTitle( OString aTitle ) { // FIXME: text anchoring to be done double nStringWidth = aTitle.getLength() * 8.0; @@ -301,7 +300,7 @@ class DemoRenderer { rendering::RenderState maOldRenderState = maRenderState; // push - drawTitle( ::rtl::OString( "Rectangles" ) ); + drawTitle( OString( "Rectangles" ) ); drawRect( Rectangle( 20, 30, 70, 60 ), maColorRed, 8 ); // color mediumseagreen, stipple fill, outline black @@ -317,7 +316,7 @@ class DemoRenderer rendering::RenderState maOldRenderState = maRenderState; // push translate( maBox.Width(), 0.0 ); - drawTitle( ::rtl::OString( "Ellipses" ) ); + drawTitle( OString( "Ellipses" ) ); const basegfx::B2DPoint aCenter( maBox.Width()*.5, maBox.Height()*.5 ); @@ -348,11 +347,11 @@ class DemoRenderer rendering::RenderState maOldRenderState = maRenderState; // push translate( maBox.Width() * 2.0, 0.0 ); - drawTitle( ::rtl::OString( "Text" ) ); + drawTitle( OString( "Text" ) ); translate( 0.0, maBox.Height() * .5 ); - drawTitle( ::rtl::OString( "This is lame" ) ); + drawTitle( OString( "This is lame" ) ); maRenderState = maOldRenderState; // pop } @@ -362,7 +361,7 @@ class DemoRenderer rendering::RenderState maOldRenderState = maRenderState; // push translate( 0.0, maBox.Height() ); - drawTitle( ::rtl::OString( "Images" ) ); + drawTitle( OString( "Images" ) ); uno::Reference< rendering::XBitmap > xBitmap(mxCanvas, uno::UNO_QUERY); @@ -395,7 +394,7 @@ class DemoRenderer rendering::RenderState maOldRenderState = maRenderState; // push translate( maBox.Width(), maBox.Height() ); - drawTitle( ::rtl::OString( "Lines" ) ); + drawTitle( OString( "Lines" ) ); drawPolishDiamond( 70.0, 80.0 ); drawHilbert( 140.0, 140.0 ); @@ -408,7 +407,7 @@ class DemoRenderer rendering::RenderState maOldRenderState = maRenderState; // push translate( maBox.Width() * 2.0, maBox.Height() ); - drawTitle( ::rtl::OString( "Curves" ) ); + drawTitle( OString( "Curves" ) ); translate( maBox.Width() * .5, maBox.Height() * .5 ); @@ -457,7 +456,7 @@ class DemoRenderer rendering::RenderState maOldRenderState = maRenderState; // push translate( 0.0, maBox.Height() * 2.0 ); - drawTitle( ::rtl::OString( "Arcs" ) ); + drawTitle( OString( "Arcs" ) ); //begin hacks @@ -536,7 +535,7 @@ class DemoRenderer rendering::RenderState maOldRenderState = maRenderState; // push translate( maBox.Width() * 1.0, maBox.Height() * 2.0 ); - drawTitle( ::rtl::OString( "Polgyons" ) ); + drawTitle( OString( "Polgyons" ) ); int sides= 3; for (int i= 1; i <= 4; i++) @@ -553,7 +552,7 @@ class DemoRenderer rendering::RenderState maOldRenderState = maRenderState; // push translate( maBox.Width() * 2.0, maBox.Height() * 2.0 ); - drawTitle( ::rtl::OString( "Widgets" ) ); + drawTitle( OString( "Widgets" ) ); maRenderState = maOldRenderState; // pop } @@ -620,7 +619,7 @@ void TestWindow::Paint( const Rectangle& /*rRect*/ ) catch (const uno::Exception &e) { fprintf( stderr, "Exception '%s' thrown\n" , - ::rtl::OUStringToOString( e.Message, RTL_TEXTENCODING_UTF8 ).getStr() ); + OUStringToOString( e.Message, RTL_TEXTENCODING_UTF8 ).getStr() ); } } @@ -641,7 +640,7 @@ void DemoApp::Main() for( USHORT i = 0; i < GetCommandLineParamCount(); i++ ) { - ::rtl::OUString aParam = GetCommandLineParam( i ); + OUString aParam = GetCommandLineParam( i ); if( aParam == "--help" || aParam == "-h" ) bHelp = true; -- cgit