diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-11-22 11:26:08 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-11-22 11:54:12 +0100 |
commit | 1ae61b0ac4187b2938647f3ca0289a070a5dc7d2 (patch) | |
tree | 9461c0532919f4fe61f3e0e3fa8556e954244fbd /svtools/source/contnr/svtabbx.cxx | |
parent | 04bb9549e0a0ee567f3bd48a7707286c5abd631a (diff) |
loplugin:flatten in svtools
almost completely automatically rewritten, only had to tweak
the indentation on a couple of lines.
Change-Id: Ieec92e5b602d180d7ec556e3421ce3c835c1f646
Reviewed-on: https://gerrit.libreoffice.org/45072
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'svtools/source/contnr/svtabbx.cxx')
-rw-r--r-- | svtools/source/contnr/svtabbx.cxx | 82 |
1 files changed, 41 insertions, 41 deletions
diff --git a/svtools/source/contnr/svtabbx.cxx b/svtools/source/contnr/svtabbx.cxx index 53b0a0710e64..e5559a96814e 100644 --- a/svtools/source/contnr/svtabbx.cxx +++ b/svtools/source/contnr/svtabbx.cxx @@ -40,36 +40,36 @@ using namespace ::com::sun::star::accessibility; void SvTabListBox::SetTabs() { SvTreeListBox::SetTabs(); - if( nTabCount ) + if( !nTabCount ) + return; + + DBG_ASSERT(pTabList,"TabList ?"); + + // The tree listbox has now inserted its tabs into the list. Now we + // fluff up the list with additional tabs and adjust the rightmost tab + // of the tree listbox. + + // Picking the rightmost tab. + // HACK for the explorer! If ViewParent != 0, the first tab of the tree + // listbox is calculated by the tre listbox itself! This behavior is + // necessary for ButtonsOnRoot, as the explorer does not know in this + // case, which additional offset it need to add to the tabs in this mode + // -- the tree listbox knows that, though! + /* + if( !pViewParent ) { - DBG_ASSERT(pTabList,"TabList ?"); - - // The tree listbox has now inserted its tabs into the list. Now we - // fluff up the list with additional tabs and adjust the rightmost tab - // of the tree listbox. - - // Picking the rightmost tab. - // HACK for the explorer! If ViewParent != 0, the first tab of the tree - // listbox is calculated by the tre listbox itself! This behavior is - // necessary for ButtonsOnRoot, as the explorer does not know in this - // case, which additional offset it need to add to the tabs in this mode - // -- the tree listbox knows that, though! - /* - if( !pViewParent ) - { - SvLBoxTab* pFirstTab = (SvLBoxTab*)aTabs.GetObject( aTabs.Count()-1 ); - pFirstTab->SetPos( pTabList[0].GetPos() ); - pFirstTab->nFlags &= ~MYTABMASK; - pFirstTab->nFlags |= pTabList[0].nFlags; - } - */ + SvLBoxTab* pFirstTab = (SvLBoxTab*)aTabs.GetObject( aTabs.Count()-1 ); + pFirstTab->SetPos( pTabList[0].GetPos() ); + pFirstTab->nFlags &= ~MYTABMASK; + pFirstTab->nFlags |= pTabList[0].nFlags; + } + */ - // append all other tabs to the list - for( sal_uInt16 nCurTab = 1; nCurTab < nTabCount; nCurTab++ ) - { - SvLBoxTab* pTab = pTabList+nCurTab; - AddTab( pTab->GetPos(), pTab->nFlags ); - } + // append all other tabs to the list + for( sal_uInt16 nCurTab = 1; nCurTab < nTabCount; nCurTab++ ) + { + SvLBoxTab* pTab = pTabList+nCurTab; + AddTab( pTab->GetPos(), pTab->nFlags ); } } @@ -144,19 +144,19 @@ void SvTabListBox::SetTabs(const long* pTabs, MapUnit eMapUnit) void SvTabListBox::SetTab( sal_uInt16 nTab,long nValue,MapUnit eMapUnit ) { DBG_ASSERT(nTab<nTabCount,"Invalid Tab-Pos"); - if( nTab < nTabCount ) - { - DBG_ASSERT(pTabList,"TabList?"); - MapMode aMMSource( eMapUnit ); - MapMode aMMDest( MapUnit::MapPixel ); - Size aSize( nValue, 0 ); - aSize = LogicToLogic( aSize, &aMMSource, &aMMDest ); - nValue = aSize.Width(); - pTabList[ nTab ].SetPos( nValue ); - SvTreeListBox::nTreeFlags |= SvTreeFlags::RECALCTABS; - if( IsUpdateMode() ) - Invalidate(); - } + if( nTab >= nTabCount ) + return; + + DBG_ASSERT(pTabList,"TabList?"); + MapMode aMMSource( eMapUnit ); + MapMode aMMDest( MapUnit::MapPixel ); + Size aSize( nValue, 0 ); + aSize = LogicToLogic( aSize, &aMMSource, &aMMDest ); + nValue = aSize.Width(); + pTabList[ nTab ].SetPos( nValue ); + SvTreeListBox::nTreeFlags |= SvTreeFlags::RECALCTABS; + if( IsUpdateMode() ) + Invalidate(); } SvTreeListEntry* SvTabListBox::InsertEntry( const OUString& rText, SvTreeListEntry* pParent, |