summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOliver-Rainer Wittmann <orw@apache.org>2013-05-02 13:50:45 +0000
committerMichael Meeks <michael.meeks@suse.com>2013-05-20 11:33:27 +0100
commit256be018056fba834aff099baef452b59af586fc (patch)
treeebfc5154991e44f5717abfe5c069cef469825736
parent862395f6a1b1df8762c315f7ae56e0623810ce05 (diff)
Resolves: #i122105# text property panel, underline style control
correct application of chosen underline style in Calc cells and Drawing objects in Writer (cherry picked from commit fd23db16149eb517de9b2b403ff28ed0d31c83d6) Change-Id: Id77299c173eef99ea2eea0c0896e9bfd0bd9d1eb
-rw-r--r--sc/source/ui/view/editsh.cxx12
-rw-r--r--svx/source/sidebar/text/TextUnderlineControl.cxx17
-rw-r--r--svx/source/sidebar/text/TextUnderlineControl.hxx4
-rw-r--r--sw/source/ui/shells/drwtxtex.cxx20
4 files changed, 29 insertions, 24 deletions
diff --git a/sc/source/ui/view/editsh.cxx b/sc/source/ui/view/editsh.cxx
index fd3418811b5c..66538712910f 100644
--- a/sc/source/ui/view/editsh.cxx
+++ b/sc/source/ui/view/editsh.cxx
@@ -920,7 +920,7 @@ void ScEditShell::ExecuteAttr(SfxRequest& rReq)
lcl_InvalidateUnder( rBindings );
break;
- case SID_ATTR_CHAR_UNDERLINE: // Toggles
+ case SID_ATTR_CHAR_UNDERLINE:
case SID_ULINE_VAL_SINGLE:
case SID_ULINE_VAL_DOUBLE:
case SID_ULINE_VAL_DOTTED:
@@ -931,7 +931,15 @@ void ScEditShell::ExecuteAttr(SfxRequest& rReq)
switch (nSlot)
{
case SID_ATTR_CHAR_UNDERLINE:
- eNew = ( eOld != UNDERLINE_NONE ) ? UNDERLINE_NONE : UNDERLINE_SINGLE;
+ if ( pArgs )
+ {
+ const SvxTextLineItem& rTextLineItem = static_cast< const SvxTextLineItem& >( pArgs->Get( pArgs->GetPool()->GetWhich(nSlot) ) );
+ eNew = rTextLineItem.GetLineStyle();
+ }
+ else
+ {
+ eNew = ( eOld != UNDERLINE_NONE ) ? UNDERLINE_NONE : UNDERLINE_SINGLE;
+ }
break;
case SID_ULINE_VAL_SINGLE:
eNew = ( eOld == UNDERLINE_SINGLE ) ? UNDERLINE_NONE : UNDERLINE_SINGLE;
diff --git a/svx/source/sidebar/text/TextUnderlineControl.cxx b/svx/source/sidebar/text/TextUnderlineControl.cxx
index de04d1edfcd7..2499f0a21619 100644
--- a/svx/source/sidebar/text/TextUnderlineControl.cxx
+++ b/svx/source/sidebar/text/TextUnderlineControl.cxx
@@ -78,7 +78,7 @@ void TextUnderlineControl::initial()
Link aLink = LINK( this, TextUnderlineControl, PBClickHdl ) ;
maPBOptions.SetClickHdl(aLink);
- maVSUnderline.SetStyle( maVSUnderline.GetStyle()| WB_3DLOOK | WB_NO_DIRECTSELECT );// WB_NAMEFIELD | WB_ITEMBORDER |WB_DOUBLEBORDER | WB_NONEFIELD |
+ 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);
@@ -118,10 +118,7 @@ void TextUnderlineControl::initial()
maVSUnderline.Show();
}
-void TextUnderlineControl::GetFocus()
-{
- maVSUnderline.GrabFocus();
-}
+
void TextUnderlineControl::Rearrange(FontUnderline eLine)
{
maVSUnderline.SetItemImage(1, maIMGSingle);
@@ -195,14 +192,8 @@ void TextUnderlineControl::Rearrange(FontUnderline eLine)
}
maVSUnderline.StartSelection();
}
-ValueSet& TextUnderlineControl::GetValueSet()
-{
- return maVSUnderline;
-}
-Control& TextUnderlineControl::GetPB()
-{
- return maPBOptions;
-}
+
+
IMPL_LINK(TextUnderlineControl, VSSelectHdl, void *, pControl)
{
if(pControl == &maVSUnderline)
diff --git a/svx/source/sidebar/text/TextUnderlineControl.hxx b/svx/source/sidebar/text/TextUnderlineControl.hxx
index a57ee00cd2f7..1eeb83492dda 100644
--- a/svx/source/sidebar/text/TextUnderlineControl.hxx
+++ b/svx/source/sidebar/text/TextUnderlineControl.hxx
@@ -39,10 +39,8 @@ public:
Window* pParent,
svx::sidebar::TextPropertyPanel& rPanel,
SfxBindings* pBindings);
- void GetFocus();
void Rearrange(FontUnderline eLine);
- ValueSet& GetValueSet();
- Control& GetPB();
+
private:
svx::sidebar::TextPropertyPanel& mrTextPropertyPanel;
SfxBindings* mpBindings;
diff --git a/sw/source/ui/shells/drwtxtex.cxx b/sw/source/ui/shells/drwtxtex.cxx
index c6f20106e601..7ad14095a74d 100644
--- a/sw/source/ui/shells/drwtxtex.cxx
+++ b/sw/source/ui/shells/drwtxtex.cxx
@@ -106,13 +106,13 @@ using namespace ::com::sun::star;
void SwDrawTextShell::Execute( SfxRequest &rReq )
{
SwWrtShell &rSh = GetShell();
- OutlinerView* pOLV = pSdrView->GetTextEditOutlinerView();
- SfxItemSet aEditAttr(pOLV->GetAttribs());
+ OutlinerView* pOLV = pSdrView->GetTextEditOutlinerView();
+ SfxItemSet aEditAttr(pOLV->GetAttribs());
SfxItemSet aNewAttr(*aEditAttr.GetPool(), aEditAttr.GetRanges());
- sal_uInt16 nSlot = rReq.GetSlot();
+ const sal_uInt16 nSlot = rReq.GetSlot();
- sal_uInt16 nWhich = GetPool().GetWhich(nSlot);
+ const sal_uInt16 nWhich = GetPool().GetWhich(nSlot);
const SfxItemSet *pNewAttrs = rReq.GetArgs();
bool bRestoreSelection = false;
@@ -172,8 +172,16 @@ void SwDrawTextShell::Execute( SfxRequest &rReq )
case SID_ATTR_CHAR_UNDERLINE:
{
- FontUnderline eFU = ((const SvxUnderlineItem&)aEditAttr.Get(EE_CHAR_UNDERLINE)).GetLineStyle();
- aNewAttr.Put(SvxUnderlineItem(eFU == UNDERLINE_SINGLE ? UNDERLINE_NONE : UNDERLINE_SINGLE, EE_CHAR_UNDERLINE));
+ if ( pNewAttrs )
+ {
+ const SvxTextLineItem& rTextLineItem = static_cast< const SvxTextLineItem& >( pNewAttrs->Get( pNewAttrs->GetPool()->GetWhich(nSlot) ) );
+ aNewAttr.Put( SvxUnderlineItem( rTextLineItem.GetLineStyle(), EE_CHAR_UNDERLINE ) );
+ }
+ else
+ {
+ FontUnderline eFU = ((const SvxUnderlineItem&)aEditAttr.Get(EE_CHAR_UNDERLINE)).GetLineStyle();
+ aNewAttr.Put( SvxUnderlineItem(eFU == UNDERLINE_SINGLE ? UNDERLINE_NONE : UNDERLINE_SINGLE, EE_CHAR_UNDERLINE) );
+ }
}
break;