[Libreoffice-commits] core.git: Branch 'feature/sidebar' - cui/source

Armin Le Grand alg at apache.org
Sun May 5 12:25:31 PDT 2013


 cui/source/tabpages/tplnedef.cxx |   16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)

New commits:
commit 8df0f2347041d75dd4cb03abffdd80b2a71ddf00
Author: Armin Le Grand <alg at apache.org>
Date:   Wed Apr 17 10:51:39 2013 +0000

    Related: #i122042# corrected adding default values in LineStyleListBox
    
    (cherry picked from commit 246d57106712df34b05c2522c145d244df2d31eb)
    
    Conflicts:
    	cui/source/tabpages/tplnedef.cxx
    
    Change-Id: I6fde45b3e5a5d0a25a549ea03ec50302c8541195

diff --git a/cui/source/tabpages/tplnedef.cxx b/cui/source/tabpages/tplnedef.cxx
index 563fa72..44fe3f1 100644
--- a/cui/source/tabpages/tplnedef.cxx
+++ b/cui/source/tabpages/tplnedef.cxx
@@ -141,6 +141,10 @@ SvxLineDefTabPage::SvxLineDefTabPage
     aLbLineStyles.SetSelectHdl(
         LINK( this, SvxLineDefTabPage, SelectLinestyleHdl_Impl ) );
 
+    // #i122042# switch off default adding of 'none' and 'solid' entries
+    // for this ListBox; we want to select only editable/dashed styles
+    aLbLineStyles.setAddStandardFields(false);
+
     // absolute (in mm) or relative (in %)
     aCbxSynchronize.SetClickHdl(
         LINK( this, SvxLineDefTabPage, ChangeMetricHdl_Impl ) );
@@ -168,6 +172,7 @@ SvxLineDefTabPage::SvxLineDefTabPage
 
 void SvxLineDefTabPage::Construct()
 {
+    // Line style fill; do *not* add default fields here
     aLbLineStyles.Fill( pDashList );
 }
 
@@ -349,14 +354,17 @@ SfxTabPage* SvxLineDefTabPage::Create( Window* pWindow,
 
 IMPL_LINK( SvxLineDefTabPage, SelectLinestyleHdl_Impl, void *, p )
 {
-    if( pDashList->Count() > 0 )
+    if(pDashList->Count())
     {
         int nTmp = aLbLineStyles.GetSelectEntryPos();
-        if( nTmp == LISTBOX_ENTRY_NOTFOUND )
+
+        if(LISTBOX_ENTRY_NOTFOUND == nTmp)
         {
+            OSL_ENSURE(false, "OOps, non-existent LineDash selected (!)");
+            nTmp = 1;
         }
-        else
-            aDash = pDashList->GetDash( nTmp )->GetDash();
+
+        aDash = pDashList->GetDash( nTmp )->GetDash();
 
         FillDialog_Impl();
 


More information about the Libreoffice-commits mailing list