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>
This commit is contained in:
@@ -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 )
|
||||
|
||||
@@ -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))
|
||||
|
||||
@@ -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 )
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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 )
|
||||
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user