summaryrefslogtreecommitdiff
path: root/vcl/source/edit
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.com>2019-08-12 11:35:51 +0200
committerMiklos Vajna <vmiklos@collabora.com>2019-08-12 14:36:22 +0200
commit7eb37a422f2e66bc177d72404c53659a248661ca (patch)
treead4c6d0d41c7586368249bc6a34a4d8f1959786e /vcl/source/edit
parent7e94c4127c0fe252e0abc28cd9dc52bd2c1b6131 (diff)
tdf#118856 vcl: avoid flicker in the about dialog
There were two problems here: 1) The flickering widget in question is VclMultiLineEdit, but it wasn't like its own painting caused a flicker, rather the calling vcl::Window::PushPaintHelper() already erased the widget and later the widget painted itself. So the easy way with vcl::BufferDevice is not enough here. VclMultiLineEdit seems to be working with double buffering just fine, so enable that in the vcl::AboutDialog ctor. 2) Now that text did not flicker, its background was wrong. In case the NWF determines some gray background, the background was white for most text when there was no selection. When there was selection, then the after-selection area (in a single line) was fine, but nothing else. It seems TextEngine::ImpPaint() assumes that no need to set a default text fill color before drawing text, but the above shows that there is difference between the starting state and after clearing away a custom color with SetTextFillColor(). So fix this problem by always explicitly calling SetTextFillColor() before text paint: either setting the selection color or the default one. This brings improvement for the Windows GDI backend; Windows GL, Linux gen/gtk/gtk3 is unchanged in practice. Change-Id: Ie7ff3a7f36bedf73424ea579a00588bd8858d6c4 Reviewed-on: https://gerrit.libreoffice.org/77219 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
Diffstat (limited to 'vcl/source/edit')
-rw-r--r--vcl/source/edit/texteng.cxx3
1 files changed, 3 insertions, 0 deletions
diff --git a/vcl/source/edit/texteng.cxx b/vcl/source/edit/texteng.cxx
index 333a1a201e69..0b5303fcf9e4 100644
--- a/vcl/source/edit/texteng.cxx
+++ b/vcl/source/edit/texteng.cxx
@@ -1961,6 +1961,7 @@ void TextEngine::ImpPaint( OutputDevice* pOutDev, const Point& rStartPos, tools:
{
const sal_Int32 nL = pSelStart->GetIndex() - nTmpIndex;
pOutDev->SetFont( aFont);
+ pOutDev->SetTextFillColor();
aPos.setX( rStartPos.X() + ImpGetOutputOffset( nPara, &rLine, nTmpIndex, nTmpIndex+nL ) );
pOutDev->DrawText( aPos, pPortion->GetNode()->GetText(), nTmpIndex, nL );
nTmpIndex = nTmpIndex + nL;
@@ -1986,6 +1987,7 @@ void TextEngine::ImpPaint( OutputDevice* pOutDev, const Point& rStartPos, tools:
if ( nTmpIndex < nEnd )
{
nL = nEnd-nTmpIndex;
+ pOutDev->SetTextFillColor();
aPos.setX( rStartPos.X() + ImpGetOutputOffset( nPara, &rLine, nTmpIndex, nTmpIndex+nL ) );
pOutDev->DrawText( aPos, pPortion->GetNode()->GetText(), nTmpIndex, nEnd-nTmpIndex );
}
@@ -1994,6 +1996,7 @@ void TextEngine::ImpPaint( OutputDevice* pOutDev, const Point& rStartPos, tools:
}
if ( !bDone )
{
+ pOutDev->SetTextFillColor();
aPos.setX( rStartPos.X() + ImpGetOutputOffset( nPara, &rLine, nTmpIndex, nEnd ) );
pOutDev->DrawText( aPos, pPortion->GetNode()->GetText(), nTmpIndex, nEnd-nTmpIndex );
}