diff options
-rw-r--r-- | svtools/source/contnr/svtreebx.cxx | 42 |
1 files changed, 20 insertions, 22 deletions
diff --git a/svtools/source/contnr/svtreebx.cxx b/svtools/source/contnr/svtreebx.cxx index 9f599cbdb22e..bf6e41f93f36 100644 --- a/svtools/source/contnr/svtreebx.cxx +++ b/svtools/source/contnr/svtreebx.cxx @@ -40,6 +40,7 @@ class TabBar; #include <svtools/svlbox.hxx> #include <svtools/svlbitm.hxx> #include <svtools/svtreebx.hxx> +#include <tools/diagnose_ex.h> #include <svimpbox.hxx> #include <unotools/accessiblestatesethelper.hxx> #include <com/sun/star/accessibility/AccessibleStateType.hpp> @@ -427,17 +428,6 @@ SvLBoxEntry* SvTreeListBox::InsertEntry( const XubString& aText,SvLBoxEntry* pPa else SvLBox::Insert( pEntry, pParent, nPos ); - short nExpWidth = (short)rDefExpBmp.GetSizePixel().Width(); - short nColWidth = (short)rDefColBmp.GetSizePixel().Width(); - short nMax = Max(nExpWidth, nColWidth); - // #97680# ---------------- - nMax = pImp->UpdateContextBmpWidthVector( pEntry, nMax ); - if( nMax > nContextBmpWidthMax ) - { - nContextBmpWidthMax = nMax; - SetTabs(); - } - aPrevInsertedExpBmp = rDefExpBmp; aPrevInsertedColBmp = rDefColBmp; @@ -468,17 +458,6 @@ SvLBoxEntry* SvTreeListBox::InsertEntry( const XubString& aText, else SvLBox::Insert( pEntry, pParent, nPos ); - short nExpWidth = (short)aExpEntryBmp.GetSizePixel().Width(); - short nColWidth = (short)aCollEntryBmp.GetSizePixel().Width(); - short nMax = Max(nExpWidth, nColWidth); - // #97680# ---------------- - nMax = pImp->UpdateContextBmpWidthVector( pEntry, nMax ); - if( nMax > nContextBmpWidthMax ) - { - nContextBmpWidthMax = nMax; - SetTabs(); - } - aPrevInsertedExpBmp = aExpEntryBmp; aPrevInsertedColBmp = aCollEntryBmp; @@ -2347,6 +2326,25 @@ void SvTreeListBox::ModelNotification( USHORT nActionId, SvListEntry* pEntry1, SvLBox::ModelNotification( nActionId, pEntry1, pEntry2, nPos ); switch( nActionId ) { + case LISTACTION_INSERTED: + { + SvLBoxEntry* pEntry( dynamic_cast< SvLBoxEntry* >( pEntry1 ) ); + ENSURE_OR_BREAK( pEntry, "SvTreeListBox::ModelNotification: invalid entry!" ); + SvLBoxContextBmp* pBmpItem = static_cast< SvLBoxContextBmp* >( pEntry->GetFirstItem( SV_ITEM_ID_LBOXCONTEXTBMP ) ); + if ( !pBmpItem ) + break; + const Image& rBitmap1( pBmpItem->GetBitmap1() ); + const Image& rBitmap2( pBmpItem->GetBitmap2() ); + short nMaxWidth = short( Max( rBitmap1.GetSizePixel().Width(), rBitmap2.GetSizePixel().Width() ) ); + nMaxWidth = pImp->UpdateContextBmpWidthVector( pEntry, nMaxWidth ); + if( nMaxWidth > nContextBmpWidthMax ) + { + nContextBmpWidthMax = nMaxWidth; + SetTabs(); + } + } + break; + case LISTACTION_RESORTING: SetUpdateMode( FALSE ); break; |