diff options
author | Noel Power <noel.power@novell.com> | 2012-02-07 15:36:29 +0000 |
---|---|---|
committer | Noel Power <noel.power@novell.com> | 2012-02-07 15:38:15 +0000 |
commit | 09d7b5e6039827d0f02f424370f929caff179ac9 (patch) | |
tree | 6009fff92bcf69edd9fdb9552fa0266c39e04979 | |
parent | 5ed6b310c6721c001293f2dd058cdfaec09e8024 (diff) |
make ctrl-shift-f2 change focus to the inputline fdo#40957
-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 3771d375b0a8..ebdea66fb1ba 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 @@ -2022,6 +2027,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 185ac45d065c..b0facf100455 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 ); @@ -225,6 +228,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(); |