diff options
author | Noel Power <noel.power@novell.com> | 2012-02-07 15:36:29 +0000 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2012-02-08 21:30:04 +0100 |
commit | 910c68b5ddc30fb8dc63b67470105d0960fa04a1 (patch) | |
tree | 0594fbdec201bf6314660e5cd17d73f76043100f /sc | |
parent | 9739e6163b2429c4f23d91183089d8a768a87faf (diff) |
make ctrl-shift-f2 change focus to the inputline fdo#40957
(cherry picked from commit 09d7b5e6039827d0f02f424370f929caff179ac9)
Signed-off-by: Eike Rathke <erack@redhat.com>
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/ui/app/inputwin.cxx | 17 | ||||
-rw-r--r-- | sc/source/ui/inc/inputwin.hxx | 4 |
2 files changed, 17 insertions, 4 deletions
diff --git a/sc/source/ui/app/inputwin.cxx b/sc/source/ui/app/inputwin.cxx index 37caced86ff0..3e53062dbd31 100644 --- a/sc/source/ui/app/inputwin.cxx +++ b/sc/source/ui/app/inputwin.cxx @@ -697,7 +697,7 @@ void ScInputWindow::StopEditEngine( sal_Bool bAll ) void ScInputWindow::TextGrabFocus() { - aTextWindow.GrabFocus(); + aTextWindow.TextGrabFocus(); } void ScInputWindow::TextInvalidate() @@ -712,12 +712,13 @@ void ScInputWindow::SwitchToTextWin() aTextWindow.StartEditEngine(); if ( SC_MOD()->IsEditMode() ) { - aTextWindow.GrabFocus(); + aTextWindow.TextGrabFocus(); EditView* pView = aTextWindow.GetEditView(); if (pView) { - xub_StrLen nLen = pView->GetEditEngine()->GetTextLen(0); - ESelection aSel( 0, nLen, 0, nLen ); + sal_uInt16 nPara = pView->GetEditEngine()->GetParagraphCount() ? ( pView->GetEditEngine()->GetParagraphCount() - 1 ) : 0; + xub_StrLen nLen = pView->GetEditEngine()->GetTextLen( nPara ); + ESelection aSel( nPara, nLen, nPara, nLen ); pView->SetSelection( aSel ); // set cursor to end of text } } @@ -1115,6 +1116,10 @@ IMPL_LINK( ScInputBarGroup, Impl_ScrollHdl, ScrollBar*, EMPTYARG ) return 0; } +void ScInputBarGroup::TextGrabFocus() +{ + aMultiTextWnd.TextGrabFocus(); +} //======================================================================== // ScMultiTextWnd @@ -2018,6 +2023,10 @@ void ScTextWnd::DataChanged( const DataChangedEvent& rDCEvt ) Window::DataChanged( rDCEvt ); } +void ScTextWnd::TextGrabFocus() +{ + GrabFocus(); +} //======================================================================== // Positionsfenster diff --git a/sc/source/ui/inc/inputwin.hxx b/sc/source/ui/inc/inputwin.hxx index eec7fede9ad4..ae8383d1e727 100644 --- a/sc/source/ui/inc/inputwin.hxx +++ b/sc/source/ui/inc/inputwin.hxx @@ -65,6 +65,7 @@ public: virtual void MakeDialogEditView() = 0; virtual void SetFormulaMode( sal_Bool bSet ) = 0; virtual sal_Bool IsInputActive() = 0; + virtual void TextGrabFocus() = 0; }; class ScTextWnd : public ScTextWndBase, public DragSourceHelper // edit window @@ -85,6 +86,8 @@ public: virtual void StartEditEngine(); virtual void StopEditEngine( sal_Bool bAll ); + virtual void TextGrabFocus(); + virtual void DataChanged( const DataChangedEvent& rDCEvt ); virtual void SetFormulaMode( sal_Bool bSet ); @@ -223,6 +226,7 @@ public: virtual void Resize(); virtual const String& GetTextString() const; virtual void StopEditEngine( sal_Bool bAll ); + virtual void TextGrabFocus(); void InitEditEngine(SfxObjectShell* pObjSh); void SetFormulaMode( sal_Bool bSet ); bool IsFocus(); |