editeng/source/editeng/impedit3.cxx |    2 ++
 include/vcl/commandevent.hxx        |   19 ++++++++++---------
 sw/source/core/text/redlnitr.cxx    |    2 ++
 vcl/source/control/edit.cxx         |    2 ++
 vcl/source/edit/texteng.cxx         |    2 ++
 vcl/unx/gtk3/gtkframe.cxx           |   13 +++++++++++--
 6 files changed, 29 insertions(+), 11 deletions(-)

New commits:
commit d1cd19b56d5fefaa6f41a4d70e748331525820a4
Author:     Caolán McNamara <caol...@redhat.com>
AuthorDate: Thu Nov 3 10:21:59 2022 +0000
Commit:     Caolán McNamara <caol...@redhat.com>
CommitDate: Thu Nov 3 20:48:37 2022 +0100

    Related: tdf#149932 honour PANGO_UNDERLINE_DOUBLE for preedit underline
    
    we already have support for double underline so that's an easy add
    
    Change-Id: I1bba5620038e396765bd79050ff6a520096f9476
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142223
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caol...@redhat.com>

diff --git a/editeng/source/editeng/impedit3.cxx 
b/editeng/source/editeng/impedit3.cxx
index f932fd0df8ed..2d2a339658df 100644
--- a/editeng/source/editeng/impedit3.cxx
+++ b/editeng/source/editeng/impedit3.cxx
@@ -3061,6 +3061,8 @@ void ImpEditEngine::SeekCursor( ContentNode* pNode, 
sal_Int32 nPos, SvxFont& rFo
     ExtTextInputAttr nAttr = mpIMEInfos->pAttribs[ nPos - 
mpIMEInfos->aPos.GetIndex() - 1 ];
     if ( nAttr & ExtTextInputAttr::Underline )
         rFont.SetUnderline( LINESTYLE_SINGLE );
+    else if ( nAttr & ExtTextInputAttr::DoubleUnderline )
+        rFont.SetUnderline( LINESTYLE_DOUBLE );
     else if ( nAttr & ExtTextInputAttr::BoldUnderline )
         rFont.SetUnderline( LINESTYLE_BOLD );
     else if ( nAttr & ExtTextInputAttr::DottedUnderline )
diff --git a/include/vcl/commandevent.hxx b/include/vcl/commandevent.hxx
index d5b043ddb97a..fc6ba290793f 100644
--- a/include/vcl/commandevent.hxx
+++ b/include/vcl/commandevent.hxx
@@ -48,18 +48,19 @@ enum class CommandEventId;
 
 enum class ExtTextInputAttr {
     NONE                  = 0x0000,
-    GrayWaveline          = 0x0100,
-    Underline             = 0x0200,
-    BoldUnderline         = 0x0400,
-    DottedUnderline       = 0x0800,
-    DashDotUnderline      = 0x1000,
-    Highlight             = 0x2000,
-    RedText               = 0x4000,
-    HalfToneText          = 0x8000
+    GrayWaveline          = 0x0010,
+    Underline             = 0x0020,
+    BoldUnderline         = 0x0040,
+    DottedUnderline       = 0x0080,
+    DashDotUnderline      = 0x0100,
+    DoubleUnderline       = 0x0200,
+    Highlight             = 0x0400,
+    RedText               = 0x0800,
+    HalfToneText          = 0x1000
 };
 namespace o3tl
 {
-    template<> struct typed_flags<ExtTextInputAttr> : 
is_typed_flags<ExtTextInputAttr, 0xff00> {};
+    template<> struct typed_flags<ExtTextInputAttr> : 
is_typed_flags<ExtTextInputAttr, 0x1ff0> {};
 }
 
 #define EXTTEXTINPUT_CURSOR_INVISIBLE           (sal_uInt16(0x0001))
diff --git a/sw/source/core/text/redlnitr.cxx b/sw/source/core/text/redlnitr.cxx
index 2b8c11693d20..2b77d86aa350 100644
--- a/sw/source/core/text/redlnitr.cxx
+++ b/sw/source/core/text/redlnitr.cxx
@@ -1049,6 +1049,8 @@ void SwExtend::ActualizeFont( SwFont &rFnt, 
ExtTextInputAttr nAttr )
 {
     if ( nAttr & ExtTextInputAttr::Underline )
         rFnt.SetUnderline( LINESTYLE_SINGLE );
+    else if ( nAttr & ExtTextInputAttr::DoubleUnderline )
+        rFnt.SetUnderline( LINESTYLE_DOUBLE );
     else if ( nAttr & ExtTextInputAttr::BoldUnderline )
         rFnt.SetUnderline( LINESTYLE_BOLD );
     else if ( nAttr & ExtTextInputAttr::DottedUnderline )
diff --git a/vcl/source/control/edit.cxx b/vcl/source/control/edit.cxx
index 1554f846ba95..a072a42ec467 100644
--- a/vcl/source/control/edit.cxx
+++ b/vcl/source/control/edit.cxx
@@ -639,6 +639,8 @@ void Edit::ImplRepaint(vcl::RenderContext& rRenderContext, 
const tools::Rectangl
                         vcl::Font aFont = rRenderContext.GetFont();
                         if (nAttr & ExtTextInputAttr::Underline)
                             aFont.SetUnderline(LINESTYLE_SINGLE);
+                        else if (nAttr & ExtTextInputAttr::DoubleUnderline)
+                            aFont.SetUnderline(LINESTYLE_DOUBLE);
                         else if (nAttr & ExtTextInputAttr::BoldUnderline)
                             aFont.SetUnderline( LINESTYLE_BOLD);
                         else if (nAttr & ExtTextInputAttr::DottedUnderline)
diff --git a/vcl/source/edit/texteng.cxx b/vcl/source/edit/texteng.cxx
index 75d6085859e3..90140a58df11 100644
--- a/vcl/source/edit/texteng.cxx
+++ b/vcl/source/edit/texteng.cxx
@@ -1382,6 +1382,8 @@ void TextEngine::SeekCursor( sal_uInt32 nPara, sal_Int32 
nPos, vcl::Font& rFont,
     ExtTextInputAttr nAttr = mpIMEInfos->pAttribs[ nPos - 
mpIMEInfos->aPos.GetIndex() - 1 ];
     if ( nAttr & ExtTextInputAttr::Underline )
         rFont.SetUnderline( LINESTYLE_SINGLE );
+    else if ( nAttr & ExtTextInputAttr::DoubleUnderline )
+        rFont.SetUnderline( LINESTYLE_DOUBLE );
     else if ( nAttr & ExtTextInputAttr::BoldUnderline )
         rFont.SetUnderline( LINESTYLE_BOLD );
     else if ( nAttr & ExtTextInputAttr::DottedUnderline )
diff --git a/vcl/unx/gtk3/gtkframe.cxx b/vcl/unx/gtk3/gtkframe.cxx
index d937e8eddd9f..c4c502eedca2 100644
--- a/vcl/unx/gtk3/gtkframe.cxx
+++ b/vcl/unx/gtk3/gtkframe.cxx
@@ -5714,8 +5714,17 @@ OUString GtkSalFrame::GetPreeditDetails(GtkIMContext* 
pIMContext, std::vector<Ex
                 case PANGO_ATTR_UNDERLINE:
                 {
                     PangoAttrInt* pango_underline = 
reinterpret_cast<PangoAttrInt*>(pango_attr);
-                    if (pango_underline->value != PANGO_UNDERLINE_NONE)
-                        sal_attr |= ExtTextInputAttr::Underline;
+                    switch (pango_underline->value)
+                    {
+                        case PANGO_UNDERLINE_NONE:
+                            break;
+                        case PANGO_UNDERLINE_DOUBLE:
+                            sal_attr |= ExtTextInputAttr::DoubleUnderline;
+                            break;
+                        default:
+                            sal_attr |= ExtTextInputAttr::Underline;
+                            break;
+                    }
                     break;
                 }
                 case PANGO_ATTR_STRIKETHROUGH:

Reply via email to