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 <caolanm@redhat.com>
diff --git a/editeng/source/editeng/impedit3.cxx b/editeng/source/editeng/impedit3.cxx
index f932fd0d..2d2a3396 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 d5b043d..fc6ba29 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 2b8c116..2b77d86 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 1554f84..a072a42 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 75d6085..90140a5 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 d937e8e..c4c502e 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: