[Libreoffice-commits] core.git: Branch 'libreoffice-6-3' - editeng/source
Caolán McNamara (via logerrit)
logerrit at kemper.freedesktop.org
Thu Jun 20 10:06:27 UTC 2019
editeng/source/editeng/impedit.cxx | 29 +++++++++++++++++------------
1 file changed, 17 insertions(+), 12 deletions(-)
New commits:
commit 3eff698700a1896ddc870b202dea470d7da6317d
Author: Caolán McNamara <caolanm at redhat.com>
AuthorDate: Wed Jun 19 20:55:55 2019 +0100
Commit: Caolán McNamara <caolanm at redhat.com>
CommitDate: Thu Jun 20 12:05:43 2019 +0200
fix crash with non-window outputdevice better
Change-Id: I93511574f8ab7d564baf1f031d54ca0e72ca345e
Reviewed-on: https://gerrit.libreoffice.org/74417
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
Tested-by: Caolán McNamara <caolanm at redhat.com>
diff --git a/editeng/source/editeng/impedit.cxx b/editeng/source/editeng/impedit.cxx
index 9618c1fb604d..215af72daaed 100644
--- a/editeng/source/editeng/impedit.cxx
+++ b/editeng/source/editeng/impedit.cxx
@@ -1144,13 +1144,12 @@ Pair ImpEditView::Scroll( long ndX, long ndY, ScrollRangeCheck nRangeCheck )
if ( !ndX && !ndY )
return Pair( 0, 0 );
- if (!pOutWin)
- return Pair( 0, 0 );
+ const OutputDevice& rOutDev = getEditViewCallbacks() ? getEditViewCallbacks()->EditViewOutputDevice() : *GetWindow();
#ifdef DBG_UTIL
tools::Rectangle aR( aOutArea );
- aR = pOutWin->LogicToPixel( aR );
- aR = pOutWin->PixelToLogic( aR );
+ aR = rOutDev.LogicToPixel( aR );
+ aR = rOutDev.PixelToLogic( aR );
SAL_WARN_IF( aR != aOutArea, "editeng", "OutArea before Scroll not aligned" );
#endif
@@ -1216,8 +1215,8 @@ Pair ImpEditView::Scroll( long ndX, long ndY, ScrollRangeCheck nRangeCheck )
long nDiffY = !IsVertical() ? ( GetVisDocTop() - aNewVisArea.Top() ) : (IsTopToBottom() ? (GetVisDocLeft() - aNewVisArea.Left()) : -(GetVisDocTop() - aNewVisArea.Top()));
Size aDiffs( nDiffX, nDiffY );
- aDiffs = pOutWin->LogicToPixel( aDiffs );
- aDiffs = pOutWin->PixelToLogic( aDiffs );
+ aDiffs = rOutDev.LogicToPixel( aDiffs );
+ aDiffs = rOutDev.PixelToLogic( aDiffs );
long nRealDiffX = aDiffs.Width();
long nRealDiffY = aDiffs.Height();
@@ -1228,7 +1227,8 @@ Pair ImpEditView::Scroll( long ndX, long ndY, ScrollRangeCheck nRangeCheck )
vcl::Cursor* pCrsr = GetCursor();
bool bVisCursor = pCrsr->IsVisible();
pCrsr->Hide();
- pOutWin->Update();
+ if (pOutWin)
+ pOutWin->Update();
if ( !IsVertical() )
aVisDocStartPos.Move( -nRealDiffX, -nRealDiffY );
else
@@ -1240,18 +1240,23 @@ Pair ImpEditView::Scroll( long ndX, long ndY, ScrollRangeCheck nRangeCheck )
}
// Move by aligned value does not necessarily result in aligned
// rectangle ...
- aVisDocStartPos = pOutWin->LogicToPixel( aVisDocStartPos );
- aVisDocStartPos = pOutWin->PixelToLogic( aVisDocStartPos );
+ aVisDocStartPos = rOutDev.LogicToPixel( aVisDocStartPos );
+ aVisDocStartPos = rOutDev.PixelToLogic( aVisDocStartPos );
tools::Rectangle aRect( aOutArea );
- pOutWin->Scroll( nRealDiffX, nRealDiffY, aRect, ScrollFlags::Clip );
- if (comphelper::LibreOfficeKit::isActive())
+ if (pOutWin)
+ {
+ pOutWin->Scroll( nRealDiffX, nRealDiffY, aRect, ScrollFlags::Clip );
+ }
+
+ if (comphelper::LibreOfficeKit::isActive() || getEditViewCallbacks())
{
// Need to invalidate the window, otherwise no tile will be re-painted.
pEditView->Invalidate();
}
- pOutWin->Update();
+ if (pOutWin)
+ pOutWin->Update();
pCrsr->SetPos( pCrsr->GetPos() + Point( nRealDiffX, nRealDiffY ) );
if ( bVisCursor )
{
More information about the Libreoffice-commits
mailing list