diff options
Diffstat (limited to 'dbaccess/source/ui/app/AppDetailPageHelper.cxx')
-rw-r--r-- | dbaccess/source/ui/app/AppDetailPageHelper.cxx | 89 |
1 files changed, 28 insertions, 61 deletions
diff --git a/dbaccess/source/ui/app/AppDetailPageHelper.cxx b/dbaccess/source/ui/app/AppDetailPageHelper.cxx index d89c495e5106..df0987676ef0 100644 --- a/dbaccess/source/ui/app/AppDetailPageHelper.cxx +++ b/dbaccess/source/ui/app/AppDetailPageHelper.cxx @@ -193,7 +193,7 @@ namespace { SetTextColor( rStyleSettings.GetFieldTextColor() ); SetTextFillColor(); - } // if( bForeground || bFont ) + } if( bBackground ) SetBackground( rStyleSettings.GetFieldColor() ); @@ -543,13 +543,11 @@ sal_Bool OAppDetailPageHelper::isCutAllowed() // ----------------------------------------------------------------------------- sal_Bool OAppDetailPageHelper::isCopyAllowed() { - //int nPos = getVisibleControlIndex(); return sal_True; } // ----------------------------------------------------------------------------- sal_Bool OAppDetailPageHelper::isPasteAllowed() { - //int nPos = getVisibleControlIndex(); return sal_True; } // ----------------------------------------------------------------------------- @@ -623,8 +621,7 @@ void OAppDetailPageHelper::createTablesPage(const Reference< XConnection>& _xCon ImageProvider aImageProvider( _xConnection ); createTree( pTreeView, - aImageProvider.getDefaultImage( DatabaseObject::TABLE, false ), - aImageProvider.getDefaultImage( DatabaseObject::TABLE, true ) + aImageProvider.getDefaultImage( DatabaseObject::TABLE ) ); pTreeView->notifyHiContrastChanged(); @@ -644,10 +641,10 @@ void OAppDetailPageHelper::createTablesPage(const Reference< XConnection>& _xCon } // ----------------------------------------------------------------------------- -void OAppDetailPageHelper::getElementIcons( ElementType _eType, USHORT& _rImageId, USHORT& _rHighContrastImageId ) +void OAppDetailPageHelper::getElementIcons( ElementType _eType, USHORT& _rImageId ) { ImageProvider aImageProvider; - _rImageId = _rHighContrastImageId = 0; + _rImageId = 0; sal_Int32 nDatabaseObjectType( 0 ); switch(_eType ) @@ -659,8 +656,7 @@ void OAppDetailPageHelper::getElementIcons( ElementType _eType, USHORT& _rImageI OSL_ENSURE( sal_False, "OAppDetailPageHelper::GetElementIcons: invalid element type!" ); return; } - _rImageId = aImageProvider.getDefaultImageResourceID( nDatabaseObjectType, false ); - _rHighContrastImageId = aImageProvider.getDefaultImageResourceID( nDatabaseObjectType, true ); + _rImageId = aImageProvider.getDefaultImageResourceID( nDatabaseObjectType ); } // ----------------------------------------------------------------------------- @@ -668,41 +664,38 @@ void OAppDetailPageHelper::createPage(ElementType _eType,const Reference< XNameA { OSL_ENSURE(E_TABLE != _eType,"E_TABLE isn't allowed."); - USHORT nHelpId = 0, nImageId = 0, nImageIdH = 0; + USHORT nHelpId = 0, nImageId = 0; ImageProvider aImageProvider; - Image aFolderImage, aFolderImageHC; + Image aFolderImage; switch( _eType ) { case E_FORM: nHelpId = HID_APP_FORM_TREE; - aFolderImage = aImageProvider.getFolderImage( DatabaseObject::FORM, false ); - aFolderImageHC = aImageProvider.getFolderImage( DatabaseObject::FORM, true ); + aFolderImage = aImageProvider.getFolderImage( DatabaseObject::FORM ); break; case E_REPORT: nHelpId = HID_APP_REPORT_TREE; - aFolderImage = aImageProvider.getFolderImage( DatabaseObject::REPORT, false ); - aFolderImageHC = aImageProvider.getFolderImage( DatabaseObject::REPORT, true ); + aFolderImage = aImageProvider.getFolderImage( DatabaseObject::REPORT ); break; case E_QUERY: nHelpId = HID_APP_QUERY_TREE; - aFolderImage = aImageProvider.getFolderImage( DatabaseObject::QUERY, false ); - aFolderImageHC = aImageProvider.getFolderImage( DatabaseObject::QUERY, true ); + aFolderImage = aImageProvider.getFolderImage( DatabaseObject::QUERY ); break; default: OSL_ENSURE(0,"Illegal call!"); } - getElementIcons( _eType, nImageId, nImageIdH ); + getElementIcons( _eType, nImageId ); if ( !m_pLists[_eType] ) { - m_pLists[_eType] = createSimpleTree( nHelpId, aFolderImage, aFolderImageHC ); + m_pLists[_eType] = createSimpleTree( nHelpId, aFolderImage ); } if ( m_pLists[_eType] ) { if ( !m_pLists[_eType]->GetEntryCount() && _xContainer.is() ) { - fillNames( _xContainer, _eType, nImageId, nImageIdH, NULL ); + fillNames( _xContainer, _eType, nImageId, NULL ); m_pLists[_eType]->SelectAll(FALSE); } @@ -750,7 +743,7 @@ namespace // ----------------------------------------------------------------------------- void OAppDetailPageHelper::fillNames( const Reference< XNameAccess >& _xContainer, const ElementType _eType, - const USHORT _nImageId, const USHORT _nHighContrastImageId, SvLBoxEntry* _pParent ) + const USHORT _nImageId, SvLBoxEntry* _pParent ) { OSL_ENSURE(_xContainer.is(),"Data source is NULL! -> GPF"); OSL_ENSURE( ( _eType >= E_TABLE ) && ( _eType < E_ELEMENT_TYPE_COUNT ), "OAppDetailPageHelper::fillNames: invalid type!" ); @@ -775,33 +768,29 @@ void OAppDetailPageHelper::fillNames( const Reference< XNameAccess >& _xContaine { pEntry = pList->InsertEntry( *pIter, _pParent, FALSE, LIST_APPEND, reinterpret_cast< void* >( nFolderIndicator ) ); getBorderWin().getView()->getAppController().containerFound( Reference< XContainer >( xSubElements, UNO_QUERY ) ); - fillNames( xSubElements, _eType, _nImageId, _nHighContrastImageId, pEntry ); + fillNames( xSubElements, _eType, _nImageId, pEntry ); } else { pEntry = pList->InsertEntry( *pIter, _pParent ); Image aImage = Image( ModuleRes( _nImageId ) ); - pList->SetExpandedEntryBmp( pEntry, aImage, BMP_COLOR_NORMAL ); - pList->SetCollapsedEntryBmp( pEntry, aImage, BMP_COLOR_NORMAL ); - - Image aHCImage = Image( ModuleRes( _nHighContrastImageId ) ); - pList->SetExpandedEntryBmp( pEntry, aHCImage, BMP_COLOR_HIGHCONTRAST ); - pList->SetCollapsedEntryBmp( pEntry, aHCImage, BMP_COLOR_HIGHCONTRAST ); + pList->SetExpandedEntryBmp( pEntry, aImage ); + pList->SetCollapsedEntryBmp( pEntry, aImage ); } } } } // ----------------------------------------------------------------------------- -DBTreeListBox* OAppDetailPageHelper::createSimpleTree( ULONG _nHelpId, const Image& _rImage, const Image& _rImageHC ) +DBTreeListBox* OAppDetailPageHelper::createSimpleTree( ULONG _nHelpId, const Image& _rImage ) { DBTreeListBox* pTreeView = new DBTreeListBox(this,getBorderWin().getView()->getORB(),WB_HASLINES | WB_SORT | WB_HASBUTTONS | WB_HSCROLL |WB_HASBUTTONSATROOT | WB_TABSTOP); pTreeView->SetHelpId(_nHelpId); - return createTree( pTreeView, _rImage, _rImageHC ); + return createTree( pTreeView, _rImage ); } // ----------------------------------------------------------------------------- -DBTreeListBox* OAppDetailPageHelper::createTree( DBTreeListBox* _pTreeView, const Image& _rImage, const Image& _rImageHC ) +DBTreeListBox* OAppDetailPageHelper::createTree( DBTreeListBox* _pTreeView, const Image& _rImage ) { WaitObject aWaitCursor(this); @@ -811,9 +800,7 @@ DBTreeListBox* OAppDetailPageHelper::createTree( DBTreeListBox* _pTreeView, cons _pTreeView->SetSelectionMode(MULTIPLE_SELECTION); _pTreeView->SetDefaultCollapsedEntryBmp( _rImage ); - _pTreeView->SetDefaultCollapsedEntryBmp( _rImageHC, BMP_COLOR_HIGHCONTRAST ); _pTreeView->SetDefaultExpandedEntryBmp( _rImage ); - _pTreeView->SetDefaultExpandedEntryBmp( _rImageHC, BMP_COLOR_HIGHCONTRAST ); _pTreeView->SetDoubleClickHdl(LINK(this, OAppDetailPageHelper, OnEntryDoubleClick)); _pTreeView->SetEnterKeyHdl(LINK(this, OAppDetailPageHelper, OnEntryDoubleClick)); @@ -905,26 +892,22 @@ SvLBoxEntry* OAppDetailPageHelper::elementAdded(ElementType _eType,const ::rtl:: } } - USHORT nImageId = 0, nImageIdH = 0; - getElementIcons( _eType, nImageId, nImageIdH ); + USHORT nImageId = 0; + getElementIcons( _eType, nImageId ); Reference<XNameAccess> xContainer(_rObject,UNO_QUERY); if ( xContainer.is() ) { const sal_Int32 nFolderIndicator = lcl_getFolderIndicatorForType( _eType ); pRet = pTreeView->InsertEntry( _rName, pEntry, FALSE, LIST_APPEND, reinterpret_cast< void* >( nFolderIndicator ) ); - fillNames( xContainer, _eType, nImageId, nImageIdH, pRet ); + fillNames( xContainer, _eType, nImageId, pRet ); } else { pRet = pTreeView->InsertEntry( _rName, pEntry ); Image aImage = Image( ModuleRes( nImageId ) ); - pTreeView->SetExpandedEntryBmp( pRet, aImage, BMP_COLOR_NORMAL ); - pTreeView->SetCollapsedEntryBmp( pRet, aImage, BMP_COLOR_NORMAL ); - - Image aHCImage = Image( ModuleRes( nImageIdH ) ); - pTreeView->SetExpandedEntryBmp( pRet, aHCImage, BMP_COLOR_HIGHCONTRAST ); - pTreeView->SetCollapsedEntryBmp( pRet, aHCImage, BMP_COLOR_HIGHCONTRAST ); + pTreeView->SetExpandedEntryBmp( pRet, aImage ); + pTreeView->SetCollapsedEntryBmp( pRet, aImage ); } } return pRet; @@ -1007,8 +990,7 @@ IMPL_LINK( OAppDetailPageHelper, OnDeleteEntry, void*, /*NOINTERESTEDIN*/ ) // ----------------------------------------------------------------------------- void OAppDetailPageHelper::Resize() { - ////////////////////////////////////////////////////////////////////// - // Abmessungen parent window + // parent window dimension Size aOutputSize( GetOutputSize() ); long nOutputWidth = aOutputSize.Width(); long nOutputHeight = aOutputSize.Height(); @@ -1145,12 +1127,6 @@ void OAppDetailPageHelper::showPreview(const Reference< XContent >& _xContent) { m_aPreview.Hide(); m_aDocumentInfo.Hide(); - - // Why the below code? It might have side effects, as the tree view needs to know - // its current selection for other purposes than the preview, too. -// DBTreeListBox* pTreeView = getCurrentView(); -// if ( pTreeView ) -// pTreeView->clearCurrentSelection(); } } catch( const Exception& ) @@ -1179,7 +1155,7 @@ void OAppDetailPageHelper::showPreview( const ::rtl::OUString& _sDataSourceName, // work-around for #150518#: no layout manager (and thus no toolbars) in the preview // Must be called after initialize ... but before any other call to this frame. - // Otherwhise frame throws "life time exceptions" as e.g. NON_INITIALIZED + // Otherwise frame throws "life time exceptions" as e.g. NON_INITIALIZED Reference< XPropertySet > xFrameProps( m_xFrame, UNO_QUERY_THROW ); xFrameProps->setPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "LayoutManager" ) ), makeAny(Reference< XLayoutManager >()) ); @@ -1314,34 +1290,25 @@ void OAppDetailPageHelper::DataChanged( const DataChangedEvent& rDCEvt ) void OAppDetailPageHelper::ImplInitSettings() { const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings(); - if( true ) - { Font aFont; aFont = rStyleSettings.GetFieldFont(); aFont.SetColor( rStyleSettings.GetWindowTextColor() ); SetPointFont( aFont ); m_aTBPreview.SetPointFont( aFont ); - } - if( true ) - { SetTextColor( rStyleSettings.GetFieldTextColor() ); SetTextFillColor(); m_aBorder.SetTextColor( rStyleSettings.GetFieldTextColor() ); m_aBorder.SetTextFillColor(); m_aTBPreview.SetTextColor( rStyleSettings.GetFieldTextColor() ); m_aTBPreview.SetTextFillColor(); - } // if( true ) - if( true ) - { SetBackground( rStyleSettings.GetFieldColor() ); m_aBorder.SetBackground( rStyleSettings.GetFieldColor() ); m_aFL.SetBackground( rStyleSettings.GetFieldColor() ); m_aDocumentInfo.SetBackground( rStyleSettings.GetFieldColor() ); m_aTBPreview.SetBackground( rStyleSettings.GetFieldColor() ); m_pTablePreview->SetBackground( rStyleSettings.GetFieldColor() ); - } // if( true ) } // ----------------------------------------------------------------------------- OPreviewWindow::OPreviewWindow(Window* _pParent) @@ -1428,7 +1395,7 @@ void OPreviewWindow::ImplInitSettings( sal_Bool bFont, sal_Bool bForeground, sal { SetTextColor( rStyleSettings.GetFieldTextColor() ); SetTextFillColor(); - } // if( bForeground || bFont ) + } if( bBackground ) SetBackground( rStyleSettings.GetFieldColor() ); |