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

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Fri Nov 16 06:45:14 UTC 2018


 cui/source/tabpages/tppattern.cxx |   15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

New commits:
commit b4aa41f305c9f02a245dcab8b046af430a4dd6c9
Author:     Jim Raykowski <raykowj at gmail.com>
AuthorDate: Thu Nov 15 14:40:12 2018 -0900
Commit:     Jim Raykowski <raykowj at gmail.com>
CommitDate: Fri Nov 16 07:44:45 2018 +0100

    tdf#121216 Fix custom pattern not displayed in area tab page
    
    pattern editor on reopening
    
    Change-Id: I1c77dff4bfebc9f4a2661210f5bbbaa8573a90db
    Reviewed-on: https://gerrit.libreoffice.org/63456
    Tested-by: Jenkins
    Reviewed-by: Jim Raykowski <raykowj at gmail.com>

diff --git a/cui/source/tabpages/tppattern.cxx b/cui/source/tabpages/tppattern.cxx
index a0705a8fd11e..56ada28c2681 100644
--- a/cui/source/tabpages/tppattern.cxx
+++ b/cui/source/tabpages/tppattern.cxx
@@ -178,16 +178,17 @@ void SvxPatternTabPage::ActivatePage( const SfxItemSet& rSet )
 
         XFillBitmapItem aItem( rSet.Get( XATTR_FILLBITMAP ) );
 
-        sal_Int32 nPos( 0 );
         if ( aItem.isPattern() )
         {
-            nPos = SearchPatternList( aItem.GetName() );
-            if ( nPos == LISTBOX_ENTRY_NOTFOUND )
-                nPos = 0;
+            sal_Int32 nPos = SearchPatternList( aItem.GetName() );
+            if ( nPos != LISTBOX_ENTRY_NOTFOUND )
+            {
+                sal_uInt16 nId = m_xPatternLB->GetItemId( static_cast<size_t>( nPos ) );
+                m_xPatternLB->SelectItem( nId );
+            }
         }
-
-        sal_uInt16 nId = m_xPatternLB->GetItemId( static_cast<size_t>( nPos ) );
-        m_xPatternLB->SelectItem( nId );
+        else
+            m_xPatternLB->SelectItem( m_xPatternLB->GetItemId( static_cast<size_t>( 0 ) ) );
     }
 }
 


More information about the Libreoffice-commits mailing list