openoffice-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From o..@apache.org
Subject svn commit: r1478703 - in /openoffice/trunk/main/svx/source/sidebar/text: TextPropertyPanel.hrc TextPropertyPanel.src TextUnderlineControl.cxx
Date Fri, 03 May 2013 09:56:38 GMT
Author: orw
Date: Fri May  3 09:56:38 2013
New Revision: 1478703

URL: http://svn.apache.org/r1478703
Log:
122140: add 'None' entry to underline style drop-down-list in text property panel

Modified:
    openoffice/trunk/main/svx/source/sidebar/text/TextPropertyPanel.hrc
    openoffice/trunk/main/svx/source/sidebar/text/TextPropertyPanel.src
    openoffice/trunk/main/svx/source/sidebar/text/TextUnderlineControl.cxx

Modified: openoffice/trunk/main/svx/source/sidebar/text/TextPropertyPanel.hrc
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/svx/source/sidebar/text/TextPropertyPanel.hrc?rev=1478703&r1=1478702&r2=1478703&view=diff
==============================================================================
--- openoffice/trunk/main/svx/source/sidebar/text/TextPropertyPanel.hrc (original)
+++ openoffice/trunk/main/svx/source/sidebar/text/TextPropertyPanel.hrc Fri May  3 09:56:38
2013
@@ -107,6 +107,8 @@
 #define IMG_DASH_DOT_DOT_SEL	48
 #define IMG_WAVE_SEL			49
 
+#define STR_WITHOUT             50
+
 //popup window font color
 #define VS_FONT_COLOR			1
 #define STR_AUTOMATICE			2

Modified: openoffice/trunk/main/svx/source/sidebar/text/TextPropertyPanel.src
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/svx/source/sidebar/text/TextPropertyPanel.src?rev=1478703&r1=1478702&r2=1478703&view=diff
==============================================================================
--- openoffice/trunk/main/svx/source/sidebar/text/TextPropertyPanel.src (original)
+++ openoffice/trunk/main/svx/source/sidebar/text/TextPropertyPanel.src Fri May  3 09:56:38
2013
@@ -392,6 +392,11 @@ Control RID_POPUPPANEL_TEXTPAGE_UNDERLIN
 		ImageBitmap = Bitmap{File = "symphony/selected-line10.bmp";};
 	};
 	
+	String STR_WITHOUT
+	{
+		Text [ en-US ] = "(Without)";
+	};
+
 	//tips 
 	String STR_SINGLE
 	{

Modified: openoffice/trunk/main/svx/source/sidebar/text/TextUnderlineControl.cxx
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/svx/source/sidebar/text/TextUnderlineControl.cxx?rev=1478703&r1=1478702&r2=1478703&view=diff
==============================================================================
--- openoffice/trunk/main/svx/source/sidebar/text/TextUnderlineControl.cxx (original)
+++ openoffice/trunk/main/svx/source/sidebar/text/TextUnderlineControl.cxx Fri May  3 09:56:38
2013
@@ -85,54 +85,58 @@ TextUnderlineControl::TextUnderlineContr
 
 void TextUnderlineControl::initial()
 {
-	maVSUnderline.SetColor(GetSettings().GetStyleSettings().GetHighContrastMode()?
-		GetSettings().GetStyleSettings().GetMenuColor():
-		sfx2::sidebar::Theme::GetColor( sfx2::sidebar::Theme::Paint_PanelBackground ));
-	maVSUnderline.SetBackground(GetSettings().GetStyleSettings().GetHighContrastMode()?
-		GetSettings().GetStyleSettings().GetMenuColor():
-		sfx2::sidebar::Theme::GetColor( sfx2::sidebar::Theme::Paint_PanelBackground ));
+    maVSUnderline.SetColor(GetSettings().GetStyleSettings().GetHighContrastMode()?
+        GetSettings().GetStyleSettings().GetMenuColor():
+        sfx2::sidebar::Theme::GetColor( sfx2::sidebar::Theme::Paint_PanelBackground ));
+    maVSUnderline.SetBackground(GetSettings().GetStyleSettings().GetHighContrastMode()?
+        GetSettings().GetStyleSettings().GetMenuColor():
+        sfx2::sidebar::Theme::GetColor( sfx2::sidebar::Theme::Paint_PanelBackground ));
 
-	Link aLink = LINK( this, TextUnderlineControl, PBClickHdl ) ;
-	maPBOptions.SetClickHdl(aLink);
+    Link aLink = LINK( this, TextUnderlineControl, PBClickHdl ) ;
+    maPBOptions.SetClickHdl(aLink);
 
-	maVSUnderline.SetStyle( maVSUnderline.GetStyle()| WB_3DLOOK | WB_NO_DIRECTSELECT );
+    maVSUnderline.SetStyle( maVSUnderline.GetStyle()| WB_3DLOOK | WB_NO_DIRECTSELECT );
 
-	maVSUnderline.InsertItem(1, maIMGSingle ,String(SVX_RES(STR_SINGLE)));
-	maVSUnderline.SetItemData(1, (void*)(sal_uInt64)UNDERLINE_SINGLE);
+    // 'none' item
+    maVSUnderline.SetStyle( maVSUnderline.GetStyle()| WB_NONEFIELD | WB_MENUSTYLEVALUESET
);
+    maVSUnderline.SetText( String(SVX_RES(STR_WITHOUT) ) );
 
-	maVSUnderline.InsertItem(2, maIMGDouble ,String(SVX_RES(STR_DOUBLE)));
-	maVSUnderline.SetItemData(2, (void*)(sal_uInt64)UNDERLINE_DOUBLE);
+    maVSUnderline.InsertItem(1, maIMGSingle ,String(SVX_RES(STR_SINGLE)));
+    maVSUnderline.SetItemData(1, (void*)(sal_uInt64)UNDERLINE_SINGLE);
 
-	maVSUnderline.InsertItem(3, maIMGBold, String(SVX_RES(STR_BOLD)));
-	maVSUnderline.SetItemData(3,(void*)(sal_uInt64)UNDERLINE_BOLD);
+    maVSUnderline.InsertItem(2, maIMGDouble ,String(SVX_RES(STR_DOUBLE)));
+    maVSUnderline.SetItemData(2, (void*)(sal_uInt64)UNDERLINE_DOUBLE);
 
-	maVSUnderline.InsertItem(4, maIMGDot, String(SVX_RES(STR_DOT)));
-	maVSUnderline.SetItemData(4,(void*)(sal_uInt64)UNDERLINE_DOTTED);
+    maVSUnderline.InsertItem(3, maIMGBold, String(SVX_RES(STR_BOLD)));
+    maVSUnderline.SetItemData(3,(void*)(sal_uInt64)UNDERLINE_BOLD);
 
-	maVSUnderline.InsertItem(5, maIMGDotBold, String(SVX_RES(STR_DOT_BOLD)));
-	maVSUnderline.SetItemData(5,(void*)(sal_uInt64)UNDERLINE_BOLDDOTTED);
+    maVSUnderline.InsertItem(4, maIMGDot, String(SVX_RES(STR_DOT)));
+    maVSUnderline.SetItemData(4,(void*)(sal_uInt64)UNDERLINE_DOTTED);
 
-	maVSUnderline.InsertItem(6, maIMGDash, String(SVX_RES(STR_DASH)));
-	maVSUnderline.SetItemData(6,(void*)(sal_uInt64)UNDERLINE_DASH);
+    maVSUnderline.InsertItem(5, maIMGDotBold, String(SVX_RES(STR_DOT_BOLD)));
+    maVSUnderline.SetItemData(5,(void*)(sal_uInt64)UNDERLINE_BOLDDOTTED);
 
-	maVSUnderline.InsertItem(7, maIMGDashLong,String(SVX_RES(STR_DASH_LONG)));
-	maVSUnderline.SetItemData(7,(void*)(sal_uInt64)UNDERLINE_LONGDASH);
+    maVSUnderline.InsertItem(6, maIMGDash, String(SVX_RES(STR_DASH)));
+    maVSUnderline.SetItemData(6,(void*)(sal_uInt64)UNDERLINE_DASH);
 
-	maVSUnderline.InsertItem(8, maIMGDashDot, String(SVX_RES(STR_DASH_DOT)));
-	maVSUnderline.SetItemData(8,(void*)(sal_uInt64)UNDERLINE_DASHDOT);
+    maVSUnderline.InsertItem(7, maIMGDashLong,String(SVX_RES(STR_DASH_LONG)));
+    maVSUnderline.SetItemData(7,(void*)(sal_uInt64)UNDERLINE_LONGDASH);
 
-	maVSUnderline.InsertItem(9, maIMGDashDotDot, String(SVX_RES(STR_DASH_DOT_DOT)));
-	maVSUnderline.SetItemData(9,(void*)(sal_uInt64)UNDERLINE_DASHDOTDOT);
+    maVSUnderline.InsertItem(8, maIMGDashDot, String(SVX_RES(STR_DASH_DOT)));
+    maVSUnderline.SetItemData(8,(void*)(sal_uInt64)UNDERLINE_DASHDOT);
 
-	maVSUnderline.InsertItem(10, maIMGWave, String(SVX_RES(STR_WAVE)));
-	maVSUnderline.SetItemData(10,(void*)(sal_uInt64)UNDERLINE_WAVE);
+    maVSUnderline.InsertItem(9, maIMGDashDotDot, String(SVX_RES(STR_DASH_DOT_DOT)));
+    maVSUnderline.SetItemData(9,(void*)(sal_uInt64)UNDERLINE_DASHDOTDOT);
 
-	maVSUnderline.SetColCount( 1 );
-	aLink =  LINK( this, TextUnderlineControl, VSSelectHdl ) ;
+    maVSUnderline.InsertItem(10, maIMGWave, String(SVX_RES(STR_WAVE)));
+    maVSUnderline.SetItemData(10,(void*)(sal_uInt64)UNDERLINE_WAVE);
+
+    maVSUnderline.SetColCount( 1 );
+    aLink =  LINK( this, TextUnderlineControl, VSSelectHdl ) ;
     maVSUnderline.SetSelectHdl(aLink);
 
-	maVSUnderline.StartSelection();
-	maVSUnderline.Show();
+    maVSUnderline.StartSelection();
+    maVSUnderline.Show();
 }
 
 
@@ -150,85 +154,90 @@ void TextUnderlineControl::Rearrange(Fon
 	maVSUnderline.SetItemImage(9, GetDisplayBackground().GetColor().IsDark()? maIMGDashDotDotH
: maIMGDashDotDot);
 	maVSUnderline.SetItemImage(10, GetDisplayBackground().GetColor().IsDark()? maIMGWaveH :
maIMGWave);
 
-	switch(eLine)
-	{
-	case UNDERLINE_SINGLE:
-		maVSUnderline.SetItemImage(1, maIMGSingleSel);
-		maVSUnderline.SelectItem(1);
-		maVSUnderline.GrabFocus();
-		break;
-	case UNDERLINE_DOUBLE:
-		maVSUnderline.SetItemImage(2, maIMGDoubleSel);
-		maVSUnderline.SelectItem(2);
-		maVSUnderline.GrabFocus();
-		break;
-	case UNDERLINE_BOLD:
-		maVSUnderline.SetItemImage(3, maIMGBoldSel);
-		maVSUnderline.SelectItem(3);
-		maVSUnderline.GrabFocus();
-		break;	
-	case UNDERLINE_DOTTED:
-		maVSUnderline.SetItemImage(4, maIMGDotSel);
-		maVSUnderline.SelectItem(4);
-		maVSUnderline.GrabFocus();
-		break;
-	case UNDERLINE_BOLDDOTTED:
-		maVSUnderline.SetItemImage(5, maIMGDotBoldSel);
-		maVSUnderline.SelectItem(5);
-		maVSUnderline.GrabFocus();
-		break;
-	case UNDERLINE_DASH:
-		maVSUnderline.SetItemImage(6, maIMGDashSel);
-		maVSUnderline.SelectItem(6);
-		maVSUnderline.GrabFocus();
-		break;
-	case UNDERLINE_LONGDASH:
-		maVSUnderline.SetItemImage(7, maIMGDashLongSel);
-		maVSUnderline.SelectItem(7);
-		maVSUnderline.GrabFocus();
-		break;
-	case UNDERLINE_DASHDOT:
-		maVSUnderline.SetItemImage(8, maIMGDashDotSel);
-		maVSUnderline.SelectItem(8);
-		maVSUnderline.GrabFocus();
-		break;
-	case UNDERLINE_DASHDOTDOT:
-		maVSUnderline.SetItemImage(9, maIMGDashDotDotSel);
-		maVSUnderline.SelectItem(9);
-		maVSUnderline.GrabFocus();
-		break;
-	case UNDERLINE_WAVE:
-		maVSUnderline.SetItemImage(10, maIMGWaveSel);
-		maVSUnderline.SelectItem(10);
-		maVSUnderline.GrabFocus();
-		break;
-	case UNDERLINE_NONE:
-	default:
-		maVSUnderline.SelectItem(1);
-		maVSUnderline.SetNoSelection();
-		maPBOptions.GrabFocus();
-	}
-	maVSUnderline.StartSelection();
+    switch(eLine)
+    {
+    case UNDERLINE_SINGLE:
+        maVSUnderline.SetItemImage(1, maIMGSingleSel);
+        maVSUnderline.SelectItem(1);
+        maVSUnderline.GrabFocus();
+        break;
+    case UNDERLINE_DOUBLE:
+        maVSUnderline.SetItemImage(2, maIMGDoubleSel);
+        maVSUnderline.SelectItem(2);
+        maVSUnderline.GrabFocus();
+        break;
+    case UNDERLINE_BOLD:
+        maVSUnderline.SetItemImage(3, maIMGBoldSel);
+        maVSUnderline.SelectItem(3);
+        maVSUnderline.GrabFocus();
+        break;
+    case UNDERLINE_DOTTED:
+        maVSUnderline.SetItemImage(4, maIMGDotSel);
+        maVSUnderline.SelectItem(4);
+        maVSUnderline.GrabFocus();
+        break;
+    case UNDERLINE_BOLDDOTTED:
+        maVSUnderline.SetItemImage(5, maIMGDotBoldSel);
+        maVSUnderline.SelectItem(5);
+        maVSUnderline.GrabFocus();
+        break;
+    case UNDERLINE_DASH:
+        maVSUnderline.SetItemImage(6, maIMGDashSel);
+        maVSUnderline.SelectItem(6);
+        maVSUnderline.GrabFocus();
+        break;
+    case UNDERLINE_LONGDASH:
+        maVSUnderline.SetItemImage(7, maIMGDashLongSel);
+        maVSUnderline.SelectItem(7);
+        maVSUnderline.GrabFocus();
+        break;
+    case UNDERLINE_DASHDOT:
+        maVSUnderline.SetItemImage(8, maIMGDashDotSel);
+        maVSUnderline.SelectItem(8);
+        maVSUnderline.GrabFocus();
+        break;
+    case UNDERLINE_DASHDOTDOT:
+        maVSUnderline.SetItemImage(9, maIMGDashDotDotSel);
+        maVSUnderline.SelectItem(9);
+        maVSUnderline.GrabFocus();
+        break;
+    case UNDERLINE_WAVE:
+        maVSUnderline.SetItemImage(10, maIMGWaveSel);
+        maVSUnderline.SelectItem(10);
+        maVSUnderline.GrabFocus();
+        break;
+    case UNDERLINE_NONE:
+        maVSUnderline.SelectItem(0);
+        maVSUnderline.GrabFocus();
+        break;
+    default:
+        maVSUnderline.SelectItem(1);
+        maVSUnderline.SetNoSelection();
+        maPBOptions.GrabFocus();
+    }
+    maVSUnderline.StartSelection();
 }
 
 
 IMPL_LINK(TextUnderlineControl, VSSelectHdl, void *, pControl)
 {
-	if(pControl == &maVSUnderline)  
-	{
-		sal_uInt16 iPos = maVSUnderline.GetSelectItemId();
-		FontUnderline eUnderline = (FontUnderline)(sal_uInt64)maVSUnderline.GetItemData( iPos );
-
-		SvxUnderlineItem aLineItem(eUnderline, SID_ATTR_CHAR_UNDERLINE);
-
-		aLineItem.SetColor(mrTextPropertyPanel.GetUnderlineColor());
-		mpBindings->GetDispatcher()->Execute(SID_ATTR_CHAR_UNDERLINE, SFX_CALLMODE_RECORD,
&aLineItem, 0L);
-
-		mrTextPropertyPanel.SetUnderline(eUnderline);
-
-		mrTextPropertyPanel.EndUnderlinePopupMode();
-	}
-	return( 0L );
+    if ( pControl == &maVSUnderline )
+    {
+        const sal_uInt16 iPos = maVSUnderline.GetSelectItemId();
+        const FontUnderline eUnderline = ( iPos == 0 )
+                                         ? UNDERLINE_NONE
+                                         : (FontUnderline)(sal_uInt64)maVSUnderline.GetItemData(
iPos );
+
+        SvxUnderlineItem aLineItem(eUnderline, SID_ATTR_CHAR_UNDERLINE);
+
+        aLineItem.SetColor(mrTextPropertyPanel.GetUnderlineColor());
+        mpBindings->GetDispatcher()->Execute(SID_ATTR_CHAR_UNDERLINE, SFX_CALLMODE_RECORD,
&aLineItem, 0L);
+
+        mrTextPropertyPanel.SetUnderline(eUnderline);
+
+        mrTextPropertyPanel.EndUnderlinePopupMode();
+    }
+    return( 0L );
 }
 
 IMPL_LINK(TextUnderlineControl, PBClickHdl, PushButton *, pPBtn)



Mime
View raw message