diff options
author | Oliver-Rainer Wittmann <orw@apache.org> | 2013-05-02 13:50:45 +0000 |
---|---|---|
committer | Michael Meeks <michael.meeks@suse.com> | 2013-05-20 11:33:27 +0100 |
commit | 256be018056fba834aff099baef452b59af586fc (patch) | |
tree | ebfc5154991e44f5717abfe5c069cef469825736 /sw/source/ui/shells/drwtxtex.cxx | |
parent | 862395f6a1b1df8762c315f7ae56e0623810ce05 (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
Diffstat (limited to 'sw/source/ui/shells/drwtxtex.cxx')
-rw-r--r-- | sw/source/ui/shells/drwtxtex.cxx | 20 |
1 files changed, 14 insertions, 6 deletions
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; |