summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOliver-Rainer Wittmann <orw@apache.org>2013-05-03 09:56:38 +0000
committerMichael Meeks <michael.meeks@suse.com>2013-05-20 11:33:28 +0100
commitc6f163600e308ae7c4f5ea3f6962a23cb067185f (patch)
tree8d8a4f2a8bfecacb66b2069fbca1b99648a28792
parentf8f1f1d4a0700de4ff0b01b99bf8f09736116f70 (diff)
Related: #i122140# add 'None' entry to underline style...
drop-down-list in text property panel (cherry picked from commit 3c4045722f20bddddef9143c4f393e6f251f6d2d) Change-Id: Ieffbd19318742dd133fce1b96d7cad2d7c457975
-rw-r--r--svx/source/sidebar/text/TextPropertyPanel.hrc2
-rw-r--r--svx/source/sidebar/text/TextPropertyPanel.src5
-rw-r--r--svx/source/sidebar/text/TextUnderlineControl.cxx15
3 files changed, 19 insertions, 3 deletions
diff --git a/svx/source/sidebar/text/TextPropertyPanel.hrc b/svx/source/sidebar/text/TextPropertyPanel.hrc
index 146d51cdddef..0244ee5029e7 100644
--- a/svx/source/sidebar/text/TextPropertyPanel.hrc
+++ b/svx/source/sidebar/text/TextPropertyPanel.hrc
@@ -91,6 +91,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
diff --git a/svx/source/sidebar/text/TextPropertyPanel.src b/svx/source/sidebar/text/TextPropertyPanel.src
index cd5ce5678c03..d1ca9c30973b 100644
--- a/svx/source/sidebar/text/TextPropertyPanel.src
+++ b/svx/source/sidebar/text/TextPropertyPanel.src
@@ -346,6 +346,11 @@ Control RID_POPUPPANEL_TEXTPAGE_UNDERLINE
ImageBitmap = Bitmap{File = "symphony/selected-line10.bmp";};
};
+ String STR_WITHOUT
+ {
+ Text [ en-US ] = "(Without)";
+ };
+
//tips
String STR_SINGLE
{
diff --git a/svx/source/sidebar/text/TextUnderlineControl.cxx b/svx/source/sidebar/text/TextUnderlineControl.cxx
index 2499f0a21619..8c2227bf7e42 100644
--- a/svx/source/sidebar/text/TextUnderlineControl.cxx
+++ b/svx/source/sidebar/text/TextUnderlineControl.cxx
@@ -80,6 +80,10 @@ void TextUnderlineControl::initial()
maVSUnderline.SetStyle( maVSUnderline.GetStyle()| WB_3DLOOK | WB_NO_DIRECTSELECT );
+ // 'none' item
+ maVSUnderline.SetStyle( maVSUnderline.GetStyle()| WB_NONEFIELD | WB_MENUSTYLEVALUESET );
+ maVSUnderline.SetText( String(SVX_RES(STR_WITHOUT) ) );
+
maVSUnderline.InsertItem(1, maIMGSingle ,String(SVX_RES(STR_SINGLE)));
maVSUnderline.SetItemData(1, (void*)(sal_uInt64)UNDERLINE_SINGLE);
@@ -185,6 +189,9 @@ void TextUnderlineControl::Rearrange(FontUnderline eLine)
maVSUnderline.GrabFocus();
break;
case UNDERLINE_NONE:
+ maVSUnderline.SelectItem(0);
+ maVSUnderline.GrabFocus();
+ break;
default:
maVSUnderline.SelectItem(1);
maVSUnderline.SetNoSelection();
@@ -196,10 +203,12 @@ void TextUnderlineControl::Rearrange(FontUnderline eLine)
IMPL_LINK(TextUnderlineControl, VSSelectHdl, void *, pControl)
{
- if(pControl == &maVSUnderline)
+ if ( pControl == &maVSUnderline )
{
- sal_uInt16 iPos = maVSUnderline.GetSelectItemId();
- FontUnderline eUnderline = (FontUnderline)(sal_uInt64)maVSUnderline.GetItemData( iPos );
+ 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);