Kaydet (Commit) f9369d33 authored tarafından Alexandre Vicenzi's avatar Alexandre Vicenzi Kaydeden (comit) Marcos Souza

fdo#54938 Convert to cppu::supportsService

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