[Libreoffice-commits] .: sc/source
Noel Power
noelp at kemper.freedesktop.org
Tue Feb 7 07:48:25 PST 2012
sc/source/ui/app/inputwin.cxx | 17 +++++++++++++----
sc/source/ui/inc/inputwin.hxx | 4 ++++
2 files changed, 17 insertions(+), 4 deletions(-)
New commits:
commit 09d7b5e6039827d0f02f424370f929caff179ac9
Author: Noel Power <noel.power at novell.com>
Date: Tue Feb 7 15:36:29 2012 +0000
make ctrl-shift-f2 change focus to the inputline fdo#40957
diff --git a/sc/source/ui/app/inputwin.cxx b/sc/source/ui/app/inputwin.cxx
index 3771d37..ebdea66 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 185ac45..b0facf1 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();
More information about the Libreoffice-commits
mailing list