summaryrefslogtreecommitdiff
path: root/dbaccess/source/ui/querydesign/JoinTableView.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'dbaccess/source/ui/querydesign/JoinTableView.cxx')
-rw-r--r--dbaccess/source/ui/querydesign/JoinTableView.cxx72
1 files changed, 35 insertions, 37 deletions
diff --git a/dbaccess/source/ui/querydesign/JoinTableView.cxx b/dbaccess/source/ui/querydesign/JoinTableView.cxx
index b28ea923ebf2..f2f263d7f006 100644
--- a/dbaccess/source/ui/querydesign/JoinTableView.cxx
+++ b/dbaccess/source/ui/querydesign/JoinTableView.cxx
@@ -46,7 +46,7 @@
#include <com/sun/star/accessibility/AccessibleEventId.hpp>
#include <cppuhelper/exc_hlp.hxx>
#include <connectivity/dbtools.hxx>
-#include <tools/diagnose_ex.h>
+#include <comphelper/diagnose_ex.hxx>
#include <algorithm>
#include <functional>
@@ -54,7 +54,6 @@ using namespace dbaui;
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::sdbc;
using namespace ::com::sun::star::accessibility;
-using namespace ::com::sun::star::container;
using namespace ::com::sun::star::lang;
#define LINE_SIZE 50
@@ -66,14 +65,14 @@ using namespace ::com::sun::star::lang;
#define TABWIN_HEIGHT_STD 120
OScrollWindowHelper::OScrollWindowHelper( vcl::Window* pParent) : Window( pParent)
- ,m_aHScrollBar( VclPtr<ScrollBar>::Create(this, WB_HSCROLL|WB_REPEAT|WB_DRAG) )
- ,m_aVScrollBar( VclPtr<ScrollBar>::Create(this, WB_VSCROLL|WB_REPEAT|WB_DRAG) )
- ,m_pCornerWindow(VclPtr<ScrollBarBox>::Create(this, WB_3DLOOK))
+ ,m_aHScrollBar( VclPtr<ScrollAdaptor>::Create(this, true) )
+ ,m_aVScrollBar( VclPtr<ScrollAdaptor>::Create(this, false) )
,m_pTableView(nullptr)
{
+ StyleSettings aSystemStyle = Application::GetSettings().GetStyleSettings();
+ SetBackground(aSystemStyle.GetFaceColor());
// ScrollBars
-
GetHScrollBar().SetRange( Range(0, 1000) );
GetVScrollBar().SetRange( Range(0, 1000) );
@@ -82,7 +81,6 @@ OScrollWindowHelper::OScrollWindowHelper( vcl::Window* pParent) : Window( pParen
GetHScrollBar().Show();
GetVScrollBar().Show();
- m_pCornerWindow->Show();
// normally we should be SCROLL_PANE
SetAccessibleRole(AccessibleRole::SCROLL_PANE);
@@ -97,8 +95,7 @@ void OScrollWindowHelper::dispose()
{
m_aHScrollBar.disposeAndClear();
m_aVScrollBar.disposeAndClear();
- m_pCornerWindow.disposeAndClear();
- m_pTableView.clear();
+ m_pTableView.reset();
vcl::Window::dispose();
}
@@ -106,8 +103,8 @@ void OScrollWindowHelper::setTableView(OJoinTableView* _pTableView)
{
m_pTableView = _pTableView;
// ScrollBars
- GetHScrollBar().SetScrollHdl( LINK(m_pTableView, OJoinTableView, ScrollHdl) );
- GetVScrollBar().SetScrollHdl( LINK(m_pTableView, OJoinTableView, ScrollHdl) );
+ GetHScrollBar().SetScrollHdl( LINK(m_pTableView, OJoinTableView, HorzScrollHdl) );
+ GetVScrollBar().SetScrollHdl( LINK(m_pTableView, OJoinTableView, VertScrollHdl) );
}
void OScrollWindowHelper::resetRange(const Point& _aSize)
@@ -135,11 +132,6 @@ void OScrollWindowHelper::Resize()
Size( nVScrollWidth, aTotalOutputSize.Height()-nHScrollHeight )
);
- m_pCornerWindow->SetPosSizePixel(
- Point( aTotalOutputSize.Width() - nVScrollWidth, aTotalOutputSize.Height() - nHScrollHeight),
- Size( nVScrollWidth, nHScrollHeight )
- );
-
GetHScrollBar().SetPageSize( aTotalOutputSize.Width() );
GetHScrollBar().SetVisibleSize( aTotalOutputSize.Width() );
@@ -192,19 +184,25 @@ void OJoinTableView::dispose()
}
// delete lists
clearLayoutInformation();
- m_pDragWin.clear();
- m_pSizingWin.clear();
- m_pSelectedConn.clear();
- m_pLastFocusTabWin.clear();
- m_pView.clear();
+ m_pDragWin.reset();
+ m_pSizingWin.reset();
+ m_pSelectedConn.reset();
+ m_pLastFocusTabWin.reset();
+ m_pView.reset();
m_vTableConnection.clear();
vcl::Window::dispose();
}
-IMPL_LINK( OJoinTableView, ScrollHdl, ScrollBar*, pScrollBar, void )
+IMPL_LINK(OJoinTableView, HorzScrollHdl, weld::Scrollbar&, rScrollbar, void)
+{
+ // move all windows
+ ScrollPane(rScrollbar.adjustment_get_value() - m_aScrollOffset.X(), true, false);
+}
+
+IMPL_LINK(OJoinTableView, VertScrollHdl, weld::Scrollbar&, rScrollbar, void)
{
// move all windows
- ScrollPane( pScrollBar->GetDelta(), (pScrollBar == &GetHScrollBar()), false );
+ ScrollPane(rScrollbar.adjustment_get_value() - m_aScrollOffset.Y(), false, false);
}
void OJoinTableView::Resize()
@@ -237,7 +235,7 @@ void OJoinTableView::Resize()
}
}
-sal_uLong OJoinTableView::GetTabWinCount() const
+sal_Int64 OJoinTableView::GetTabWinCount() const
{
return m_aTableMap.size();
}
@@ -258,7 +256,7 @@ bool OJoinTableView::RemoveConnection(VclPtr<OTableConnection>& rConn, bool _bDe
modified();
if ( m_pAccessible )
m_pAccessible->notifyAccessibleEvent( AccessibleEventId::CHILD,
- makeAny(xConn->GetAccessible()),
+ Any(xConn->GetAccessible()),
Any());
if (_bDelete)
xConn->disposeOnce();
@@ -326,7 +324,7 @@ void OJoinTableView::AddTabWin(const OUString& _rComposedName, const OUString& r
{
m_pView->getController().getTableWindowData().push_back( pNewTabWinData);
// when we already have a table with this name insert the full qualified one instead
- if(m_aTableMap.find(rWinName) != m_aTableMap.end())
+ if(m_aTableMap.contains(rWinName))
m_aTableMap[_rComposedName] = pNewTabWin;
else
m_aTableMap[rWinName] = pNewTabWin;
@@ -338,7 +336,7 @@ void OJoinTableView::AddTabWin(const OUString& _rComposedName, const OUString& r
if ( m_pAccessible )
m_pAccessible->notifyAccessibleEvent( AccessibleEventId::CHILD,
Any(),
- makeAny(pNewTabWin->GetAccessible()));
+ Any(pNewTabWin->GetAccessible()));
}
else
{
@@ -374,7 +372,7 @@ void OJoinTableView::RemoveTabWin( OTableWindow* pTabWin )
{
if ( m_pAccessible )
m_pAccessible->notifyAccessibleEvent( AccessibleEventId::CHILD,
- makeAny(pTabWin->GetAccessible()),Any()
+ Any(pTabWin->GetAccessible()),Any()
);
pTabWin->Hide();
@@ -405,7 +403,7 @@ namespace
bool isScrollAllowed( OJoinTableView* _pView,tools::Long nDelta, bool bHoriz)
{
// adjust ScrollBar-Positions
- ScrollBar& rBar = bHoriz ? _pView->GetHScrollBar() : _pView->GetVScrollBar() ;
+ ScrollAdaptor& rBar = bHoriz ? _pView->GetHScrollBar() : _pView->GetVScrollBar();
tools::Long nOldThumbPos = rBar.GetThumbPos();
tools::Long nNewThumbPos = nOldThumbPos + nDelta;
@@ -493,7 +491,7 @@ bool OJoinTableView::isMovementAllowed(const Point& _rPoint,const Size& _rSize)
void OJoinTableView::EnsureVisible(const OTableWindow* _pWin)
{
// data about the tab win
- TTableWindowData::value_type pData = _pWin->GetData();
+ const TTableWindowData::value_type& pData = _pWin->GetData();
EnsureVisible( pData->GetPosition() , pData->GetSize());
Invalidate(InvalidateFlags::NoChildren);
}
@@ -1121,9 +1119,9 @@ void OJoinTableView::executePopup(const Point& rPos, VclPtr<OTableConnection>& r
{
::tools::Rectangle aRect(rPos, Size(1, 1));
weld::Window* pPopupParent = weld::GetPopupParent(*this, aRect);
- std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(pPopupParent, "dbaccess/ui/joinviewmenu.ui"));
- std::unique_ptr<weld::Menu> xContextMenu(xBuilder->weld_menu("menu"));
- OString sIdent = xContextMenu->popup_at_rect(pPopupParent, aRect);
+ std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(pPopupParent, u"dbaccess/ui/joinviewmenu.ui"_ustr));
+ std::unique_ptr<weld::Menu> xContextMenu(xBuilder->weld_menu(u"menu"_ustr));
+ OUString sIdent = xContextMenu->popup_at_rect(pPopupParent, aRect);
if (sIdent == "delete")
RemoveConnection(rSelConnection, true);
else if (sIdent == "edit")
@@ -1219,7 +1217,7 @@ bool OJoinTableView::PreNotify(NotifyEvent& rNEvt)
bool bHandled = false;
switch (rNEvt.GetType())
{
- case MouseNotifyEvent::COMMAND:
+ case NotifyEventType::COMMAND:
{
const CommandEvent* pCommand = rNEvt.GetCommandEvent();
if (pCommand->GetCommand() == CommandEventId::Wheel)
@@ -1236,7 +1234,7 @@ bool OJoinTableView::PreNotify(NotifyEvent& rNEvt)
}
}
break;
- case MouseNotifyEvent::KEYINPUT:
+ case NotifyEventType::KEYINPUT:
{
if (m_aTableMap.empty())
// no tab wins -> no conns -> no traveling
@@ -1364,7 +1362,7 @@ bool OJoinTableView::PreNotify(NotifyEvent& rNEvt)
}
}
break;
- case MouseNotifyEvent::GETFOCUS:
+ case NotifyEventType::GETFOCUS:
{
if (m_aTableMap.empty())
// no tab wins -> no conns -> no focus change
@@ -1546,7 +1544,7 @@ void OJoinTableView::addConnection(OTableConnection* _pConnection,bool _bAddData
if ( m_pAccessible )
m_pAccessible->notifyAccessibleEvent( AccessibleEventId::CHILD,
Any(),
- makeAny(_pConnection->GetAccessible()));
+ Any(_pConnection->GetAccessible()));
}
bool OJoinTableView::allowQueries() const