[Libreoffice-commits] .: sc/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Thu Nov 29 21:04:17 PST 2012


 sc/source/ui/xmlsource/xmlsourcedlg.cxx |   21 ++++++++++-----------
 1 file changed, 10 insertions(+), 11 deletions(-)

New commits:
commit 24a2e032ed0d5f1dcddf583424dfe9ab4c214ebf
Author: Kohei Yoshida <kohei.yoshida at gmail.com>
Date:   Fri Nov 30 00:04:48 2012 -0500

    Highlight the reference entry after ensuring that it's mappable.
    
    Change-Id: I9b245c56c58b2db741e7c69c5ad480179db25ee8

diff --git a/sc/source/ui/xmlsource/xmlsourcedlg.cxx b/sc/source/ui/xmlsource/xmlsourcedlg.cxx
index c60cc1d..fed942e 100644
--- a/sc/source/ui/xmlsource/xmlsourcedlg.cxx
+++ b/sc/source/ui/xmlsource/xmlsourcedlg.cxx
@@ -304,17 +304,6 @@ void ScXMLSourceDlg::TreeItemSelected()
     }
 
     mpCurRefEntry = getReferenceEntry(maLbTree, pEntry);
-    if (mpCurRefEntry != pEntry)
-    {
-        // Highlight the reference entry if it differs from the current entry.
-        SvViewDataEntry* pView = maLbTree.GetViewDataEntry(mpCurRefEntry);
-        if (pView)
-        {
-            pView->SetHighlighted(true);
-            maLbTree.PaintEntry(mpCurRefEntry);
-            maHighlightedEntries.push_back(mpCurRefEntry);
-        }
-    }
 
     ScOrcusXMLTreeParam::EntryData* pUserData = ScOrcusXMLTreeParam::getUserData(*mpCurRefEntry);
     OSL_ASSERT(pUserData);
@@ -404,6 +393,16 @@ void ScXMLSourceDlg::RepeatElementSelected(SvTreeListEntry& rEntry)
         return;
     }
 
+    SvViewDataEntry* p = maLbTree.GetViewDataEntry(&rEntry);
+    if (!p->IsHighlighted())
+    {
+        // Highlight the entry if not highlighted already.  This can happen
+        // when the current entry is a child entry of a repeat element entry.
+        p->SetHighlighted(true);
+        maLbTree.PaintEntry(&rEntry);
+        maHighlightedEntries.push_back(&rEntry);
+    }
+
     SelectAllChildEntries(rEntry);
     SetRangeLinkable();
 }


More information about the Libreoffice-commits mailing list