summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sw/source/ui/dbui/createaddresslistdialog.cxx13
1 files changed, 13 insertions, 0 deletions
diff --git a/sw/source/ui/dbui/createaddresslistdialog.cxx b/sw/source/ui/dbui/createaddresslistdialog.cxx
index ad83d23c4540..077a74de83ad 100644
--- a/sw/source/ui/dbui/createaddresslistdialog.cxx
+++ b/sw/source/ui/dbui/createaddresslistdialog.cxx
@@ -199,6 +199,9 @@ void SwAddressControl_Impl::SetData(SwCSVData& rDBData)
if(nContentHeight < m_aScrollBar.GetSizePixel().Height())
{
nContentHeight = m_aScrollBar.GetSizePixel().Height();
+ // Reset the scrollbar's thumb to the top before it is disabled.
+ m_aScrollBar.DoScroll(0);
+ m_aScrollBar.SetThumbPos(0);
m_aScrollBar.Enable(sal_False);
}
else
@@ -207,12 +210,22 @@ void SwAddressControl_Impl::SetData(SwCSVData& rDBData)
m_aScrollBar.SetRange(Range(0, nLines));
m_aScrollBar.SetThumbPos(0);
m_aScrollBar.SetVisibleSize(nVisibleLines);
+ // Reset the scroll bar position (especially if items deleted)
+ m_aScrollBar.DoScroll(m_aScrollBar.GetRangeMax());
+ m_aScrollBar.DoScroll(0);
}
Size aWinOutputSize(m_aWinOutputSize);
aWinOutputSize.Height() = nContentHeight;
m_aWindow.SetOutputSizePixel(aWinOutputSize);
}
+ // Even if no items in m_aEdits, the scrollbar will still exist;
+ // we might as well disable it.
+ if (m_aEdits.size() < 1) {
+ m_aScrollBar.DoScroll(0);
+ m_aScrollBar.SetThumbPos(0);
+ m_aScrollBar.Enable(sal_False);
+ }
}
void SwAddressControl_Impl::SetCurrentDataSet(sal_uInt32 nSet)