User: kz      
Date: 2006/10/05 06:02:03

Modified:
   dba/dbaccess/source/ui/browser/dsEntriesNoExp.cxx

Log:
 INTEGRATION: CWS hsqlcsvstage1 (1.16.2); FILE MERGED
 2006/09/20 11:43:56 fs 1.16.2.1: #i69696#, being stage 1 of issue #i69526#: 
merging changes from CWS hsqlcsv herein

File Changes:

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

File [changed]: dsEntriesNoExp.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/dbaccess/source/ui/browser/dsEntriesNoExp.cxx?r1=1.16&r2=1.17
Delta lines:  +69 -27
---------------------
--- dsEntriesNoExp.cxx  17 Sep 2006 06:57:47 -0000      1.16
+++ dsEntriesNoExp.cxx  5 Oct 2006 13:02:00 -0000       1.17
@@ -45,6 +45,9 @@
 #ifndef _DBAUI_LISTVIEWITEMS_HXX_
 #include "listviewitems.hxx"
 #endif
+#ifndef DBACCESS_IMAGEPROVIDER_HXX
+#include "imageprovider.hxx"
+#endif
 #ifndef _TOOLS_DEBUG_HXX
 #include <tools/debug.hxx>
 #endif
@@ -76,7 +79,7 @@
        switch (getEntryType(_pEntry))
        {
                case etTableContainer:
-                       return etTable;
+                       return etTableOrView;
                case etQueryContainer:
                        return etQuery;
         default:
@@ -118,7 +121,7 @@
                return etQueryContainer;
 
        if (pTables == pEntryParent)
-               return etTable;
+               return etTableOrView;
 
        if (pQueries == pEntryParent)
                return etQuery;
@@ -196,39 +199,78 @@
 {
        return String();
 }
+
 // 
-----------------------------------------------------------------------------
-void SbaTableQueryBrowser::notifyHiContrastChanged()
+sal_Int32 SbaTableQueryBrowser::getDatabaseObjectType( EntryType _eType )
 {
-       if ( m_pTreeView )
+    switch ( _eType )
        {
-               sal_Bool bHiContrast = isHiContrast();
+    case etQuery:
+    case etQueryContainer:
+        return DatabaseObject::QUERY;
+    case etTableOrView:
+    case etTableContainer:
+        return DatabaseObject::TABLE;
+    default:
+        break;
+    }
+    OSL_ENSURE( false, "SbaTableQueryBrowser::getDatabaseObjectType: folder 
types and 'Unknown' not allowed here!" );
+    return DatabaseObject::TABLE;
+}
 
-               if ( m_bHiContrast != bHiContrast )
+// 
-----------------------------------------------------------------------------
+void SbaTableQueryBrowser::notifyHiContrastChanged()
+{
+       if ( m_pTreeView )
                {
-                       m_bHiContrast = bHiContrast;
                        // change all bitmap entries
                        SvLBoxEntry* pEntryLoop = m_pTreeModel->First();
                        while ( pEntryLoop )
                        {
                                DBTreeListModel::DBTreeListUserData* pData = 
static_cast<DBTreeListModel::DBTreeListUserData*>(pEntryLoop->GetUserData());
-                               if ( pData )
+                       if ( !pData )
                                {
-                                       ModuleRes 
aResId(DBTreeListModel::getImageResId(pData->eType,isHiContrast()));
-                                       Image aImage(aResId);
+                               pEntryLoop = m_pTreeModel->Next(pEntryLoop);
+                continue;
+            }
+
+            // the connection to which this entry belongs, if any
+            ::std::auto_ptr< ImageProvider > pImageProvider( 
getImageProviderFor( pEntryLoop ) );
+
+            // the images for this entry
+            Image aImage, aImageHC;
+            bool bIsFolder = !isObject( pData->eType );
+            if ( bIsFolder )
+            {
+                sal_Int32 nObjectType( getDatabaseObjectType( pData->eType ) );
+                aImage = pImageProvider->getFolderImage( nObjectType, false );
+                aImageHC = pImageProvider->getFolderImage( nObjectType, true );
+            }
+            else
+            {
+                sal_Int32 nObjectType( getDatabaseObjectType( pData->eType ) );
+                aImage = pImageProvider->getImage( GetEntryText( pEntryLoop ), 
nObjectType, false );
+                aImageHC = pImageProvider->getImage( GetEntryText( pEntryLoop 
), nObjectType, true );
+            }
+
+            // find the proper item, and set its icons
                                        USHORT nCount = pEntryLoop->ItemCount();
                                        for (USHORT i=0;i<nCount;++i)
                                        {
                                                SvLBoxItem* pItem = 
pEntryLoop->GetItem(i);
-                                               if ( pItem && pItem->IsA() == 
SV_ITEM_ID_LBOXCONTEXTBMP)
-                                               {
-                                                       
static_cast<SvLBoxContextBmp*>(pItem)->SetBitmap1( aImage );
-                                                       
static_cast<SvLBoxContextBmp*>(pItem)->SetBitmap2( aImage );
+                               if ( !pItem || ( pItem->IsA() != 
SV_ITEM_ID_LBOXCONTEXTBMP ) )
+                    continue;
+
+                SvLBoxContextBmp* pContextBitmapItem = static_cast< 
SvLBoxContextBmp* >( pItem );
+
+                               pContextBitmapItem->SetBitmap1( aImage, 
BMP_COLOR_NORMAL );
+                               pContextBitmapItem->SetBitmap2( aImage, 
BMP_COLOR_NORMAL );
+                               pContextBitmapItem->SetBitmap1( aImageHC, 
BMP_COLOR_HIGHCONTRAST );
+                               pContextBitmapItem->SetBitmap2( aImageHC, 
BMP_COLOR_HIGHCONTRAST );
                                                        break;
                                                }
-                                       }
-                               }
+
                                pEntryLoop = m_pTreeModel->Next(pEntryLoop);
-                       }
                }
        }
 }




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

Reply via email to