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.cxx36
1 files changed, 19 insertions, 17 deletions
diff --git a/dbaccess/source/ui/querydesign/JoinTableView.cxx b/dbaccess/source/ui/querydesign/JoinTableView.cxx
index 9f3df281d774..5ef30e19aeda 100644
--- a/dbaccess/source/ui/querydesign/JoinTableView.cxx
+++ b/dbaccess/source/ui/querydesign/JoinTableView.cxx
@@ -33,6 +33,7 @@
#include "QueryMoveTabWinUndoAct.hxx"
#include "QuerySizeTabWinUndoAct.hxx"
#include <toolkit/helper/vclunohelper.hxx>
+#include <vcl/menu.hxx>
#include <vcl/svapp.hxx>
#include <vcl/settings.hxx>
#include <vcl/commandevent.hxx>
@@ -861,11 +862,11 @@ void OJoinTableView::DeselectConn(OTableConnection* pConn)
// deselect the corresponding entries in the ListBox of the table window
OTableWindow* pWin = pConn->GetSourceWin();
if (pWin && pWin->GetListBox())
- pWin->GetListBox()->SelectAll(false);
+ pWin->GetListBox()->get_widget().unselect_all();
pWin = pConn->GetDestWin();
if (pWin && pWin->GetListBox())
- pWin->GetListBox()->SelectAll(false);
+ pWin->GetListBox()->get_widget().unselect_all();
pConn->Deselect();
m_pSelectedConn = nullptr;
@@ -890,11 +891,10 @@ void OJoinTableView::SelectConn(OTableConnection* pConn)
if (!(pSourceBox && pDestBox))
return;
- pSourceBox->SelectAll(false);
- pDestBox->SelectAll(false);
+ pSourceBox->get_widget().unselect_all();
+ pDestBox->get_widget().unselect_all();
- SvTreeListEntry* pFirstSourceVisible = pSourceBox->GetFirstEntryInView();
- SvTreeListEntry* pFirstDestVisible = pDestBox->GetFirstEntryInView();
+ bool bScrolled = false;
const std::vector<std::unique_ptr<OConnectionLine>>& rLines = pConn->GetConnLineList();
auto aIter = rLines.rbegin();
@@ -902,27 +902,29 @@ void OJoinTableView::SelectConn(OTableConnection* pConn)
{
if ((*aIter)->IsValid())
{
- SvTreeListEntry* pSourceEntry = pSourceBox->GetEntryFromText((*aIter)->GetData()->GetSourceFieldName());
- if (pSourceEntry)
+ int nSourceEntry = pSourceBox->GetEntryFromText((*aIter)->GetData()->GetSourceFieldName());
+ if (nSourceEntry != -1)
{
- pSourceBox->Select(pSourceEntry);
- pSourceBox->MakeVisible(pSourceEntry);
+ pSourceBox->get_widget().select(nSourceEntry);
+ pSourceBox->get_widget().scroll_to_row(nSourceEntry);
+ bScrolled = true;
}
- SvTreeListEntry* pDestEntry = pDestBox->GetEntryFromText((*aIter)->GetData()->GetDestFieldName());
- if (pDestEntry)
+ int nDestEntry = pDestBox->GetEntryFromText((*aIter)->GetData()->GetDestFieldName());
+ if (nDestEntry != -1)
{
- pDestBox->Select(pDestEntry);
- pDestBox->MakeVisible(pDestEntry);
+ pDestBox->get_widget().select(nDestEntry);
+ pDestBox->get_widget().scroll_to_row(nDestEntry);
+ bScrolled = true;
}
-
}
}
- if ((pFirstSourceVisible != pSourceBox->GetFirstEntryInView())
- || (pFirstDestVisible != pDestBox->GetFirstEntryInView()))
+ if (bScrolled)
+ {
// scrolling was done -> redraw
Invalidate(InvalidateFlags::NoChildren);
+ }
}
void OJoinTableView::Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle& rRect)