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

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Tue Aug 4 14:59:46 UTC 2020


 cui/source/tabpages/tpbitmap.cxx |    8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

New commits:
commit a1cb7ede7841de1cb38f260cecd5c067f0a8dac6
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Tue Aug 4 11:16:17 2020 +0100
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Tue Aug 4 16:59:05 2020 +0200

    tdf#134420 select neighbour when deleted
    
    Change-Id: I55c6135360d3d77b7b3d2e54012ad82e1a4813ed
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100086
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/cui/source/tabpages/tpbitmap.cxx b/cui/source/tabpages/tpbitmap.cxx
index 87f22835adc3..c679339199db 100644
--- a/cui/source/tabpages/tpbitmap.cxx
+++ b/cui/source/tabpages/tpbitmap.cxx
@@ -572,10 +572,14 @@ IMPL_LINK_NOARG(SvxBitmapTabPage, ClickDeleteHdl, SvxPresetListBox*, void)
 
     if (xQueryBox->run() == RET_YES)
     {
+        sal_uInt16 nNextId = m_xBitmapLB->GetItemId(nPos + 1);
+        if (!nNextId)
+            nNextId = m_xBitmapLB->GetItemId(nPos - 1);
+
         m_pBitmapList->Remove( static_cast<sal_uInt16>(nPos) );
         m_xBitmapLB->RemoveItem( nId );
-        nId = m_xBitmapLB->GetItemId(0);
-        m_xBitmapLB->SelectItem( nId );
+
+        m_xBitmapLB->SelectItem(nNextId);
 
         m_aCtlBitmapPreview.Invalidate();
         ModifyBitmapHdl(m_xBitmapLB.get());


More information about the Libreoffice-commits mailing list