diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-09-26 13:54:49 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-09-28 13:46:14 +0200 |
commit | 616d47dbbea2ee39e1936e987b26a0d2095f0906 (patch) | |
tree | 1e88d50936ff65ffc769793dd16c97356c249bdb | |
parent | f453d2b0c7f27211d9c9061aa5c522cda37e37c6 (diff) |
loplugin:virtualdead in basctl
Change-Id: I6a3f74a3c52f3fb97b26de69b20ffd7502968d5e
Reviewed-on: https://gerrit.libreoffice.org/79646
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r-- | basctl/source/basicide/baside2.cxx | 5 | ||||
-rw-r--r-- | basctl/source/basicide/baside2.hxx | 1 | ||||
-rw-r--r-- | basctl/source/basicide/basides1.cxx | 14 | ||||
-rw-r--r-- | basctl/source/basicide/basidesh.cxx | 20 | ||||
-rw-r--r-- | basctl/source/basicide/bastypes.cxx | 5 | ||||
-rw-r--r-- | basctl/source/inc/bastypes.hxx | 1 | ||||
-rw-r--r-- | compilerplugins/clang/virtualdead.results | 3 |
7 files changed, 2 insertions, 47 deletions
diff --git a/basctl/source/basicide/baside2.cxx b/basctl/source/basicide/baside2.cxx index 335a51f1d918..7e0dc2b0288d 100644 --- a/basctl/source/basicide/baside2.cxx +++ b/basctl/source/basicide/baside2.cxx @@ -759,11 +759,6 @@ void ModulWindow::StoreData() GetEditorWindow().SetSourceInBasic(); } -bool ModulWindow::CanClose() -{ - return true; -} - bool ModulWindow::AllowUndo() { return GetEditorWindow().CanModify(); diff --git a/basctl/source/basicide/baside2.hxx b/basctl/source/basicide/baside2.hxx index d46dc4c966c0..81401763c9ae 100644 --- a/basctl/source/basicide/baside2.hxx +++ b/basctl/source/basicide/baside2.hxx @@ -323,7 +323,6 @@ public: virtual void GetState( SfxItemSet& ) override; virtual void StoreData() override; virtual void UpdateData() override; - virtual bool CanClose() override; // return number of pages to be printed virtual sal_Int32 countPages( Printer* pPrinter ) override; // print page diff --git a/basctl/source/basicide/basides1.cxx b/basctl/source/basicide/basides1.cxx index 9a6c1d91cbc0..2486543d1635 100644 --- a/basctl/source/basicide/basides1.cxx +++ b/basctl/source/basicide/basides1.cxx @@ -1380,20 +1380,6 @@ void Shell::Deactivate( bool bMDI ) if( pXDlgWin->IsModified() ) MarkDocumentModified( pXDlgWin->GetDocument() ); } - - // test CanClose to also test during deactivating the BasicIDE whether - // the sourcecode is too large in one of the modules... - for (auto const& window : aWindowTable) - { - BaseWindow* pWin = window.second; - if ( /* !pWin->IsSuspended() && */ !pWin->CanClose() ) - { - if ( !m_aCurLibName.isEmpty() && ( pWin->IsDocument( m_aCurDocument ) || pWin->GetLibName() != m_aCurLibName ) ) - SetCurLib( ScriptDocument::getApplicationScriptDocument(), OUString(), false ); - SetCurWindow( pWin, true ); - break; - } - } } } diff --git a/basctl/source/basicide/basidesh.cxx b/basctl/source/basicide/basidesh.cxx index e86a03ef5ac9..01d5f4a1d199 100644 --- a/basctl/source/basicide/basidesh.cxx +++ b/basctl/source/basicide/basidesh.cxx @@ -397,24 +397,8 @@ bool Shell::PrepareClose( bool bUI ) } else { - bool bCanClose = true; - for (auto const& window : aWindowTable) - { - BaseWindow* pWin = window.second; - if ( !pWin->CanClose() ) - { - if ( !m_aCurLibName.isEmpty() && ( pWin->IsDocument( m_aCurDocument ) || pWin->GetLibName() != m_aCurLibName ) ) - SetCurLib( ScriptDocument::getApplicationScriptDocument(), OUString(), false ); - SetCurWindow( pWin, true ); - bCanClose = false; - break; - } - } - - if ( bCanClose ) - StoreAllWindowData( false ); // don't write on the disk, that will be done later automatically - - return bCanClose; + StoreAllWindowData( false ); // don't write on the disk, that will be done later automatically + return true; } } diff --git a/basctl/source/basicide/bastypes.cxx b/basctl/source/basicide/bastypes.cxx index e78fbd7a7a35..5e642673cf8e 100644 --- a/basctl/source/basicide/bastypes.cxx +++ b/basctl/source/basicide/bastypes.cxx @@ -148,11 +148,6 @@ void BaseWindow::StoreData() { } -bool BaseWindow::CanClose() -{ - return true; -} - bool BaseWindow::AllowUndo() { return true; diff --git a/basctl/source/inc/bastypes.hxx b/basctl/source/inc/bastypes.hxx index 6f76e941f0f8..50a9445696cf 100644 --- a/basctl/source/inc/bastypes.hxx +++ b/basctl/source/inc/bastypes.hxx @@ -188,7 +188,6 @@ public: virtual void StoreData(); virtual void UpdateData(); - virtual bool CanClose(); // return number of pages to be printed virtual sal_Int32 countPages( Printer* pPrinter ) = 0; diff --git a/compilerplugins/clang/virtualdead.results b/compilerplugins/clang/virtualdead.results index 740ef0bedbd6..3b6f2193714c 100644 --- a/compilerplugins/clang/virtualdead.results +++ b/compilerplugins/clang/virtualdead.results @@ -1,6 +1,3 @@ -basctl/source/inc/bastypes.hxx:191 - _Bool basctl::BaseWindow::CanClose() - 1 basic/source/comp/codegen.cxx:464 void OffSetAccumulator::start(const unsigned char *,) empty |