Author: alg
Date: Wed Apr 17 11:51:39 2013
New Revision: 1468851

URL: http://svn.apache.org/r1468851
Log:
i122042 corrected adding default values in LineStyleListBox

Modified:
    openoffice/trunk/main/cui/source/tabpages/tplnedef.cxx

Modified: openoffice/trunk/main/cui/source/tabpages/tplnedef.cxx
URL: 
http://svn.apache.org/viewvc/openoffice/trunk/main/cui/source/tabpages/tplnedef.cxx?rev=1468851&r1=1468850&r2=1468851&view=diff
==============================================================================
--- openoffice/trunk/main/cui/source/tabpages/tplnedef.cxx (original)
+++ openoffice/trunk/main/cui/source/tabpages/tplnedef.cxx Wed Apr 17 11:51:39 
2013
@@ -164,6 +164,10 @@ SvxLineDefTabPage::SvxLineDefTabPage
        aLbLineStyles.SetSelectHdl(
                LINK( this, SvxLineDefTabPage, SelectLinestyleHdl_Impl ) );
 
+    // #122042# switch off default adding of 'none' and 'solid' entries
+    // for this ListBox; we want to select only editable/dashed styles
+    aLbLineStyles.setAddStandardFields(false);
+
        // Absolut (in mm) oder Relativ (in %)
        aCbxSynchronize.SetClickHdl(
                LINK( this, SvxLineDefTabPage, ChangeMetricHdl_Impl ) );
@@ -191,7 +195,7 @@ SvxLineDefTabPage::SvxLineDefTabPage
 
 void SvxLineDefTabPage::Construct()
 {
-       // Linienstile
+       // Line style fill; do *not* add default fields here
        aLbLineStyles.Fill( pDashList );
 }
 
@@ -390,14 +394,17 @@ SfxTabPage* SvxLineDefTabPage::Create( W
 
 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();
 


Reply via email to