[Libreoffice-commits] core.git: sw/source

Christopher Copits ChrisCDev at live.com
Thu Mar 14 15:53:26 PDT 2013


 sw/source/ui/dbui/createaddresslistdialog.cxx |   13 +++++++++++++
 1 file changed, 13 insertions(+)

New commits:
commit 3cafeddf42e128110bf69ce93af39658080d7c63
Author: Christopher Copits <ChrisCDev at live.com>
Date:   Wed Feb 27 19:14:55 2013 -0500

    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 at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/sw/source/ui/dbui/createaddresslistdialog.cxx b/sw/source/ui/dbui/createaddresslistdialog.cxx
index ad83d23..077a74d 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)


More information about the Libreoffice-commits mailing list