[PATCH] fdo#38448 No scrolling in mailmerge's create new address lis...

Christopher Copits (via Code Review) gerrit at gerrit.libreoffice.org
Wed Feb 27 16:17:46 PST 2013


Hi,

I have submitted a patch for review:

    https://gerrit.libreoffice.org/2454

To pull it, you can do:

    git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/54/2454/1

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
---
M sw/source/ui/dbui/createaddresslistdialog.cxx
1 file changed, 13 insertions(+), 0 deletions(-)



diff --git a/sw/source/ui/dbui/createaddresslistdialog.cxx b/sw/source/ui/dbui/createaddresslistdialog.cxx
index f7f8532..138eacf 100644
--- a/sw/source/ui/dbui/createaddresslistdialog.cxx
+++ b/sw/source/ui/dbui/createaddresslistdialog.cxx
@@ -199,6 +199,9 @@
         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 @@
             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)

-- 
To view, visit https://gerrit.libreoffice.org/2454
To unsubscribe, visit https://gerrit.libreoffice.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I29f82256ad51fbd55a3f82400ca9d7875539e9ff
Gerrit-PatchSet: 1
Gerrit-Project: core
Gerrit-Branch: master
Gerrit-Owner: Christopher Copits <ChrisCDev at live.com>



More information about the LibreOffice mailing list