From 246d57106712df34b05c2522c145d244df2d31eb Mon Sep 17 00:00:00 2001 From: Armin Le Grand Date: Wed, 17 Apr 2013 10:51:39 +0000 Subject: i122042 corrected adding default values in LineStyleListBox --- cui/source/tabpages/tplnedef.cxx | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'cui') diff --git a/cui/source/tabpages/tplnedef.cxx b/cui/source/tabpages/tplnedef.cxx index 4a5adb6e2bea..147a0c7302b3 100644 --- a/cui/source/tabpages/tplnedef.cxx +++ b/cui/source/tabpages/tplnedef.cxx @@ -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( 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(); -- cgit