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>
diff --git a/include/svx/svxids.hrc b/include/svx/svxids.hrc
index 851ef3e..100d2f4 100644
--- a/include/svx/svxids.hrc
+++ b/include/svx/svxids.hrc
@@ -990,8 +990,13 @@ class SvxSetItem;

#define SID_IMPRESS_DOC                                 TypedWhichId<SfxBoolItem>( SID_SVX_START + 1194 )

#define SID_ULINE_VAL_NONE                              (SID_SVX_START + 1195) /* no underline */
#define SID_ULINE_VAL_SINGLE                            (SID_SVX_START + 1196) /* single underline */
#define SID_ULINE_VAL_DOUBLE                            (SID_SVX_START + 1197) /* double underline */
#define SID_ULINE_VAL_DOTTED                            (SID_SVX_START + 1198) /* dotted underline */

// IMPORTANT NOTE: adjust SID_SVX_FIRSTFREE, when adding new slot id
#define SID_SVX_FIRSTFREE                               ( SID_SVX_START + 1194 + 1 )
#define SID_SVX_FIRSTFREE                               ( SID_SVX_START + 1198 + 1 )

// Overflow check for slot IDs
#if SID_SVX_FIRSTFREE > SID_SVX_END
diff --git a/officecfg/registry/data/org/openoffice/Office/UI/CalcCommands.xcu b/officecfg/registry/data/org/openoffice/Office/UI/CalcCommands.xcu
index ff1e596..5fc352c 100644
--- a/officecfg/registry/data/org/openoffice/Office/UI/CalcCommands.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/UI/CalcCommands.xcu
@@ -1233,16 +1233,6 @@
          <value xml:lang="en-US">Collaborate...</value>
        </prop>
      </node>
      <node oor:name=".uno:UnderlineNone" oor:op="replace">
        <prop oor:name="Label" oor:type="xs:string">
          <value xml:lang="en-US">Underline: Off</value>
        </prop>
      </node>
      <node oor:name=".uno:UnderlineSingle" oor:op="replace">
        <prop oor:name="Label" oor:type="xs:string">
          <value xml:lang="en-US">Underline: Single</value>
        </prop>
      </node>
      <node oor:name=".uno:AcceptChanges" oor:op="replace">
        <prop oor:name="Label" oor:type="xs:string">
          <value xml:lang="en-US">~Manage...</value>
@@ -1265,11 +1255,6 @@
          <value>1</value>
        </prop>
      </node>
      <node oor:name=".uno:UnderlineDotted" oor:op="replace">
        <prop oor:name="Label" oor:type="xs:string">
          <value xml:lang="en-US">Underline: Dotted</value>
        </prop>
      </node>
      <node oor:name=".uno:Delete" oor:op="replace">
        <prop oor:name="Label" oor:type="xs:string">
          <value xml:lang="en-US">Cle~ar Cells...</value>
diff --git a/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu b/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu
index 0d4cf4e..34cdc64 100644
--- a/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu
@@ -1563,6 +1563,7 @@
          <value>9</value>
        </prop>
      </node>
      <!-- selection of possible underlines -->
      <node oor:name=".uno:Underline" oor:op="replace">
        <prop oor:name="Label" oor:type="xs:string">
          <value xml:lang="en-US">Underline</value>
@@ -1571,6 +1572,7 @@
          <value>9</value>
        </prop>
      </node>
      <!-- set single underline, state of any non-None underline -->
      <node oor:name=".uno:UnderlineSimple" oor:op="replace">
        <prop oor:name="Label" oor:type="xs:string">
          <value xml:lang="en-US">Underline</value>
@@ -1582,6 +1584,22 @@
          <value>.uno:Underline</value>
        </prop>
      </node>
      <node oor:name=".uno:UnderlineNone" oor:op="replace">
        <prop oor:name="Label" oor:type="xs:string">
          <value xml:lang="en-US">Underline: Off</value>
        </prop>
        <prop oor:name="Properties" oor:type="xs:int">
          <value>9</value>
        </prop>
      </node>
      <node oor:name=".uno:UnderlineSingle" oor:op="replace">
        <prop oor:name="Label" oor:type="xs:string">
          <value xml:lang="en-US">Single Underline</value>
        </prop>
        <prop oor:name="Properties" oor:type="xs:int">
          <value>9</value>
        </prop>
      </node>
      <node oor:name=".uno:UnderlineDouble" oor:op="replace">
        <prop oor:name="Label" oor:type="xs:string">
          <value xml:lang="en-US">Double Underline</value>
@@ -1590,6 +1608,11 @@
          <value>9</value>
        </prop>
      </node>
      <node oor:name=".uno:UnderlineDotted" oor:op="replace">
        <prop oor:name="Label" oor:type="xs:string">
          <value xml:lang="en-US">Dotted Underline</value>
        </prop>
      </node>
      <node oor:name=".uno:Overline" oor:op="replace">
        <prop oor:name="Label" oor:type="xs:string">
          <value xml:lang="en-US">Overline</value>
diff --git a/sc/inc/sc.hrc b/sc/inc/sc.hrc
index c8388a4..ccd4ad2 100644
--- a/sc/inc/sc.hrc
+++ b/sc/inc/sc.hrc
@@ -584,12 +584,6 @@

#define FID_FOCUS_POSWND        (SID_NEW_SLOTS+74)

//  single slots for different underline kinds (popup menu)
#define SID_ULINE_VAL_NONE      (SID_NEW_SLOTS+75)
#define SID_ULINE_VAL_SINGLE    (SID_NEW_SLOTS+76)
#define SID_ULINE_VAL_DOUBLE    (SID_NEW_SLOTS+77)
#define SID_ULINE_VAL_DOTTED    (SID_NEW_SLOTS+78)

#define FID_DEL_MANUALBREAKS    (SID_NEW_SLOTS+79)
#define SID_ADD_PRINTAREA       (SID_NEW_SLOTS+80)
#define FID_ADJUST_PRINTZOOM    (SID_NEW_SLOTS+81)
diff --git a/sc/source/ui/view/editsh.cxx b/sc/source/ui/view/editsh.cxx
index 261b4e2..ebcde62 100644
--- a/sc/source/ui/view/editsh.cxx
+++ b/sc/source/ui/view/editsh.cxx
@@ -1193,7 +1193,6 @@ void ScEditShell::GetAttrState(SfxItemSet &rSet)
        ScViewUtil::PutItemScript( rSet, aAttribs, EE_CHAR_ITALIC, nScript );

    // underline

    SfxItemState eState = aAttribs.GetItemState( EE_CHAR_UNDERLINE );
    if ( eState == SfxItemState::DONTCARE )
    {
diff --git a/sc/uiconfig/scalc/menubar/menubar.xml b/sc/uiconfig/scalc/menubar/menubar.xml
index f360aa0..d1d8069 100644
--- a/sc/uiconfig/scalc/menubar/menubar.xml
+++ b/sc/uiconfig/scalc/menubar/menubar.xml
@@ -320,7 +320,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/sdi/_drvwsh.sdi b/sd/sdi/_drvwsh.sdi
index 73f9bf4..69fde76 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 6e29a208..e34445f 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 b73fa0d..a675db0 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 0222501..0899643 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 c686630..0b06a88 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 00a595b..435aea9 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 ab8a9a7..f5bffd9 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 0e48502..c8254a5 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 42b7d43..ddaf30f 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"/>
diff --git a/sw/inc/cmdid.h b/sw/inc/cmdid.h
index 838091e..6b49d5a 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 3d7bbd5..bfd4771 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 481d25b..78dfda3 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 7a532e9..2e42c12 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:
        {
            FontLineStyle eUnderline =
                            aSet.Get(RES_CHRATR_UNDERLINE).GetLineStyle();
            switch( eState )
            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 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 ba17271..ec01305 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 c020fc01..7c5df55 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 521b893..9c0ac3e 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 7640667..973cfd9 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 7f92943..a81e5dd 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 a711471..81d7ad9 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 2ffc863a..1a03f67 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"/>