Kaydet (Commit) 3cafeddf authored tarafından Christopher Copits's avatar Christopher Copits Kaydeden (comit) Caolán McNamara

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/2454Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst b0cf3aba
......@@ -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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment