From ca4701fec182d928ab3d39f2183dafecf90e430b Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Mon, 3 Jul 2017 12:55:49 +0200 Subject: loplugin:unusedfields bIsMarked in SvTreeListEntry write-only since GetIsMarked was removed in commit 06ea347b939895d3091ce747c26de58f4d4a766a "loplugin:unusedmethods svtools" which in was unused since introduced by commit b755fb8c0f6b1282f62c12f378c0a5ecac64d490 Author: Steve Yin Date: Mon Nov 25 16:15:58 2013 +0000 Integrate branch of IAccessible2 Change-Id: I1342d4c020e53380f4c52fadcbf36ff520efaad4 Reviewed-on: https://gerrit.libreoffice.org/39470 Tested-by: Jenkins Reviewed-by: Noel Grandin --- include/svtools/treelistentry.hxx | 3 - sc/source/ui/navipi/content.cxx | 21 +---- sd/source/ui/dlg/navigatr.cxx | 4 +- sd/source/ui/dlg/sdtreelb.cxx | 160 +------------------------------- sd/source/ui/inc/sdtreelb.hxx | 2 - svtools/source/contnr/treelistentry.cxx | 2 - sw/source/uibase/utlui/content.cxx | 23 +---- 7 files changed, 8 insertions(+), 207 deletions(-) diff --git a/include/svtools/treelistentry.hxx b/include/svtools/treelistentry.hxx index 8851224fa111..57a7056cdad7 100644 --- a/include/svtools/treelistentry.hxx +++ b/include/svtools/treelistentry.hxx @@ -61,7 +61,6 @@ class SVT_DLLPUBLIC SvTreeListEntry sal_uLong nAbsPos; sal_uLong nListPos; ItemsType m_Items; - bool bIsMarked; void* pUserData; SvTLEntryFlags nEntryFlags; Color maBackColor; @@ -110,8 +109,6 @@ public: SvTLEntryFlags GetFlags() const { return nEntryFlags;} void SetFlags( SvTLEntryFlags nFlags ); - void SetMarked( bool IsMarked ) { bIsMarked = IsMarked; } - void SetBackColor( const Color& aColor ) { maBackColor = aColor; } const Color& GetBackColor() const { return maBackColor; } SvTreeListEntry* GetParent() const { return pParent; } diff --git a/sc/source/ui/navipi/content.cxx b/sc/source/ui/navipi/content.cxx index a05185191a22..28f8d77987be 100644 --- a/sc/source/ui/navipi/content.cxx +++ b/sc/source/ui/navipi/content.cxx @@ -986,26 +986,7 @@ void ScContentTree::GetDrawNames( ScContentId nType ) SvTreeListEntry* pParent = pRootNodes[nType]; if (pParent) { - SvTreeListEntry* pChild=InsertEntry( aName, pParent ); - if(pChild) - pChild->SetMarked(false); - vcl::Window* pWindow=nullptr; - ScTabViewShell* pScTabViewShell=nullptr; - ScDrawView* pScDrawView=nullptr; - ScNavigatorDlg* pScNavigatorDlg=nullptr; - if(pChild) - pWindow=reinterpret_cast(GetParent(pChild)); - if(pWindow) - pScNavigatorDlg = static_cast(pWindow); - if (pScNavigatorDlg!=nullptr) - pScTabViewShell = ScNavigatorDlg::GetTabViewShell(); - if(pScTabViewShell !=nullptr) - pScDrawView =pScTabViewShell->GetViewData().GetScDrawView(); - if(pScDrawView!=nullptr) - { - bool bMarked =pScDrawView->GetObjectIsMarked(pObject); - pChild->SetMarked( bMarked ); - } + InsertEntry( aName, pParent ); }//end if parent else SAL_WARN("sc", "InsertContent without parent"); diff --git a/sd/source/ui/dlg/navigatr.cxx b/sd/source/ui/dlg/navigatr.cxx index d8add42bad15..72fb0312b758 100644 --- a/sd/source/ui/dlg/navigatr.cxx +++ b/sd/source/ui/dlg/navigatr.cxx @@ -146,7 +146,7 @@ void SdNavigatorWin::FreshTree( const SdDrawDocument* pDoc ) void SdNavigatorWin::FreshEntry( ) { - maTlbObjects->FreshCurEntry(); + maTlbObjects->Invalidate(); } void SdNavigatorWin::InitTreeLB( const SdDrawDocument* pDoc ) @@ -333,7 +333,7 @@ IMPL_LINK_NOARG(SdNavigatorWin, ClickObjectHdl, SvTreeListBox*, bool) SID_NAVIGATOR_OBJECT, SfxCallMode::SLOT | SfxCallMode::RECORD, { &aItem }); //set sign variable - maTlbObjects->MarkCurEntry(aStr); + maTlbObjects->Invalidate(); // moved here from SetGetFocusHdl. Reset the // focus only if something has been selected in the diff --git a/sd/source/ui/dlg/sdtreelb.cxx b/sd/source/ui/dlg/sdtreelb.cxx index 147073b4ed02..66365ef451df 100644 --- a/sd/source/ui/dlg/sdtreelb.cxx +++ b/sd/source/ui/dlg/sdtreelb.cxx @@ -289,60 +289,6 @@ OUString SdPageObjsTLB::GetEntryLongDescription( SvTreeListEntry* pEntry ) const return getAltLongDescText( pEntry, false); } -void SdPageObjsTLB::MarkCurEntry( const OUString& rName ) -{ - - if (!rName.isEmpty()) - { - SvTreeListEntry* pCurEntry =GetCurEntry(); - SvTreeListEntry* pEntry =nullptr; - OUString aTmp1; - OUString aTmp2; - - if( GetParent(pCurEntry)==nullptr ) - { - aTmp1 = GetEntryText( pCurEntry ); - for( pEntry = First(); pEntry ; pEntry = Next( pEntry ) ) - { - if(GetParent( pEntry )==nullptr) - continue; - aTmp2 = GetEntryText( GetParent( pEntry )); - if( aTmp1 != aTmp2) - { - // IA2 CWS. MT: Removed in SvTreeListEntry for now - only used in Sw/Sd/ScContentLBoxString, they should decide if they need this - pEntry->SetMarked(false); - } - } - } - else - { - for( pEntry = First(); pEntry ; pEntry = Next( pEntry ) ) - { - aTmp2 = GetEntryText( pEntry ); - if( aTmp2 == rName) - { - pEntry->SetMarked(true); - } - else - { - pEntry->SetMarked(false); - } - } - } - } - Invalidate(); -} - -void SdPageObjsTLB:: FreshCurEntry() -{ - SvTreeListEntry* pEntry =nullptr; - for( pEntry = First(); pEntry ; pEntry = Next( pEntry ) ) - { - pEntry->SetMarked(false); - } - Invalidate(); -} - void SdPageObjsTLB::InitEntry(SvTreeListEntry* pEntry, const OUString& rStr, const Image& rImg1, const Image& rImg2, SvLBoxButtonKind eButtonKind) { @@ -579,28 +525,6 @@ void SdPageObjsTLB::AddShapeList ( !rList.HasObjectNavigationOrder() /* use navigation order, if available */, SdrIterMode::Flat); - bool bMarked=false; - if(bisInSdNavigatorWin) - { - vcl::Window* pWindow=nullptr; - SdNavigatorWin* pSdNavigatorWin=nullptr; - sd::DrawDocShell* pSdDrawDocShell = nullptr; - if(pEntry) - pWindow=reinterpret_cast(GetParent(pEntry)); - if(pWindow) - pSdNavigatorWin = static_cast(pWindow); - if( pSdNavigatorWin ) - pSdDrawDocShell = SdNavigatorWin::GetDrawDocShell(mpDoc); - if(pSdDrawDocShell) - bMarked = pSdDrawDocShell->IsMarked(pShape); - if(pEntry) - { - if(bMarked) - pEntry->SetMarked(true); - else - pEntry->SetMarked(false); - } - } while( aIter.IsMore() ) { SdrObject* pObj = aIter.Next(); @@ -613,7 +537,7 @@ void SdPageObjsTLB::AddShapeList ( { if( pObj->GetObjInventor() == SdrInventor::Default && pObj->GetObjIdentifier() == OBJ_OLE2 ) { - SvTreeListEntry *pNewEntry = InsertEntry( + InsertEntry( aStr, maImgOle, maImgOle, @@ -622,32 +546,10 @@ void SdPageObjsTLB::AddShapeList ( TREELIST_APPEND, pObj ); - - if(bisInSdNavigatorWin) - { - vcl::Window* pWindow=nullptr; - SdNavigatorWin* pSdNavigatorWin=nullptr; - sd::DrawDocShell* pSdDrawDocShell = nullptr; - if(pNewEntry) - pWindow=reinterpret_cast(GetParent(pNewEntry)); - if(pWindow) - pSdNavigatorWin = static_cast(pWindow); - if( pSdNavigatorWin ) - pSdDrawDocShell = SdNavigatorWin::GetDrawDocShell(mpDoc); - if(pSdDrawDocShell) - bMarked = pSdDrawDocShell->IsMarked(pObj); - if(pNewEntry) - { - if(bMarked) - pNewEntry->SetMarked(true); - else - pNewEntry->SetMarked(false); - } - } } else if( pObj->GetObjInventor() == SdrInventor::Default && pObj->GetObjIdentifier() == OBJ_GRAF ) { - SvTreeListEntry *pNewEntry = InsertEntry( + InsertEntry( aStr, maImgGraphic, maImgGraphic, @@ -656,32 +558,6 @@ void SdPageObjsTLB::AddShapeList ( TREELIST_APPEND, pObj ); - - if(bisInSdNavigatorWin) - { - vcl::Window* pWindow=nullptr; - SdNavigatorWin* pSdNavigatorWin=nullptr; - sd::DrawDocShell* pSdDrawDocShell = nullptr; - if(pNewEntry) - pWindow=reinterpret_cast(GetParent(pNewEntry)); - if(pWindow) - pSdNavigatorWin = static_cast(pWindow); - if( pSdNavigatorWin ) - pSdDrawDocShell = SdNavigatorWin::GetDrawDocShell(mpDoc); - if(pSdDrawDocShell) - bMarked = pSdDrawDocShell->IsMarked(pObj); - if(pNewEntry) - { - if(bMarked) - { - pNewEntry->SetMarked(true); - } - else - { - pNewEntry->SetMarked(false); - } - } - } } else if (pObj->IsGroupObject()) { @@ -696,7 +572,7 @@ void SdPageObjsTLB::AddShapeList ( } else { - SvTreeListEntry *pNewEntry = InsertEntry( + InsertEntry( aStr, rIconProvider.maImgObjects, rIconProvider.maImgObjects, @@ -705,32 +581,6 @@ void SdPageObjsTLB::AddShapeList ( TREELIST_APPEND, pObj ); - - if(bisInSdNavigatorWin) - { - vcl::Window* pWindow=nullptr; - SdNavigatorWin* pSdNavigatorWin=nullptr; - sd::DrawDocShell* pSdDrawDocShell = nullptr; - if(pNewEntry) - pWindow=reinterpret_cast(GetParent(pNewEntry)); - if(pWindow) - pSdNavigatorWin = static_cast(pWindow); - if( pSdNavigatorWin ) - pSdDrawDocShell = SdNavigatorWin::GetDrawDocShell(mpDoc); - if(pSdDrawDocShell) - bMarked = pSdDrawDocShell->IsMarked(pObj); - if(pNewEntry) - { - if(bMarked) - { - pNewEntry->SetMarked(true); - } - else - { - pNewEntry->SetMarked(false); - } - } - } } } } @@ -1076,7 +926,6 @@ void SdPageObjsTLB::KeyInput( const KeyEvent& rKEvt ) { if(bisInSdNavigatorWin) { - bool bMarked=false; SvTreeListEntry* pNewEntry = GetCurEntry(); if (!pNewEntry) return; @@ -1088,9 +937,8 @@ void SdPageObjsTLB::KeyInput( const KeyEvent& rKEvt ) if (pSdDrawDocShell) { pSdDrawDocShell->GetObjectIsmarked(aStr, true); - bMarked = pSdDrawDocShell->GetObjectIsmarked(aStr, false); + pSdDrawDocShell->GetObjectIsmarked(aStr, false); } - pNewEntry->SetMarked(bMarked); Invalidate(); } } diff --git a/sd/source/ui/inc/sdtreelb.hxx b/sd/source/ui/inc/sdtreelb.hxx index 8541ace2557b..bf7e59b7581c 100644 --- a/sd/source/ui/inc/sdtreelb.hxx +++ b/sd/source/ui/inc/sdtreelb.hxx @@ -209,9 +209,7 @@ public: OUString GetSelectEntry(); //Mark Current Entry - void MarkCurEntry( const OUString& rName ); void SetSdNavigatorWinFlag(bool isInSdNavigatorWin){bisInSdNavigatorWin =isInSdNavigatorWin;}; - void FreshCurEntry(); void Clear(); void SetSaveTreeItemStateFlag(bool bState){mbSaveTreeItemState = bState;} diff --git a/svtools/source/contnr/treelistentry.cxx b/svtools/source/contnr/treelistentry.cxx index 3e71eceac0f2..72436e9f5fa6 100644 --- a/svtools/source/contnr/treelistentry.cxx +++ b/svtools/source/contnr/treelistentry.cxx @@ -54,7 +54,6 @@ SvTreeListEntry::SvTreeListEntry() : pParent(nullptr) , nAbsPos(0) , nListPos(0) - , bIsMarked(false) , pUserData(nullptr) , nEntryFlags(SvTLEntryFlags::NONE) , maBackColor(Application::GetSettings().GetStyleSettings().GetWindowColor()) @@ -65,7 +64,6 @@ SvTreeListEntry::SvTreeListEntry(const SvTreeListEntry& r) : pParent(nullptr) , nAbsPos(r.nAbsPos) , nListPos(r.nListPos & 0x7FFFFFFF) - , bIsMarked(r.bIsMarked) , pUserData(r.pUserData) , nEntryFlags(r.nEntryFlags) , maBackColor(Application::GetSettings().GetStyleSettings().GetWindowColor()) diff --git a/sw/source/uibase/utlui/content.cxx b/sw/source/uibase/utlui/content.cxx index 6a6d5c96c894..4be4e226be6d 100644 --- a/sw/source/uibase/utlui/content.cxx +++ b/sw/source/uibase/utlui/content.cxx @@ -1337,34 +1337,13 @@ void SwContentTree::RequestingChildren( SvTreeListEntry* pParent ) { for(size_t i = 0; i < nCount; ++i) { - SvTreeListEntry* pChild = nullptr; const SwContent* pCnt = pCntType->GetMember(i); if (pCnt) { OUString sEntry = pCnt->GetName(); if (sEntry.isEmpty()) sEntry = m_sSpace; - pChild = InsertEntry(sEntry, pParent, false, TREELIST_APPEND, const_cast(pCnt)); - } - if (pChild) - { - //If object is marked , the corresponding entry is set true, - //else the corresponding entry is set false . - pChild->SetMarked(false); - SdrObject * pObj = GetDrawingObjectsByContent(pCnt); - if(pObj) - { - SdrView* pDrawView = m_pActiveShell->GetDrawView(); - SdrPageView* pPV = pDrawView->/*GetPageViewPvNum*/GetSdrPageView(/*0*/); - if( pPV ) - { - bool Marked = pDrawView->IsObjMarked(pObj); - if(Marked) - { - pChild->SetMarked(true); - } - } - } + InsertEntry(sEntry, pParent, false, TREELIST_APPEND, const_cast(pCnt)); } } } -- cgit