summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Copits <ChrisCDev@live.com>2013-02-27 19:14:55 -0500
committerCaolán McNamara <caolanm@redhat.com>2013-03-14 22:53:06 +0000
commit3cafeddf42e128110bf69ce93af39658080d7c63 (patch)
treeae55cb7117bee2a6e653d4a0ca90c779a2ecc79b
parentb0cf3aba085373d84a55ef144b273a8a89d017af (diff)
fdo#38448 No scrolling in mailmerge's create new address list > customize
What changes I made: 1. After the address list is edited, the scroll bar scrolls up. 2. If all entries are deleted from the list, the scroll bar scrolls all the way up and is disabled. 3. When multiple entries are deleted, the scroll bar is not reset to match the entries. Therefore, I reset the scrollbar in this case. Change-Id: I29f82256ad51fbd55a3f82400ca9d7875539e9ff Reviewed-on: https://gerrit.libreoffice.org/2454 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
-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)