diff options
author | Caolán McNamara <caolanm@redhat.com> | 2019-11-11 12:22:56 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2019-11-12 12:25:21 +0100 |
commit | 431950e1eade91f8587d3ecffa73fd09136e16b6 (patch) | |
tree | d402e05fef613f36992e68efce2359e7cff54304 /sw | |
parent | f088d85f80c643378262a1f53bdea6f42abcf7d4 (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 'sw')
-rw-r--r-- | sw/inc/cmdid.h | 3 | ||||
-rw-r--r-- | sw/sdi/_textsh.sdi | 20 | ||||
-rw-r--r-- | sw/sdi/swriter.sdi | 58 | ||||
-rw-r--r-- | sw/source/uibase/shells/txtattr.cxx | 69 | ||||
-rw-r--r-- | sw/source/uibase/uiview/view.cxx | 3 | ||||
-rw-r--r-- | sw/uiconfig/sglobal/menubar/menubar.xml | 2 | ||||
-rw-r--r-- | sw/uiconfig/sweb/menubar/menubar.xml | 2 | ||||
-rw-r--r-- | sw/uiconfig/swform/menubar/menubar.xml | 2 | ||||
-rw-r--r-- | sw/uiconfig/swreport/menubar/menubar.xml | 2 | ||||
-rw-r--r-- | sw/uiconfig/swriter/menubar/menubar.xml | 2 | ||||
-rw-r--r-- | sw/uiconfig/swxform/menubar/menubar.xml | 2 |
11 files changed, 133 insertions, 32 deletions
diff --git a/sw/inc/cmdid.h b/sw/inc/cmdid.h index 838091eb82a7..6b49d5a91e51 100644 --- a/sw/inc/cmdid.h +++ b/sw/inc/cmdid.h @@ -286,8 +286,7 @@ #define FN_AUTOFORMAT_AUTO (FN_FORMAT + 2 ) /* apply autoformat during user input */ #define FN_GROW_FONT_SIZE (FN_FORMAT + 3 ) /* size */ #define FN_SHRINK_FONT_SIZE (FN_FORMAT + 4 ) /* size */ -#define FN_UNDERLINE_DOUBLE (FN_FORMAT + 5 ) /* double underline */ -#define FN_AUTOFORMAT_REDLINE_APPLY (FN_FORMAT + 6 ) /* apply autoformat with Redlining */ +#define FN_AUTOFORMAT_REDLINE_APPLY (FN_FORMAT + 5 ) /* apply autoformat with Redlining */ #define FN_SET_SUPER_SCRIPT (FN_FORMAT + 11) /* superscript */ #define FN_SET_SUB_SCRIPT (FN_FORMAT + 12) /* subscript */ #define FN_SET_SMALL_CAPS (FN_FORMAT + 13) /* small caps */ diff --git a/sw/sdi/_textsh.sdi b/sw/sdi/_textsh.sdi index 3d7bbd56b32e..bfd47719ca35 100644 --- a/sw/sdi/_textsh.sdi +++ b/sw/sdi/_textsh.sdi @@ -1450,7 +1450,25 @@ interface BaseText StateMethod = GetTextCtrlState; DisableFlags="SfxDisableFlags::SwOnProtectedCursor"; ] - FN_UNDERLINE_DOUBLE // status(final|play) + SID_ULINE_VAL_NONE // status(final|play) + [ + ExecMethod = ExecCharAttr ; + StateMethod = GetAttrState ; + DisableFlags="SfxDisableFlags::SwOnProtectedCursor"; + ] + SID_ULINE_VAL_SINGLE // status(final|play) + [ + ExecMethod = ExecCharAttr ; + StateMethod = GetAttrState ; + DisableFlags="SfxDisableFlags::SwOnProtectedCursor"; + ] + SID_ULINE_VAL_DOUBLE // status(final|play) + [ + ExecMethod = ExecCharAttr ; + StateMethod = GetAttrState ; + DisableFlags="SfxDisableFlags::SwOnProtectedCursor"; + ] + SID_ULINE_VAL_DOTTED // status(final|play) [ ExecMethod = ExecCharAttr ; StateMethod = GetAttrState ; diff --git a/sw/sdi/swriter.sdi b/sw/sdi/swriter.sdi index 481d25b66cc9..78dfda33e744 100644 --- a/sw/sdi/swriter.sdi +++ b/sw/sdi/swriter.sdi @@ -5980,13 +5980,67 @@ SfxVoidItem ToggleObjectLayer FN_TOOL_HIERARCHIE GroupId = SfxGroupId::Format; ] -SfxBoolItem UnderlineDouble FN_UNDERLINE_DOUBLE +SfxBoolItem UnderlineNone SID_ULINE_VAL_NONE [ AutoUpdate = TRUE, FastCall = FALSE, ReadOnlyDoc = FALSE, - Toggle = TRUE, + 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; diff --git a/sw/source/uibase/shells/txtattr.cxx b/sw/source/uibase/shells/txtattr.cxx index 7a532e91c45d..2e42c12c7898 100644 --- a/sw/source/uibase/shells/txtattr.cxx +++ b/sw/source/uibase/shells/txtattr.cxx @@ -158,25 +158,37 @@ void SwTextShell::ExecCharAttr(SfxRequest &rReq) rSh.QuickUpdateStyle(); rReq.Done(); break; - case FN_UNDERLINE_DOUBLE: + + case SID_ULINE_VAL_NONE: + { + SvxUnderlineItem aUnderline(LINESTYLE_NONE, RES_CHRATR_UNDERLINE ); + rSh.SetAttrItem( aUnderline ); + rReq.AppendItem( aUnderline ); + rReq.Done(); + break; + } + + case SID_ULINE_VAL_SINGLE: + case SID_ULINE_VAL_DOUBLE: + case SID_ULINE_VAL_DOTTED: { - FontLineStyle eUnderline = - aSet.Get(RES_CHRATR_UNDERLINE).GetLineStyle(); - switch( eState ) + FontLineStyle eOld = aSet.Get(RES_CHRATR_UNDERLINE).GetLineStyle(); + FontLineStyle eNew = eOld; + + switch (nWhich) { - case STATE_TOGGLE: - eUnderline = eUnderline == LINESTYLE_DOUBLE ? - LINESTYLE_NONE : - LINESTYLE_DOUBLE; - break; - case STATE_ON: - eUnderline = LINESTYLE_DOUBLE; - break; - case STATE_OFF: - eUnderline = LINESTYLE_NONE; - break; + 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(eUnderline, RES_CHRATR_UNDERLINE ); + + SvxUnderlineItem aUnderline(eNew, RES_CHRATR_UNDERLINE ); rSh.SetAttrItem( aUnderline ); rReq.AppendItem( aUnderline ); rReq.Done(); @@ -691,14 +703,31 @@ void SwTextShell::GetAttrState(SfxItemSet &rSet) nSlot = 0; } break; - case FN_UNDERLINE_DOUBLE: + case SID_ULINE_VAL_NONE: + case SID_ULINE_VAL_SINGLE: + case SID_ULINE_VAL_DOUBLE: + case SID_ULINE_VAL_DOTTED: { eState = aCoreSet.GetItemState(RES_CHRATR_UNDERLINE); if( eState >= SfxItemState::DEFAULT ) { - FontLineStyle eUnderline = - aCoreSet.Get(RES_CHRATR_UNDERLINE).GetLineStyle(); - rSet.Put(SfxBoolItem(nSlot, eUnderline == LINESTYLE_DOUBLE)); + FontLineStyle eLineStyle = aCoreSet.Get(RES_CHRATR_UNDERLINE).GetLineStyle(); + + switch (nSlot) + { + case SID_ULINE_VAL_NONE: + rSet.Put(SfxBoolItem(nSlot, eLineStyle == LINESTYLE_NONE)); + break; + case SID_ULINE_VAL_SINGLE: + rSet.Put(SfxBoolItem(nSlot, eLineStyle == LINESTYLE_SINGLE)); + break; + case SID_ULINE_VAL_DOUBLE: + rSet.Put(SfxBoolItem(nSlot, eLineStyle == LINESTYLE_DOUBLE)); + break; + case SID_ULINE_VAL_DOTTED: + rSet.Put(SfxBoolItem(nSlot, eLineStyle == LINESTYLE_DOTTED)); + break; + } } else rSet.InvalidateItem(nSlot); diff --git a/sw/source/uibase/uiview/view.cxx b/sw/source/uibase/uiview/view.cxx index ba17271dfd6d..ec013052dc75 100644 --- a/sw/source/uibase/uiview/view.cxx +++ b/sw/source/uibase/uiview/view.cxx @@ -613,7 +613,8 @@ void SwView::CheckReadonlyState() SID_ATTR_CHAR_COLOR, SID_ATTR_CHAR_WEIGHT, SID_ATTR_CHAR_POSTURE, SID_ATTR_CHAR_OVERLINE, SID_ATTR_CHAR_UNDERLINE, SID_ATTR_FLASH, SID_ATTR_CHAR_STRIKEOUT, - FN_UNDERLINE_DOUBLE, SID_ATTR_CHAR_CONTOUR, SID_ATTR_CHAR_SHADOWED, + SID_ULINE_VAL_SINGLE, SID_ULINE_VAL_DOUBLE, SID_ULINE_VAL_DOTTED, + SID_ATTR_CHAR_CONTOUR, SID_ATTR_CHAR_SHADOWED, SID_ATTR_CHAR_AUTOKERN, SID_ATTR_CHAR_ESCAPEMENT, FN_SET_SUPER_SCRIPT, FN_SET_SUB_SCRIPT, SID_ATTR_CHAR_CASEMAP, SID_ATTR_CHAR_LANGUAGE, SID_ATTR_CHAR_KERNING, SID_CHAR_DLG, SID_ATTR_CHAR_WORDLINEMODE, diff --git a/sw/uiconfig/sglobal/menubar/menubar.xml b/sw/uiconfig/sglobal/menubar/menubar.xml index c020fc014626..7c5df550f5bf 100644 --- a/sw/uiconfig/sglobal/menubar/menubar.xml +++ b/sw/uiconfig/sglobal/menubar/menubar.xml @@ -356,7 +356,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/sw/uiconfig/sweb/menubar/menubar.xml b/sw/uiconfig/sweb/menubar/menubar.xml index 521b8931e8da..9c0ac3e88a3a 100644 --- a/sw/uiconfig/sweb/menubar/menubar.xml +++ b/sw/uiconfig/sweb/menubar/menubar.xml @@ -229,7 +229,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/sw/uiconfig/swform/menubar/menubar.xml b/sw/uiconfig/swform/menubar/menubar.xml index 7640667b277b..973cfd9ade65 100644 --- a/sw/uiconfig/swform/menubar/menubar.xml +++ b/sw/uiconfig/swform/menubar/menubar.xml @@ -308,7 +308,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/sw/uiconfig/swreport/menubar/menubar.xml b/sw/uiconfig/swreport/menubar/menubar.xml index 7f929432a8e8..a81e5dd14d42 100644 --- a/sw/uiconfig/swreport/menubar/menubar.xml +++ b/sw/uiconfig/swreport/menubar/menubar.xml @@ -294,7 +294,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/sw/uiconfig/swriter/menubar/menubar.xml b/sw/uiconfig/swriter/menubar/menubar.xml index a71147117a39..81d7ad9d96f0 100644 --- a/sw/uiconfig/swriter/menubar/menubar.xml +++ b/sw/uiconfig/swriter/menubar/menubar.xml @@ -359,7 +359,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/sw/uiconfig/swxform/menubar/menubar.xml b/sw/uiconfig/swxform/menubar/menubar.xml index 2ffc863af248..1a03f6786465 100644 --- a/sw/uiconfig/swxform/menubar/menubar.xml +++ b/sw/uiconfig/swxform/menubar/menubar.xml @@ -355,7 +355,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"/> |