Tag: cws_dev300_dba30d
User: fs      
Date: 2008-06-16 08:45:14+0000
Modified:
   dba/dbaccess/source/ui/browser/unodatbr.cxx

Log:
 correct OnTreeEntryCompare

File Changes:

Directory: /dba/dbaccess/source/ui/browser/
===========================================

File [changed]: unodatbr.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/dbaccess/source/ui/browser/unodatbr.cxx?r1=1.200.8.7&r2=1.200.8.8
Delta lines:  +20 -10
---------------------
--- unodatbr.cxx        2008-06-11 20:26:06+0000        1.200.8.7
+++ unodatbr.cxx        2008-06-16 08:45:12+0000        1.200.8.8
@@ -7,7 +7,7 @@
  * OpenOffice.org - a multi-platform office productivity suite
  *
  * $RCSfile: unodatbr.cxx,v $
- * $Revision: 1.200.8.7 $
+ * $Revision: 1.200.8.8 $
  *
  * This file is part of OpenOffice.org.
  *
@@ -1925,18 +1925,22 @@
 
        // the child for the queries container
        {
-               SvLBoxEntry* pQueries = 
m_pTreeView->getListBox().InsertEntry(_rQueryName, _rQueryImage, _rQueryImage, 
pDatasourceEntry, sal_True);
                DBTreeListUserData* pQueriesData = new DBTreeListUserData;
                pQueriesData->eType = etQueryContainer;
-               pQueries->SetUserData(pQueriesData);
+
+        m_pTreeView->getListBox().InsertEntry(
+            _rQueryName, _rQueryImage, _rQueryImage, pDatasourceEntry,
+            TRUE /*ChildsOnDemand*/, LIST_APPEND, pQueriesData );
        }
 
        // the child for the tables container
        {
-               SvLBoxEntry* pTables = 
m_pTreeView->getListBox().InsertEntry(_rTableName, _rTableImage, _rTableImage, 
pDatasourceEntry, sal_True);
                DBTreeListUserData* pTablesData = new DBTreeListUserData;
                pTablesData->eType = etTableContainer;
-               pTables->SetUserData(pTablesData);
+
+               SvLBoxEntry* pTables = m_pTreeView->getListBox().InsertEntry(
+            _rTableName, _rTableImage, _rTableImage, pDatasourceEntry,
+            TRUE /*ChildsOnDemand*/, LIST_APPEND, pTablesData );
        }
 
 }
@@ -3247,11 +3251,17 @@
                else if (String(ModuleRes(RID_STR_QUERIES_CONTAINER)) == sLeft)
                        eLeft = etQueryContainer;
 
-               return  eLeft < eRight
-                       ?       COMPARE_LESS
-                       :               eLeft == eRight
-                               ?       COMPARE_EQUAL
-                               :       COMPARE_GREATER;
+        if ( eLeft == eRight )
+            return COMPARE_EQUAL;
+
+        if ( ( eLeft == etTableContainer ) && ( eRight == etQueryContainer ) )
+            return COMPARE_GREATER;
+
+        if ( ( eLeft == etQueryContainer ) && ( eRight == etTableContainer ) )
+            return COMPARE_LESS;
+
+        OSL_ENSURE( false, "SbaTableQueryBrowser::OnTreeEntryCompare: 
unexpected case!" );
+        return COMPARE_EQUAL;
        }
 
        SvLBoxString* pLeftTextItem = 
static_cast<SvLBoxString*>(pLHS->GetFirstItem(SV_ITEM_ID_LBOXSTRING));




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to