[Libreoffice-commits] .: svtools/inc svtools/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Thu Nov 29 20:49:52 PST 2012


 svtools/inc/svtools/viewdataentry.hxx   |    6 +++---
 svtools/source/contnr/treelistbox.cxx   |    4 +---
 svtools/source/contnr/viewdataentry.cxx |    3 ++-
 3 files changed, 6 insertions(+), 7 deletions(-)

New commits:
commit af659d4ca2769669fe1066514f6d6279f1b8b8cb
Author: Kohei Yoshida <kohei.yoshida at gmail.com>
Date:   Thu Nov 29 23:47:47 2012 -0500

    Let's make it so that selected = highlighted + logically selected.
    
    Being selected but not highlighted makes no sense.  This way, an entry
    can be highlighted without being selected, but can never be selected without
    being highlighted.
    
    Change-Id: I6c469a1d2cf0df79c2e5e4ff4120af5efd5f6103

diff --git a/svtools/inc/svtools/viewdataentry.hxx b/svtools/inc/svtools/viewdataentry.hxx
index 304b5fa..9fc0408 100644
--- a/svtools/inc/svtools/viewdataentry.hxx
+++ b/svtools/inc/svtools/viewdataentry.hxx
@@ -36,9 +36,9 @@ struct SvViewDataItem
  * SvTreeListBox::CreateViewData(). The item array contains the same number
  * of items as that of the items in its corresponding tree list entry.
  *
- * When an entry is selected, it is both logically and visually selected.
- * When an entry is highlighted, it appears selected visually, but it's not
- * logically selected.
+ * When an entry is selected, it is logically selected and visually
+ * highlighted. When an entry is only highlighted, it looks visually
+ * highlighted, but not logically selected.
  */
 class SVT_DLLPUBLIC SvViewDataEntry
 {
diff --git a/svtools/source/contnr/treelistbox.cxx b/svtools/source/contnr/treelistbox.cxx
index 945fbb7..f55ef95 100644
--- a/svtools/source/contnr/treelistbox.cxx
+++ b/svtools/source/contnr/treelistbox.cxx
@@ -3007,9 +3007,7 @@ long SvTreeListBox::PaintEntry1(SvTreeListEntry* pEntry,long nLine,sal_uInt16 nT
             int bSelTab = nFlags & SV_LBOXTAB_SHOW_SELECTION;
             sal_uInt16 nItemType = pItem->GetType();
 
-            bool bHighlighted = pViewDataEntry->IsHighlighted() || pViewDataEntry->IsSelected();
-
-            if (bHighlighted && bSelTab && !pViewDataEntry->IsCursored())
+            if (pViewDataEntry->IsHighlighted() && bSelTab && !pViewDataEntry->IsCursored())
             {
                 Color aNewWallColor = rSettings.GetHighlightColor();
                 if ( !bInUse || nItemType != SV_ITEM_ID_LBOXCONTEXTBMP )
diff --git a/svtools/source/contnr/viewdataentry.cxx b/svtools/source/contnr/viewdataentry.cxx
index a7f1a90..c9c75f3 100644
--- a/svtools/source/contnr/viewdataentry.cxx
+++ b/svtools/source/contnr/viewdataentry.cxx
@@ -45,7 +45,7 @@ SvViewDataEntry::SvViewDataEntry() :
 SvViewDataEntry::SvViewDataEntry( const SvViewDataEntry& rData ) :
     nVisPos(rData.nVisPos),
     mbSelected(false),
-    mbHighlighted(rData.mbHighlighted),
+    mbHighlighted(false),
     mbExpanded(rData.mbExpanded),
     mbFocused(false),
     mbCursored(rData.mbCursored),
@@ -105,6 +105,7 @@ void SvViewDataEntry::SetCursored( bool bCursored )
 void SvViewDataEntry::SetSelected( bool bSelected )
 {
     mbSelected = bSelected;
+    mbHighlighted = bSelected;
 }
 
 void SvViewDataEntry::SetHighlighted( bool bHighlighted )


More information about the Libreoffice-commits mailing list