summaryrefslogtreecommitdiff
path: root/sd/source/ui/view
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2019-11-11 12:22:56 +0000
committerCaolán McNamara <caolanm@redhat.com>2019-11-12 12:25:21 +0100
commit431950e1eade91f8587d3ecffa73fd09136e16b6 (patch)
treed402e05fef613f36992e68efce2359e7cff54304 /sd/source/ui/view
parentf088d85f80c643378262a1f53bdea6f42abcf7d4 (diff)
tdf#121239 give writer, calc and draw/impress the same underline options
uno:Underline is the "real" deal, and has multiple underline options uno:UnderlineSimple is "some underline on" vs no underline calc and writer had UnderlineSingle, UnderlineDouble and UnderlineDotted for that specific type of underline on vs not-on add those to draw/impress too and then use UnderlineSingle instead of Underline in the format menu so that when UnderlineDouble is applied, UnderlineSingle is not show as applied, instead of using Underline ot UnderlineSimple which would show as on if UnderlineDouble was applied Change-Id: I6f9fcf37c2c90d215ea52b536e4fa84734754850 Reviewed-on: https://gerrit.libreoffice.org/82469 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sd/source/ui/view')
-rw-r--r--sd/source/ui/view/drtxtob.cxx29
-rw-r--r--sd/source/ui/view/drtxtob1.cxx32
-rw-r--r--sd/source/ui/view/drviews2.cxx32
-rw-r--r--sd/source/ui/view/drviewsf.cxx34
4 files changed, 127 insertions, 0 deletions
diff --git a/sd/source/ui/view/drtxtob.cxx b/sd/source/ui/view/drtxtob.cxx
index 022250103593..089964333274 100644
--- a/sd/source/ui/view/drtxtob.cxx
+++ b/sd/source/ui/view/drtxtob.cxx
@@ -24,6 +24,7 @@
#include <com/sun/star/linguistic2/XThesaurus.hpp>
#include <editeng/eeitem.hxx>
+#include <editeng/udlnitem.hxx>
#include <editeng/ulspitem.hxx>
#include <editeng/lspcitem.hxx>
#include <editeng/adjustitem.hxx>
@@ -376,6 +377,34 @@ void TextObjectBar::GetAttrState( SfxItemSet& rSet )
}
break;
+ case SID_ULINE_VAL_NONE:
+ case SID_ULINE_VAL_SINGLE:
+ case SID_ULINE_VAL_DOUBLE:
+ case SID_ULINE_VAL_DOTTED:
+ {
+ if( aAttrSet.GetItemState( EE_CHAR_UNDERLINE ) >= SfxItemState::DEFAULT )
+ {
+ FontLineStyle eLineStyle = aAttrSet.Get(EE_CHAR_UNDERLINE).GetLineStyle();
+
+ switch (nSlotId)
+ {
+ case SID_ULINE_VAL_NONE:
+ rSet.Put(SfxBoolItem(nSlotId, eLineStyle == LINESTYLE_NONE));
+ break;
+ case SID_ULINE_VAL_SINGLE:
+ rSet.Put(SfxBoolItem(nSlotId, eLineStyle == LINESTYLE_SINGLE));
+ break;
+ case SID_ULINE_VAL_DOUBLE:
+ rSet.Put(SfxBoolItem(nSlotId, eLineStyle == LINESTYLE_DOUBLE));
+ break;
+ case SID_ULINE_VAL_DOTTED:
+ rSet.Put(SfxBoolItem(nSlotId, eLineStyle == LINESTYLE_DOTTED));
+ break;
+ }
+ }
+ }
+ break;
+
case SID_GROW_FONT_SIZE:
case SID_SHRINK_FONT_SIZE:
{
diff --git a/sd/source/ui/view/drtxtob1.cxx b/sd/source/ui/view/drtxtob1.cxx
index c686630d6a2d..0b06a88c267b 100644
--- a/sd/source/ui/view/drtxtob1.cxx
+++ b/sd/source/ui/view/drtxtob1.cxx
@@ -551,6 +551,38 @@ void TextObjectBar::Execute( SfxRequest &rReq )
EE_CHAR_UNDERLINE ) );
}
break;
+
+ case SID_ULINE_VAL_NONE:
+ {
+ aNewAttr.Put(SvxUnderlineItem(LINESTYLE_NONE, EE_CHAR_UNDERLINE));
+ break;
+ }
+
+ case SID_ULINE_VAL_SINGLE:
+ case SID_ULINE_VAL_DOUBLE:
+ case SID_ULINE_VAL_DOTTED:
+ {
+ FontLineStyle eOld = aEditAttr.Get(EE_CHAR_UNDERLINE).GetLineStyle();
+ FontLineStyle eNew = eOld;
+
+ switch (nSlot)
+ {
+ case SID_ULINE_VAL_SINGLE:
+ eNew = ( eOld == LINESTYLE_SINGLE ) ? LINESTYLE_NONE : LINESTYLE_SINGLE;
+ break;
+ case SID_ULINE_VAL_DOUBLE:
+ eNew = ( eOld == LINESTYLE_DOUBLE ) ? LINESTYLE_NONE : LINESTYLE_DOUBLE;
+ break;
+ case SID_ULINE_VAL_DOTTED:
+ eNew = ( eOld == LINESTYLE_DOTTED ) ? LINESTYLE_NONE : LINESTYLE_DOTTED;
+ break;
+ }
+
+ SvxUnderlineItem aUnderline(eNew, EE_CHAR_UNDERLINE);
+ aNewAttr.Put(aUnderline);
+ }
+ break;
+
case SID_ATTR_CHAR_OVERLINE:
{
FontLineStyle eFO = aEditAttr.Get( EE_CHAR_OVERLINE ).GetLineStyle();
diff --git a/sd/source/ui/view/drviews2.cxx b/sd/source/ui/view/drviews2.cxx
index 00a595becb44..435aea90a925 100644
--- a/sd/source/ui/view/drviews2.cxx
+++ b/sd/source/ui/view/drviews2.cxx
@@ -3560,6 +3560,38 @@ void DrawViewShell::ExecChar( SfxRequest &rReq )
}
}
break;
+
+ case SID_ULINE_VAL_NONE:
+ {
+ aNewAttr.Put(SvxUnderlineItem(LINESTYLE_NONE, EE_CHAR_UNDERLINE));
+ break;
+ }
+
+ case SID_ULINE_VAL_SINGLE:
+ case SID_ULINE_VAL_DOUBLE:
+ case SID_ULINE_VAL_DOTTED:
+ {
+ FontLineStyle eOld = aEditAttr.Get(EE_CHAR_UNDERLINE).GetLineStyle();
+ FontLineStyle eNew = eOld;
+
+ switch (nSId)
+ {
+ case SID_ULINE_VAL_SINGLE:
+ eNew = ( eOld == LINESTYLE_SINGLE ) ? LINESTYLE_NONE : LINESTYLE_SINGLE;
+ break;
+ case SID_ULINE_VAL_DOUBLE:
+ eNew = ( eOld == LINESTYLE_DOUBLE ) ? LINESTYLE_NONE : LINESTYLE_DOUBLE;
+ break;
+ case SID_ULINE_VAL_DOTTED:
+ eNew = ( eOld == LINESTYLE_DOTTED ) ? LINESTYLE_NONE : LINESTYLE_DOTTED;
+ break;
+ }
+
+ SvxUnderlineItem aUnderline(eNew, EE_CHAR_UNDERLINE);
+ aNewAttr.Put(aUnderline);
+ }
+ break;
+
case SID_ATTR_CHAR_SHADOWED:
if( rReq.GetArgs() )
{
diff --git a/sd/source/ui/view/drviewsf.cxx b/sd/source/ui/view/drviewsf.cxx
index ab8a9a720131..f5bffd9929d4 100644
--- a/sd/source/ui/view/drviewsf.cxx
+++ b/sd/source/ui/view/drviewsf.cxx
@@ -25,6 +25,7 @@
#include <svx/hlnkitem.hxx>
#include <editeng/eeitem.hxx>
#include <editeng/flditem.hxx>
+#include <editeng/udlnitem.hxx>
#include <sfx2/viewfrm.hxx>
#include <svl/whiter.hxx>
#include <svl/eitem.hxx>
@@ -365,6 +366,39 @@ void DrawViewShell::GetAttrState( SfxItemSet& rSet )
Invalidate(SID_ATTR_PARA_ULSPACE);
}
break;
+ case SID_ULINE_VAL_NONE:
+ case SID_ULINE_VAL_SINGLE:
+ case SID_ULINE_VAL_DOUBLE:
+ case SID_ULINE_VAL_DOTTED:
+ {
+ SfxItemSet aAttrs( GetDoc()->GetPool() );
+ mpDrawView->GetAttributes( aAttrs );
+ if( aAttrs.GetItemState( EE_CHAR_UNDERLINE ) >= SfxItemState::DEFAULT )
+ {
+ FontLineStyle eLineStyle = aAttrs.Get(EE_CHAR_UNDERLINE).GetLineStyle();
+
+ switch (nSlotId)
+ {
+ case SID_ULINE_VAL_NONE:
+ rSet.Put(SfxBoolItem(nSlotId, eLineStyle == LINESTYLE_NONE));
+ break;
+ case SID_ULINE_VAL_SINGLE:
+ rSet.Put(SfxBoolItem(nSlotId, eLineStyle == LINESTYLE_SINGLE));
+ break;
+ case SID_ULINE_VAL_DOUBLE:
+ rSet.Put(SfxBoolItem(nSlotId, eLineStyle == LINESTYLE_DOUBLE));
+ break;
+ case SID_ULINE_VAL_DOTTED:
+ rSet.Put(SfxBoolItem(nSlotId, eLineStyle == LINESTYLE_DOTTED));
+ break;
+ }
+ }
+
+ bAttr = true;
+
+ Invalidate(nSlotId);
+ }
+ break;
case SID_ATTR_FILL_STYLE:
case SID_ATTR_FILL_COLOR:
case SID_ATTR_FILL_GRADIENT: