Kaydet (Commit) 23bdf47e authored tarafından Jan-Marek Glogowski's avatar Jan-Marek Glogowski

KDE fix various clang plugin complains

Fixes clang plugin reported problems in the KDE and KDE4 backend.

Change-Id: I0280beae9dd6f33ee59bdbe89cd38222f33fdc68
üst ae174b00
...@@ -274,9 +274,7 @@ bool KabImplModule::impl_doAllowNewKDEVersion() ...@@ -274,9 +274,7 @@ bool KabImplModule::impl_doAllowNewKDEVersion()
Reference< XMultiServiceFactory > xConfigProvider( Reference< XMultiServiceFactory > xConfigProvider(
css::configuration::theDefaultProvider::get( m_xContext ) ); css::configuration::theDefaultProvider::get( m_xContext ) );
Sequence< Any > aCreationArgs(1); Sequence< Any > aCreationArgs(1);
aCreationArgs[0] <<= PropertyValue( aCreationArgs[0] <<= PropertyValue( "nodepath", 0,
OUString( "nodepath" ),
0,
makeAny( KabDriver::impl_getConfigurationSettingsPath() ), makeAny( KabDriver::impl_getConfigurationSettingsPath() ),
PropertyState_DIRECT_VALUE ); PropertyState_DIRECT_VALUE );
Reference< XPropertySet > xSettings( xConfigProvider->createInstanceWithArguments( Reference< XPropertySet > xSettings( xConfigProvider->createInstanceWithArguments(
......
...@@ -23,6 +23,9 @@ ...@@ -23,6 +23,9 @@
#include <unx/saldisp.hxx> #include <unx/saldisp.hxx>
#include <unx/saldata.hxx> #include <unx/saldata.hxx>
#include <unx/salframe.h> #include <unx/salframe.h>
#include <unx/salgdi.h>
#include <memory>
class KDEData : public X11SalData class KDEData : public X11SalData
{ {
...@@ -48,13 +51,9 @@ class KDESalFrame : public X11SalFrame ...@@ -48,13 +51,9 @@ class KDESalFrame : public X11SalFrame
struct GraphicsHolder struct GraphicsHolder
{ {
X11SalGraphics* pGraphics; std::unique_ptr<X11SalGraphics> pGraphics;
bool bInUse; bool bInUse;
GraphicsHolder() GraphicsHolder() : bInUse( false ) {}
: pGraphics( nullptr ),
bInUse( false )
{}
~GraphicsHolder();
}; };
GraphicsHolder m_aGraphics[ nMaxGraphics ]; GraphicsHolder m_aGraphics[ nMaxGraphics ];
...@@ -77,7 +76,6 @@ protected: ...@@ -77,7 +76,6 @@ protected:
public: public:
KDESalInstance( SalYieldMutex* pMutex ) KDESalInstance( SalYieldMutex* pMutex )
: X11SalInstance( pMutex ) {} : X11SalInstance( pMutex ) {}
virtual ~KDESalInstance() override {}
virtual SalFrame* CreateFrame( SalFrame* pParent, SalFrameStyleFlags nStyle ) override; virtual SalFrame* CreateFrame( SalFrame* pParent, SalFrameStyleFlags nStyle ) override;
virtual bool hasNativeFileSelection() const override { return true; } virtual bool hasNativeFileSelection() const override { return true; }
......
...@@ -129,7 +129,6 @@ class KDEX11Pixmap : public X11Pixmap ...@@ -129,7 +129,6 @@ class KDEX11Pixmap : public X11Pixmap
{ {
public: public:
KDEX11Pixmap( int nWidth, int nHeight ); KDEX11Pixmap( int nWidth, int nHeight );
virtual ~KDEX11Pixmap() override {};
virtual int GetDepth() const override; virtual int GetDepth() const override;
virtual SalX11Screen GetScreen() const override; virtual SalX11Screen GetScreen() const override;
...@@ -1238,7 +1237,6 @@ class KDESalGraphics : public X11SalGraphics ...@@ -1238,7 +1237,6 @@ class KDESalGraphics : public X11SalGraphics
{ {
public: public:
KDESalGraphics() {} KDESalGraphics() {}
virtual ~KDESalGraphics() override {}
virtual bool IsNativeControlSupported( ControlType nType, ControlPart nPart ) override; virtual bool IsNativeControlSupported( ControlType nType, ControlPart nPart ) override;
virtual bool hitTestNativeControl( ControlType nType, ControlPart nPart, virtual bool hitTestNativeControl( ControlType nType, ControlPart nPart,
const Rectangle& rControlRegion, const Point& aPos, const Rectangle& rControlRegion, const Point& aPos,
...@@ -2017,10 +2015,10 @@ SalGraphics* KDESalFrame::AcquireGraphics() ...@@ -2017,10 +2015,10 @@ SalGraphics* KDESalFrame::AcquireGraphics()
m_aGraphics[i].bInUse = true; m_aGraphics[i].bInUse = true;
if( ! m_aGraphics[i].pGraphics ) if( ! m_aGraphics[i].pGraphics )
{ {
m_aGraphics[i].pGraphics = new KDESalGraphics(); m_aGraphics[i].pGraphics.reset (new KDESalGraphics() );
m_aGraphics[i].pGraphics->Init( this, GetWindow(), GetScreenNumber() ); m_aGraphics[i].pGraphics->Init( this, GetWindow(), GetScreenNumber() );
} }
return m_aGraphics[i].pGraphics; return m_aGraphics[i].pGraphics.get();
} }
} }
} }
...@@ -2032,7 +2030,7 @@ void KDESalFrame::ReleaseGraphics( SalGraphics *pGraphics ) ...@@ -2032,7 +2030,7 @@ void KDESalFrame::ReleaseGraphics( SalGraphics *pGraphics )
{ {
for( int i = 0; i < nMaxGraphics; i++ ) for( int i = 0; i < nMaxGraphics; i++ )
{ {
if( m_aGraphics[i].pGraphics == pGraphics ) if( m_aGraphics[i].pGraphics.get() == pGraphics )
{ {
m_aGraphics[i].bInUse = false; m_aGraphics[i].bInUse = false;
break; break;
...@@ -2054,11 +2052,6 @@ KDESalFrame::~KDESalFrame() ...@@ -2054,11 +2052,6 @@ KDESalFrame::~KDESalFrame()
{ {
} }
KDESalFrame::GraphicsHolder::~GraphicsHolder()
{
delete pGraphics;
}
// KDESalInstance implementation // KDESalInstance implementation
SalFrame * KDESalInstance::CreateFrame( SalFrame *pParent, SalFrameStyleFlags nStyle ) SalFrame * KDESalInstance::CreateFrame( SalFrame *pParent, SalFrameStyleFlags nStyle )
......
...@@ -345,7 +345,7 @@ void KDESalFrame::ReleaseGraphics( SalGraphics *pGraphics ) ...@@ -345,7 +345,7 @@ void KDESalFrame::ReleaseGraphics( SalGraphics *pGraphics )
{ {
for( int i = 0; i < nMaxGraphics; i++ ) for( int i = 0; i < nMaxGraphics; i++ )
{ {
if( m_aGraphics[i].pGraphics == pGraphics ) if( m_aGraphics[i].pGraphics.get() == pGraphics )
{ {
m_aGraphics[i].bInUse = false; m_aGraphics[i].bInUse = false;
break; break;
...@@ -363,14 +363,6 @@ void KDESalFrame::updateGraphics( bool bClear ) ...@@ -363,14 +363,6 @@ void KDESalFrame::updateGraphics( bool bClear )
} }
} }
KDESalFrame::~KDESalFrame()
{
}
KDESalFrame::GraphicsHolder::~GraphicsHolder()
{
}
SalGraphics* KDESalFrame::AcquireGraphics() SalGraphics* KDESalFrame::AcquireGraphics()
{ {
if( GetWindow() ) if( GetWindow() )
...@@ -382,10 +374,10 @@ SalGraphics* KDESalFrame::AcquireGraphics() ...@@ -382,10 +374,10 @@ SalGraphics* KDESalFrame::AcquireGraphics()
m_aGraphics[i].bInUse = true; m_aGraphics[i].bInUse = true;
if( ! m_aGraphics[i].pGraphics ) if( ! m_aGraphics[i].pGraphics )
{ {
m_aGraphics[i].pGraphics = new KDESalGraphics; m_aGraphics[i].pGraphics.reset( new KDESalGraphics );
m_aGraphics[i].pGraphics->Init( this, GetWindow(), GetScreenNumber() ); m_aGraphics[i].pGraphics->Init( this, GetWindow(), GetScreenNumber() );
} }
return m_aGraphics[i].pGraphics; return m_aGraphics[i].pGraphics.get();
} }
} }
} }
......
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
#include <unx/saldisp.hxx> #include <unx/saldisp.hxx>
#include <unx/salframe.h> #include <unx/salframe.h>
#include <unx/salgdi.h>
class KDESalFrame : public X11SalFrame class KDESalFrame : public X11SalFrame
{ {
...@@ -31,18 +32,16 @@ class KDESalFrame : public X11SalFrame ...@@ -31,18 +32,16 @@ class KDESalFrame : public X11SalFrame
struct GraphicsHolder struct GraphicsHolder
{ {
X11SalGraphics* pGraphics; std::unique_ptr<X11SalGraphics> pGraphics;
bool bInUse; bool bInUse;
GraphicsHolder() : pGraphics(nullptr),bInUse( false ) {} GraphicsHolder() : bInUse( false ) {}
~GraphicsHolder();
}; };
GraphicsHolder m_aGraphics[ nMaxGraphics ]; GraphicsHolder m_aGraphics[ nMaxGraphics ];
public: public:
KDESalFrame( SalFrame* pParent, SalFrameStyleFlags nStyle ); KDESalFrame( SalFrame* pParent, SalFrameStyleFlags nStyle );
virtual ~KDESalFrame() override;
virtual SalGraphics* AcquireGraphics() override; virtual SalGraphics* AcquireGraphics() override;
virtual void ReleaseGraphics( SalGraphics *pGraphics ) override; virtual void ReleaseGraphics( SalGraphics *pGraphics ) override;
......
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