LCOV - code coverage report
Current view: top level - dbaccess/source/ui/app - AppView.cxx (source / functions) Hit Total Coverage
Test: commit 0e63ca4fde4e446f346e35849c756a30ca294aab Lines: 136 262 51.9 %
Date: 2014-04-11 Functions: 26 54 48.1 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
       2             : /*
       3             :  * This file is part of the LibreOffice project.
       4             :  *
       5             :  * This Source Code Form is subject to the terms of the Mozilla Public
       6             :  * License, v. 2.0. If a copy of the MPL was not distributed with this
       7             :  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
       8             :  *
       9             :  * This file incorporates work covered by the following license notice:
      10             :  *
      11             :  *   Licensed to the Apache Software Foundation (ASF) under one or more
      12             :  *   contributor license agreements. See the NOTICE file distributed
      13             :  *   with this work for additional information regarding copyright
      14             :  *   ownership. The ASF licenses this file to you under the Apache
      15             :  *   License, Version 2.0 (the "License"); you may not use this file
      16             :  *   except in compliance with the License. You may obtain a copy of
      17             :  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
      18             :  */
      19             : 
      20             : #include "AppView.hxx"
      21             : #include "dbu_app.hrc"
      22             : #include <tools/debug.hxx>
      23             : #include <tools/diagnose_ex.h>
      24             : #include "dbaccess_helpid.hrc"
      25             : #include <vcl/toolbox.hxx>
      26             : #include <unotools/configmgr.hxx>
      27             : #include <vcl/waitobj.hxx>
      28             : #include <comphelper/types.hxx>
      29             : #include <com/sun/star/datatransfer/clipboard/XClipboard.hpp>
      30             : #include <com/sun/star/beans/XPropertySet.hpp>
      31             : #include <com/sun/star/sdbcx/XTablesSupplier.hpp>
      32             : #include <com/sun/star/sdb/XQueriesSupplier.hpp>
      33             : #include <unotools/syslocale.hxx>
      34             : #include "UITools.hxx"
      35             : #include "AppDetailView.hxx"
      36             : #include "tabletree.hxx"
      37             : #include "AppSwapWindow.hxx"
      38             : #include <vcl/svapp.hxx>
      39             : #include <vcl/settings.hxx>
      40             : #include "AppTitleWindow.hxx"
      41             : #include "dsntypes.hxx"
      42             : #include "dbustrings.hrc"
      43             : #include <dbaccess/IController.hxx>
      44             : #include "browserids.hxx"
      45             : #include <unotools/pathoptions.hxx>
      46             : #include "IApplicationController.hxx"
      47             : #include <boost/scoped_ptr.hpp>
      48             : 
      49             : using namespace ::dbaui;
      50             : using namespace ::com::sun::star::uno;
      51             : using namespace ::com::sun::star::ucb;
      52             : using namespace ::com::sun::star::beans;
      53             : using namespace ::com::sun::star::sdb;
      54             : using namespace ::com::sun::star::sdbc;
      55             : using namespace ::com::sun::star::sdbcx;
      56             : using namespace ::com::sun::star::datatransfer::clipboard;
      57             : using namespace ::com::sun::star::lang;
      58             : using namespace ::com::sun::star::frame;
      59             : using namespace ::com::sun::star::container;
      60             : using ::com::sun::star::sdb::application::NamedDatabaseObject;
      61             : 
      62             : // class OAppBorderWindow
      63           5 : OAppBorderWindow::OAppBorderWindow(OApplicationView* _pParent,PreviewMode _ePreviewMode) : Window(_pParent,WB_DIALOGCONTROL)
      64             :     ,m_pPanel(NULL)
      65             :     ,m_pDetailView(NULL)
      66           5 :     ,m_pView(_pParent)
      67             : {
      68             : 
      69           5 :     SetBorderStyle(WINDOW_BORDER_MONO);
      70             : 
      71           5 :     m_pPanel = new OTitleWindow(this,STR_DATABASE,WB_BORDER | WB_DIALOGCONTROL ,sal_False);
      72           5 :     m_pPanel->SetBorderStyle(WINDOW_BORDER_MONO);
      73           5 :     OApplicationSwapWindow* pSwap = new OApplicationSwapWindow( m_pPanel, *this );
      74           5 :     pSwap->Show();
      75           5 :     pSwap->SetUniqueId(UID_APP_SWAP_VIEW);
      76             : 
      77           5 :     m_pPanel->setChildWindow(pSwap);
      78           5 :     m_pPanel->SetUniqueId(UID_APP_DATABASE_VIEW);
      79           5 :     m_pPanel->Show();
      80             : 
      81           5 :     m_pDetailView = new OApplicationDetailView(*this,_ePreviewMode);
      82           5 :     m_pDetailView->Show();
      83             : 
      84           5 :     ImplInitSettings();
      85           5 : }
      86             : 
      87           3 : OAppBorderWindow::~OAppBorderWindow()
      88             : {
      89             :     // destroy children
      90           1 :     if ( m_pPanel )
      91             :     {
      92           1 :         m_pPanel->Hide();
      93           1 :         boost::scoped_ptr<Window> aTemp(m_pPanel);
      94           1 :         m_pPanel = NULL;
      95             :     }
      96           1 :     if ( m_pDetailView )
      97             :     {
      98           1 :         m_pDetailView->Hide();
      99           1 :         boost::scoped_ptr<Window> aTemp(m_pDetailView);
     100           1 :         m_pDetailView = NULL;
     101             :     }
     102             : 
     103           2 : }
     104             : 
     105           6 : void OAppBorderWindow::GetFocus()
     106             : {
     107           6 :     if ( m_pPanel )
     108           5 :         m_pPanel->GrabFocus();
     109           6 : }
     110             : 
     111          17 : void OAppBorderWindow::Resize()
     112             : {
     113             :     // parent window dimension
     114          17 :     Size aOutputSize( GetOutputSize() );
     115          17 :     long nOutputWidth   = aOutputSize.Width();
     116          17 :     long nOutputHeight  = aOutputSize.Height();
     117          17 :     long nX = 0;
     118             : 
     119          17 :     Size aFLSize = LogicToPixel( Size( 3, 8 ), MAP_APPFONT );
     120          17 :     if ( m_pPanel )
     121             :     {
     122          17 :         OApplicationSwapWindow* pSwap = getPanel();
     123          17 :         if ( pSwap )
     124             :         {
     125          17 :             if ( pSwap->GetEntryCount() != 0 )
     126          17 :                 nX = pSwap->GetBoundingBox( pSwap->GetEntry(0) ).GetWidth() + aFLSize.Height();
     127             :         }
     128          17 :         nX = ::std::max(m_pPanel->GetWidthPixel() ,nX);
     129          17 :         m_pPanel->SetPosSizePixel(Point(0,0),Size(nX,nOutputHeight));
     130             :     }
     131             : 
     132          17 :     if ( m_pDetailView )
     133          17 :         m_pDetailView->SetPosSizePixel(Point(nX + aFLSize.Width(),0),Size(nOutputWidth - nX - aFLSize.Width(),nOutputHeight));
     134          17 : }
     135             : 
     136           0 : void OAppBorderWindow::DataChanged( const DataChangedEvent& rDCEvt )
     137             : {
     138           0 :     Window::DataChanged( rDCEvt );
     139             : 
     140           0 :     if ( (rDCEvt.GetType() == DATACHANGED_FONTS) ||
     141           0 :         (rDCEvt.GetType() == DATACHANGED_DISPLAY) ||
     142           0 :         (rDCEvt.GetType() == DATACHANGED_FONTSUBSTITUTION) ||
     143           0 :         ((rDCEvt.GetType() == DATACHANGED_SETTINGS) &&
     144           0 :         (rDCEvt.GetFlags() & SETTINGS_STYLE)) )
     145             :     {
     146           0 :         ImplInitSettings();
     147           0 :         Invalidate();
     148             :     }
     149           0 : }
     150             : 
     151           5 : void OAppBorderWindow::ImplInitSettings()
     152             : {
     153           5 :     const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
     154             :     if( true )
     155             :     {
     156           5 :         Font aFont;
     157           5 :         aFont = rStyleSettings.GetFieldFont();
     158           5 :         aFont.SetColor( rStyleSettings.GetWindowTextColor() );
     159           5 :         SetPointFont( aFont );
     160             :     }
     161             : 
     162             :     if( true )
     163             :     {
     164           5 :         SetTextColor( rStyleSettings.GetFieldTextColor() );
     165           5 :         SetTextFillColor();
     166             :     }
     167             : 
     168             :     if( true )
     169           5 :         SetBackground( rStyleSettings.GetDialogColor() );
     170           5 : }
     171             : 
     172          22 : OApplicationView* OAppBorderWindow::getView() const
     173             : {
     174          22 :     return m_pView;
     175             : }
     176             : 
     177         201 : OApplicationSwapWindow* OAppBorderWindow::getPanel() const
     178             : {
     179         201 :     return static_cast< OApplicationSwapWindow* >( m_pPanel->getChildWindow() );
     180             : }
     181             : 
     182         279 : OApplicationDetailView* OAppBorderWindow::getDetailView() const
     183             : {
     184         279 :     return m_pDetailView;
     185             : }
     186             : 
     187             : // class OApplicationView
     188           5 : OApplicationView::OApplicationView( Window* pParent
     189             :                                     ,const Reference< XComponentContext >& _rxOrb
     190             :                                     ,IApplicationController& _rAppController
     191             :                                     ,PreviewMode _ePreviewMode
     192             :                                    ) :
     193             :     ODataView( pParent, _rAppController, _rxOrb, WB_DIALOGCONTROL )
     194             :     ,m_rAppController( _rAppController )
     195           5 :     ,m_eChildFocus(NONE)
     196             : {
     197             : 
     198             :     try
     199             :     {
     200           5 :         m_aLocale = SvtSysLocale().GetLanguageTag().getLocale();
     201             :     }
     202           0 :     catch(Exception&)
     203             :     {
     204             :     }
     205             : 
     206           5 :     m_pWin = new OAppBorderWindow(this,_ePreviewMode);
     207           5 :     m_pWin->SetUniqueId(UID_APP_VIEW_BORDER_WIN);
     208           5 :     m_pWin->Show();
     209             : 
     210           5 :     ImplInitSettings();
     211           5 : }
     212             : 
     213           3 : OApplicationView::~OApplicationView()
     214             : {
     215             : 
     216             :     {
     217           1 :         stopComponentListening(m_xObject);
     218           1 :         m_pWin->Hide();
     219           1 :         boost::scoped_ptr<Window> aTemp(m_pWin);
     220           1 :         m_pWin = NULL;
     221             :     }
     222           2 : }
     223             : 
     224           5 : void OApplicationView::createIconAutoMnemonics( MnemonicGenerator& _rMnemonics )
     225             : {
     226           5 :     if ( m_pWin && m_pWin->getPanel() )
     227           5 :         m_pWin->getPanel()->createIconAutoMnemonics( _rMnemonics );
     228           5 : }
     229             : 
     230           5 : void OApplicationView::setTaskExternalMnemonics( MnemonicGenerator& _rMnemonics )
     231             : {
     232           5 :     if ( m_pWin && m_pWin->getDetailView() )
     233           5 :         m_pWin->getDetailView()->setTaskExternalMnemonics( _rMnemonics );
     234           5 : }
     235             : 
     236           0 : void OApplicationView::DataChanged( const DataChangedEvent& rDCEvt )
     237             : {
     238           0 :     ODataView::DataChanged( rDCEvt );
     239             : 
     240           0 :     if ( (rDCEvt.GetType() == DATACHANGED_FONTS) ||
     241           0 :         (rDCEvt.GetType() == DATACHANGED_DISPLAY) ||
     242           0 :         (rDCEvt.GetType() == DATACHANGED_FONTSUBSTITUTION) ||
     243           0 :         ((rDCEvt.GetType() == DATACHANGED_SETTINGS) &&
     244           0 :         (rDCEvt.GetFlags() & SETTINGS_STYLE)) )
     245             :     {
     246           0 :         ImplInitSettings();
     247           0 :         Invalidate();
     248             :     }
     249           0 : }
     250             : 
     251          17 : void OApplicationView::resizeDocumentView(Rectangle& _rPlayground)
     252             : {
     253          17 :     if ( m_pWin && !_rPlayground.IsEmpty() )
     254             :     {
     255          12 :         Size aFLSize = LogicToPixel( Size( 3, 3 ), MAP_APPFONT );
     256          12 :         _rPlayground.Move( aFLSize.A(),aFLSize.B() );
     257          12 :         Size aOldSize = _rPlayground.GetSize();
     258          12 :         _rPlayground.SetSize( Size(aOldSize.A() - 2*aFLSize.A(), aOldSize.B() - 2*aFLSize.B()) );
     259             : 
     260          12 :         m_pWin->SetPosSizePixel(_rPlayground.TopLeft() , _rPlayground.GetSize() );
     261             :     }
     262             :     // just for completeness: there is no space left, we occupied it all ...
     263          17 :     _rPlayground.SetPos( _rPlayground.BottomRight() );
     264          17 :     _rPlayground.SetSize( Size( 0, 0 ) );
     265          17 : }
     266             : 
     267          64 : bool OApplicationView::PreNotify( NotifyEvent& rNEvt )
     268             : {
     269          64 :     switch(rNEvt.GetType())
     270             :     {
     271             :         case EVENT_GETFOCUS:
     272          34 :             if( m_pWin && getPanel() && getPanel()->HasChildPathFocus() )
     273          15 :                 m_eChildFocus = PANELSWAP;
     274          19 :             else if ( m_pWin && getDetailView() && getDetailView()->HasChildPathFocus() )
     275           0 :                 m_eChildFocus = DETAIL;
     276             :             else
     277          19 :                 m_eChildFocus = NONE;
     278          34 :             break;
     279             :         case EVENT_KEYINPUT:
     280             :         {
     281           0 :             const KeyEvent* pKeyEvent = rNEvt.GetKeyEvent();
     282             :             // give the pane the chance to intercept mnemonic accelerators
     283             :             // #i34790#
     284           0 :             if ( getPanel() && getPanel()->interceptKeyInput( *pKeyEvent ) )
     285           0 :                 return true;
     286             :             // and ditto the detail view
     287             :             // #i72799#
     288           0 :             if ( getDetailView() && getDetailView()->interceptKeyInput( *pKeyEvent ) )
     289           0 :                 return true;
     290             :         }
     291           0 :         break;
     292             :     }
     293             : 
     294          64 :     return ODataView::PreNotify(rNEvt);
     295             : }
     296             : 
     297           0 : IClipboardTest* OApplicationView::getActiveChild() const
     298             : {
     299           0 :     IClipboardTest* pTest = NULL;
     300           0 :     if ( DETAIL == m_eChildFocus )
     301           0 :         pTest = getDetailView();
     302           0 :     return pTest;
     303             : }
     304             : 
     305           0 : sal_Bool OApplicationView::isCopyAllowed()
     306             : {
     307           0 :     IClipboardTest* pTest = getActiveChild();
     308           0 :     return pTest && pTest->isCopyAllowed();
     309             : }
     310             : 
     311           0 : sal_Bool OApplicationView::isCutAllowed()
     312             : {
     313           0 :     IClipboardTest* pTest = getActiveChild();
     314           0 :     return pTest && pTest->isCutAllowed();
     315             : }
     316             : 
     317           0 : sal_Bool OApplicationView::isPasteAllowed()
     318             : {
     319           0 :     IClipboardTest* pTest = getActiveChild();
     320           0 :     return pTest && pTest->isPasteAllowed();
     321             : }
     322             : 
     323           0 : void OApplicationView::copy()
     324             : {
     325           0 :     IClipboardTest* pTest = getActiveChild();
     326           0 :     if ( pTest )
     327           0 :         pTest->copy();
     328           0 : }
     329             : 
     330           0 : void OApplicationView::cut()
     331             : {
     332           0 :     IClipboardTest* pTest = getActiveChild();
     333           0 :     if ( pTest )
     334           0 :         pTest->cut();
     335           0 : }
     336             : 
     337           0 : void OApplicationView::paste()
     338             : {
     339           0 :     IClipboardTest* pTest = getActiveChild();
     340           0 :     if ( pTest )
     341           0 :         pTest->paste();
     342           0 : }
     343             : 
     344           0 : OUString OApplicationView::getQualifiedName( SvTreeListEntry* _pEntry ) const
     345             : {
     346             :     OSL_ENSURE(m_pWin && getDetailView(),"Detail view is NULL! -> GPF");
     347           0 :     return getDetailView()->getQualifiedName( _pEntry );
     348             : }
     349             : 
     350           0 : sal_Bool OApplicationView::isLeaf(SvTreeListEntry* _pEntry) const
     351             : {
     352             :     OSL_ENSURE(m_pWin && getDetailView(),"Detail view is NULL! -> GPF");
     353           0 :     return getDetailView()->isLeaf(_pEntry);
     354             : }
     355             : 
     356          12 : sal_Bool OApplicationView::isALeafSelected() const
     357             : {
     358             :     OSL_ENSURE(m_pWin && getDetailView(),"Detail view is NULL! -> GPF");
     359          12 :     return getDetailView()->isALeafSelected();
     360             : }
     361             : 
     362           0 : void OApplicationView::selectAll()
     363             : {
     364             :     OSL_ENSURE(m_pWin && getDetailView(),"Detail view is NULL! -> GPF");
     365           0 :     getDetailView()->selectAll();
     366           0 : }
     367             : 
     368           0 : sal_Bool OApplicationView::isSortUp() const
     369             : {
     370             :     OSL_ENSURE(m_pWin && getDetailView(),"Detail view is NULL! -> GPF");
     371           0 :     return getDetailView()->isSortUp();
     372             : }
     373             : 
     374           0 : void OApplicationView::sortDown()
     375             : {
     376             :     OSL_ENSURE(m_pWin && getDetailView(),"Detail view is NULL! -> GPF");
     377           0 :     getDetailView()->sortDown();
     378           0 : }
     379             : 
     380           0 : void OApplicationView::sortUp()
     381             : {
     382             :     OSL_ENSURE(m_pWin && getDetailView(),"Detail view is NULL! -> GPF");
     383           0 :     getDetailView()->sortUp();
     384           0 : }
     385             : 
     386           8 : sal_Bool OApplicationView::isFilled() const
     387             : {
     388             :     OSL_ENSURE(m_pWin && getDetailView(),"Detail view is NULL! -> GPF");
     389           8 :     return getDetailView()->isFilled();
     390             : }
     391             : 
     392         112 : ElementType OApplicationView::getElementType() const
     393             : {
     394             :     OSL_ENSURE(m_pWin && getDetailView() && getPanel(),"Detail view is NULL! -> GPF");
     395         112 :     return getDetailView()->HasChildPathFocus() ? getDetailView()->getElementType() : getPanel()->getElementType();
     396             : }
     397             : 
     398          72 : sal_Int32 OApplicationView::getSelectionCount()
     399             : {
     400             :     OSL_ENSURE(m_pWin && getDetailView(),"Detail view is NULL! -> GPF");
     401          72 :     return getDetailView()->getSelectionCount();
     402             : }
     403             : 
     404          12 : sal_Int32 OApplicationView::getElementCount()
     405             : {
     406             :     OSL_ENSURE(m_pWin && getDetailView(),"Detail view is NULL! -> GPF");
     407          12 :     return getDetailView()->getElementCount();
     408             : }
     409             : 
     410           0 : void OApplicationView::getSelectionElementNames( ::std::vector< OUString>& _rNames ) const
     411             : {
     412             :     OSL_ENSURE(m_pWin && getDetailView(),"Detail view is NULL! -> GPF");
     413           0 :     getDetailView()->getSelectionElementNames( _rNames );
     414           0 : }
     415             : 
     416           0 : void OApplicationView::describeCurrentSelectionForControl( const Control& _rControl, Sequence< NamedDatabaseObject >& _out_rSelectedObjects )
     417             : {
     418             :     OSL_ENSURE(m_pWin && getDetailView(),"Detail view is NULL! -> GPF");
     419           0 :     getDetailView()->describeCurrentSelectionForControl( _rControl, _out_rSelectedObjects );
     420           0 : }
     421             : 
     422           0 : void OApplicationView::describeCurrentSelectionForType( const ElementType _eType, Sequence< NamedDatabaseObject >& _out_rSelectedObjects )
     423             : {
     424             :     OSL_ENSURE(m_pWin && getDetailView(),"Detail view is NULL! -> GPF");
     425           0 :     getDetailView()->describeCurrentSelectionForType( _eType, _out_rSelectedObjects );
     426           0 : }
     427             : 
     428           0 : void OApplicationView::selectElements(const Sequence< OUString>& _aNames)
     429             : {
     430             :     OSL_ENSURE(m_pWin && getDetailView(),"Detail view is NULL! -> GPF");
     431           0 :     getDetailView()->selectElements( _aNames );
     432           0 : }
     433             : 
     434           0 : SvTreeListEntry* OApplicationView::elementAdded(ElementType eType,const OUString& _rName, const Any& _rObject )
     435             : {
     436             :     OSL_ENSURE(m_pWin && getDetailView(),"Detail view is NULL! -> GPF");
     437           0 :     return getDetailView()->elementAdded(eType,_rName,_rObject);
     438             : }
     439             : 
     440           0 : void OApplicationView::elementRemoved(ElementType eType,const OUString& _rName )
     441             : {
     442             :     OSL_ENSURE(m_pWin && getDetailView(),"Detail view is NULL! -> GPF");
     443           0 :     getDetailView()->elementRemoved(eType,_rName);
     444           0 : }
     445             : 
     446           0 : void OApplicationView::elementReplaced(ElementType _eType
     447             :                                                     ,const OUString& _rOldName
     448             :                                                     ,const OUString& _rNewName )
     449             : {
     450             :     OSL_ENSURE(m_pWin && getDetailView(),"Detail view is NULL! -> GPF");
     451           0 :     getDetailView()->elementReplaced(_eType, _rOldName, _rNewName );
     452           0 : }
     453             : 
     454           0 : void OApplicationView::clearPages(sal_Bool _bTaskAlso)
     455             : {
     456             :     OSL_ENSURE(m_pWin && getDetailView() && getPanel(),"Detail view is NULL! -> GPF");
     457           0 :     getPanel()->clearSelection();
     458           0 :     getDetailView()->clearPages(_bTaskAlso);
     459           0 : }
     460             : 
     461           2 : void OApplicationView::selectContainer(ElementType _eType)
     462             : {
     463             :     OSL_ENSURE(m_pWin && getPanel(),"Detail view is NULL! -> GPF");
     464           2 :     WaitObject aWO(this);
     465           2 :     getPanel()->selectContainer(_eType);
     466           2 : }
     467             : 
     468           0 : SvTreeListEntry* OApplicationView::getEntry( const Point& _aPosPixel ) const
     469             : {
     470             :     OSL_ENSURE(m_pWin && getDetailView(),"Detail view is NULL! -> GPF");
     471           0 :     return getDetailView()->getEntry(_aPosPixel);
     472             : }
     473             : 
     474          18 : PreviewMode OApplicationView::getPreviewMode()
     475             : {
     476             :     OSL_ENSURE(m_pWin && getDetailView(),"Detail view is NULL! -> GPF");
     477          18 :     return getDetailView()->getPreviewMode();
     478             : }
     479             : 
     480           0 : sal_Bool OApplicationView::isPreviewEnabled()
     481             : {
     482             :     OSL_ENSURE(m_pWin && getDetailView(),"Detail view is NULL! -> GPF");
     483           0 :     return getDetailView()->isPreviewEnabled();
     484             : }
     485             : 
     486           0 : void OApplicationView::switchPreview(PreviewMode _eMode)
     487             : {
     488             :     OSL_ENSURE(m_pWin && getDetailView(),"Detail view is NULL! -> GPF");
     489           0 :     getDetailView()->switchPreview(_eMode);
     490           0 : }
     491             : 
     492           1 : void OApplicationView::showPreview(const Reference< XContent >& _xContent)
     493             : {
     494             :     OSL_ENSURE(m_pWin && getDetailView(),"Detail view is NULL! -> GPF");
     495           1 :     stopComponentListening(m_xObject);
     496           1 :     m_xObject = NULL;
     497           1 :     getDetailView()->showPreview(_xContent);
     498           1 : }
     499             : 
     500           0 : void OApplicationView::showPreview( const OUString& _sDataSourceName,
     501             :                                     const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection>& _xConnection,
     502             :                                     const OUString& _sName,
     503             :                                     sal_Bool _bTable)
     504             : {
     505             :     OSL_ENSURE(m_pWin && getDetailView(),"Detail view is NULL! -> GPF");
     506           0 :     if ( isPreviewEnabled() )
     507             :     {
     508           0 :         stopComponentListening(m_xObject);
     509           0 :         m_xObject = NULL;
     510             :         try
     511             :         {
     512           0 :             Reference<XNameAccess> xNameAccess;
     513           0 :             if ( _bTable )
     514             :             {
     515           0 :                 Reference<XTablesSupplier> xSup(_xConnection,UNO_QUERY);
     516           0 :                 if ( xSup.is() )
     517           0 :                     xNameAccess.set(xSup->getTables(),UNO_QUERY);
     518             :             }
     519             :             else
     520             :             {
     521           0 :                 Reference<XQueriesSupplier> xSup(_xConnection,UNO_QUERY);
     522           0 :                 if ( xSup.is() )
     523           0 :                     xNameAccess.set(xSup->getQueries(),UNO_QUERY);
     524             :             }
     525           0 :             if ( xNameAccess.is() && xNameAccess->hasByName(_sName) )
     526           0 :                 m_xObject.set(xNameAccess->getByName(_sName),UNO_QUERY);
     527             :         }
     528           0 :         catch( const Exception& )
     529             :         {
     530             :             DBG_UNHANDLED_EXCEPTION();
     531             :         }
     532           0 :         if ( m_xObject.is() )
     533           0 :             startComponentListening(m_xObject);
     534           0 :         getDetailView()->showPreview(_sDataSourceName,_sName,_bTable);
     535             :     }
     536           0 : }
     537             : 
     538           6 : void OApplicationView::GetFocus()
     539             : {
     540           6 :     if ( m_eChildFocus == NONE && m_pWin )
     541             :     {
     542           5 :         m_pWin->GrabFocus();
     543             :     }
     544           6 : }
     545             : 
     546           0 : void OApplicationView::_disposing( const ::com::sun::star::lang::EventObject& /*_rSource*/ )
     547             : {
     548           0 :     if ( m_pWin && getDetailView() )
     549           0 :         showPreview(NULL);
     550           0 : }
     551             : 
     552           5 : void OApplicationView::ImplInitSettings()
     553             : {
     554           5 :     const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
     555             :     if( true )
     556             :     {
     557           5 :         Font aFont;
     558           5 :         aFont = rStyleSettings.GetFieldFont();
     559           5 :         aFont.SetColor( rStyleSettings.GetWindowTextColor() );
     560           5 :         SetPointFont( aFont );
     561             :     }
     562             : 
     563             :     if( true )
     564             :     {
     565           5 :         SetTextColor( rStyleSettings.GetFieldTextColor() );
     566           5 :         SetTextFillColor();
     567             :     }
     568             : 
     569             :     if( true )
     570           5 :         SetBackground( rStyleSettings.GetFieldColor() );
     571           5 : }
     572             : 
     573             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10