summaryrefslogtreecommitdiff
path: root/dbaccess/source/ui/browser/brwview.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'dbaccess/source/ui/browser/brwview.cxx')
-rw-r--r--dbaccess/source/ui/browser/brwview.cxx62
1 files changed, 26 insertions, 36 deletions
diff --git a/dbaccess/source/ui/browser/brwview.cxx b/dbaccess/source/ui/browser/brwview.cxx
index 258c3966cee9..6a15ce0fca39 100644
--- a/dbaccess/source/ui/browser/brwview.cxx
+++ b/dbaccess/source/ui/browser/brwview.cxx
@@ -21,7 +21,6 @@
#include <sbagrid.hxx>
#include <toolkit/helper/vclunohelper.hxx>
#include <comphelper/types.hxx>
-#include <vcl/fixed.hxx>
#include <vcl/split.hxx>
#include <strings.hxx>
#include <com/sun/star/form/XLoadable.hpp>
@@ -33,7 +32,6 @@
using namespace dbaui;
using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::sdb;
using namespace ::com::sun::star::form;
using namespace ::com::sun::star::beans;
using namespace ::com::sun::star::container;
@@ -45,7 +43,7 @@ namespace
{
bool bGrabFocus = false;
SbaGridControl* pVclControl = _pView->getVclControl();
- const Reference< css::awt::XControl >& xGrid = _pView->getGridControl();
+ const rtl::Reference< SbaXGridControl > xGrid = _pView->getGridControl();
if (pVclControl && xGrid.is())
{
bGrabFocus = true;
@@ -71,7 +69,6 @@ UnoDataBrowserView::UnoDataBrowserView( vcl::Window* pParent,
,m_pTreeView(nullptr)
,m_pSplitter(nullptr)
,m_pVclControl(nullptr)
- ,m_pStatus(nullptr)
{
}
@@ -90,10 +87,8 @@ void UnoDataBrowserView::Construct(const Reference< css::awt::XControlModel >& x
OSL_ENSURE(m_xGrid.is(), "UnoDataBrowserView::Construct : could not create a grid control !");
// in design mode (for the moment)
m_xGrid->setDesignMode(true);
-
- Reference< css::awt::XWindow > xGridWindow(m_xGrid, UNO_QUERY);
- xGridWindow->setVisible(true);
- xGridWindow->setEnable(true);
+ m_xGrid->setVisible(true);
+ m_xGrid->setEnable(true);
// introduce the model to the grid
m_xGrid->setModel(xModel);
@@ -124,8 +119,6 @@ void UnoDataBrowserView::dispose()
m_pSplitter.disposeAndClear();
setTreeView(nullptr);
- m_pStatus.disposeAndClear();
-
try
{
::comphelper::disposeComponent(m_xGrid);
@@ -133,8 +126,8 @@ void UnoDataBrowserView::dispose()
}
catch(const Exception&)
{}
- m_pTreeView.clear();
- m_pVclControl.clear();
+ m_pTreeView.reset();
+ m_pVclControl.reset();
ODataView::dispose();
}
@@ -167,10 +160,11 @@ void UnoDataBrowserView::showStatus( const OUString& _rStatus )
hideStatus();
else
{
- if (!m_pStatus)
- m_pStatus = VclPtr<FixedText>::Create(this);
- m_pStatus->SetText(_rStatus);
- m_pStatus->Show();
+ if (!m_pTreeView)
+ return;
+ weld::Label& rLabel = m_pTreeView->GetStatusBar();
+ rLabel.set_label(_rStatus);
+ rLabel.show();
Resize();
PaintImmediately();
}
@@ -178,10 +172,15 @@ void UnoDataBrowserView::showStatus( const OUString& _rStatus )
void UnoDataBrowserView::hideStatus()
{
- if (!m_pStatus || !m_pStatus->IsVisible())
+ if (!m_pTreeView)
+ return;
+ weld::Label& rLabel = m_pTreeView->GetStatusBar();
+ if (!rLabel.get_visible())
+ {
// nothing to do
return;
- m_pStatus->Hide();
+ }
+ rLabel.hide();
Resize();
PaintImmediately();
}
@@ -211,20 +210,12 @@ void UnoDataBrowserView::resizeDocumentView(tools::Rectangle& _rPlayground)
Point aTreeViewPos( aPlaygroundPos );
Size aTreeViewSize( aSplitPos.X(), aPlaygroundSize.Height() );
- // the status pos and size
- if (m_pStatus && m_pStatus->IsVisible())
- {
- Size aStatusSize(aPlaygroundPos.X(), GetTextHeight() + 2);
- aStatusSize = LogicToPixel(aStatusSize, MapMode(MapUnit::MapAppFont));
- aStatusSize.setWidth( aTreeViewSize.Width() - 2 - 2 );
-
- Point aStatusPos( aPlaygroundPos.X() + 2, aTreeViewPos.Y() + aTreeViewSize.Height() - aStatusSize.Height() );
- m_pStatus->SetPosSizePixel( aStatusPos, aStatusSize );
- aTreeViewSize.AdjustHeight( -(aStatusSize.Height()) );
- }
-
// set the size of treelistbox
m_pTreeView->SetPosSizePixel( aTreeViewPos, aTreeViewSize );
+ // Call this to trigger InterimItemWindow::Layout immediately, and
+ // not later on idle so the statusbar will be shown to explain
+ // a long delay on opening databases
+ m_pTreeView->Resize();
//set the size of the splitter
m_pSplitter->SetPosSizePixel( aSplitPos, Size( aSplitSize.Width(), aPlaygroundSize.Height() ) );
@@ -232,9 +223,8 @@ void UnoDataBrowserView::resizeDocumentView(tools::Rectangle& _rPlayground)
}
// set the size of grid control
- Reference< css::awt::XWindow > xGridAsWindow(m_xGrid, UNO_QUERY);
- if (xGridAsWindow.is())
- xGridAsWindow->setPosSize( aSplitPos.X() + aSplitSize.Width(), aPlaygroundPos.Y(),
+ if (m_xGrid.is())
+ m_xGrid->setPosSize( aSplitPos.X() + aSplitSize.Width(), aPlaygroundPos.Y(),
aPlaygroundSize.Width() - aSplitSize.Width() - aSplitPos.X(), aPlaygroundSize.Height(), css::awt::PosSize::POSSIZE);
// just for completeness: there is no space left, we occupied it all ...
@@ -257,11 +247,11 @@ SbaGridControl* UnoDataBrowserView::getVclControl() const
Reference< css::awt::XWindowPeer > xPeer = m_xGrid->getPeer();
if ( xPeer.is() )
{
- SbaXGridPeer* pPeer = comphelper::getUnoTunnelImplementation<SbaXGridPeer>(xPeer);
+ SbaXGridPeer* pPeer = dynamic_cast<SbaXGridPeer*>(xPeer.get());
UnoDataBrowserView* pTHIS = const_cast<UnoDataBrowserView*>(this);
if ( pPeer )
{
- m_pVclControl = static_cast<SbaGridControl*>(pPeer->GetWindow().get());
+ m_pVclControl = static_cast<SbaGridControl*>(pPeer->GetWindow());
pTHIS->startComponentListening(VCLUnoHelper::GetInterface(m_pVclControl));
}
}
@@ -298,7 +288,7 @@ void UnoDataBrowserView::_disposing( const css::lang::EventObject& /*_rSource*/
bool UnoDataBrowserView::PreNotify( NotifyEvent& rNEvt )
{
bool bDone = false;
- if(rNEvt.GetType() == MouseNotifyEvent::KEYINPUT)
+ if(rNEvt.GetType() == NotifyEventType::KEYINPUT)
{
bool bGrabAllowed = isGrabVclControlFocusAllowed(this);
if ( bGrabAllowed )