summaryrefslogtreecommitdiff
path: root/editeng/source
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2020-09-30 14:42:10 +0100
committerCaolán McNamara <caolanm@redhat.com>2020-10-02 10:37:09 +0200
commite1ac2a940389f52e28264a623a6620a7a0d94d57 (patch)
treee8cf96b31091482bc628cf501ecbba4cf1096c05 /editeng/source
parent1709a9b9a2433032b5acf262ef506272c33d5e63 (diff)
tdf#134566 gtk IM support for custom widgets
Change-Id: I5c731161768d09d021db5c353de816e173159096 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103764 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'editeng/source')
-rw-r--r--editeng/source/editeng/impedit2.cxx11
1 files changed, 6 insertions, 5 deletions
diff --git a/editeng/source/editeng/impedit2.cxx b/editeng/source/editeng/impedit2.cxx
index 0887005cc8b1..471159845118 100644
--- a/editeng/source/editeng/impedit2.cxx
+++ b/editeng/source/editeng/impedit2.cxx
@@ -478,11 +478,12 @@ 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 );
- if (vcl::Window* pWindow = pView->GetWindow())
- {
- tools::Rectangle aRect = pView->GetImpEditView()->GetWindowPos( aR1 );
- pWindow->SetCursorRect( &aRect, aR2.Left()-aR1.Right() );
- }
+ tools::Rectangle aRect = pView->GetImpEditView()->GetWindowPos( aR1 );
+ auto nExtTextInputWidth = aR2.Left() - aR1.Right();
+ if (EditViewCallbacks* pEditViewCallbacks = pView->getEditViewCallbacks())
+ pEditViewCallbacks->EditViewCursorRect(aRect, nExtTextInputWidth);
+ else if (vcl::Window* pWindow = pView->GetWindow())
+ pWindow->SetCursorRect(&aRect, nExtTextInputWidth);
}
}
else