diff options
author | Jan-Marek Glogowski <glogow@fbihome.de> | 2016-09-21 15:49:36 +0200 |
---|---|---|
committer | Jan-Marek Glogowski <glogow@fbihome.de> | 2016-09-23 23:25:47 +0200 |
commit | f486329a03b8667bd958624937f02edc9af143d1 (patch) | |
tree | 39aca9529f23fa4ab0231d7905c2554a82979abf /vcl | |
parent | e44b034512551c09689edcecfa7401ecbb4af80e (diff) |
TDE fix some clang plugin based warnings
Change-Id: I3b44038e8a889e4c13126fd8d721e53e71ea9ec6
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/inc/unx/kde/kdedata.hxx | 20 | ||||
-rw-r--r-- | vcl/unx/kde/UnxCommandThread.hxx | 2 | ||||
-rw-r--r-- | vcl/unx/kde/UnxFilePicker.cxx | 37 | ||||
-rw-r--r-- | vcl/unx/kde/UnxFilePicker.hxx | 2 | ||||
-rw-r--r-- | vcl/unx/kde/fpicker/kdecommandthread.cxx | 4 | ||||
-rw-r--r-- | vcl/unx/kde/fpicker/kdecommandthread.hxx | 2 | ||||
-rw-r--r-- | vcl/unx/kde/fpicker/kdefilepicker.cxx | 18 | ||||
-rw-r--r-- | vcl/unx/kde/fpicker/kdefilepicker.hxx | 2 | ||||
-rw-r--r-- | vcl/unx/kde/fpicker/kdefpmain.cxx | 2 | ||||
-rw-r--r-- | vcl/unx/kde/fpicker/kdemodalityfilter.cxx | 2 | ||||
-rw-r--r-- | vcl/unx/kde/fpicker/kdemodalityfilter.hxx | 2 | ||||
-rw-r--r-- | vcl/unx/kde/kdedata.cxx | 4 | ||||
-rw-r--r-- | vcl/unx/kde/salnativewidgets-kde.cxx | 158 |
13 files changed, 127 insertions, 128 deletions
diff --git a/vcl/inc/unx/kde/kdedata.hxx b/vcl/inc/unx/kde/kdedata.hxx index 43aa46389e7b..025e0f9924c0 100644 --- a/vcl/inc/unx/kde/kdedata.hxx +++ b/vcl/inc/unx/kde/kdedata.hxx @@ -28,7 +28,7 @@ class KDEData : public X11SalData { public: KDEData( SalInstance *pInstance ) : X11SalData( SAL_DATA_KDE3, pInstance ) {} - virtual ~KDEData(); + virtual ~KDEData() override; virtual void Init() override; virtual void initNWF() override; @@ -39,7 +39,7 @@ class SalKDEDisplay : public SalX11Display { public: SalKDEDisplay( Display* pDisp ); - virtual ~SalKDEDisplay(); + virtual ~SalKDEDisplay() override; }; class KDESalFrame : public X11SalFrame @@ -51,7 +51,7 @@ class KDESalFrame : public X11SalFrame X11SalGraphics* pGraphics; bool bInUse; GraphicsHolder() - : pGraphics( NULL ), + : pGraphics( nullptr ), bInUse( false ) {} ~GraphicsHolder(); @@ -60,13 +60,13 @@ class KDESalFrame : public X11SalFrame public: KDESalFrame( SalFrame* pParent, SalFrameStyleFlags ); - virtual ~KDESalFrame(); + virtual ~KDESalFrame() override; virtual SalGraphics* AcquireGraphics() override; virtual void ReleaseGraphics( SalGraphics *pGraphics ) override; virtual void updateGraphics( bool bClear ) override; virtual void UpdateSettings( AllSettings& rSettings ) override; - virtual void Show( bool bVisible, bool bNoActivate ) override; + virtual void Show( bool bVisible, bool bNoActivate = false ) override; }; class KDESalInstance : public X11SalInstance @@ -74,7 +74,7 @@ class KDESalInstance : public X11SalInstance public: KDESalInstance( SalYieldMutex* pMutex ) : X11SalInstance( pMutex ) {} - virtual ~KDESalInstance() {} + virtual ~KDESalInstance() override {} virtual SalFrame* CreateFrame( SalFrame* pParent, SalFrameStyleFlags nStyle ) override; virtual bool hasNativeFileSelection() const override { return true; } @@ -93,12 +93,12 @@ class KDEXLib : public SalXLib public: KDEXLib() : SalXLib(), m_bStartupDone( false ), - m_pApplication( NULL ), - m_pFreeCmdLineArgs( NULL ), - m_pAppCmdLineArgs( NULL ), + m_pApplication( nullptr ), + m_pFreeCmdLineArgs( nullptr ), + m_pAppCmdLineArgs( nullptr ), m_nFakeCmdLineArgs( 0 ) {} - virtual ~KDEXLib(); + virtual ~KDEXLib() override; virtual void Init() override; void doStartup(); diff --git a/vcl/unx/kde/UnxCommandThread.hxx b/vcl/unx/kde/UnxCommandThread.hxx index 35d79cc825f9..6c3a228e9f5c 100644 --- a/vcl/unx/kde/UnxCommandThread.hxx +++ b/vcl/unx/kde/UnxCommandThread.hxx @@ -97,7 +97,7 @@ protected: public: UnxFilePickerCommandThread( UnxFilePickerNotifyThread *pNotifyThread, int nReadFD ); - virtual ~UnxFilePickerCommandThread(); + virtual ~UnxFilePickerCommandThread() override; YieldingCondition& SAL_CALL execCondition() { return m_aExecCondition; } bool SAL_CALL result(); diff --git a/vcl/unx/kde/UnxFilePicker.cxx b/vcl/unx/kde/UnxFilePicker.cxx index 2fa7af624688..dd5293b94f9b 100644 --- a/vcl/unx/kde/UnxFilePicker.cxx +++ b/vcl/unx/kde/UnxFilePicker.cxx @@ -136,7 +136,7 @@ bool controlIdInfo( sal_Int16 nControlId, OUString &rType, sal_Int32 &rTitleId ) { ExtendedFilePickerElementIds::LISTBOX_TEMPLATE, &aListBox, STR_SVT_FILEPICKER_TEMPLATES }, { ExtendedFilePickerElementIds::LISTBOX_IMAGE_TEMPLATE, &aListBox, STR_SVT_FILEPICKER_IMAGE_TEMPLATE }, { ExtendedFilePickerElementIds::CHECKBOX_SELECTION, &aCheckBox, STR_SVT_FILEPICKER_SELECTION }, - { 0, 0, 0 } + { 0, nullptr, 0 } }; for ( pPtr = pArray; pPtr->nId && ( pPtr->nId != nControlId ); ++pPtr ) @@ -193,8 +193,8 @@ UnxFilePicker::UnxFilePicker( const uno::Reference<uno::XComponentContext>& ) m_nFilePickerPid( -1 ), m_nFilePickerWrite( -1 ), m_nFilePickerRead( -1 ), - m_pNotifyThread( NULL ), - m_pCommandThread( NULL ), + m_pNotifyThread( nullptr ), + m_pCommandThread( nullptr ), m_pResMgr( ResMgr::CreateResMgr("fps_office") ) { } @@ -203,15 +203,15 @@ UnxFilePicker::~UnxFilePicker() { if ( m_nFilePickerPid > 0 ) { - sendCommand( OUString( "exit" ) ); - waitpid( m_nFilePickerPid, NULL, 0 ); + sendCommand( "exit" ); + waitpid( m_nFilePickerPid, nullptr, 0 ); } if ( m_pCommandThread ) { m_pCommandThread->join(); - delete m_pCommandThread, m_pCommandThread = NULL; + delete m_pCommandThread; m_pCommandThread = nullptr; } if ( m_pNotifyThread ) @@ -220,7 +220,7 @@ UnxFilePicker::~UnxFilePicker() m_pNotifyThread->join(); - delete m_pNotifyThread, m_pNotifyThread = NULL; + delete m_pNotifyThread; m_pNotifyThread = nullptr; } if ( m_nFilePickerWrite >= 0 ) @@ -229,7 +229,7 @@ UnxFilePicker::~UnxFilePicker() if ( m_nFilePickerRead >= 0 ) close( m_nFilePickerRead ); - delete m_pResMgr, m_pResMgr = NULL; + delete m_pResMgr; m_pResMgr = nullptr; } void SAL_CALL UnxFilePicker::addFilePickerListener( const uno::Reference<XFilePickerListener>& xListener ) @@ -272,7 +272,7 @@ sal_Int16 SAL_CALL UnxFilePicker::execute() // this is _not_ an osl::Condition, see i#93366 m_pCommandThread->execCondition().reset(); - sendCommand( OUString( "exec" )); + sendCommand( "exec" ); m_pCommandThread->execCondition().wait(); @@ -287,11 +287,10 @@ void SAL_CALL UnxFilePicker::setMultiSelectionMode( sal_Bool bMode ) checkFilePicker(); ::osl::MutexGuard aGuard( m_aMutex ); - OUString aString = bMode? - OUString( "setMultiSelection true" ): - OUString( "setMultiSelection false" ); - - sendCommand( aString ); + if ( bMode ) + sendCommand( "setMultiSelection true" ); + else + sendCommand( "setMultiSelection false" ); } void SAL_CALL UnxFilePicker::setDefaultName( const OUString &rName ) @@ -328,7 +327,7 @@ OUString SAL_CALL UnxFilePicker::getDisplayDirectory() checkFilePicker(); ::osl::MutexGuard aGuard( m_aMutex ); - sendCommand( OUString( "getDirectory" ), + sendCommand( "getDirectory", m_pCommandThread->getDirectoryCondition() ); return m_pCommandThread->getDirectory(); @@ -340,7 +339,7 @@ uno::Sequence< OUString > SAL_CALL UnxFilePicker::getFiles() checkFilePicker(); ::osl::MutexGuard aGuard( m_aMutex ); - sendCommand( OUString( "getFiles" ), + sendCommand( "getFiles", m_pCommandThread->getFilesCondition() ); return m_pCommandThread->getFiles(); @@ -382,7 +381,7 @@ OUString SAL_CALL UnxFilePicker::getCurrentFilter() checkFilePicker(); ::osl::MutexGuard aGuard( m_aMutex ); - sendCommand( OUString( "getCurrentFilter" ), + sendCommand( "getCurrentFilter", m_pCommandThread->getCurrentFilterCondition() ); return m_pCommandThread->getCurrentFilter(); @@ -828,7 +827,7 @@ void UnxFilePicker::initFilePicker() // TODO pass here the real parent (not possible for system dialogs // yet), and default to GetDefDialogParent() only when the real parent - // is NULL + // is nullptr vcl::Window *pParentWin = Application::GetDefDialogParent(); if ( pParentWin ) { @@ -841,7 +840,7 @@ void UnxFilePicker::initFilePicker() } // Execute the fpicker implementation - execlp( helper.getStr(), helper.getStr(), "--winid", pWinId, NULL ); + execlp( helper.getStr(), helper.getStr(), "--winid", pWinId, nullptr ); // Error, finish the child exit( -1 ); diff --git a/vcl/unx/kde/UnxFilePicker.hxx b/vcl/unx/kde/UnxFilePicker.hxx index 30e4d42a27be..803d91b76fcf 100644 --- a/vcl/unx/kde/UnxFilePicker.hxx +++ b/vcl/unx/kde/UnxFilePicker.hxx @@ -68,7 +68,7 @@ protected: public: explicit UnxFilePicker( const css::uno::Reference< css::uno::XComponentContext >& ); - virtual ~UnxFilePicker(); + virtual ~UnxFilePicker() override; // XComponent diff --git a/vcl/unx/kde/fpicker/kdecommandthread.cxx b/vcl/unx/kde/fpicker/kdecommandthread.cxx index b30f3e72e314..241f5a8996ab 100644 --- a/vcl/unx/kde/fpicker/kdecommandthread.cxx +++ b/vcl/unx/kde/fpicker/kdecommandthread.cxx @@ -63,7 +63,7 @@ KDECommandEvent::KDECommandEvent( const QString &qCommand, QStringList *pStringL { "setDefaultName", SetDefaultName }, { "setMultiSelection", SetMultiSelection }, { "exec", Exec }, - { 0, Unknown } + { nullptr, Unknown } }; for ( pIdx = pMapping; pIdx->pName && qCommand != pIdx->pName; ++pIdx ) @@ -159,7 +159,7 @@ void KDECommandThread::handleCommand( const QString &rString, bool &bQuit ) return; if ( pTokens->empty() ) { - delete pTokens, pTokens = NULL; + delete pTokens; pTokens = nullptr; return; } diff --git a/vcl/unx/kde/fpicker/kdecommandthread.hxx b/vcl/unx/kde/fpicker/kdecommandthread.hxx index 416e118c3451..374d74a4f1cb 100644 --- a/vcl/unx/kde/fpicker/kdecommandthread.hxx +++ b/vcl/unx/kde/fpicker/kdecommandthread.hxx @@ -90,7 +90,7 @@ protected: public: KDECommandThread( QWidget *pObject ); - virtual ~KDECommandThread(); + virtual ~KDECommandThread() override; virtual void run() override; diff --git a/vcl/unx/kde/fpicker/kdefilepicker.cxx b/vcl/unx/kde/fpicker/kdefilepicker.cxx index 766bd38e9893..1f7b7d693d39 100644 --- a/vcl/unx/kde/fpicker/kdefilepicker.cxx +++ b/vcl/unx/kde/fpicker/kdefilepicker.cxx @@ -101,9 +101,9 @@ bool isSupportedProtocol( const QString &rProtocol ) ".uno", ".component", "vnd.sun.star.pkg", "ldap", "db", "vnd.sun.star.cmd", "vnd.sun.star.script", "telnet", - NULL }; + nullptr }; - for ( const char **pIndex = pOOoProtocols; *pIndex != NULL; ++pIndex ) + for ( const char **pIndex = pOOoProtocols; *pIndex != nullptr; ++pIndex ) { if ( rProtocol == *pIndex ) return true; @@ -432,7 +432,7 @@ void KDEFileDialog::customEvent( QCustomEvent *pEvent ) QString qFileName( addExtension( qLocalSelectedURL.path() ) ); bCanExit = !QFile::exists( qFileName ) || - ( KMessageBox::warningYesNo( 0, + ( KMessageBox::warningYesNo( nullptr, i18n( "A file named \"%1\" already exists. " "Are you sure you want to overwrite it?" ).arg( qFileName ), i18n( "Overwrite File?" ), @@ -440,7 +440,7 @@ void KDEFileDialog::customEvent( QCustomEvent *pEvent ) } else if ( !isSupportedProtocol( qProtocol ) ) { - KMessageBox::sorry( 0, + KMessageBox::sorry( nullptr, i18n( "Saving using protocol \"%1\" is not supported." ).arg( qProtocol ) ); bCanExit = false; } @@ -449,7 +449,7 @@ void KDEFileDialog::customEvent( QCustomEvent *pEvent ) } else if ( !isSave() && result() == QDialog::Accepted && !isSupportedProtocol( qProtocol ) ) { - KMessageBox::information( 0, + KMessageBox::information( nullptr, i18n( "Protocol \"%1\" is supported only partially. " "Local copy of the file will be created." ).arg( qProtocol ) ); bCanExit = true; @@ -509,7 +509,7 @@ QWidget* KDEFileDialog::findControl( const QString &rId ) const for ( ; it != pList->end() && qName != (*it)->name(); ++it ) ; - QWidget *pWidget = NULL; + QWidget *pWidget = nullptr; if ( it != pList->end() ) pWidget = static_cast< QWidget* >( *it ); @@ -664,7 +664,7 @@ QString KDEFileDialog::addExtension( const QString &rFileName ) const QString qExtension; QWidget *pExtensionWidget = findControl( "100" ); // CHECKBOX_AUTOEXTENSION - QCheckBox *pExtensionCB = pExtensionWidget? static_cast< QCheckBox* >( pExtensionWidget->qt_cast( QCheckBox_String ) ): NULL; + QCheckBox *pExtensionCB = pExtensionWidget? static_cast< QCheckBox* >( pExtensionWidget->qt_cast( QCheckBox_String ) ): nullptr; if ( pExtensionCB && pExtensionCB->isChecked() ) { // FIXME: qFilter can be a MIME; we ignore it now... @@ -730,9 +730,9 @@ QString KDEFileDialog::localCopy( const QString &rFileName ) const KURL qDestURL; qDestURL.setPath( qTempFile.name() ); - if ( !KIO::NetAccess::file_copy( rFileName, qDestURL, 0600, true, false, NULL ) ) + if ( !KIO::NetAccess::file_copy( rFileName, qDestURL, 0600, true ) ) { - KMessageBox::error( 0, KIO::NetAccess::lastErrorString() ); + KMessageBox::error( nullptr, KIO::NetAccess::lastErrorString() ); return QString::null; } diff --git a/vcl/unx/kde/fpicker/kdefilepicker.hxx b/vcl/unx/kde/fpicker/kdefilepicker.hxx index 93bc45935412..630b4278811c 100644 --- a/vcl/unx/kde/fpicker/kdefilepicker.hxx +++ b/vcl/unx/kde/fpicker/kdefilepicker.hxx @@ -81,7 +81,7 @@ protected: public: KDEFileDialog( const QString &startDir, const QString &filter, QWidget *parent, const char *name ); - virtual ~KDEFileDialog(); + virtual ~KDEFileDialog() override; protected: virtual void resizeEvent( QResizeEvent *pEvent ) override; diff --git a/vcl/unx/kde/fpicker/kdefpmain.cxx b/vcl/unx/kde/fpicker/kdefpmain.cxx index ee0f0c41b18c..0031ae0e92bf 100644 --- a/vcl/unx/kde/fpicker/kdefpmain.cxx +++ b/vcl/unx/kde/fpicker/kdefpmain.cxx @@ -92,7 +92,7 @@ int main( int argc, char* argv[] ) KDEModalityFilter qModalityFilter( nWinId ); - KDEFileDialog aFileDialog( NULL, QString(), NULL, THIS_DESKENV_NAME_LOW "filedialog" ); + KDEFileDialog aFileDialog( nullptr, QString(), nullptr, THIS_DESKENV_NAME_LOW "filedialog" ); KDECommandThread qCommandThread( &aFileDialog ); qCommandThread.start(); diff --git a/vcl/unx/kde/fpicker/kdemodalityfilter.cxx b/vcl/unx/kde/fpicker/kdemodalityfilter.cxx index 1b91d02839d3..007369353f54 100644 --- a/vcl/unx/kde/fpicker/kdemodalityfilter.cxx +++ b/vcl/unx/kde/fpicker/kdemodalityfilter.cxx @@ -50,7 +50,7 @@ bool KDEModalityFilter::eventFilter( QObject *pObject, QEvent *pEvent ) if ( pObject->isWidgetType() && pEvent->type() == QEvent::Show ) { KDialogBase* pDlg = ::qt_cast< KDialogBase* >( pObject ); - if ( pDlg != NULL && m_nWinId != 0 ) + if ( pDlg != nullptr && m_nWinId != 0 ) { XSetTransientForHint( qt_xdisplay(), pDlg->winId(), m_nWinId ); m_nWinId = 0; diff --git a/vcl/unx/kde/fpicker/kdemodalityfilter.hxx b/vcl/unx/kde/fpicker/kdemodalityfilter.hxx index e4dd8eed202b..4f068e3dea43 100644 --- a/vcl/unx/kde/fpicker/kdemodalityfilter.hxx +++ b/vcl/unx/kde/fpicker/kdemodalityfilter.hxx @@ -42,7 +42,7 @@ private: public: KDEModalityFilter( WId nWinId ); - virtual ~KDEModalityFilter(); + virtual ~KDEModalityFilter() override; virtual bool eventFilter( QObject *pObject, QEvent *pEvent ) override; }; diff --git a/vcl/unx/kde/kdedata.cxx b/vcl/unx/kde/kdedata.cxx index 4a2d68cc2dbb..f136cc60f293 100644 --- a/vcl/unx/kde/kdedata.cxx +++ b/vcl/unx/kde/kdedata.cxx @@ -75,7 +75,7 @@ SalKDEDisplay::~SalKDEDisplay() // clean up own members doDestruct(); // prevent SalDisplay from closing KApplication's display - pDisp_ = NULL; + pDisp_ = nullptr; } /*************************************************************************** @@ -224,7 +224,7 @@ extern "C" { if( nMajor != 3 || nMinor < 2 || (nMinor == 2 && nMicro < 2) ) { SAL_INFO( "vcl.kde", "unsuitable qt version " << nMajor << "." << nMinor << "." << nMicro ); - return NULL; + return nullptr; } KDESalInstance* pInstance = new KDESalInstance( new SalYieldMutex() ); diff --git a/vcl/unx/kde/salnativewidgets-kde.cxx b/vcl/unx/kde/salnativewidgets-kde.cxx index 4f320da6b1f2..6fd0de51afe7 100644 --- a/vcl/unx/kde/salnativewidgets-kde.cxx +++ b/vcl/unx/kde/salnativewidgets-kde.cxx @@ -128,7 +128,7 @@ class KDEX11Pixmap : public X11Pixmap { public: KDEX11Pixmap( int nWidth, int nHeight ); - virtual ~KDEX11Pixmap() {}; + virtual ~KDEX11Pixmap() override {}; virtual int GetDepth() const override; virtual SalX11Screen GetScreen() const override; @@ -320,7 +320,7 @@ class WidgetPainter /** Implicit constructor. It creates an empty WidgetPainter with all the cached widgets initialized - to NULL. The widgets are created on demand and they are still hidden + to nullptr. The widgets are created on demand and they are still hidden (no QWidget::show()), because they are needed just as a parameter for QStyle::drawControl(). @@ -359,7 +359,7 @@ class WidgetPainter /** 'Get' method for push button. The method returns the cached push button. It is constructed if it - does not exist. It has NULL as a parent and it stays hidden, but it + does not exist. It has nullptr as a parent and it stays hidden, but it is necessary for the drawStyledWidget() method. @return valid push button. @@ -469,63 +469,63 @@ class WidgetPainter }; WidgetPainter::WidgetPainter() - : m_pPushButton( NULL ), - m_pRadioButton( NULL ), - m_pCheckBox( NULL ), - m_pComboBox( NULL ), - m_pEditableComboBox( NULL ), - m_pLineEdit( NULL ), - m_pSpinWidget( NULL ), - m_pSpinEdit( NULL ), - m_pTabLeft( NULL ), - m_pTabMiddle( NULL ), - m_pTabRight( NULL ), - m_pTabAlone( NULL ), - m_pTabBarParent( NULL ), - m_pTabBar( NULL ), - m_pTabWidget( NULL ), - m_pListView( NULL ), - m_pScrollBar( NULL ), - m_pMainWindow( NULL ), - m_pToolBarHoriz( NULL ), - m_pToolBarVert( NULL ), - m_pToolButton( NULL ), - m_pMenuBar( NULL ), + : m_pPushButton( nullptr ), + m_pRadioButton( nullptr ), + m_pCheckBox( nullptr ), + m_pComboBox( nullptr ), + m_pEditableComboBox( nullptr ), + m_pLineEdit( nullptr ), + m_pSpinWidget( nullptr ), + m_pSpinEdit( nullptr ), + m_pTabLeft( nullptr ), + m_pTabMiddle( nullptr ), + m_pTabRight( nullptr ), + m_pTabAlone( nullptr ), + m_pTabBarParent( nullptr ), + m_pTabBar( nullptr ), + m_pTabWidget( nullptr ), + m_pListView( nullptr ), + m_pScrollBar( nullptr ), + m_pMainWindow( nullptr ), + m_pToolBarHoriz( nullptr ), + m_pToolBarVert( nullptr ), + m_pToolButton( nullptr ), + m_pMenuBar( nullptr ), m_nMenuBarEnabledItem( 0 ), m_nMenuBarDisabledItem( 0 ), - m_pPopupMenu( NULL ), + m_pPopupMenu( nullptr ), m_nPopupMenuEnabledItem( 0 ), m_nPopupMenuDisabledItem( 0 ), - m_pProgressBar( NULL ) + m_pProgressBar( nullptr ) { } WidgetPainter::~WidgetPainter() { - delete m_pPushButton, m_pPushButton = NULL; - delete m_pRadioButton, m_pRadioButton = NULL; - delete m_pCheckBox, m_pCheckBox = NULL; - delete m_pComboBox, m_pComboBox = NULL; - delete m_pEditableComboBox, m_pEditableComboBox = NULL; - delete m_pLineEdit, m_pLineEdit = NULL; - delete m_pSpinWidget, m_pSpinWidget = NULL; - m_pSpinEdit = NULL; // Deleted in m_pSpinWidget's destructor - delete m_pTabAlone, m_pTabAlone = NULL; - delete m_pTabBarParent, m_pTabBarParent = NULL; - m_pTabBar = NULL; // Deleted in m_pTabBarParent's destructor - m_pTabLeft = NULL; - m_pTabMiddle = NULL; - m_pTabRight = NULL; - delete m_pTabWidget, m_pTabWidget = NULL; - delete m_pListView, m_pListView = NULL; - delete m_pScrollBar, m_pScrollBar = NULL; - delete m_pToolBarHoriz, m_pToolBarHoriz = NULL; - delete m_pToolBarVert, m_pToolBarVert = NULL; - delete m_pMainWindow, m_pMainWindow = NULL; - delete m_pToolButton, m_pToolButton = NULL; - delete m_pMenuBar, m_pMenuBar = NULL; - delete m_pPopupMenu, m_pPopupMenu = NULL; - delete m_pProgressBar, m_pProgressBar = NULL; + delete m_pPushButton; m_pPushButton = nullptr; + delete m_pRadioButton; m_pRadioButton = nullptr; + delete m_pCheckBox; m_pCheckBox = nullptr; + delete m_pComboBox; m_pComboBox = nullptr; + delete m_pEditableComboBox; m_pEditableComboBox = nullptr; + delete m_pLineEdit; m_pLineEdit = nullptr; + delete m_pSpinWidget; m_pSpinWidget = nullptr; + m_pSpinEdit = nullptr; // Deleted in m_pSpinWidget's destructor + delete m_pTabAlone; m_pTabAlone = nullptr; + delete m_pTabBarParent; m_pTabBarParent = nullptr; + m_pTabBar = nullptr; // Deleted in m_pTabBarParent's destructor + m_pTabLeft = nullptr; + m_pTabMiddle = nullptr; + m_pTabRight = nullptr; + delete m_pTabWidget; m_pTabWidget = nullptr; + delete m_pListView; m_pListView = nullptr; + delete m_pScrollBar; m_pScrollBar = nullptr; + delete m_pToolBarHoriz; m_pToolBarHoriz = nullptr; + delete m_pToolBarVert; m_pToolBarVert = nullptr; + delete m_pMainWindow; m_pMainWindow = nullptr; + delete m_pToolButton; m_pToolButton = nullptr; + delete m_pMenuBar; m_pMenuBar = nullptr; + delete m_pPopupMenu; m_pPopupMenu = nullptr; + delete m_pProgressBar; m_pProgressBar = nullptr; } bool WidgetPainter::drawStyledWidget( QWidget *pWidget, @@ -616,7 +616,7 @@ bool WidgetPainter::drawStyledWidget( QWidget *pWidget, } else if ( strcmp( QSpinWidget_String, pClassName ) == 0 ) { - const SpinbuttonValue* pValue = (aValue.getType() == ControlType::SpinButtons) ? static_cast<const SpinbuttonValue*>(&aValue) : NULL; + const SpinbuttonValue* pValue = (aValue.getType() == ControlType::SpinButtons) ? static_cast<const SpinbuttonValue*>(&aValue) : nullptr; // Is any of the buttons pressed? QStyle::SCFlags eActive = QStyle::SC_None; @@ -669,7 +669,7 @@ bool WidgetPainter::drawStyledWidget( QWidget *pWidget, { const TabitemValue *pValue = static_cast<const TabitemValue *> ( &aValue ); - QTab *pTab = NULL; + QTab *pTab = nullptr; if ( pValue ) { if ( ( pValue->isFirst() || pValue->isLeftAligned() ) && ( pValue->isLast() || pValue->isRightAligned() ) ) @@ -705,7 +705,7 @@ bool WidgetPainter::drawStyledWidget( QWidget *pWidget, } else if ( strcmp( QScrollBar_String, pClassName ) == 0 ) { - const ScrollbarValue* pValue = (aValue.getType() == ControlType::Scrollbar) ? static_cast<const ScrollbarValue*>(&aValue) : NULL; + const ScrollbarValue* pValue = (aValue.getType() == ControlType::Scrollbar) ? static_cast<const ScrollbarValue*>(&aValue) : nullptr; QStyle::SCFlags eActive = QStyle::SC_None; if ( pValue ) @@ -877,7 +877,7 @@ bool WidgetPainter::drawStyledWidget( QWidget *pWidget, return false; // Bitblt it to the screen - pGraphics->RenderPixmapToScreen( &xPixmap, NULL, qWidgetPos.x(), qWidgetPos.y() ); + pGraphics->RenderPixmapToScreen( &xPixmap, nullptr, qWidgetPos.x(), qWidgetPos.y() ); // Restore widget's position pWidget->move( qWidgetPos ); @@ -889,7 +889,7 @@ QPushButton *WidgetPainter::pushButton( const Rectangle& rControlRegion, bool bDefault ) { if ( !m_pPushButton ) - m_pPushButton = new QPushButton( NULL, "push_button" ); + m_pPushButton = new QPushButton( nullptr, "push_button" ); QRect qRect = region2QRect( rControlRegion ); @@ -925,7 +925,7 @@ QPushButton *WidgetPainter::pushButton( const Rectangle& rControlRegion, QRadioButton *WidgetPainter::radioButton( const Rectangle& rControlRegion ) { if ( !m_pRadioButton ) - m_pRadioButton = new QRadioButton( NULL, "radio_button" ); + m_pRadioButton = new QRadioButton( nullptr, "radio_button" ); QRect qRect = region2QRect( rControlRegion ); @@ -954,7 +954,7 @@ QRadioButton *WidgetPainter::radioButton( const Rectangle& rControlRegion ) QCheckBox *WidgetPainter::checkBox( const Rectangle& rControlRegion ) { if ( !m_pCheckBox ) - m_pCheckBox = new QCheckBox( NULL, "check_box" ); + m_pCheckBox = new QCheckBox( nullptr, "check_box" ); QRect qRect = region2QRect( rControlRegion ); @@ -983,17 +983,17 @@ QCheckBox *WidgetPainter::checkBox( const Rectangle& rControlRegion ) QComboBox *WidgetPainter::comboBox( const Rectangle& rControlRegion, bool bEditable ) { - QComboBox *pComboBox = NULL; + QComboBox *pComboBox = nullptr; if ( bEditable ) { if ( !m_pEditableComboBox ) - m_pEditableComboBox = new QComboBox( true, NULL, "combo_box_edit" ); + m_pEditableComboBox = new QComboBox( true, nullptr, "combo_box_edit" ); pComboBox = m_pEditableComboBox; } else { if ( !m_pComboBox ) - m_pComboBox = new QComboBox( false, NULL, "combo_box" ); + m_pComboBox = new QComboBox( false, nullptr, "combo_box" ); pComboBox = m_pComboBox; } @@ -1008,7 +1008,7 @@ QComboBox *WidgetPainter::comboBox( const Rectangle& rControlRegion, QLineEdit *WidgetPainter::lineEdit( const Rectangle& rControlRegion ) { if ( !m_pLineEdit ) - m_pLineEdit = new QLineEdit( NULL, "line_edit" ); + m_pLineEdit = new QLineEdit( nullptr, "line_edit" ); QRect qRect = region2QRect( rControlRegion ); @@ -1022,8 +1022,8 @@ QSpinWidget *WidgetPainter::spinWidget( const Rectangle& rControlRegion ) { if ( !m_pSpinWidget ) { - m_pSpinWidget = new QSpinWidget( NULL, "spin_widget" ); - m_pSpinEdit = new QLineEdit( NULL, "line_edit_spin" ); + m_pSpinWidget = new QSpinWidget( nullptr, "spin_widget" ); + m_pSpinEdit = new QLineEdit( nullptr, "line_edit_spin" ); m_pSpinWidget->setEditWidget( m_pSpinEdit ); } @@ -1041,7 +1041,7 @@ QTabBar *WidgetPainter::tabBar( const Rectangle& rControlRegion ) if ( !m_pTabBar ) { if ( !m_pTabBarParent ) - m_pTabBarParent = new QWidget( NULL, "tab_bar_parent" ); + m_pTabBarParent = new QWidget( nullptr, "tab_bar_parent" ); m_pTabBar = new QTabBar( m_pTabBarParent, "tab_bar" ); @@ -1068,7 +1068,7 @@ QTabBar *WidgetPainter::tabBar( const Rectangle& rControlRegion ) QTabWidget *WidgetPainter::tabWidget( const Rectangle& rControlRegion ) { if ( !m_pTabWidget ) - m_pTabWidget = new QTabWidget( NULL, "tab_widget" ); + m_pTabWidget = new QTabWidget( nullptr, "tab_widget" ); QRect qRect = region2QRect( rControlRegion ); --qRect.rTop(); @@ -1082,7 +1082,7 @@ QTabWidget *WidgetPainter::tabWidget( const Rectangle& rControlRegion ) QListView *WidgetPainter::listView( const Rectangle& rControlRegion ) { if ( !m_pListView ) - m_pListView = new QListView( NULL, "list_view" ); + m_pListView = new QListView( nullptr, "list_view" ); QRect qRect = region2QRect( rControlRegion ); @@ -1097,7 +1097,7 @@ QScrollBar *WidgetPainter::scrollBar( const Rectangle& rControlRegion, { if ( !m_pScrollBar ) { - m_pScrollBar = new QScrollBar( NULL, "scroll_bar" ); + m_pScrollBar = new QScrollBar( nullptr, "scroll_bar" ); m_pScrollBar->setTracking( false ); m_pScrollBar->setLineStep( 1 ); } @@ -1108,7 +1108,7 @@ QScrollBar *WidgetPainter::scrollBar( const Rectangle& rControlRegion, m_pScrollBar->resize( qRect.size() ); m_pScrollBar->setOrientation( bHorizontal? Qt::Horizontal: Qt::Vertical ); - const ScrollbarValue* pValue = (aValue.getType() == ControlType::Scrollbar) ? static_cast<const ScrollbarValue*>(&aValue) : NULL; + const ScrollbarValue* pValue = (aValue.getType() == ControlType::Scrollbar) ? static_cast<const ScrollbarValue*>(&aValue) : nullptr; if ( pValue ) { m_pScrollBar->setMinValue( pValue->mnMin ); @@ -1123,7 +1123,7 @@ QScrollBar *WidgetPainter::scrollBar( const Rectangle& rControlRegion, QToolBar *WidgetPainter::toolBar( const Rectangle& rControlRegion, bool bHorizontal ) { if ( !m_pMainWindow ) - m_pMainWindow = new QMainWindow( NULL, "main_window" ); + m_pMainWindow = new QMainWindow( nullptr, "main_window" ); QToolBar *pToolBar; if ( bHorizontal ) @@ -1156,7 +1156,7 @@ QToolBar *WidgetPainter::toolBar( const Rectangle& rControlRegion, bool bHorizon QToolButton *WidgetPainter::toolButton( const Rectangle& rControlRegion) { if ( !m_pToolButton ) - m_pToolButton = new QToolButton( NULL, "tool_button" ); + m_pToolButton = new QToolButton( nullptr, "tool_button" ); QRect qRect = region2QRect( rControlRegion ); @@ -1170,7 +1170,7 @@ QMenuBar *WidgetPainter::menuBar( const Rectangle& rControlRegion) { if ( !m_pMenuBar ) { - m_pMenuBar = new QMenuBar( NULL, "menu_bar" ); + m_pMenuBar = new QMenuBar( nullptr, "menu_bar" ); m_nMenuBarEnabledItem = m_pMenuBar->insertItem( "" ); m_nMenuBarDisabledItem = m_pMenuBar->insertItem( "" ); @@ -1191,7 +1191,7 @@ QPopupMenu *WidgetPainter::popupMenu( const Rectangle& rControlRegion) { if ( !m_pPopupMenu ) { - m_pPopupMenu = new QPopupMenu( NULL, "popup_menu" ); + m_pPopupMenu = new QPopupMenu( nullptr, "popup_menu" ); m_nPopupMenuEnabledItem = m_pPopupMenu->insertItem( "" ); m_nPopupMenuDisabledItem = m_pPopupMenu->insertItem( "" ); @@ -1211,7 +1211,7 @@ QPopupMenu *WidgetPainter::popupMenu( const Rectangle& rControlRegion) QProgressBar *WidgetPainter::progressBar( const Rectangle& rControlRegion ) { if ( !m_pProgressBar ) - m_pProgressBar = new QProgressBar( NULL, "progress_bar" ); + m_pProgressBar = new QProgressBar( nullptr, "progress_bar" ); QRect qRect = region2QRect( rControlRegion ); @@ -1237,7 +1237,7 @@ class KDESalGraphics : public X11SalGraphics { public: KDESalGraphics() {} - virtual ~KDESalGraphics() {} + virtual ~KDESalGraphics() override {} virtual bool IsNativeControlSupported( ControlType nType, ControlPart nPart ) override; virtual bool hitTestNativeControl( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion, const Point& aPos, @@ -1537,7 +1537,7 @@ bool KDESalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPar QRect qBoundingRect = WidgetPainter::region2QRect( rControlRegion ); QRect qRect; - QWidget *pWidget = NULL; + QWidget *pWidget = nullptr; switch ( nType ) { // Metrics of the push button @@ -2058,7 +2058,7 @@ SalGraphics* KDESalFrame::AcquireGraphics() } } - return NULL; + return nullptr; } void KDESalFrame::ReleaseGraphics( SalGraphics *pGraphics ) @@ -2123,10 +2123,10 @@ void KDEData::initNWF() void KDEData::deInitNWF() { delete pWidgetPainter; - pWidgetPainter = NULL; + pWidgetPainter = nullptr; // We have to destroy the style early - QApplication::setStyle( NULL ); + QApplication::setStyle( nullptr ); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |