summaryrefslogtreecommitdiff
path: root/sd
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
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')
-rw-r--r--sd/sdi/_drvwsh.sdi20
-rw-r--r--sd/sdi/drtxtob.sdi30
-rw-r--r--sd/sdi/sdraw.sdi72
-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
-rw-r--r--sd/uiconfig/sdraw/menubar/menubar.xml2
-rw-r--r--sd/uiconfig/simpress/menubar/menubar.xml2
9 files changed, 251 insertions, 2 deletions
diff --git a/sd/sdi/_drvwsh.sdi b/sd/sdi/_drvwsh.sdi
index 73f9bf4f2a5f..69fde762bfee 100644
--- a/sd/sdi/_drvwsh.sdi
+++ b/sd/sdi/_drvwsh.sdi
@@ -2727,6 +2727,26 @@ interface DrawView
ExecMethod = ExecChar ;
StateMethod = GetAttrState ;
]
+ SID_ULINE_VAL_NONE
+ [
+ ExecMethod = ExecChar ;
+ StateMethod = GetAttrState ;
+ ]
+ SID_ULINE_VAL_SINGLE
+ [
+ ExecMethod = ExecChar ;
+ StateMethod = GetAttrState ;
+ ]
+ SID_ULINE_VAL_DOUBLE
+ [
+ ExecMethod = ExecChar ;
+ StateMethod = GetAttrState ;
+ ]
+ SID_ULINE_VAL_DOTTED
+ [
+ ExecMethod = ExecChar ;
+ StateMethod = GetAttrState ;
+ ]
SID_ATTR_CHAR_SHADOWED
[
ExecMethod = ExecChar ;
diff --git a/sd/sdi/drtxtob.sdi b/sd/sdi/drtxtob.sdi
index 6e29a20899ef..e34445f55b74 100644
--- a/sd/sdi/drtxtob.sdi
+++ b/sd/sdi/drtxtob.sdi
@@ -68,12 +68,42 @@ shell TextObjectBar
StateMethod = GetAttrState;
]
+ SID_ULINE_VAL_NONE
+ [
+ ExecMethod = Execute ;
+ StateMethod = GetAttrState ;
+ ]
+
+ SID_ULINE_VAL_SINGLE
+ [
+ ExecMethod = Execute ;
+ StateMethod = GetAttrState ;
+ ]
+
+ SID_ULINE_VAL_DOUBLE
+ [
+ ExecMethod = Execute ;
+ StateMethod = GetAttrState ;
+ ]
+
+ SID_ULINE_VAL_DOTTED
+ [
+ ExecMethod = Execute ;
+ StateMethod = GetAttrState ;
+ ]
+
SID_ATTR_CHAR_OVERLINE // ole : ?, status : ?
[
ExecMethod = Execute;
StateMethod = GetAttrState;
]
+ SID_ATTR_CHAR_UNDERLINE // ole : ?, status : ?
+ [
+ ExecMethod = Execute;
+ StateMethod = GetAttrState;
+ ]
+
SID_ATTR_CHAR_CONTOUR // ole : ?, status : ?
[
ExecMethod = Execute;
diff --git a/sd/sdi/sdraw.sdi b/sd/sdi/sdraw.sdi
index b73fa0d779f1..a675db0efb5e 100644
--- a/sd/sdi/sdraw.sdi
+++ b/sd/sdi/sdraw.sdi
@@ -4734,3 +4734,75 @@ SfxVoidItem EditDiagram SID_EDIT_DIAGRAM
ToolBoxConfig = TRUE,
GroupId = SfxGroupId::Modify;
]
+
+SfxBoolItem UnderlineNone SID_ULINE_VAL_NONE
+
+[
+ AutoUpdate = TRUE,
+ FastCall = FALSE,
+ ReadOnlyDoc = FALSE,
+ Toggle = FALSE,
+ Container = FALSE,
+ RecordAbsolute = FALSE,
+ RecordPerSet;
+
+
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ ToolBoxConfig = TRUE,
+ GroupId = SfxGroupId::Format;
+]
+
+SfxBoolItem UnderlineSingle SID_ULINE_VAL_SINGLE
+
+[
+ AutoUpdate = TRUE,
+ FastCall = FALSE,
+ ReadOnlyDoc = FALSE,
+ Toggle = FALSE,
+ Container = FALSE,
+ RecordAbsolute = FALSE,
+ RecordPerSet;
+
+
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ ToolBoxConfig = TRUE,
+ GroupId = SfxGroupId::Format;
+]
+
+SfxBoolItem UnderlineDouble SID_ULINE_VAL_DOUBLE
+
+[
+ AutoUpdate = TRUE,
+ FastCall = FALSE,
+ ReadOnlyDoc = FALSE,
+ Toggle = FALSE,
+ Container = FALSE,
+ RecordAbsolute = FALSE,
+ RecordPerSet;
+
+
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ ToolBoxConfig = TRUE,
+ GroupId = SfxGroupId::Format;
+]
+
+SfxBoolItem UnderlineDotted SID_ULINE_VAL_DOTTED
+
+[
+ AutoUpdate = TRUE,
+ FastCall = FALSE,
+ ReadOnlyDoc = FALSE,
+ Toggle = FALSE,
+ Container = FALSE,
+ RecordAbsolute = FALSE,
+ RecordPerSet;
+
+
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ ToolBoxConfig = TRUE,
+ GroupId = SfxGroupId::Format;
+]
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:
diff --git a/sd/uiconfig/sdraw/menubar/menubar.xml b/sd/uiconfig/sdraw/menubar/menubar.xml
index 0e48502ec360..c8254a5e6c1e 100644
--- a/sd/uiconfig/sdraw/menubar/menubar.xml
+++ b/sd/uiconfig/sdraw/menubar/menubar.xml
@@ -280,7 +280,7 @@
<menu:menupopup>
<menu:menuitem menu:id=".uno:Bold"/>
<menu:menuitem menu:id=".uno:Italic"/>
- <menu:menuitem menu:id=".uno:Underline"/>
+ <menu:menuitem menu:id=".uno:UnderlineSingle"/>
<menu:menuitem menu:id=".uno:UnderlineDouble"/>
<menu:menuitem menu:id=".uno:Strikeout"/>
<menu:menuitem menu:id=".uno:Overline"/>
diff --git a/sd/uiconfig/simpress/menubar/menubar.xml b/sd/uiconfig/simpress/menubar/menubar.xml
index 42b7d435c56a..ddaf30f94e52 100644
--- a/sd/uiconfig/simpress/menubar/menubar.xml
+++ b/sd/uiconfig/simpress/menubar/menubar.xml
@@ -313,7 +313,7 @@
<menu:menupopup>
<menu:menuitem menu:id=".uno:Bold"/>
<menu:menuitem menu:id=".uno:Italic"/>
- <menu:menuitem menu:id=".uno:Underline"/>
+ <menu:menuitem menu:id=".uno:UnderlineSingle"/>
<menu:menuitem menu:id=".uno:UnderlineDouble"/>
<menu:menuitem menu:id=".uno:Strikeout"/>
<menu:menuitem menu:id=".uno:Overline"/>