[Libreoffice-commits] core.git: Branch 'libreoffice-6-4' - editeng/source
Caolán McNamara (via logerrit)
logerrit at kemper.freedesktop.org
Mon May 25 08:27:32 UTC 2020
editeng/source/editeng/impedit2.cxx | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
New commits:
commit f6b3f97759be00e382e482512fb89f3d777e8e06
Author: Caolán McNamara <caolanm at redhat.com>
AuthorDate: Mon May 18 12:21:09 2020 +0100
Commit: Michael Stahl <michael.stahl at cib.de>
CommitDate: Mon May 25 10:26:59 2020 +0200
Resolves: tdf#129620 crash because there is no associated window
only an outputdevice in this editeng-in-a-widget case
Change-Id: Idf054872a48befba652012cd511e4f9df4437166
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94282
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl at cib.de>
diff --git a/editeng/source/editeng/impedit2.cxx b/editeng/source/editeng/impedit2.cxx
index 607664c0f3d0..dc1730a72a94 100644
--- a/editeng/source/editeng/impedit2.cxx
+++ b/editeng/source/editeng/impedit2.cxx
@@ -496,13 +496,17 @@ void ImpEditEngine::Command( const CommandEvent& rCEvt, EditView* pView )
if ( nInputEnd > rLine.GetEnd() )
nInputEnd = rLine.GetEnd();
tools::Rectangle aR2 = PaMtoEditCursor( EditPaM( aPaM.GetNode(), nInputEnd ), GetCursorFlags::EndOfLine );
- tools::Rectangle aRect = pView->GetImpEditView()->GetWindowPos( aR1 );
- pView->GetWindow()->SetCursorRect( &aRect, aR2.Left()-aR1.Right() );
+ if (vcl::Window* pWindow = pView->GetWindow())
+ {
+ tools::Rectangle aRect = pView->GetImpEditView()->GetWindowPos( aR1 );
+ pWindow->SetCursorRect( &aRect, aR2.Left()-aR1.Right() );
+ }
}
}
else
{
- pView->GetWindow()->SetCursorRect();
+ if (vcl::Window* pWindow = pView->GetWindow())
+ pWindow->SetCursorRect();
}
}
else if ( rCEvt.GetCommand() == CommandEventId::SelectionChange )
@@ -563,7 +567,8 @@ void ImpEditEngine::Command( const CommandEvent& rCEvt, EditView* pView )
tools::Rectangle aR2 = GetEditCursor( pParaPortion, nInputPos );
aRects[ i ] = pView->GetImpEditView()->GetWindowPos( aR2 );
}
- pView->GetWindow()->SetCompositionCharRect( aRects.get(), mpIMEInfos->nLen );
+ if (vcl::Window* pWindow = pView->GetWindow())
+ pWindow->SetCompositionCharRect( aRects.get(), mpIMEInfos->nLen );
}
}
}
More information about the Libreoffice-commits
mailing list