[Libreoffice-commits] .: 2 commits - basctl/source cui/source dbaccess/source sc/source sd/source svtools/inc svtools/source svx/inc svx/source svx/workben sw/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Thu Nov 29 13:34:01 PST 2012


 basctl/source/basicide/moduldl2.cxx             |    7 +--
 cui/source/customize/acccfg.cxx                 |    4 -
 cui/source/customize/cfg.cxx                    |    8 +--
 cui/source/customize/macropg.cxx                |   14 +++---
 cui/source/dialogs/thesdlg.cxx                  |    5 --
 cui/source/dialogs/thesdlg_impl.hxx             |    3 -
 cui/source/options/optHeaderTabListbox.cxx      |    6 +-
 cui/source/options/optlingu.cxx                 |   18 ++++----
 cui/source/tabpages/autocdlg.cxx                |   10 ++--
 dbaccess/source/ui/control/listviewitems.cxx    |    6 +-
 dbaccess/source/ui/inc/listviewitems.hxx        |    3 -
 dbaccess/source/ui/misc/WNameMatch.cxx          |    4 -
 sc/source/ui/inc/xmlsourcedlg.hxx               |    3 +
 sc/source/ui/miscdlgs/solveroptions.cxx         |    4 -
 sc/source/ui/optdlg/calcoptionsdlg.cxx          |    4 -
 sc/source/ui/xmlsource/xmlsourcedlg.cxx         |   50 ++++++++++++++++++++++++
 sd/source/ui/animations/CustomAnimationList.cxx |   14 ++++--
 svtools/inc/svtools/svlbitm.hxx                 |   14 ++++--
 svtools/inc/svtools/treelistbox.hxx             |    9 +---
 svtools/source/contnr/svimpbox.cxx              |   48 +++++++++++++++++++++++
 svtools/source/contnr/svlbitm.cxx               |   30 ++++++++------
 svtools/source/contnr/treelistbox.cxx           |   10 ++--
 svtools/source/uno/treecontrolpeer.cxx          |   10 ++--
 svx/inc/svx/ctredlin.hxx                        |    4 +
 svx/inc/svx/fontlb.hxx                          |    7 ---
 svx/source/dialog/ctredlin.cxx                  |    9 ++--
 svx/source/dialog/docrecovery.cxx               |    6 --
 svx/source/dialog/fontlb.cxx                    |    7 +--
 svx/source/form/filtnav.cxx                     |   10 ++--
 svx/source/inc/docrecovery.hxx                  |   30 +++++---------
 svx/workben/msview/msview.cxx                   |    5 +-
 sw/source/ui/inc/conttree.hxx                   |    5 +-
 sw/source/ui/inc/swcont.hxx                     |    2 
 sw/source/ui/utlui/content.cxx                  |   22 +++++-----
 sw/source/ui/utlui/glbltree.cxx                 |    7 +--
 35 files changed, 262 insertions(+), 136 deletions(-)

New commits:
commit 251dab0145e15a372ff0fe41ce9647e9df8e9ffd
Author: Kohei Yoshida <kohei.yoshida at gmail.com>
Date:   Thu Nov 29 14:17:48 2012 -0500

    Pass pointer to view data entry to Paint() instead of its raw flag value.
    
    We need to hide these flags away.
    
    Change-Id: I112003a88a92174f5012b3356ba261a039eeccc1

diff --git a/basctl/source/basicide/moduldl2.cxx b/basctl/source/basicide/moduldl2.cxx
index 1fefb92..3245042 100644
--- a/basctl/source/basicide/moduldl2.cxx
+++ b/basctl/source/basicide/moduldl2.cxx
@@ -122,12 +122,12 @@ public:
     LibLBoxString( SvTreeListEntry* pEntry, sal_uInt16 nFlags, const String& rTxt ) :
         SvLBoxString( pEntry, nFlags, rTxt ) {}
 
-    virtual void Paint( const Point& rPos, SvTreeListBox& rDev, sal_uInt16 nFlags, SvTreeListEntry* pEntry );
+    virtual void Paint(const Point& rPos, SvTreeListBox& rDev, const SvViewDataEntry* pView, const SvTreeListEntry* pEntry);
 };
 
 //----------------------------------------------------------------------------
 
-void LibLBoxString::Paint( const Point& rPos, SvTreeListBox& rDev, sal_uInt16, SvTreeListEntry* pEntry )
+void LibLBoxString::Paint(const Point& rPos, SvTreeListBox& rDev, const SvViewDataEntry* /*pView*/, const SvTreeListEntry* pEntry)
 {
     // Change text color if library is read only:
     bool bReadOnly = false;
@@ -137,8 +137,7 @@ void LibLBoxString::Paint( const Point& rPos, SvTreeListBox& rDev, sal_uInt16, S
             static_cast<LibUserData*>(pEntry->GetUserData())->
             GetDocument() );
 
-        OUString aLibName(
-            static_cast< SvLBoxString * >(pEntry->GetItem(1))->GetText());
+        OUString aLibName = static_cast<const SvLBoxString*>(pEntry->GetItem(1))->GetText();
         Reference< script::XLibraryContainer2 > xModLibContainer(
             aDocument.getLibraryContainer( E_SCRIPTS ), UNO_QUERY);
         Reference< script::XLibraryContainer2 > xDlgLibContainer(
diff --git a/cui/source/customize/acccfg.cxx b/cui/source/customize/acccfg.cxx
index d0cc24a..78b9e73 100644
--- a/cui/source/customize/acccfg.cxx
+++ b/cui/source/customize/acccfg.cxx
@@ -630,7 +630,7 @@ class SfxAccCfgLBoxString_Impl : public SvLBoxString
     virtual ~SfxAccCfgLBoxString_Impl();
 
     virtual void Paint(
-        const Point& aPos, SvTreeListBox& rDevice, sal_uInt16 nFlags, SvTreeListEntry* pEntry);
+        const Point& aPos, SvTreeListBox& rDevice, const SvViewDataEntry* pView, const SvTreeListEntry* pEntry);
 };
 
 //-----------------------------------------------
@@ -647,7 +647,7 @@ SfxAccCfgLBoxString_Impl::~SfxAccCfgLBoxString_Impl()
 }
 
 void SfxAccCfgLBoxString_Impl::Paint(
-    const Point& aPos, SvTreeListBox& rDevice, sal_uInt16 /*nFlags*/, SvTreeListEntry* pEntry)
+    const Point& aPos, SvTreeListBox& rDevice, const SvViewDataEntry* /*pView*/, const SvTreeListEntry* pEntry)
 {
     if (!pEntry)
         return;
diff --git a/cui/source/customize/cfg.cxx b/cui/source/customize/cfg.cxx
index d657db0..72e9097 100644
--- a/cui/source/customize/cfg.cxx
+++ b/cui/source/customize/cfg.cxx
@@ -1360,10 +1360,10 @@ public:
 
     ~PopupPainter() { }
 
-    void Paint( const Point& rPos, SvTreeListBox& rOutDev,
-        sal_uInt16 nViewDataEntryFlags, SvTreeListEntry* pEntry )
+    virtual void Paint( const Point& rPos, SvTreeListBox& rOutDev,
+        const SvViewDataEntry* pView, const SvTreeListEntry* pEntry)
     {
-        SvLBoxString::Paint( rPos, rOutDev, nViewDataEntryFlags, pEntry );
+        SvLBoxString::Paint(rPos, rOutDev, pView, pEntry);
 
         Color aOldFillColor = rOutDev.GetFillColor();
 
@@ -1376,7 +1376,7 @@ public:
             nX -= pVScroll->GetSizePixel().Width();
         }
 
-        SvViewDataItem* pItem = rOutDev.GetViewDataItem( pEntry, this );
+        const SvViewDataItem* pItem = rOutDev.GetViewDataItem( pEntry, this );
         nX -= pItem->maSize.Height();
 
         long nSize = pItem->maSize.Height() / 2;
diff --git a/cui/source/customize/macropg.cxx b/cui/source/customize/macropg.cxx
index 376d751..691c4e7 100644
--- a/cui/source/customize/macropg.cxx
+++ b/cui/source/customize/macropg.cxx
@@ -433,10 +433,11 @@ class IconLBoxString : public SvLBoxString
     Image* m_pComponentImg;
     int m_nxImageOffset;
 
-    public:
-        IconLBoxString( SvTreeListEntry* pEntry, sal_uInt16 nFlags, const String& sText,
-            Image* pMacroImg, Image* pComponentImg );
-        virtual void Paint(const Point& aPos, SvTreeListBox& aDevice, sal_uInt16 nFlags, SvTreeListEntry* pEntry );
+public:
+    IconLBoxString( SvTreeListEntry* pEntry, sal_uInt16 nFlags, const String& sText,
+        Image* pMacroImg, Image* pComponentImg );
+    virtual void Paint(
+        const Point& rPos, SvTreeListBox& rOutDev, const SvViewDataEntry* pView, const SvTreeListEntry* pEntry);
 };
 
 
@@ -450,8 +451,9 @@ IconLBoxString::IconLBoxString( SvTreeListEntry* pEntry, sal_uInt16 nFlags, cons
 }
 
 //===============================================
-void IconLBoxString::Paint( const Point& aPos, SvTreeListBox& aDevice,
-                               sal_uInt16 /*nFlags*/, SvTreeListEntry* /*pEntry*/ )
+void IconLBoxString::Paint(
+    const Point& aPos, SvTreeListBox& aDevice, const SvViewDataEntry* /*pView*/,
+    const SvTreeListEntry* /*pEntry*/)
 {
     String aTxt( GetText() );
     if( aTxt.Len() )
diff --git a/cui/source/dialogs/thesdlg.cxx b/cui/source/dialogs/thesdlg.cxx
index b222b19..c0ec800 100644
--- a/cui/source/dialogs/thesdlg.cxx
+++ b/cui/source/dialogs/thesdlg.cxx
@@ -139,9 +139,8 @@ AlternativesString::AlternativesString(
 }
 
 void AlternativesString::Paint(
-    const Point& rPos,
-    SvTreeListBox& rDev, sal_uInt16,
-    SvTreeListEntry* pEntry )
+    const Point& rPos, SvTreeListBox& rDev, const SvViewDataEntry* /*pView*/,
+    const SvTreeListEntry* pEntry)
 {
     AlternativesExtraData* pData = m_rControlImpl.GetExtraData( pEntry );
     Point aPos( rPos );
diff --git a/cui/source/dialogs/thesdlg_impl.hxx b/cui/source/dialogs/thesdlg_impl.hxx
index 1349ab3..e0dbad9 100644
--- a/cui/source/dialogs/thesdlg_impl.hxx
+++ b/cui/source/dialogs/thesdlg_impl.hxx
@@ -56,7 +56,8 @@ public:
     AlternativesString( ThesaurusAlternativesCtrl &rControl,
         SvTreeListEntry* pEntry, sal_uInt16 nFlags, const String& rStr );
 
-    virtual void Paint( const Point& rPos, SvTreeListBox& rDev, sal_uInt16 nFlags, SvTreeListEntry* pEntry);
+    virtual void Paint(
+        const Point& rPos, SvTreeListBox& rOutDev, const SvViewDataEntry* pView, const SvTreeListEntry* pEntry);
 };
 
 #endif
diff --git a/cui/source/options/optHeaderTabListbox.cxx b/cui/source/options/optHeaderTabListbox.cxx
index 93909bf..7a63518 100644
--- a/cui/source/options/optHeaderTabListbox.cxx
+++ b/cui/source/options/optHeaderTabListbox.cxx
@@ -33,12 +33,14 @@ public:
     OptLBoxString_Impl( SvTreeListEntry* pEntry, sal_uInt16 nFlags, const String& rTxt ) :
         SvLBoxString( pEntry, nFlags, rTxt ) {}
 
-    virtual void Paint( const Point& rPos, SvTreeListBox& rDev, sal_uInt16 nFlags, SvTreeListEntry* pEntry );
+    virtual void Paint(
+        const Point& rPos, SvTreeListBox& rDev, const SvViewDataEntry* pView, const SvTreeListEntry* pEntry);
 };
 
 // -----------------------------------------------------------------------
 
-void OptLBoxString_Impl::Paint( const Point& rPos, SvTreeListBox& rDev, sal_uInt16, SvTreeListEntry* pEntry )
+void OptLBoxString_Impl::Paint(
+    const Point& rPos, SvTreeListBox& rDev, const SvViewDataEntry* /*pView*/, const SvTreeListEntry* pEntry)
 {
     Font aOldFont( rDev.GetFont() );
     Font aFont( aOldFont );
diff --git a/cui/source/options/optlingu.cxx b/cui/source/options/optlingu.cxx
index 542d7eb..ae328c0 100644
--- a/cui/source/options/optlingu.cxx
+++ b/cui/source/options/optlingu.cxx
@@ -286,12 +286,13 @@ public:
     BrwStringDic_Impl( SvTreeListEntry* pEntry, sal_uInt16 nFlags,
         const String& rStr ) : SvLBoxString( pEntry, nFlags, rStr ) {}
 
-    virtual void Paint( const Point& rPos, SvTreeListBox& rDev, sal_uInt16 nFlags,
-                                            SvTreeListEntry* pEntry);
+    virtual void Paint(
+        const Point& rPos, SvTreeListBox& rOutDev, const SvViewDataEntry* pView, const SvTreeListEntry* pEntry);
 };
 
-void BrwStringDic_Impl::Paint( const Point& rPos, SvTreeListBox& rDev, sal_uInt16,
-    SvTreeListEntry* pEntry )
+void BrwStringDic_Impl::Paint(
+    const Point& rPos, SvTreeListBox& rDev, const SvViewDataEntry* /*pView*/,
+    const SvTreeListEntry* pEntry)
 {
     ModuleUserData_Impl* pData = (ModuleUserData_Impl*)pEntry->GetUserData();
     Point aPos(rPos);
@@ -451,12 +452,13 @@ public:
     BrwString_Impl( SvTreeListEntry* pEntry, sal_uInt16 nFlags,
         const String& rStr ) : SvLBoxString( pEntry, nFlags, rStr ) {}
 
-    virtual void Paint( const Point& rPos, SvTreeListBox& rDev, sal_uInt16 nFlags,
-                                            SvTreeListEntry* pEntry);
+    virtual void Paint(
+        const Point& rPos, SvTreeListBox& rOutDev, const SvViewDataEntry* pView, const SvTreeListEntry* pEntry);
 };
 
-void BrwString_Impl::Paint( const Point& rPos, SvTreeListBox& rDev, sal_uInt16,
-    SvTreeListEntry* pEntry )
+void BrwString_Impl::Paint(
+    const Point& rPos, SvTreeListBox& rDev, const SvViewDataEntry* /*pView*/,
+    const SvTreeListEntry* pEntry)
 {
     Point aPos(rPos);
     aPos.X() += 20;
diff --git a/cui/source/tabpages/autocdlg.cxx b/cui/source/tabpages/autocdlg.cxx
index 4837358..024bcf8 100644
--- a/cui/source/tabpages/autocdlg.cxx
+++ b/cui/source/tabpages/autocdlg.cxx
@@ -333,12 +333,14 @@ public:
     OfaImpBrwString( SvTreeListEntry* pEntry, sal_uInt16 nFlags,
         const String& rStr ) : SvLBoxString(pEntry,nFlags,rStr){}
 
-    virtual void Paint( const Point& rPos, SvTreeListBox& rDev, sal_uInt16 nFlags,
-                                            SvTreeListEntry* pEntry);
+    virtual void Paint(
+        const Point& rPos, SvTreeListBox& rDev, const SvViewDataEntry* pView,
+        const SvTreeListEntry* pEntry);
 };
 
-void OfaImpBrwString::Paint( const Point& rPos, SvTreeListBox& rDev, sal_uInt16 /*nFlags*/,
-    SvTreeListEntry* pEntry )
+void OfaImpBrwString::Paint(
+    const Point& rPos, SvTreeListBox& rDev, const SvViewDataEntry* /*pView*/,
+    const SvTreeListEntry* pEntry)
 {
     rDev.DrawText( rPos, GetText() );
     if(pEntry->GetUserData())
diff --git a/dbaccess/source/ui/control/listviewitems.cxx b/dbaccess/source/ui/control/listviewitems.cxx
index 81d4ea0..7b8c8a0 100644
--- a/dbaccess/source/ui/control/listviewitems.cxx
+++ b/dbaccess/source/ui/control/listviewitems.cxx
@@ -48,7 +48,9 @@ namespace dbaui
         return SV_ITEM_ID_BOLDLBSTRING;
     }
 
-    void OBoldListboxString::Paint(const Point& rPos, SvTreeListBox& rDev, sal_uInt16 nFlags, SvTreeListEntry* pEntry )
+    void OBoldListboxString::Paint(
+        const Point& rPos, SvTreeListBox& rDev, const SvViewDataEntry* pView,
+        const SvTreeListEntry* pEntry)
     {
         if (m_bEmphasized)
         {
@@ -61,7 +63,7 @@ namespace dbaui
             rDev.Pop();
         }
         else
-            SvLBoxString::Paint(rPos, rDev, nFlags, pEntry);
+            SvLBoxString::Paint(rPos, rDev, pView, pEntry);
     }
 
 //........................................................................
diff --git a/dbaccess/source/ui/inc/listviewitems.hxx b/dbaccess/source/ui/inc/listviewitems.hxx
index e14b421..2dc6dd1 100644
--- a/dbaccess/source/ui/inc/listviewitems.hxx
+++ b/dbaccess/source/ui/inc/listviewitems.hxx
@@ -45,7 +45,8 @@ namespace dbaui
 
         virtual sal_uInt16 GetType() const;
 
-        virtual void Paint(const Point& rPos, SvTreeListBox& rDev, sal_uInt16 nFlags, SvTreeListEntry* pEntry);
+        virtual void Paint(
+            const Point& rPos, SvTreeListBox& rOutDev, const SvViewDataEntry* pView, const SvTreeListEntry* pEntry);
         virtual void InitViewData( SvTreeListBox* pView,SvTreeListEntry* pEntry, SvViewDataItem* _pViewData);
 
         sal_Bool    isEmphasized() const { return m_bEmphasized; }
diff --git a/dbaccess/source/ui/misc/WNameMatch.cxx b/dbaccess/source/ui/misc/WNameMatch.cxx
index b639371..f56bd6a 100644
--- a/dbaccess/source/ui/misc/WNameMatch.cxx
+++ b/dbaccess/source/ui/misc/WNameMatch.cxx
@@ -336,10 +336,10 @@ public:
     {
     }
 
-    virtual void Paint(const Point& rPos, SvTreeListBox& rDev, sal_uInt16 nFlags, SvTreeListEntry* pEntry);
+    virtual void Paint(const Point& rPos, SvTreeListBox& rDev, const SvViewDataEntry* pView, const SvTreeListEntry* pEntry);
 };
 //------------------------------------------------------------------------
-void OColumnString::Paint(const Point& rPos, SvTreeListBox& rDev, sal_uInt16 /*nFlags*/, SvTreeListEntry* /*pEntry*/ )
+void OColumnString::Paint(const Point& rPos, SvTreeListBox& rDev, const SvViewDataEntry* /*pView*/, const SvTreeListEntry* /*pEntry*/)
 {
     if(m_bReadOnly)
     {
diff --git a/sc/source/ui/miscdlgs/solveroptions.cxx b/sc/source/ui/miscdlgs/solveroptions.cxx
index 2539645..3665c47 100644
--- a/sc/source/ui/miscdlgs/solveroptions.cxx
+++ b/sc/source/ui/miscdlgs/solveroptions.cxx
@@ -86,10 +86,10 @@ public:
     void      SetDoubleValue( double fNew ) { mbIsDouble = true; mfDoubleValue = fNew; }
     void      SetIntValue( sal_Int32 nNew ) { mbIsDouble = false; mnIntValue = nNew; }
 
-    virtual void Paint( const Point& rPos, SvTreeListBox& rDev, sal_uInt16 nFlags, SvTreeListEntry* pEntry );
+    virtual void Paint(const Point& rPos, SvTreeListBox& rDev, const SvViewDataEntry* pView, const SvTreeListEntry* pEntry);
 };
 
-void ScSolverOptionsString::Paint( const Point& rPos, SvTreeListBox& rDev, sal_uInt16, SvTreeListEntry* /* pEntry */ )
+void ScSolverOptionsString::Paint( const Point& rPos, SvTreeListBox& rDev, const SvViewDataEntry* /*pView*/, const SvTreeListEntry* /*pEntry*/)
 {
     //! move position? (SvxLinguTabPage: aPos.X() += 20)
     String aNormalStr( GetText() );
diff --git a/sc/source/ui/optdlg/calcoptionsdlg.cxx b/sc/source/ui/optdlg/calcoptionsdlg.cxx
index 91a4440..250063c 100644
--- a/sc/source/ui/optdlg/calcoptionsdlg.cxx
+++ b/sc/source/ui/optdlg/calcoptionsdlg.cxx
@@ -43,10 +43,10 @@ public:
     OptionString(const rtl::OUString& rDesc, const rtl::OUString& rValue) :
         maDesc(rDesc), maValue(rValue) {}
 
-    virtual void Paint(const Point& rPos, SvTreeListBox& rDev, sal_uInt16 nFlags, SvTreeListEntry* pEntry);
+    virtual void Paint(const Point& rPos, SvTreeListBox& rDev, const SvViewDataEntry* pView, const SvTreeListEntry* pEntry);
 };
 
-void OptionString::Paint(const Point& rPos, SvTreeListBox& rDev, sal_uInt16 /*nFlags*/, SvTreeListEntry* /*pEntry*/)
+void OptionString::Paint(const Point& rPos, SvTreeListBox& rDev, const SvViewDataEntry* /*pView*/, const SvTreeListEntry* /*pEntry*/)
 {
     Point aPos = rPos;
     rtl::OUString aDesc = maDesc + rtl::OUString(": ");
diff --git a/sc/source/ui/xmlsource/xmlsourcedlg.cxx b/sc/source/ui/xmlsource/xmlsourcedlg.cxx
index 013ad69..1d6bdab 100644
--- a/sc/source/ui/xmlsource/xmlsourcedlg.cxx
+++ b/sc/source/ui/xmlsource/xmlsourcedlg.cxx
@@ -264,6 +264,7 @@ public:
 
 void ScXMLSourceDlg::TreeItemSelected()
 {
+    fprintf(stdout, "ScXMLSourceDlg::TreeItemSelected:   called\n");
     SvTreeListEntry* pEntry = maLbTree.GetCurEntry();
     if (!pEntry)
         return;
diff --git a/sd/source/ui/animations/CustomAnimationList.cxx b/sd/source/ui/animations/CustomAnimationList.cxx
index 62ec3b5..f1d4c78 100644
--- a/sd/source/ui/animations/CustomAnimationList.cxx
+++ b/sd/source/ui/animations/CustomAnimationList.cxx
@@ -205,10 +205,11 @@ public:
                     CustomAnimationListEntryItem( SvTreeListEntry*,sal_uInt16 nFlags, OUString aDescription, CustomAnimationEffectPtr pEffect, CustomAnimationList* pParent  );
     virtual         ~CustomAnimationListEntryItem();
     void            InitViewData( SvTreeListBox*,SvTreeListEntry*,SvViewDataItem* );
-    void            Paint( const Point&, SvTreeListBox& rDev, sal_uInt16 nFlags,SvTreeListEntry* );
     SvLBoxItem*     Create() const;
     void            Clone( SvLBoxItem* pSource );
 
+    virtual void Paint(
+        const Point&, SvTreeListBox& rDev, const SvViewDataEntry* pView,const SvTreeListEntry* pEntry);
 private:
     CustomAnimationList* mpParent;
     OUString        maDescription;
@@ -246,10 +247,11 @@ void CustomAnimationListEntryItem::InitViewData( SvTreeListBox* pView, SvTreeLis
 
 // --------------------------------------------------------------------
 
-void CustomAnimationListEntryItem::Paint( const Point& rPos, SvTreeListBox& rDev, sal_uInt16, SvTreeListEntry* pEntry )
+void CustomAnimationListEntryItem::Paint(
+    const Point& rPos, SvTreeListBox& rDev, const SvViewDataEntry* /*pView*/, const SvTreeListEntry* pEntry)
 {
 
-    SvViewDataItem* pViewData = mpParent->GetViewDataItem( pEntry, this );
+    const SvViewDataItem* pViewData = mpParent->GetViewDataItem( pEntry, this );
 
     Point aPos( rPos );
     Size aSize( pViewData->maSize );
@@ -356,9 +358,10 @@ public:
     virtual         ~CustomAnimationTriggerEntryItem();
     virtual sal_uInt16  IsA();
     void            InitViewData( SvTreeListBox*,SvTreeListEntry*,SvViewDataItem* );
-    void            Paint( const Point&, SvTreeListBox& rDev, sal_uInt16 nFlags,SvTreeListEntry* );
     SvLBoxItem*     Create() const;
     void            Clone( SvLBoxItem* pSource );
+    virtual void Paint(
+        const Point& rPos, SvTreeListBox& rOutDev, const SvViewDataEntry* pView, const SvTreeListEntry* pEntry);
 
 private:
     OUString        maDescription;
@@ -399,7 +402,8 @@ void CustomAnimationTriggerEntryItem::InitViewData( SvTreeListBox* pView, SvTree
 
 // --------------------------------------------------------------------
 
-void CustomAnimationTriggerEntryItem::Paint( const Point& rPos, SvTreeListBox& rDev, sal_uInt16, SvTreeListEntry* )
+void CustomAnimationTriggerEntryItem::Paint(
+    const Point& rPos, SvTreeListBox& rDev, const SvViewDataEntry* /*pView*/, const SvTreeListEntry* /*pEntry*/)
 {
     Size aSize( rDev.GetOutputSizePixel().Width(), static_cast< SvTreeListBox* >(&rDev)->GetEntryHeight() );
 
diff --git a/svtools/inc/svtools/svlbitm.hxx b/svtools/inc/svtools/svlbitm.hxx
index b0fcd73..c65d87e 100644
--- a/svtools/inc/svtools/svlbitm.hxx
+++ b/svtools/inc/svtools/svlbitm.hxx
@@ -117,7 +117,10 @@ public:
     virtual void    InitViewData(SvTreeListBox*, SvTreeListEntry*, SvViewDataItem*);
     rtl::OUString   GetText() const { return maText; }
     void            SetText( const rtl::OUString& rText ) { maText = rText; }
-    virtual void    Paint( const Point&, SvTreeListBox& rDev, sal_uInt16 nFlags,SvTreeListEntry* );
+
+    virtual void Paint(
+        const Point& rPos, SvTreeListBox& rOutDev, const SvViewDataEntry* pView, const SvTreeListEntry* pEntry);
+
     virtual SvLBoxItem* Create() const;
     virtual void    Clone( SvLBoxItem* pSource );
 };
@@ -130,7 +133,8 @@ public:
     virtual         ~SvLBoxBmp();
     virtual sal_uInt16 GetType() const;
     virtual void    InitViewData( SvTreeListBox*,SvTreeListEntry*,SvViewDataItem* );
-    virtual void    Paint( const Point&, SvTreeListBox& rView, sal_uInt16 nFlags,SvTreeListEntry* );
+    virtual void Paint(
+        const Point& rPos, SvTreeListBox& rOutDev, const SvViewDataEntry* pView, const SvTreeListEntry* pEntry);
     virtual SvLBoxItem* Create() const;
     virtual void    Clone( SvLBoxItem* pSource );
 };
@@ -164,7 +168,8 @@ public:
     virtual void    InitViewData( SvTreeListBox*,SvTreeListEntry*,SvViewDataItem* );
     virtual sal_uInt16 GetType() const;
     virtual sal_Bool    ClickHdl(SvTreeListBox* pView, SvTreeListEntry* );
-    virtual void    Paint( const Point&, SvTreeListBox& rView, sal_uInt16 nFlags,SvTreeListEntry* );
+    virtual void Paint(
+        const Point& rPos, SvTreeListBox& rOutDev, const SvViewDataEntry* pView, const SvTreeListEntry* pEntry);
     virtual SvLBoxItem* Create() const;
     virtual void    Clone( SvLBoxItem* pSource );
     sal_uInt16          GetButtonFlags() const { return nItemFlags; }
@@ -222,7 +227,8 @@ public:
     virtual         ~SvLBoxContextBmp();
     virtual sal_uInt16 GetType() const;
     virtual void    InitViewData( SvTreeListBox*,SvTreeListEntry*,SvViewDataItem* );
-    virtual void    Paint( const Point&, SvTreeListBox& rView, sal_uInt16 nFlags,SvTreeListEntry* );
+    virtual void Paint(
+        const Point& rPos, SvTreeListBox& rOutDev, const SvViewDataEntry* pView, const SvTreeListEntry* pEntry);
     virtual SvLBoxItem* Create() const;
     virtual void    Clone( SvLBoxItem* pSource );
 
diff --git a/svtools/inc/svtools/treelistbox.hxx b/svtools/inc/svtools/treelistbox.hxx
index 23a55f4..26476f4 100644
--- a/svtools/inc/svtools/treelistbox.hxx
+++ b/svtools/inc/svtools/treelistbox.hxx
@@ -149,9 +149,8 @@ public:
                             return pIData->maSize;
                         }
 
-    virtual void        Paint( const Point& rPos, SvTreeListBox& rOutDev,
-                            sal_uInt16 nViewDataEntryFlags,
-                            SvTreeListEntry* pEntry ) = 0;
+    virtual void Paint(
+        const Point& rPos, SvTreeListBox& rOutDev, const SvViewDataEntry* pView, const SvTreeListEntry* pEntry) = 0;
 
     virtual void        InitViewData( SvTreeListBox* pView, SvTreeListEntry* pEntry,
                             // If != 0: this Pointer must be used!
@@ -647,8 +646,8 @@ public:
 
     virtual String  GetEntryText( SvTreeListEntry* pEntry ) const;
     String          SearchEntryText( SvTreeListEntry* pEntry ) const;
-    const Image&    GetExpandedEntryBmp(SvTreeListEntry* _pEntry ) const;
-    const Image&    GetCollapsedEntryBmp(SvTreeListEntry* _pEntry ) const;
+    const Image&    GetExpandedEntryBmp(const SvTreeListEntry* _pEntry ) const;
+    const Image&    GetCollapsedEntryBmp(const SvTreeListEntry* _pEntry ) const;
 
     void            SetCheckButtonHdl( const Link& rLink )  { aCheckButtonHdl=rLink; }
     Link            GetCheckButtonHdl() const { return aCheckButtonHdl; }
diff --git a/svtools/source/contnr/svimpbox.cxx b/svtools/source/contnr/svimpbox.cxx
index 99612f9..d3c0eb7 100644
--- a/svtools/source/contnr/svimpbox.cxx
+++ b/svtools/source/contnr/svimpbox.cxx
@@ -38,6 +38,48 @@
 #define NODE_BMP_TABDIST_NOTVALID   -2000000
 #define FIRST_ENTRY_TAB             1
 
+#include <stdio.h>
+#include <string>
+#include <sys/time.h>
+
+namespace {
+
+class stack_printer
+{
+public:
+    explicit stack_printer(const char *msg) :
+        msMsg(msg)
+    {
+        fprintf(stdout, "%s: --begin\n", msMsg.c_str());
+        mfStartTime = getTime();
+    }
+
+    ~stack_printer()
+    {
+        double fEndTime = getTime();
+        fprintf(stdout, "%s: --end (duration: %g sec)\n", msMsg.c_str(), (fEndTime - mfStartTime));
+    }
+
+    void printTime(int line) const
+    {
+        double fEndTime = getTime();
+        fprintf(stdout, "%s: --(%d) (duration: %g sec)\n", msMsg.c_str(), line, (fEndTime - mfStartTime));
+    }
+
+private:
+    double getTime() const
+    {
+        timeval tv;
+        gettimeofday(&tv, NULL);
+        return tv.tv_sec + tv.tv_usec / 1000000.0;
+    }
+
+    ::std::string msMsg;
+    double mfStartTime;
+};
+
+}
+
 // #i27063# (pl), #i32300# (pb) never access VCL after DeInitVCL - also no destructors
 Image*  SvImpLBox::s_pDefCollapsed      = NULL;
 Image*  SvImpLBox::s_pDefExpanded       = NULL;
@@ -599,6 +641,7 @@ void SvImpLBox::RecalcFocusRect()
 
 void SvImpLBox::SetCursor( SvTreeListEntry* pEntry, bool bForceNoSelect )
 {
+    stack_printer __stack_printer__("SvImpLBox::SetCursor");
     SvViewDataEntry* pViewDataNewCur = 0;
     if( pEntry )
         pViewDataNewCur= pView->GetViewDataEntry(pEntry);
@@ -607,6 +650,7 @@ void SvImpLBox::SetCursor( SvTreeListEntry* pEntry, bool bForceNoSelect )
         pViewDataNewCur->HasFocus() &&
         pViewDataNewCur->IsSelected())
     {
+        fprintf(stdout, "SvImpLBox::SetCursor:   nothing to do\n");
         return;
     }
 
@@ -628,9 +672,11 @@ void SvImpLBox::SetCursor( SvTreeListEntry* pEntry, bool bForceNoSelect )
     pCursor = pEntry;
     if( pCursor )
     {
+        fprintf(stdout, "SvImpLBox::SetCursor:   cp (%d)\n", __LINE__);
         pViewDataNewCur->SetFocus( true );
         if(!bForceNoSelect && bSimpleTravel && !(nFlags & F_DESEL_ALL) && GetUpdateMode())
         {
+            fprintf(stdout, "SvImpLBox::SetCursor:   cp (%d)\n", __LINE__);
             pView->Select( pCursor, true );
         }
         // multiple selection: select in cursor move if we're not in
@@ -640,10 +686,12 @@ void SvImpLBox::SetCursor( SvTreeListEntry* pEntry, bool bForceNoSelect )
                  !(nFlags & F_DESEL_ALL) && !aSelEng.IsAddMode() &&
                  !bForceNoSelect )
         {
+            fprintf(stdout, "SvImpLBox::SetCursor:   cp (%d)\n", __LINE__);
             pView->Select( pCursor, true );
         }
         else
         {
+            fprintf(stdout, "SvImpLBox::SetCursor:   cp (%d)\n", __LINE__);
             ShowCursor( true );
         }
 
diff --git a/svtools/source/contnr/svlbitm.cxx b/svtools/source/contnr/svlbitm.cxx
index 138ae3b..31ba9fe 100644
--- a/svtools/source/contnr/svlbitm.cxx
+++ b/svtools/source/contnr/svlbitm.cxx
@@ -211,16 +211,17 @@ sal_uInt16 SvLBoxString::GetType() const
     return SV_ITEM_ID_LBOXSTRING;
 }
 
-void SvLBoxString::Paint( const Point& rPos, SvTreeListBox& rDev, sal_uInt16 /* nFlags */,
-    SvTreeListEntry* _pEntry)
+void SvLBoxString::Paint(
+    const Point& rPos, SvTreeListBox& rDev, const SvViewDataEntry* /*pView*/,
+    const SvTreeListEntry* pEntry)
 {
     DBG_CHKTHIS(SvLBoxString,0);
-    if ( _pEntry )
+    if (pEntry)
     {
         sal_uInt16 nStyle = rDev.IsEnabled() ? 0 : TEXT_DRAW_DISABLE;
         if ( rDev.IsEntryMnemonicsEnabled() )
             nStyle |= TEXT_DRAW_MNEMONIC;
-        rDev.DrawText(Rectangle(rPos, GetSize(&rDev,_pEntry)), maText, nStyle);
+        rDev.DrawText(Rectangle(rPos, GetSize(&rDev, pEntry)), maText, nStyle);
     }
     else
         rDev.DrawText(rPos, maText);
@@ -279,8 +280,9 @@ void SvLBoxBmp::InitViewData( SvTreeListBox* pView,SvTreeListEntry* pEntry,
     pViewData->maSize = aBmp.GetSizePixel();
 }
 
-void SvLBoxBmp::Paint( const Point& rPos, SvTreeListBox& rDev, sal_uInt16 /* nFlags */,
-                        SvTreeListEntry* )
+void SvLBoxBmp::Paint(
+    const Point& rPos, SvTreeListBox& rDev, const SvViewDataEntry* /*pView*/,
+    const SvTreeListEntry* /*pEntry*/)
 {
     DBG_CHKTHIS(SvLBoxBmp,0);
     sal_uInt16 nStyle = rDev.IsEnabled() ? 0 : IMAGE_DRAW_DISABLE;
@@ -351,8 +353,9 @@ sal_Bool SvLBoxButton::ClickHdl( SvTreeListBox*, SvTreeListEntry* pEntry )
     return sal_False;
 }
 
-void SvLBoxButton::Paint( const Point& rPos, SvTreeListBox& rDev, sal_uInt16 /* nFlags */,
-                            SvTreeListEntry* /*pEntry*/ )
+void SvLBoxButton::Paint(
+    const Point& rPos, SvTreeListBox& rDev, const SvViewDataEntry* /*pView*/,
+    const SvTreeListEntry* /*pEntry*/)
 {
     DBG_CHKTHIS(SvLBoxButton,0);
     sal_uInt16 nIndex = eKind == SvLBoxButtonKind_staticImage
@@ -528,15 +531,16 @@ void SvLBoxContextBmp::InitViewData( SvTreeListBox* pView,SvTreeListEntry* pEntr
     pViewData->maSize = m_pImpl->m_aImage1.GetSizePixel();
 }
 
-void SvLBoxContextBmp::Paint( const Point& _rPos, SvTreeListBox& _rDev,
-    sal_uInt16 _nViewDataEntryFlags, SvTreeListEntry* _pEntry )
+void SvLBoxContextBmp::Paint(
+    const Point& _rPos, SvTreeListBox& _rDev,
+    const SvViewDataEntry* pView, const SvTreeListEntry* pEntry)
 {
     DBG_CHKTHIS(SvLBoxContextBmp,0);
 
-    // get the image
-    const Image& rImage = implGetImageStore( 0 == ( _nViewDataEntryFlags & m_pImpl->m_nB2IndicatorFlags ) );
+    // get the image (TODO: Avoid directly referencing the flags).
+    const Image& rImage = implGetImageStore( 0 == (pView->GetFlags() & m_pImpl->m_nB2IndicatorFlags ) );
 
-    sal_Bool _bSemiTransparent = _pEntry && ( 0 != ( SV_ENTRYFLAG_SEMITRANSPARENT  & _pEntry->GetFlags( ) ) );
+    sal_Bool _bSemiTransparent = pEntry && ( 0 != ( SV_ENTRYFLAG_SEMITRANSPARENT  & pEntry->GetFlags( ) ) );
     // draw
     sal_uInt16 nStyle = _rDev.IsEnabled() ? 0 : IMAGE_DRAW_DISABLE;
     if ( _bSemiTransparent )
diff --git a/svtools/source/contnr/treelistbox.cxx b/svtools/source/contnr/treelistbox.cxx
index 6c4eb5e..c1d80f1 100644
--- a/svtools/source/contnr/treelistbox.cxx
+++ b/svtools/source/contnr/treelistbox.cxx
@@ -1782,20 +1782,20 @@ String SvTreeListBox::SearchEntryText( SvTreeListEntry* pEntry ) const
     return sRet;
 }
 
-const Image& SvTreeListBox::GetExpandedEntryBmp(SvTreeListEntry* pEntry) const
+const Image& SvTreeListBox::GetExpandedEntryBmp(const SvTreeListEntry* pEntry) const
 {
     DBG_CHKTHIS(SvTreeListBox,0);
     DBG_ASSERT(pEntry,"Entry?");
-    SvLBoxContextBmp* pItem = (SvLBoxContextBmp*)(pEntry->GetFirstItem(SV_ITEM_ID_LBOXCONTEXTBMP));
+    const SvLBoxContextBmp* pItem = static_cast<const SvLBoxContextBmp*>(pEntry->GetFirstItem(SV_ITEM_ID_LBOXCONTEXTBMP));
     DBG_ASSERT(pItem,"GetContextBmp:Item not found");
     return pItem->GetBitmap2( );
 }
 
-const Image& SvTreeListBox::GetCollapsedEntryBmp( SvTreeListEntry* pEntry ) const
+const Image& SvTreeListBox::GetCollapsedEntryBmp( const SvTreeListEntry* pEntry ) const
 {
     DBG_CHKTHIS(SvTreeListBox,0);
     DBG_ASSERT(pEntry,"Entry?");
-    SvLBoxContextBmp* pItem = (SvLBoxContextBmp*)(pEntry->GetFirstItem(SV_ITEM_ID_LBOXCONTEXTBMP));
+    const SvLBoxContextBmp* pItem = static_cast<const SvLBoxContextBmp*>(pEntry->GetFirstItem(SV_ITEM_ID_LBOXCONTEXTBMP));
     DBG_ASSERT(pItem,"GetContextBmp:Item not found");
     return pItem->GetBitmap1( );
 }
@@ -3073,7 +3073,7 @@ long SvTreeListBox::PaintEntry1(SvTreeListEntry* pEntry,long nLine,sal_uInt16 nT
             // draw item
             // center vertically
             aEntryPos.Y() += ( nTempEntryHeight - aSize.Height() ) / 2;
-            pItem->Paint( aEntryPos, *this, pViewDataEntry->GetFlags(), pEntry );
+            pItem->Paint(aEntryPos, *this, pViewDataEntry, pEntry);
 
             // division line between tabs
             if (pNextTab && pItem->GetType() == SV_ITEM_ID_LBOXSTRING &&
diff --git a/svtools/source/uno/treecontrolpeer.cxx b/svtools/source/uno/treecontrolpeer.cxx
index 8a40909..15cdf99 100644
--- a/svtools/source/uno/treecontrolpeer.cxx
+++ b/svtools/source/uno/treecontrolpeer.cxx
@@ -115,7 +115,8 @@ public:
     void            SetImage( const Image& rImage );
     OUString        GetGraphicURL() const;
     void            SetGraphicURL( const OUString& rGraphicURL );
-    void            Paint( const Point&, SvTreeListBox& rDev, sal_uInt16 nFlags,SvTreeListEntry* );
+    virtual void Paint(
+        const Point& rPos, SvTreeListBox& rOutDev, const SvViewDataEntry* pView, const SvTreeListEntry* pEntry);
     SvLBoxItem*     Create() const;
     void            Clone( SvLBoxItem* pSource );
 
@@ -1600,12 +1601,13 @@ UnoTreeListItem::~UnoTreeListItem()
 
 // --------------------------------------------------------------------
 
-void UnoTreeListItem::Paint( const Point& rPos, SvTreeListBox& rDev, sal_uInt16 /* nFlags */, SvTreeListEntry* _pEntry)
+void UnoTreeListItem::Paint(
+    const Point& rPos, SvTreeListBox& rDev, const SvViewDataEntry* /*pView*/, const SvTreeListEntry* pEntry)
 {
     Point aPos( rPos );
-    if( _pEntry )
+    if (pEntry)
     {
-        Size aSize( GetSize(&rDev,_pEntry) );
+        Size aSize( GetSize(&rDev, pEntry) );
         if( !!maImage )
         {
             rDev.DrawImage( aPos, maImage, rDev.IsEnabled() ? 0 : IMAGE_DRAW_DISABLE );
diff --git a/svx/inc/svx/ctredlin.hxx b/svx/inc/svx/ctredlin.hxx
index 46b5c0a..4268adc 100644
--- a/svx/inc/svx/ctredlin.hxx
+++ b/svx/inc/svx/ctredlin.hxx
@@ -79,7 +79,9 @@ public:
                     SvLBoxColorString();
                     ~SvLBoxColorString();
 
-    void            Paint( const Point&, SvTreeListBox& rDev, sal_uInt16 nFlags,SvTreeListEntry* );
+    virtual void Paint(
+        const Point& rPos, SvTreeListBox& rOutDev, const SvViewDataEntry* pView, const SvTreeListEntry* pEntry);
+
     SvLBoxItem*     Create() const;
 };
 
diff --git a/svx/inc/svx/fontlb.hxx b/svx/inc/svx/fontlb.hxx
index 1437984..236ba82 100644
--- a/svx/inc/svx/fontlb.hxx
+++ b/svx/inc/svx/fontlb.hxx
@@ -51,11 +51,8 @@ public:
     void            InitViewData( SvTreeListBox*,SvTreeListEntry*,SvViewDataItem* );
 
     /** Paints this entry to the specified position, using the own font settings. */
-    void                        Paint(
-                                    const Point& rPos,
-                                    SvTreeListBox& rDev,
-                                    sal_uInt16 nFlags,
-                                    SvTreeListEntry* pEntry );
+    virtual void Paint(
+        const Point& rPos, SvTreeListBox& rOutDev, const SvViewDataEntry* pView, const SvTreeListEntry* pEntry);
 };
 
 
diff --git a/svx/source/dialog/ctredlin.cxx b/svx/source/dialog/ctredlin.cxx
index 732dc85..54d4307 100644
--- a/svx/source/dialog/ctredlin.cxx
+++ b/svx/source/dialog/ctredlin.cxx
@@ -112,8 +112,9 @@ SvLBoxItem* SvLBoxColorString::Create() const
     return new SvLBoxColorString;
 }
 
-void SvLBoxColorString::Paint( const Point& rPos, SvTreeListBox& rDev,
-                             sal_uInt16 nFlags, SvTreeListEntry* pEntry )
+void SvLBoxColorString::Paint(
+    const Point& rPos, SvTreeListBox& rDev,
+    const SvViewDataEntry* pView, const SvTreeListEntry* pEntry)
 /* [Description]
 
    Paint function of the SvLBoxColorString class. The relevant text with the
@@ -123,11 +124,11 @@ void SvLBoxColorString::Paint( const Point& rPos, SvTreeListBox& rDev,
 {
     Color aColor=rDev.GetTextColor();
     Color a2Color=aColor;
-    if(!(nFlags & SVLISTENTRYFLAG_SELECTED))
+    if (!pView->IsSelected())
     {
         rDev.SetTextColor(aPrivColor);
     }
-    SvLBoxString::Paint(rPos,rDev,nFlags,pEntry );
+    SvLBoxString::Paint(rPos, rDev, pView, pEntry);
     rDev.SetTextColor(a2Color);
 }
 
diff --git a/svx/source/dialog/docrecovery.cxx b/svx/source/dialog/docrecovery.cxx
index f38ca72..6ce25d7 100644
--- a/svx/source/dialog/docrecovery.cxx
+++ b/svx/source/dialog/docrecovery.cxx
@@ -884,10 +884,8 @@ RecovDocListEntry::RecovDocListEntry(      SvTreeListEntry* pEntry,
 }
 
 //===============================================
-void RecovDocListEntry::Paint(const Point&       aPos   ,
-                                    SvTreeListBox&      aDevice,
-                                    sal_uInt16       /*nFlags */,
-                                    SvTreeListEntry* pEntry )
+void RecovDocListEntry::Paint(
+    const Point& aPos, SvTreeListBox& aDevice, const SvViewDataEntry* /*pView*/, const SvTreeListEntry* pEntry)
 {
     const Image*        pImg  = 0;
     const OUString*     pTxt  = 0;
diff --git a/svx/source/dialog/fontlb.cxx b/svx/source/dialog/fontlb.cxx
index e6ab6c3..e3247de 100644
--- a/svx/source/dialog/fontlb.cxx
+++ b/svx/source/dialog/fontlb.cxx
@@ -56,12 +56,13 @@ SvLBoxItem* SvLBoxFontString::Create() const
     return new SvLBoxFontString;
 }
 
-void SvLBoxFontString::Paint( const Point& rPos, SvTreeListBox& rDev, sal_uInt16 nFlags, SvTreeListEntry* pEntry )
+void SvLBoxFontString::Paint(
+    const Point& rPos, SvTreeListBox& rDev, const SvViewDataEntry* pView, const SvTreeListEntry* pEntry)
 {
     DBG_CHKTHIS( SvLBoxFontString, 0 );
     Font aOldFont( rDev.GetFont() );
     Font aNewFont( maFont );
-    bool bSel = (nFlags & SVLISTENTRYFLAG_SELECTED) != 0;
+    bool bSel = pView->IsSelected();
     if( !mbUseColor || bSel )       // selection always gets highlight color
     {
         const StyleSettings& rSett = Application::GetSettings().GetStyleSettings();
@@ -69,7 +70,7 @@ void SvLBoxFontString::Paint( const Point& rPos, SvTreeListBox& rDev, sal_uInt16
     }
 
     rDev.SetFont( aNewFont );
-    SvLBoxString::Paint( rPos, rDev, nFlags, pEntry );
+    SvLBoxString::Paint(rPos, rDev, pView, pEntry);
     rDev.SetFont( aOldFont );
 }
 
diff --git a/svx/source/form/filtnav.cxx b/svx/source/form/filtnav.cxx
index cb7d51f..a03c38f 100644
--- a/svx/source/form/filtnav.cxx
+++ b/svx/source/form/filtnav.cxx
@@ -1036,13 +1036,14 @@ public:
     FmFilterItemsString( SvTreeListEntry* pEntry, sal_uInt16 nFlags,    const XubString& rStr )
         :SvLBoxString(pEntry,nFlags,rStr){}
 
-    virtual void Paint(const Point& rPos, SvTreeListBox& rDev, sal_uInt16 nFlags, SvTreeListEntry* pEntry);
+    virtual void Paint(const Point& rPos, SvTreeListBox& rDev, const SvViewDataEntry* pView, const SvTreeListEntry* pEntry);
     virtual void InitViewData( SvTreeListBox* pView,SvTreeListEntry* pEntry, SvViewDataItem* pViewData);
 };
 
 const int nxDBmp = 12;
 //------------------------------------------------------------------------
-void FmFilterItemsString::Paint(const Point& rPos, SvTreeListBox& rDev, sal_uInt16 /*nFlags*/, SvTreeListEntry* pEntry )
+void FmFilterItemsString::Paint(
+    const Point& rPos, SvTreeListBox& rDev, const SvViewDataEntry* /*pView*/, const SvTreeListEntry* pEntry)
 {
     FmFilterItems* pRow = (FmFilterItems*)pEntry->GetUserData();
     FmFormItem* pForm = (FmFormItem*)pRow->GetParent();
@@ -1100,7 +1101,7 @@ public:
         m_aName.AppendAscii(": ");
     }
 
-    virtual void Paint(const Point& rPos, SvTreeListBox& rDev, sal_uInt16 nFlags, SvTreeListEntry* pEntry);
+    virtual void Paint(const Point& rPos, SvTreeListBox& rDev, const SvViewDataEntry* pView, const SvTreeListEntry* pEntry);
     virtual void InitViewData( SvTreeListBox* pView,SvTreeListEntry* pEntry, SvViewDataItem* pViewData);
 };
 
@@ -1124,7 +1125,8 @@ void FmFilterString::InitViewData( SvTreeListBox* pView,SvTreeListEntry* pEntry,
 }
 
 //------------------------------------------------------------------------
-void FmFilterString::Paint(const Point& rPos, SvTreeListBox& rDev, sal_uInt16 /*nFlags*/, SvTreeListEntry* /*pEntry*/ )
+void FmFilterString::Paint(
+    const Point& rPos, SvTreeListBox& rDev, const SvViewDataEntry* /*pView*/, const SvTreeListEntry* /*pEntry*/)
 {
     Font aOldFont( rDev.GetFont());
     Font aFont( aOldFont );
diff --git a/svx/source/inc/docrecovery.hxx b/svx/source/inc/docrecovery.hxx
index 6e76d06..6802827 100644
--- a/svx/source/inc/docrecovery.hxx
+++ b/svx/source/inc/docrecovery.hxx
@@ -550,24 +550,18 @@ class SaveProgressDialog : public ModalDialog
 //===============================================
 class RecovDocListEntry : public SvLBoxString
 {
-    //-------------------------------------------
-    // interface
-    private:
-
-    //-------------------------------------------
-    // interface
-    public:
-
-        //---------------------------------------
-        /** @short TODO */
-        RecovDocListEntry(      SvTreeListEntry* pEntry,
-                                sal_uInt16       nFlags,
-                          const String&      sText );
-
-        //---------------------------------------
-        /** @short TODO */
-        virtual void Paint(
-            const Point& aPos, SvTreeListBox& aDevice, sal_uInt16 nFlags, SvTreeListEntry* pEntry);
+public:
+
+    //---------------------------------------
+    /** @short TODO */
+    RecovDocListEntry(      SvTreeListEntry* pEntry,
+                            sal_uInt16       nFlags,
+                      const String&      sText );
+
+    //---------------------------------------
+    /** @short TODO */
+    virtual void Paint(
+        const Point& rPos, SvTreeListBox& rOutDev, const SvViewDataEntry* pView, const SvTreeListEntry* pEntry);
 };
 
 //===============================================
diff --git a/svx/workben/msview/msview.cxx b/svx/workben/msview/msview.cxx
index 1a24d66..9760d2a 100644
--- a/svx/workben/msview/msview.cxx
+++ b/svx/workben/msview/msview.cxx
@@ -487,7 +487,8 @@ public:
 
     ~AtomBoxString() { }
 
-    void Paint( const Point& rPos, SvLBox& rOutDev, USHORT nViewDataEntryFlags, SvTreeListEntry* pEntry )
+    virtual void Paint(
+        const Point& rPos, SvLBox& rOutDev, const SvViewDataEntry* pView, const SvTreeListEntry* pEntry)
     {
         Color aOldTextColor = rOutDev.GetTextColor();
 
@@ -497,7 +498,7 @@ public:
             rOutDev.SetTextColor( Color( gColors[ pAtom->getCompareStatus() ] ) );
         }
 
-        SvLBoxString::Paint( rPos, rOutDev, nViewDataEntryFlags, pEntry );
+        SvLBoxString::Paint(rPos, rOutDev, pView, pEntry);
 
         rOutDev.SetTextColor( aOldTextColor );
     }
diff --git a/sw/source/ui/inc/conttree.hxx b/sw/source/ui/inc/conttree.hxx
index 3d26863..72f25c9 100644
--- a/sw/source/ui/inc/conttree.hxx
+++ b/sw/source/ui/inc/conttree.hxx
@@ -220,8 +220,9 @@ public:
     {
     }
 
-    virtual void Paint( const Point& rPos, SvTreeListBox& rDev, sal_uInt16 nFlags,
-        SvTreeListEntry* pEntry);
+    virtual void Paint(
+        const Point& rPos, SvTreeListBox& rDev, const SvViewDataEntry* pView,
+        const SvTreeListEntry* pEntry);
 };
 
 namespace sfx2 { class DocumentInserter; }
diff --git a/sw/source/ui/inc/swcont.hxx b/sw/source/ui/inc/swcont.hxx
index bf8496c..fd0740c 100644
--- a/sw/source/ui/inc/swcont.hxx
+++ b/sw/source/ui/inc/swcont.hxx
@@ -72,7 +72,7 @@ class SwTypeNumber
         SwTypeNumber(sal_uInt8 nId) :nTypeId(nId){}
         virtual ~SwTypeNumber();
 
-        virtual sal_uInt8   GetTypeId();
+        sal_uInt8 GetTypeId() const;
 };
 //----------------------------------------------------------------------------
 
diff --git a/sw/source/ui/utlui/content.cxx b/sw/source/ui/utlui/content.cxx
index e54b732..977b3af 100644
--- a/sw/source/ui/utlui/content.cxx
+++ b/sw/source/ui/utlui/content.cxx
@@ -117,14 +117,14 @@ sal_Bool SwContentTree::bIsInDrag = sal_False;
 
 namespace
 {
-    static sal_Bool lcl_IsContent(SvTreeListEntry* pEntry)
+    static sal_Bool lcl_IsContent(const SvTreeListEntry* pEntry)
     {
-        return ((SwTypeNumber*)pEntry->GetUserData())->GetTypeId() == CTYPE_CNT;
+        return ((const SwTypeNumber*)pEntry->GetUserData())->GetTypeId() == CTYPE_CNT;
     }
 
-    static sal_Bool lcl_IsContentType(SvTreeListEntry* pEntry)
+    static sal_Bool lcl_IsContentType(const SvTreeListEntry* pEntry)
     {
-        return ((SwTypeNumber*)pEntry->GetUserData())->GetTypeId() == CTYPE_CTT;
+        return ((const SwTypeNumber*)pEntry->GetUserData())->GetTypeId() == CTYPE_CTT;
     }
 
     static sal_Bool lcl_FindShell(SwWrtShell* pShell)
@@ -162,7 +162,7 @@ SwContent::SwContent(const SwContentType* pCnt, const String& rName, long nYPos)
 {
 }
 
-sal_uInt8   SwTypeNumber::GetTypeId()
+sal_uInt8 SwTypeNumber::GetTypeId() const
 {
     return nTypeId;
 }
@@ -3131,8 +3131,9 @@ public:
     SwContentLBoxString( SvTreeListEntry* pEntry, sal_uInt16 nFlags,
         const String& rStr ) : SvLBoxString(pEntry,nFlags,rStr) {}
 
-    virtual void Paint( const Point& rPos, SvTreeListBox& rDev, sal_uInt16 nFlags,
-        SvTreeListEntry* pEntry);
+    virtual void Paint(
+        const Point& rPos, SvTreeListBox& rDev, const SvViewDataEntry* pView,
+        const SvTreeListEntry* pEntry);
 };
 
 void SwContentTree::InitEntry(SvTreeListEntry* pEntry,
@@ -3146,8 +3147,9 @@ void SwContentTree::InitEntry(SvTreeListEntry* pEntry,
     pEntry->ReplaceItem( pStr, nColToHilite );
 }
 
-void SwContentLBoxString::Paint( const Point& rPos, SvTreeListBox& rDev, sal_uInt16 nFlags,
-    SvTreeListEntry* pEntry )
+void SwContentLBoxString::Paint(
+    const Point& rPos, SvTreeListBox& rDev, const SvViewDataEntry* pView,
+    const SvTreeListEntry* pEntry)
 {
     if(lcl_IsContent(pEntry) &&
             ((SwContent *)pEntry->GetUserData())->IsInvisible())
@@ -3161,7 +3163,7 @@ void SwContentLBoxString::Paint( const Point& rPos, SvTreeListBox& rDev, sal_uIn
         rDev.SetFont( aOldFont );
     }
     else
-        SvLBoxString::Paint( rPos, rDev, nFlags, pEntry);
+        SvLBoxString::Paint( rPos, rDev, pView, pEntry);
 }
 
 void    SwContentTree::DataChanged( const DataChangedEvent& rDCEvt )
diff --git a/sw/source/ui/utlui/glbltree.cxx b/sw/source/ui/utlui/glbltree.cxx
index 6702507..6e9aa86 100644
--- a/sw/source/ui/utlui/glbltree.cxx
+++ b/sw/source/ui/utlui/glbltree.cxx
@@ -1235,8 +1235,9 @@ void SwGlobalTree::InitEntry(SvTreeListEntry* pEntry,
     pEntry->ReplaceItem( pStr, nColToHilite );
 }
 
-void SwLBoxString::Paint( const Point& rPos, SvTreeListBox& rDev, sal_uInt16 nFlags,
-    SvTreeListEntry* pEntry )
+void SwLBoxString::Paint(
+    const Point& rPos, SvTreeListBox& rDev, const SvViewDataEntry* pView,
+    const SvTreeListEntry* pEntry)
 {
     SwGlblDocContent* pCont = (SwGlblDocContent*)pEntry->GetUserData();
     if(pCont->GetType() == GLBLDOC_SECTION &&
@@ -1251,7 +1252,7 @@ void SwLBoxString::Paint( const Point& rPos, SvTreeListBox& rDev, sal_uInt16 nFl
         rDev.SetFont( aOldFont );
     }
     else
-        SvLBoxString::Paint( rPos, rDev, nFlags, pEntry);
+        SvLBoxString::Paint( rPos, rDev, pView, pEntry);
 }
 
 void    SwGlobalTree::DataChanged( const DataChangedEvent& rDCEvt )
commit 764878deacb5018539ff5df71af8bf7e6677a93e
Author: Kohei Yoshida <kohei.yoshida at gmail.com>
Date:   Wed Nov 28 23:22:28 2012 -0500

    Highlight all its child entries when a recurring element is selected.
    
    Change-Id: I5d91d702fa0b55d9a9a63ef66a5ce243943e77a3

diff --git a/sc/source/ui/inc/xmlsourcedlg.hxx b/sc/source/ui/inc/xmlsourcedlg.hxx
index 1540b29..9139a35 100644
--- a/sc/source/ui/inc/xmlsourcedlg.hxx
+++ b/sc/source/ui/inc/xmlsourcedlg.hxx
@@ -19,6 +19,7 @@
 #include "orcusxml.hxx"
 
 #include <set>
+#include <vector>
 #include <boost/scoped_ptr.hpp>
 
 class ScDocument;
@@ -55,6 +56,7 @@ class ScXMLSourceDlg : public ScAnyRefDlg
     ScOrcusXMLTreeParam maXMLParam;
     std::set<const SvTreeListEntry*> maCellLinks;
     std::set<const SvTreeListEntry*> maRangeLinks;
+    std::vector<SvTreeListEntry*> maSelectedEntries;
 
     boost::scoped_ptr<ScOrcusXMLContext> mpXMLContext;
 
@@ -88,6 +90,7 @@ private:
     void SetNonLinkable();
     void SetSingleLinkable();
     void SetRangeLinkable();
+    void SelectAllChildEntries(SvTreeListEntry& rEntry);
 
     /**
      * Check if any of its parents is linked or repeated.  The passed entry is
diff --git a/sc/source/ui/xmlsource/xmlsourcedlg.cxx b/sc/source/ui/xmlsource/xmlsourcedlg.cxx
index 7a3afd4..013ad69 100644
--- a/sc/source/ui/xmlsource/xmlsourcedlg.cxx
+++ b/sc/source/ui/xmlsource/xmlsourcedlg.cxx
@@ -21,6 +21,7 @@
 #include "tools/urlobj.hxx"
 #include "svtools/svlbitm.hxx"
 #include "svtools/treelistentry.hxx"
+#include "svtools/viewdataentry.hxx"
 #include "sfx2/objsh.hxx"
 
 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
@@ -236,12 +237,44 @@ void ScXMLSourceDlg::HandleLoseFocus(Control* /*pCtrl*/)
 {
 }
 
+namespace {
+
+class UnselectEntry : std::unary_function<SvTreeListEntry*, void>
+{
+    SvTreeListBox& mrTree;
+    const SvTreeListEntry* mpCurrent;
+public:
+    UnselectEntry(SvTreeListBox& rTree, const SvTreeListEntry* pCur) : mrTree(rTree), mpCurrent(pCur) {}
+
+    void operator() (SvTreeListEntry* p)
+    {
+        if (p == mpCurrent)
+            return;
+
+        SvViewDataEntry* pView = mrTree.GetViewDataEntry(p);
+        if (!pView)
+            return;
+
+        pView->SetSelected(false);
+        mrTree.PaintEntry(p);
+    }
+};
+
+}
+
 void ScXMLSourceDlg::TreeItemSelected()
 {
     SvTreeListEntry* pEntry = maLbTree.GetCurEntry();
     if (!pEntry)
         return;
 
+    if (!maSelectedEntries.empty())
+    {
+        // Unselect highlighted entries that are not currently selected.
+        std::for_each(maSelectedEntries.begin(), maSelectedEntries.end(), UnselectEntry(maLbTree, pEntry));
+        maSelectedEntries.clear();
+    }
+
     ScOrcusXMLTreeParam::EntryData* pUserData = ScOrcusXMLTreeParam::getUserData(*pEntry);
     OSL_ASSERT(pUserData);
 
@@ -330,6 +363,7 @@ void ScXMLSourceDlg::RepeatElementSelected(SvTreeListEntry& rEntry)
         return;
     }
 
+    SelectAllChildEntries(rEntry);
     SetRangeLinkable();
 }
 
@@ -381,6 +415,21 @@ void ScXMLSourceDlg::SetRangeLinkable()
     maRefBtn.Enable();
 }
 
+void ScXMLSourceDlg::SelectAllChildEntries(SvTreeListEntry& rEntry)
+{
+    SvTreeListEntries& rChildren = rEntry.GetChildEntries();
+    SvTreeListEntries::iterator it = rChildren.begin(), itEnd = rChildren.end();
+    for (; it != itEnd; ++it)
+    {
+        SvTreeListEntry& r = *it;
+        SelectAllChildEntries(r); // select recursively.
+        SvViewDataEntry* p = maLbTree.GetViewDataEntry(&r);
+        p->SetSelected(true);
+        maLbTree.PaintEntry(&r);
+        maSelectedEntries.push_back(&r);
+    }
+}
+
 bool ScXMLSourceDlg::IsParentDirty(SvTreeListEntry* pEntry) const
 {
     ScOrcusXMLTreeParam::EntryData* pUserData = NULL;


More information about the Libreoffice-commits mailing list