diff options
-rw-r--r-- | animations/source/animcore/targetpropertiescreator.cxx | 20 | ||||
-rw-r--r-- | basegfx/source/tools/unopolypolygon.cxx | 3 | ||||
-rw-r--r-- | cppuhelper/source/factory.cxx | 3 | ||||
-rw-r--r-- | cui/source/dialogs/colorpicker.cxx | 123 | ||||
-rw-r--r-- | embeddedobj/source/commonembedding/xfactory.cxx | 28 | ||||
-rw-r--r-- | forms/source/component/FormattedFieldWrapper.cxx | 24 | ||||
-rw-r--r-- | package/source/zippackage/ZipPackage.cxx | 7 | ||||
-rw-r--r-- | unotools/source/ucbhelper/xtempfile.cxx | 9 |
8 files changed, 21 insertions, 196 deletions
diff --git a/animations/source/animcore/targetpropertiescreator.cxx b/animations/source/animcore/targetpropertiescreator.cxx index 6141f676b2bc..04cc32fc74ef 100644 --- a/animations/source/animcore/targetpropertiescreator.cxx +++ b/animations/source/animcore/targetpropertiescreator.cxx @@ -31,16 +31,16 @@ #include <com/sun/star/drawing/XShape.hpp> #include <com/sun/star/animations/AnimationNodeType.hpp> #include <com/sun/star/animations/XAnimate.hpp> + +#include <animations/animationnodehelper.hxx> +#include <boost/unordered_map.hpp> #include <cppuhelper/compbase3.hxx> #include <cppuhelper/factory.hxx> #include <cppuhelper/implementationentry.hxx> +#include <cppuhelper/supportsservice.hxx> #include <comphelper/broadcasthelper.hxx> #include <comphelper/sequence.hxx> - -#include <animations/animationnodehelper.hxx> - #include <vector> -#include <boost/unordered_map.hpp> using namespace ::com::sun::star; @@ -88,8 +88,6 @@ namespace animcore TargetPropertiesCreator( const uno::Reference< uno::XComponentContext >& rxContext ); }; - // -------------------------------------------------------------------- - uno::Reference< uno::XInterface > SAL_CALL createInstance_TargetPropertiesCreator( const uno::Reference< uno::XComponentContext > & rSMgr ) throw (uno::Exception) { return TargetPropertiesCreator::createInstance( rSMgr ); @@ -107,8 +105,6 @@ namespace animcore return aRet; } - // -------------------------------------------------------------------- - namespace { // Vector containing all properties for a given shape @@ -201,7 +197,6 @@ namespace animcore { // extract target shape from iterate node // (will override the target for all children) - // -------------------------------------------------- uno::Reference< animations::XIterateContainer > xIterNode( xNode, uno::UNO_QUERY ); @@ -395,8 +390,6 @@ namespace animcore }; } - // -------------------------------------------------------------------- - TargetPropertiesCreator::TargetPropertiesCreator( const uno::Reference< uno::XComponentContext >& ) : TargetPropertiesCreator_Base( m_aMutex ) { @@ -433,10 +426,7 @@ namespace animcore // it actually does right now, for the slideshow implementation). aFunctor( xRootNode ); - // output to result sequence - // ---------------------------------------------------------------------- - uno::Sequence< animations::TargetProperties > aRes( aShapeHash.size() ); ::std::size_t nCurrIndex(0); @@ -474,7 +464,7 @@ namespace animcore sal_Bool SAL_CALL TargetPropertiesCreator::supportsService( const OUString& ServiceName ) throw( uno::RuntimeException ) { - return ServiceName.equalsIgnoreAsciiCase(SERVICE_NAME); + return cppu::supportsService(this, ServiceName); } uno::Sequence< OUString > SAL_CALL TargetPropertiesCreator::getSupportedServiceNames() throw( uno::RuntimeException ) diff --git a/basegfx/source/tools/unopolypolygon.cxx b/basegfx/source/tools/unopolypolygon.cxx index aa93b41428ff..38535ab05735 100644 --- a/basegfx/source/tools/unopolypolygon.cxx +++ b/basegfx/source/tools/unopolypolygon.cxx @@ -32,6 +32,7 @@ #include <basegfx/polygon/b2dpolypolygontools.hxx> #include <basegfx/tools/unopolypolygon.hxx> #include <basegfx/matrix/b2dhommatrixtools.hxx> +#include <cppuhelper/supportsservice.hxx> using namespace ::com::sun::star; @@ -443,7 +444,7 @@ namespace unotools sal_Bool SAL_CALL UnoPolyPolygon::supportsService( const OUString& ServiceName ) throw( uno::RuntimeException ) { - return ServiceName == SERVICE_NAME; + return cppu::supportsService(this, ServiceName); } uno::Sequence< OUString > SAL_CALL UnoPolyPolygon::getSupportedServiceNames() throw( uno::RuntimeException ) diff --git a/cppuhelper/source/factory.cxx b/cppuhelper/source/factory.cxx index b9e85c132c3b..b0b7e7bd9ea6 100644 --- a/cppuhelper/source/factory.cxx +++ b/cppuhelper/source/factory.cxx @@ -954,8 +954,7 @@ OUString OFactoryProxyHelper::getImplementationName() sal_Bool OFactoryProxyHelper::supportsService(const OUString& ServiceName) throw(::com::sun::star::uno::RuntimeException) { - Reference<XServiceInfo > xInfo( xFactory, UNO_QUERY ); - return xInfo.is() && xInfo->supportsService( ServiceName ); + return cppu::supportsService(this, ServiceName); } // XServiceInfo diff --git a/cui/source/dialogs/colorpicker.cxx b/cui/source/dialogs/colorpicker.cxx index e0ca149e799f..f4858e5083ab 100644 --- a/cui/source/dialogs/colorpicker.cxx +++ b/cui/source/dialogs/colorpicker.cxx @@ -26,6 +26,7 @@ #include <com/sun/star/datatransfer/clipboard/XClipboard.hpp> #include <com/sun/star/awt/XWindow.hpp> #include <cppuhelper/compbase4.hxx> +#include <cppuhelper/supportsservice.hxx> #include <comphelper/broadcasthelper.hxx> #include <vcl/dialog.hxx> #include <vcl/button.hxx> @@ -89,8 +90,6 @@ static void HSVtoRGB(double dH, double dS, double dV, double& dR, double& dG, do dB = result.getBlue(); } -// ----------------------------------------------------------------------- - // CMYK values from 0 to 1 static void CMYKtoRGB( double fCyan, double fMagenta, double fYellow, double fKey, double& dR, double& dG, double& dB ) { @@ -103,8 +102,6 @@ static void CMYKtoRGB( double fCyan, double fMagenta, double fYellow, double fKe dB = std::max( std::min( ( 1.0 - fYellow ), 1.0), 0.0 ); } -// ----------------------------------------------------------------------- - // CMY results from 0 to 1 static void RGBtoCMYK( double dR, double dG, double dB, double& fCyan, double& fMagenta, double& fYellow, double& fKey ) { @@ -133,8 +130,6 @@ static void RGBtoCMYK( double dR, double dG, double dB, double& fCyan, double& f } } -// ==================================================================== - class HexColorControl : public Edit { public: @@ -156,8 +151,6 @@ HexColorControl::HexColorControl( Window* pParent, const ResId& rResId ) SetMaxTextLen( 6 ); } -// ----------------------------------------------------------------------- - void HexColorControl::SetColor( sal_Int32 nColor ) { OUStringBuffer aBuffer; @@ -165,8 +158,6 @@ void HexColorControl::SetColor( sal_Int32 nColor ) SetText( aBuffer.makeStringAndClear().copy(1) ); } -// ----------------------------------------------------------------------- - sal_Int32 HexColorControl::GetColor() { sal_Int32 nColor = -1; @@ -190,8 +181,6 @@ sal_Int32 HexColorControl::GetColor() return nColor; } -// ----------------------------------------------------------------------- - bool HexColorControl::PreNotify( NotifyEvent& rNEvt ) { if ( (rNEvt.GetType() == EVENT_KEYINPUT) && !rNEvt.GetKeyEvent()->GetKeyCode().IsMod2() ) @@ -203,8 +192,6 @@ bool HexColorControl::PreNotify( NotifyEvent& rNEvt ) return Edit::PreNotify( rNEvt ); } -// ----------------------------------------------------------------------- - void HexColorControl::Paste() { ::com::sun::star::uno::Reference<com::sun::star::datatransfer::clipboard::XClipboard> aClipboard(GetClipboard()); @@ -249,8 +236,6 @@ void HexColorControl::Paste() } } -// ----------------------------------------------------------------------- - bool HexColorControl::ImplProcessKeyInput( const KeyEvent& rKEv ) { const KeyCode& rKeyCode = rKEv.GetKeyCode(); @@ -268,8 +253,6 @@ bool HexColorControl::ImplProcessKeyInput( const KeyEvent& rKEv ) return false; } -// ==================================================================== - class ColorPreviewControl : public Control { public: @@ -282,8 +265,6 @@ private: Color maColor; }; -// ----------------------------------------------------------------------- - ColorPreviewControl::ColorPreviewControl( Window* pParent, const ResId& rResId ) : Control( pParent, rResId ) { @@ -291,8 +272,6 @@ ColorPreviewControl::ColorPreviewControl( Window* pParent, const ResId& rResId ) SetLineColor( maColor ); } -// ----------------------------------------------------------------------- - void ColorPreviewControl::SetColor( const Color& rCol ) { if( rCol != maColor ) @@ -304,15 +283,11 @@ void ColorPreviewControl::SetColor( const Color& rCol ) } } -// ----------------------------------------------------------------------- - void ColorPreviewControl::Paint( const Rectangle& rRect ) { DrawRect( rRect ); } -// ==================================================================== - enum ColorMode { HUE, SATURATION, BRIGHTNESS, RED, GREEN, BLUE }; const ColorMode DefaultMode = HUE; @@ -357,8 +332,6 @@ private: std::vector< sal_uInt16 > maPercent_Vert; }; -// ----------------------------------------------------------------------- - ColorFieldControl::ColorFieldControl( Window* pParent, const ResId& rResId ) : Control( pParent, rResId ) , meMode( DefaultMode ) @@ -369,15 +342,11 @@ ColorFieldControl::ColorFieldControl( Window* pParent, const ResId& rResId ) SetControlBackground(); } -// ----------------------------------------------------------------------- - ColorFieldControl::~ColorFieldControl() { delete mpBitmap; } -// ----------------------------------------------------------------------- - void ColorFieldControl::UpdateBitmap() { const Size aSize( GetOutputSizePixel() ); @@ -519,8 +488,6 @@ void ColorFieldControl::UpdateBitmap() } } -// ----------------------------------------------------------------------- - void ColorFieldControl::ShowPosition( const Point& rPos, bool bUpdate ) { if( !mpBitmap ) @@ -564,7 +531,6 @@ void ColorFieldControl::ShowPosition( const Point& rPos, bool bUpdate ) } } } -// ----------------------------------------------------------------------- void ColorFieldControl::MouseMove( const MouseEvent& rMEvt ) { @@ -575,7 +541,6 @@ void ColorFieldControl::MouseMove( const MouseEvent& rMEvt ) } } -// ----------------------------------------------------------------------- void ColorFieldControl::MouseButtonDown( const MouseEvent& rMEvt ) { if( rMEvt.IsLeft() && !rMEvt.IsShift() ) @@ -586,15 +551,12 @@ void ColorFieldControl::MouseButtonDown( const MouseEvent& rMEvt ) } } -// ----------------------------------------------------------------------- void ColorFieldControl::MouseButtonUp( const MouseEvent& ) { if( IsMouseCaptured() ) ReleaseMouse(); } -// ----------------------------------------------------------------------- - void ColorFieldControl::KeyMove( int dx, int dy ) { Size aSize( GetOutputSizePixel() ); @@ -615,8 +577,6 @@ void ColorFieldControl::KeyMove( int dx, int dy ) Modify(); } -// ----------------------------------------------------------------------- - void ColorFieldControl::KeyInput( const KeyEvent& rKEvt ) { bool bShift = rKEvt.GetKeyCode().IsShift(); @@ -636,8 +596,6 @@ void ColorFieldControl::KeyInput( const KeyEvent& rKEvt ) Control::KeyInput( rKEvt ); } -// ----------------------------------------------------------------------- - void ColorFieldControl::Paint( const Rectangle& rRect ) { if( !mpBitmap ) @@ -661,23 +619,17 @@ void ColorFieldControl::Paint( const Rectangle& rRect ) DrawEllipse( Rectangle( maPosition, Size( 11, 11) ) ); } -// ----------------------------------------------------------------------- - void ColorFieldControl::Resize() { UpdateBitmap(); Control::Resize(); } -// ----------------------------------------------------------------------- - void ColorFieldControl::Modify() { maModifyHdl.Call( this ); } -// ----------------------------------------------------------------------- - void ColorFieldControl::SetValues( Color aColor, ColorMode eMode, double x, double y ) { bool bUpdateBitmap = (maColor!= aColor) || (meMode != eMode); @@ -696,30 +648,22 @@ void ColorFieldControl::SetValues( Color aColor, ColorMode eMode, double x, doub } } -// ----------------------------------------------------------------------- - double ColorFieldControl::GetX() { return mdX; } -// ----------------------------------------------------------------------- - double ColorFieldControl::GetY() { return mdY; } -// ----------------------------------------------------------------------- - void ColorFieldControl::UpdatePosition() { Size aSize( GetOutputSizePixel() ); ShowPosition( Point(static_cast<long>(mdX * aSize.Width()), static_cast<long>((1.0 - mdY) * aSize.Height())), false ); } -// ==================================================================== - class ColorSliderControl : public Control { public: @@ -755,8 +699,6 @@ private: double mdValue; }; -// ----------------------------------------------------------------------- - ColorSliderControl::ColorSliderControl( Window* pParent, const ResId& rResId ) : Control( pParent, rResId ) , meMode( DefaultMode ) @@ -767,15 +709,11 @@ ColorSliderControl::ColorSliderControl( Window* pParent, const ResId& rResId ) SetControlBackground(); } -// ----------------------------------------------------------------------- - ColorSliderControl::~ColorSliderControl() { delete mpBitmap; } -// ----------------------------------------------------------------------- - void ColorSliderControl::UpdateBitmap() { Size aSize( 1, GetOutputSizePixel().Height() ); @@ -858,8 +796,6 @@ void ColorSliderControl::UpdateBitmap() } } -// ----------------------------------------------------------------------- - void ColorSliderControl::ChangePosition( long nY ) { const long nHeight = GetOutputSizePixel().Height() - 1; @@ -873,8 +809,6 @@ void ColorSliderControl::ChangePosition( long nY ) mdValue = ((double)(nHeight - nY)) / (double)nHeight; } -// ----------------------------------------------------------------------- - void ColorSliderControl::MouseMove( const MouseEvent& rMEvt ) { if( rMEvt.IsLeft() ) @@ -884,7 +818,6 @@ void ColorSliderControl::MouseMove( const MouseEvent& rMEvt ) } } -// ----------------------------------------------------------------------- void ColorSliderControl::MouseButtonDown( const MouseEvent& rMEvt ) { if( rMEvt.IsLeft() && !rMEvt.IsShift() ) @@ -895,23 +828,18 @@ void ColorSliderControl::MouseButtonDown( const MouseEvent& rMEvt ) } } -// ----------------------------------------------------------------------- void ColorSliderControl::MouseButtonUp( const MouseEvent& ) { if( IsMouseCaptured() ) ReleaseMouse(); } -// ----------------------------------------------------------------------- - void ColorSliderControl::KeyMove( int dy ) { ChangePosition( mnLevel + dy ); Modify(); } -// ----------------------------------------------------------------------- - void ColorSliderControl::KeyInput( const KeyEvent& rKEvt ) { if ( !rKEvt.GetKeyCode().IsMod2() && !rKEvt.GetKeyCode().IsShift() ) @@ -925,7 +853,6 @@ void ColorSliderControl::KeyInput( const KeyEvent& rKEvt ) Control::KeyInput( rKEvt ); } -// ----------------------------------------------------------------------- void ColorSliderControl::Paint( const Rectangle& /*rRect*/ ) { @@ -948,23 +875,17 @@ void ColorSliderControl::Paint( const Rectangle& /*rRect*/ ) } } -// ----------------------------------------------------------------------- - void ColorSliderControl::Resize() { UpdateBitmap(); Control::Resize(); } -// ----------------------------------------------------------------------- - void ColorSliderControl::Modify() { maModifyHdl.Call( this ); } -// ----------------------------------------------------------------------- - void ColorSliderControl::SetValue( const Color& rColor, ColorMode eMode, double dValue ) { bool bUpdateBitmap = (rColor != maColor) || (eMode != meMode); @@ -980,8 +901,6 @@ void ColorSliderControl::SetValue( const Color& rColor, ColorMode eMode, double } } -// ==================================================================== - const sal_uInt16 UPDATE_RGB = 0x01; const sal_uInt16 UPDATE_CMYK = 0x02; const sal_uInt16 UPDATE_HSB = 0x04; @@ -1069,8 +988,6 @@ private: CancelButton maBTNCancel; }; -// -------------------------------------------------------------------- - ColorPickerDialog::ColorPickerDialog( Window* pParent, sal_Int32 nColor, sal_Int16 nMode ) : ModalDialog( pParent, CUI_RES( RID_CUI_DIALOG_COLORPICKER ) ) , maPreviousColor( nColor ) @@ -1193,8 +1110,6 @@ ColorPickerDialog::ColorPickerDialog( Window* pParent, sal_Int32 nColor, sal_Int update_color(); } -// -------------------------------------------------------------------- - static int toInt( double dValue, double dRange ) { return static_cast< int >( std::floor((dValue * dRange) + 0.5 ) ); @@ -1282,8 +1197,6 @@ void ColorPickerDialog::update_color( sal_uInt16 n ) maColorPreview.SetColor( aColor ); } -// -------------------------------------------------------------------- - IMPL_LINK( ColorPickerDialog, ColorModifyHdl, void *, p ) { sal_uInt16 n = 0; @@ -1397,8 +1310,6 @@ IMPL_LINK( ColorPickerDialog, ColorModifyHdl, void *, p ) return 0; } -// -------------------------------------------------------------------- - IMPL_LINK_NOARG(ColorPickerDialog, ModeModifyHdl) { ColorMode eMode = HUE; @@ -1433,8 +1344,6 @@ IMPL_LINK_NOARG(ColorPickerDialog, ModeModifyHdl) return 0; } -// -------------------------------------------------------------------- - void ColorPickerDialog::setColorComponent( sal_uInt16 nComp, double dValue ) { switch( nComp ) @@ -1468,8 +1377,6 @@ void ColorPickerDialog::setColorComponent( sal_uInt16 nComp, double dValue ) } } -// -------------------------------------------------------------------- - typedef ::cppu::WeakComponentImplHelper4< XServiceInfo, XExecutableDialog, XInitialization, XPropertyAccess > ColorPickerBase; class ColorPicker : protected ::comphelper::OBaseMutex, // Struct for right initalization of mutex member! Must be first of baseclasses. @@ -1504,22 +1411,16 @@ private: Reference< ::com::sun::star::awt::XWindow > mxParent; }; -// -------------------------------------------------------------------- - OUString SAL_CALL ColorPicker_getImplementationName() { return OUString( "com.sun.star.cui.ColorPicker" ); } -// -------------------------------------------------------------------- - Reference< XInterface > SAL_CALL ColorPicker_createInstance( Reference< XComponentContext > const & xContext ) SAL_THROW( (Exception) ) { return static_cast<XWeak*>( new ColorPicker( xContext ) ); } -// -------------------------------------------------------------------- - Sequence< OUString > SAL_CALL ColorPicker_getSupportedServiceNames() throw( RuntimeException ) { Sequence< OUString > seq(1); @@ -1527,8 +1428,6 @@ Sequence< OUString > SAL_CALL ColorPicker_getSupportedServiceNames() throw( Runt return seq; } -// -------------------------------------------------------------------- - ColorPicker::ColorPicker( Reference< XComponentContext > const & xContext ) : ColorPickerBase( m_aMutex ) , mxContext( xContext ) @@ -1539,8 +1438,6 @@ ColorPicker::ColorPicker( Reference< XComponentContext > const & xContext ) { } -// -------------------------------------------------------------------- - // XInitialization void SAL_CALL ColorPicker::initialize( const Sequence< Any >& aArguments ) throw (Exception, RuntimeException) { @@ -1550,30 +1447,22 @@ void SAL_CALL ColorPicker::initialize( const Sequence< Any >& aArguments ) throw } } -// -------------------------------------------------------------------- - // XInitialization OUString SAL_CALL ColorPicker::getImplementationName( ) throw (RuntimeException) { return ColorPicker_getImplementationName(); } -// -------------------------------------------------------------------- - sal_Bool SAL_CALL ColorPicker::supportsService( const OUString& sServiceName ) throw (RuntimeException) { - return sServiceName == "com.sun.star.ui.dialogs.ColorPicker"; + return cppu::supportsService(this, sServiceName); } -// -------------------------------------------------------------------- - Sequence< OUString > SAL_CALL ColorPicker::getSupportedServiceNames( ) throw (RuntimeException) { return ColorPicker_getSupportedServiceNames(); } -// -------------------------------------------------------------------- - // XPropertyAccess Sequence< PropertyValue > SAL_CALL ColorPicker::getPropertyValues( ) throw (RuntimeException) { @@ -1583,8 +1472,6 @@ Sequence< PropertyValue > SAL_CALL ColorPicker::getPropertyValues( ) throw (Run return props; } -// -------------------------------------------------------------------- - void SAL_CALL ColorPicker::setPropertyValues( const Sequence< PropertyValue >& aProps ) throw (UnknownPropertyException, PropertyVetoException, IllegalArgumentException, WrappedTargetException, RuntimeException) { for( sal_Int32 n = 0; n < aProps.getLength(); n++ ) @@ -1600,16 +1487,12 @@ void SAL_CALL ColorPicker::setPropertyValues( const Sequence< PropertyValue >& a } } -// -------------------------------------------------------------------- - // XExecutableDialog void SAL_CALL ColorPicker::setTitle( const OUString& sTitle ) throw (RuntimeException) { msTitle = sTitle; } -// -------------------------------------------------------------------- - sal_Int16 SAL_CALL ColorPicker::execute( ) throw (RuntimeException) { ColorPickerDialog aDlg( VCLUnoHelper::GetWindow( mxParent ), mnColor, mnMode ); @@ -1620,8 +1503,6 @@ sal_Int16 SAL_CALL ColorPicker::execute( ) throw (RuntimeException) return ret; } -// -------------------------------------------------------------------- - } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/embeddedobj/source/commonembedding/xfactory.cxx b/embeddedobj/source/commonembedding/xfactory.cxx index b592306972f1..9bbb43c32252 100644 --- a/embeddedobj/source/commonembedding/xfactory.cxx +++ b/embeddedobj/source/commonembedding/xfactory.cxx @@ -35,7 +35,6 @@ using namespace ::com::sun::star; -//------------------------------------------------------------------------- uno::Sequence< OUString > SAL_CALL OOoEmbeddedObjectFactory::impl_staticGetSupportedServiceNames() { uno::Sequence< OUString > aRet(2); @@ -44,20 +43,17 @@ uno::Sequence< OUString > SAL_CALL OOoEmbeddedObjectFactory::impl_staticGetSuppo return aRet; } -//------------------------------------------------------------------------- OUString SAL_CALL OOoEmbeddedObjectFactory::impl_staticGetImplementationName() { return OUString("com.sun.star.comp.embed.OOoEmbeddedObjectFactory"); } -//------------------------------------------------------------------------- uno::Reference< uno::XInterface > SAL_CALL OOoEmbeddedObjectFactory::impl_staticCreateSelfInstance( const uno::Reference< lang::XMultiServiceFactory >& xServiceManager ) { return uno::Reference< uno::XInterface >( *new OOoEmbeddedObjectFactory( comphelper::getComponentContext(xServiceManager) ) ); } -//------------------------------------------------------------------------- uno::Reference< uno::XInterface > SAL_CALL OOoEmbeddedObjectFactory::createInstanceInitFromEntry( const uno::Reference< embed::XStorage >& xStorage, const OUString& sEntName, @@ -149,7 +145,6 @@ uno::Reference< uno::XInterface > SAL_CALL OOoEmbeddedObjectFactory::createInsta return xResult; } -//------------------------------------------------------------------------- uno::Reference< uno::XInterface > SAL_CALL OOoEmbeddedObjectFactory::createInstanceInitFromMediaDescriptor( const uno::Reference< embed::XStorage >& xStorage, const OUString& sEntName, @@ -213,7 +208,6 @@ uno::Reference< uno::XInterface > SAL_CALL OOoEmbeddedObjectFactory::createInsta return xResult; } -//------------------------------------------------------------------------- uno::Reference< uno::XInterface > SAL_CALL OOoEmbeddedObjectFactory::createInstanceInitNew( const uno::Sequence< sal_Int8 >& aClassID, const OUString& /*aClassName*/, @@ -264,7 +258,6 @@ uno::Reference< uno::XInterface > SAL_CALL OOoEmbeddedObjectFactory::createInsta return xResult; } -//------------------------------------------------------------------------- uno::Reference< uno::XInterface > SAL_CALL OOoEmbeddedObjectFactory::createInstanceUserInit( const uno::Sequence< sal_Int8 >& aClassID, const OUString& /*aClassName*/, @@ -326,8 +319,6 @@ uno::Reference< uno::XInterface > SAL_CALL OOoEmbeddedObjectFactory::createInsta return xResult; } - -//------------------------------------------------------------------------- uno::Reference< uno::XInterface > SAL_CALL OOoEmbeddedObjectFactory::createInstanceLink( const uno::Reference< embed::XStorage >& /*xStorage*/, const OUString& /*sEntName*/, @@ -381,7 +372,6 @@ uno::Reference< uno::XInterface > SAL_CALL OOoEmbeddedObjectFactory::createInsta return xResult; } -//------------------------------------------------------------------------- uno::Reference< uno::XInterface > SAL_CALL OOoEmbeddedObjectFactory::createInstanceLinkUserInit( const uno::Sequence< sal_Int8 >& aClassID, const OUString& /*aClassName*/, @@ -447,7 +437,6 @@ uno::Reference< uno::XInterface > SAL_CALL OOoEmbeddedObjectFactory::createInsta return xResult; } -//------------------------------------------------------------------------- OUString SAL_CALL OOoEmbeddedObjectFactory::getImplementationName() throw ( uno::RuntimeException ) { @@ -460,14 +449,12 @@ sal_Bool SAL_CALL OOoEmbeddedObjectFactory::supportsService( const OUString& Ser return cppu::supportsService(this, ServiceName); } -//------------------------------------------------------------------------- uno::Sequence< OUString > SAL_CALL OOoEmbeddedObjectFactory::getSupportedServiceNames() throw ( uno::RuntimeException ) { return impl_staticGetSupportedServiceNames(); } -//------------------------------------------------------------------------- uno::Sequence< OUString > SAL_CALL OOoSpecialEmbeddedObjectFactory::impl_staticGetSupportedServiceNames() { uno::Sequence< OUString > aRet(2); @@ -476,20 +463,17 @@ uno::Sequence< OUString > SAL_CALL OOoSpecialEmbeddedObjectFactory::impl_staticG return aRet; } -//------------------------------------------------------------------------- OUString SAL_CALL OOoSpecialEmbeddedObjectFactory::impl_staticGetImplementationName() { return OUString("com.sun.star.comp.embed.OOoSpecialEmbeddedObjectFactory"); } -//------------------------------------------------------------------------- uno::Reference< uno::XInterface > SAL_CALL OOoSpecialEmbeddedObjectFactory::impl_staticCreateSelfInstance( const uno::Reference< lang::XMultiServiceFactory >& xServiceManager ) { return uno::Reference< uno::XInterface >( *new OOoSpecialEmbeddedObjectFactory( comphelper::getComponentContext(xServiceManager) ) ); } -//------------------------------------------------------------------------- uno::Reference< uno::XInterface > SAL_CALL OOoSpecialEmbeddedObjectFactory::createInstanceUserInit( const uno::Sequence< sal_Int8 >& aClassID, const OUString& /*aClassName*/, @@ -515,32 +499,22 @@ uno::Reference< uno::XInterface > SAL_CALL OOoSpecialEmbeddedObjectFactory::crea return xResult; } -//------------------------------------------------------------------------- OUString SAL_CALL OOoSpecialEmbeddedObjectFactory::getImplementationName() throw ( uno::RuntimeException ) { return impl_staticGetImplementationName(); } -//------------------------------------------------------------------------- sal_Bool SAL_CALL OOoSpecialEmbeddedObjectFactory::supportsService( const OUString& ServiceName ) throw ( uno::RuntimeException ) { - uno::Sequence< OUString > aSeq = impl_staticGetSupportedServiceNames(); - - for ( sal_Int32 nInd = 0; nInd < aSeq.getLength(); nInd++ ) - if ( ServiceName == aSeq[nInd] ) - return sal_True; - - return sal_False; + return cppu::supportsService(this, ServiceName); } -//------------------------------------------------------------------------- uno::Sequence< OUString > SAL_CALL OOoSpecialEmbeddedObjectFactory::getSupportedServiceNames() throw ( uno::RuntimeException ) { return impl_staticGetSupportedServiceNames(); } - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/forms/source/component/FormattedFieldWrapper.cxx b/forms/source/component/FormattedFieldWrapper.cxx index abcbf50b59cb..55083bfadb80 100644 --- a/forms/source/component/FormattedFieldWrapper.cxx +++ b/forms/source/component/FormattedFieldWrapper.cxx @@ -20,14 +20,14 @@ #include "FormattedFieldWrapper.hxx" #include "Edit.hxx" #include "FormattedField.hxx" -#include <tools/debug.hxx> #include "EditBase.hxx" #include "services.hxx" +#include <comphelper/processfactory.hxx> +#include <cppuhelper/supportsservice.hxx> #include <connectivity/dbtools.hxx> +#include <tools/debug.hxx> #include <vcl/svapp.hxx> -#include <comphelper/processfactory.hxx> -//......................................................................... namespace frm { using namespace ::com::sun::star::uno; @@ -42,9 +42,6 @@ using namespace ::com::sun::star::io; using namespace ::com::sun::star::lang; using namespace ::com::sun::star::util; -//================================================================== -// OFormattedFieldWrapper -//================================================================== Reference<XInterface> SAL_CALL OFormattedFieldWrapper_CreateInstance_ForceFormatted(const Reference<XMultiServiceFactory>& _rxFactory) { @@ -138,7 +135,6 @@ OFormattedFieldWrapper::~OFormattedFieldWrapper() } -//------------------------------------------------------------------ Any SAL_CALL OFormattedFieldWrapper::queryAggregation(const Type& _rType) throw (RuntimeException) { Any aReturn; @@ -183,29 +179,22 @@ Any SAL_CALL OFormattedFieldWrapper::queryAggregation(const Type& _rType) throw return aReturn; } -//------------------------------------------------------------------ OUString SAL_CALL OFormattedFieldWrapper::getServiceName() throw(RuntimeException) { // return the old compatibility name for an EditModel return OUString(FRM_COMPONENT_EDIT); } -//------------------------------------------------------------------ OUString SAL_CALL OFormattedFieldWrapper::getImplementationName( ) throw (RuntimeException) { return OUString("com.sun.star.comp.forms.OFormattedFieldWrapper"); } -//------------------------------------------------------------------ sal_Bool SAL_CALL OFormattedFieldWrapper::supportsService( const OUString& _rServiceName ) throw (RuntimeException) { - DBG_ASSERT(m_xAggregate.is(), "OFormattedFieldWrapper::supportsService: should never have made it 'til here without an aggregate!"); - Reference< XServiceInfo > xSI; - m_xAggregate->queryAggregation(::getCppuType(static_cast< Reference< XServiceInfo >* >(NULL))) >>= xSI; - return xSI->supportsService(_rServiceName); + return cppu::supportsService(this, _rServiceName); } -//------------------------------------------------------------------ Sequence< OUString > SAL_CALL OFormattedFieldWrapper::getSupportedServiceNames( ) throw (RuntimeException) { DBG_ASSERT(m_xAggregate.is(), "OFormattedFieldWrapper::getSupportedServiceNames: should never have made it 'til here without an aggregate!"); @@ -214,7 +203,6 @@ Sequence< OUString > SAL_CALL OFormattedFieldWrapper::getSupportedServiceNames( return xSI->getSupportedServiceNames(); } -//------------------------------------------------------------------ void SAL_CALL OFormattedFieldWrapper::write(const Reference<XObjectOutputStream>& _rxOutStream) throw( IOException, RuntimeException ) { // can't write myself @@ -254,7 +242,6 @@ void SAL_CALL OFormattedFieldWrapper::write(const Reference<XObjectOutputStream> m_xFormattedPart->write(_rxOutStream); } -//------------------------------------------------------------------ void SAL_CALL OFormattedFieldWrapper::read(const Reference<XObjectInputStream>& _rxInStream) throw( IOException, RuntimeException ) { SolarMutexGuard g; @@ -327,7 +314,6 @@ void SAL_CALL OFormattedFieldWrapper::read(const Reference<XObjectInputStream>& decrement(m_refCount); } -//------------------------------------------------------------------ void OFormattedFieldWrapper::ensureAggregate() { if (m_xAggregate.is()) @@ -365,9 +351,7 @@ void OFormattedFieldWrapper::ensureAggregate() decrement(m_refCount); } -//......................................................................... } -//......................................................................... /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/package/source/zippackage/ZipPackage.cxx b/package/source/zippackage/ZipPackage.cxx index f1261571acd1..fc465c39bedb 100644 --- a/package/source/zippackage/ZipPackage.cxx +++ b/package/source/zippackage/ZipPackage.cxx @@ -1596,11 +1596,6 @@ Sequence< OUString > ZipPackage::static_getSupportedServiceNames() return aNames; } -sal_Bool SAL_CALL ZipPackage::static_supportsService( OUString const & rServiceName ) -{ - return cppu::supportsService(this, rServiceName); -} - OUString ZipPackage::getImplementationName() throw ( RuntimeException ) { @@ -1616,7 +1611,7 @@ Sequence< OUString > ZipPackage::getSupportedServiceNames() sal_Bool SAL_CALL ZipPackage::supportsService( OUString const & rServiceName ) throw ( RuntimeException ) { - return static_supportsService ( rServiceName ); + return cppu::supportsService(this, rServiceName); } uno::Reference < XSingleServiceFactory > ZipPackage::createServiceFactory( uno::Reference < XMultiServiceFactory > const & rServiceFactory ) diff --git a/unotools/source/ucbhelper/xtempfile.cxx b/unotools/source/ucbhelper/xtempfile.cxx index f206a953576b..8c4c6f0e0827 100644 --- a/unotools/source/ucbhelper/xtempfile.cxx +++ b/unotools/source/ucbhelper/xtempfile.cxx @@ -16,12 +16,14 @@ * except in compliance with the License. You may obtain a copy of * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include <XTempFile.hxx> + #include <cppuhelper/factory.hxx> +#include <cppuhelper/supportsservice.hxx> #include <cppuhelper/typeprovider.hxx> -#include <unotools/tempfile.hxx> #include <osl/file.hxx> #include <unotools/configmgr.hxx> +#include <unotools/tempfile.hxx> +#include <XTempFile.hxx> OTempFileService::OTempFileService(css::uno::Reference< css::uno::XComponentContext > const & context) : ::cppu::PropertySetMixin< css::io::XTempFile >( @@ -432,8 +434,7 @@ throw ( css::uno::RuntimeException ) sal_Bool SAL_CALL OTempFileService::supportsService( OUString const & rServiceName ) throw ( css::uno::RuntimeException ) { - css::uno::Sequence< OUString > aServices(getSupportedServiceNames_Static()); - return rServiceName == aServices[0]; + return cppu::supportsService(this, rServiceName); } css::uno::Sequence < OUString > SAL_CALL OTempFileService::getSupportedServiceNames() |