Kaydet (Commit) e41f44f8 authored tarafından Jens-Heiner Rechtien's avatar Jens-Heiner Rechtien

INTEGRATION: CWS insight01 (1.18.106); FILE MERGED

2004/03/11 08:59:18 oj 1.18.106.3: #111075# changes for closing
2004/02/27 08:41:03 oj 1.18.106.2: #111075# check for vcl control
2003/11/05 11:36:47 oj 1.18.106.1: #111075# ongoing work
üst fbe9cf00
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
* *
* $RCSfile: brwview.cxx,v $ * $RCSfile: brwview.cxx,v $
* *
* $Revision: 1.18 $ * $Revision: 1.19 $
* *
* last change: $Author: oj $ $Date: 2002-08-19 07:32:50 $ * last change: $Author: hr $ $Date: 2004-08-02 15:32:06 $
* *
* The Contents of this file are made available subject to the terms of * The Contents of this file are made available subject to the terms of
* either of the following licenses * either of the following licenses
...@@ -107,6 +107,7 @@ using namespace ::com::sun::star::form; ...@@ -107,6 +107,7 @@ using namespace ::com::sun::star::form;
// using namespace ::com::sun::star::sdbcx; // using namespace ::com::sun::star::sdbcx;
using namespace ::com::sun::star::beans; using namespace ::com::sun::star::beans;
using namespace ::com::sun::star::container; using namespace ::com::sun::star::container;
using namespace ::com::sun::star::lang;
namespace namespace
...@@ -124,7 +125,7 @@ namespace ...@@ -124,7 +125,7 @@ namespace
Reference<XChild> xChild(xGrid->getModel(),UNO_QUERY); Reference<XChild> xChild(xGrid->getModel(),UNO_QUERY);
Reference<XLoadable> xLoad; Reference<XLoadable> xLoad;
if(xChild.is()) if(xChild.is())
xLoad = Reference<XLoadable>(xChild->getParent(),UNO_QUERY); xLoad.set(xChild->getParent(),UNO_QUERY);
bGrabFocus = xLoad.is() && xLoad->isLoaded(); bGrabFocus = xLoad.is() && xLoad->isLoaded();
} }
} }
...@@ -174,15 +175,7 @@ void UnoDataBrowserView::Construct(const Reference< ::com::sun::star::awt::XCont ...@@ -174,15 +175,7 @@ void UnoDataBrowserView::Construct(const Reference< ::com::sun::star::awt::XCont
// get the VCL-control // get the VCL-control
m_pVclControl = NULL; m_pVclControl = NULL;
Reference< ::com::sun::star::awt::XWindowPeer > xPeer = m_xGrid->getPeer(); getVclControl();
if (xPeer.is())
{
SbaXGridPeer* pPeer = SbaXGridPeer::getImplementation(xPeer);
if (pPeer)
m_pVclControl = static_cast<SbaGridControl*>(pPeer->GetWindow());
::dbaui::notifySystemWindow(this,m_pVclControl,::comphelper::mem_fun(&TaskPaneList::AddWindow));
}
DBG_ASSERT(m_pVclControl != NULL, "UnoDataBrowserView::Construct : no real grid control !"); DBG_ASSERT(m_pVclControl != NULL, "UnoDataBrowserView::Construct : no real grid control !");
} }
...@@ -195,12 +188,10 @@ void UnoDataBrowserView::Construct(const Reference< ::com::sun::star::awt::XCont ...@@ -195,12 +188,10 @@ void UnoDataBrowserView::Construct(const Reference< ::com::sun::star::awt::XCont
// ------------------------------------------------------------------------- // -------------------------------------------------------------------------
UnoDataBrowserView::~UnoDataBrowserView() UnoDataBrowserView::~UnoDataBrowserView()
{ {
{
::dbaui::notifySystemWindow(this,m_pVclControl,::comphelper::mem_fun(&TaskPaneList::RemoveWindow)); ::std::auto_ptr<Splitter> aTemp(m_pSplitter);
m_pVclControl = NULL; m_pSplitter = NULL;
}
delete m_pSplitter;
m_pSplitter = NULL;
setTreeView(NULL); setTreeView(NULL);
if ( m_pStatus ) if ( m_pStatus )
...@@ -209,8 +200,13 @@ UnoDataBrowserView::~UnoDataBrowserView() ...@@ -209,8 +200,13 @@ UnoDataBrowserView::~UnoDataBrowserView()
m_pStatus = NULL; m_pStatus = NULL;
} }
::comphelper::disposeComponent(m_xGrid); try
::comphelper::disposeComponent(m_xMe); {
::comphelper::disposeComponent(m_xGrid);
::comphelper::disposeComponent(m_xMe);
}
catch(Exception)
{}
} }
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
IMPL_LINK( UnoDataBrowserView, SplitHdl, void*, p ) IMPL_LINK( UnoDataBrowserView, SplitHdl, void*, p )
...@@ -236,10 +232,8 @@ void UnoDataBrowserView::setTreeView(DBTreeView* _pTreeView) ...@@ -236,10 +232,8 @@ void UnoDataBrowserView::setTreeView(DBTreeView* _pTreeView)
if (m_pTreeView) if (m_pTreeView)
{ {
::dbaui::notifySystemWindow(this,m_pTreeView,::comphelper::mem_fun(&TaskPaneList::RemoveWindow)); ::dbaui::notifySystemWindow(this,m_pTreeView,::comphelper::mem_fun(&TaskPaneList::RemoveWindow));
::std::auto_ptr<Window> aTemp(m_pTreeView);
Window* pDeleteIt = m_pTreeView;
m_pTreeView = NULL; m_pTreeView = NULL;
delete pDeleteIt;
} }
m_pTreeView = _pTreeView; m_pTreeView = _pTreeView;
if ( m_pTreeView ) if ( m_pTreeView )
...@@ -347,8 +341,32 @@ sal_uInt16 UnoDataBrowserView::ViewColumnCount() const ...@@ -347,8 +341,32 @@ sal_uInt16 UnoDataBrowserView::ViewColumnCount() const
{ {
return m_pVclControl ? m_pVclControl->GetViewColCount() : 0; return m_pVclControl ? m_pVclControl->GetViewColCount() : 0;
} }
// -----------------------------------------------------------------------------
//------------------------------------------------------------------ SbaGridControl* UnoDataBrowserView::getVclControl() const
{
if ( !m_pVclControl )
{
OSL_ENSURE(m_xGrid.is(),"Grid not set!");
if ( m_xGrid.is() )
{
Reference< ::com::sun::star::awt::XWindowPeer > xPeer = m_xGrid->getPeer();
if ( xPeer.is() )
{
SbaXGridPeer* pPeer = SbaXGridPeer::getImplementation(xPeer);
UnoDataBrowserView* pTHIS = const_cast<UnoDataBrowserView*>(this);
if ( pPeer )
{
m_pVclControl = static_cast<SbaGridControl*>(pPeer->GetWindow());
pTHIS->startComponentListening(Reference<XComponent>(VCLUnoHelper::GetInterface(m_pVclControl),UNO_QUERY));
}
::dbaui::notifySystemWindow(pTHIS,m_pVclControl,::comphelper::mem_fun(&TaskPaneList::AddWindow));
}
}
}
return m_pVclControl;
}
// -----------------------------------------------------------------------------
void UnoDataBrowserView::GetFocus() void UnoDataBrowserView::GetFocus()
{ {
ODataView::GetFocus(); ODataView::GetFocus();
...@@ -367,6 +385,13 @@ void UnoDataBrowserView::GetFocus() ...@@ -367,6 +385,13 @@ void UnoDataBrowserView::GetFocus()
m_pTreeView->GrabFocus(); m_pTreeView->GrabFocus();
} }
} }
// -----------------------------------------------------------------------------
void UnoDataBrowserView::_disposing( const ::com::sun::star::lang::EventObject& _rSource )
{
stopComponentListening(Reference<XComponent>(VCLUnoHelper::GetInterface(m_pVclControl),UNO_QUERY));
::dbaui::notifySystemWindow(this,m_pVclControl,::comphelper::mem_fun(&TaskPaneList::RemoveWindow));
m_pVclControl = NULL;
}
// ------------------------------------------------------------------------- // -------------------------------------------------------------------------
long UnoDataBrowserView::PreNotify( NotifyEvent& rNEvt ) long UnoDataBrowserView::PreNotify( NotifyEvent& rNEvt )
{ {
...@@ -407,7 +432,3 @@ BrowserViewStatusDisplay::~BrowserViewStatusDisplay( ) ...@@ -407,7 +432,3 @@ BrowserViewStatusDisplay::~BrowserViewStatusDisplay( )
m_pView->showStatus(String()); m_pView->showStatus(String());
} }
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment