diff options
author | Olivier R <olivier.dev@grammalecte.net> | 2019-06-03 20:33:21 +0200 |
---|---|---|
committer | Michael Stahl <Michael.Stahl@cib.de> | 2019-06-05 13:58:23 +0200 |
commit | cdd69ce780dc7758047a27ed3c76bdc01b5ffb89 (patch) | |
tree | 6694d1f9dd5521884f31cf2a4ebb2de12e9d9a3c /sw | |
parent | e770bacc85a0eec96de77068d61b03f374b3cdec (diff) |
Linguistic: new underlining styles for grammar checkers
This patch adds two new underlining styles:
- BOLDWAVE: a thicker version of the default WAVE style
- BOLD: a thick straight line
No default setting changed. It's up to the grammar checkers to specify
the underlining style they want.
This contribution to LibreOffice is licensed under the MPLv2/LGPLv3+ dual license.
modified : include/vcl/outdev.hxx
modified : offapi/com/sun/star/text/TextMarkupDescriptor.idl
modified : sw/source/core/inc/wrong.hxx
modified : sw/source/core/txtnode/fntcache.cxx
modified : vcl/source/outdev/textline.cxx
modified : vcl/workben/outdevgrind.cxx
Change-Id: I5629253905ba40c51cc748a7ceeb84170ef5d94c
Reviewed-on: https://gerrit.libreoffice.org/73412
Tested-by: Jenkins
Reviewed-by: Michael Stahl <Michael.Stahl@cib.de>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/core/inc/wrong.hxx | 22 | ||||
-rw-r--r-- | sw/source/core/txtnode/fntcache.cxx | 31 |
2 files changed, 44 insertions, 9 deletions
diff --git a/sw/source/core/inc/wrong.hxx b/sw/source/core/inc/wrong.hxx index 3fe7cb7bf75b..53581720e853 100644 --- a/sw/source/core/inc/wrong.hxx +++ b/sw/source/core/inc/wrong.hxx @@ -47,9 +47,11 @@ class SwWrongList; enum WrongAreaLineType { - WRONGAREA_DASHED, + WRONGAREA_NONE, WRONGAREA_WAVE, - WRONGAREA_NONE + WRONGAREA_BOLDWAVE, + WRONGAREA_BOLD, + WRONGAREA_DASHED }; enum WrongListType @@ -125,6 +127,14 @@ private: { return WRONGAREA_WAVE; } + if (css::awt::FontUnderline::BOLDWAVE == lineType) + { + return WRONGAREA_BOLDWAVE; + } + if (css::awt::FontUnderline::BOLD == lineType) + { + return WRONGAREA_BOLD; + } if (css::awt::FontUnderline::DASH == lineType) { return WRONGAREA_DASHED; @@ -189,6 +199,14 @@ private: { return WRONGAREA_WAVE; } + if (css::awt::FontUnderline::BOLDWAVE == lineType) + { + return WRONGAREA_BOLDWAVE; + } + if (css::awt::FontUnderline::BOLD == lineType) + { + return WRONGAREA_BOLD; + } if (css::awt::FontUnderline::SMALLWAVE == lineType) { return WRONGAREA_WAVE; //Code draws wave height based on space that fits. diff --git a/sw/source/core/txtnode/fntcache.cxx b/sw/source/core/txtnode/fntcache.cxx index ed312422a361..871f9ce655ca 100644 --- a/sw/source/core/txtnode/fntcache.cxx +++ b/sw/source/core/txtnode/fntcache.cxx @@ -784,25 +784,42 @@ static void lcl_DrawLineForWrongListData( SwWrongArea const*const wrongArea = pWList->GetWrongElement(nNextStart + rInf.GetIdx()); if (wrongArea != nullptr) { - if (WRONGAREA_DASHED == wrongArea->mLineType) + if (WRONGAREA_WAVE == wrongArea->mLineType) + { + rInf.GetOut().SetLineColor( wrongArea->mColor ); + + rInf.GetOut().DrawWaveLine( aStart, aEnd, 1 ); + } + else if (WRONGAREA_BOLDWAVE == wrongArea->mLineType) + { + rInf.GetOut().SetLineColor( wrongArea->mColor ); + + rInf.GetOut().DrawWaveLine( aStart, aEnd, 2 ); + } + else if (WRONGAREA_BOLD == wrongArea->mLineType) { rInf.GetOut().SetLineColor( wrongArea->mColor ); aStart.AdjustY(30 ); aEnd.AdjustY(30 ); - LineInfo aLineInfo( LineStyle::Dash ); - aLineInfo.SetDistance( 40 ); - aLineInfo.SetDashLen( 1 ); - aLineInfo.SetDashCount(1); + LineInfo aLineInfo( LineStyle::Solid, 26 ); rInf.GetOut().DrawLine( aStart, aEnd, aLineInfo ); } - else if (WRONGAREA_WAVE == wrongArea->mLineType) + else if (WRONGAREA_DASHED == wrongArea->mLineType) { rInf.GetOut().SetLineColor( wrongArea->mColor ); - rInf.GetOut().DrawWaveLine( aStart, aEnd ); + aStart.AdjustY(30 ); + aEnd.AdjustY(30 ); + + LineInfo aLineInfo( LineStyle::Dash ); + aLineInfo.SetDistance( 40 ); + aLineInfo.SetDashLen( 1 ); + aLineInfo.SetDashCount(1); + + rInf.GetOut().DrawLine( aStart, aEnd, aLineInfo ); } } } |