summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorNoel Power <noel.power@novell.com>2011-12-11 16:40:52 +0000
committerNoel Power <noel.power@novell.com>2011-12-11 16:45:51 +0000
commitc7551439a9ff4073a0b652329357be46d07b2c91 (patch)
tree1198e599ba90e958f52078b453d1c5a40aa19dd1 /sc
parent10aba2a2d02ce8a2e6b86fa37c0087185a3c6b35 (diff)
fix autocorrection sync problem with input/formulabar
also, * make the GetEditView explicitly create EditEngine/EditView *always* * remove the bogus GetLine method * reset NotifyHdl when stopping the edit engine
Diffstat (limited to 'sc')
-rw-r--r--sc/source/ui/app/inputhdl.cxx3
-rw-r--r--sc/source/ui/app/inputwin.cxx31
-rw-r--r--sc/source/ui/inc/inputwin.hxx2
3 files changed, 16 insertions, 20 deletions
diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx
index f4fe9652ee04..98cfac2891c0 100644
--- a/sc/source/ui/app/inputhdl.cxx
+++ b/sc/source/ui/app/inputhdl.cxx
@@ -2046,7 +2046,8 @@ void ScInputHandler::SyncViews( EditView* pSourceView )
if (pTableView && pTableView != pSourceView)
lcl_SetTopSelection( pTableView, aSel );
}
- else if (pTopView && pTableView)
+ // Only sync selection from topView if we are actually editiing there
+ else if ( ( eMode == SC_INPUT_TOP ) && pTopView && pTableView)
{
aSel = pTopView->GetSelection();
lcl_SetTopSelection( pTableView, aSel );
diff --git a/sc/source/ui/app/inputwin.cxx b/sc/source/ui/app/inputwin.cxx
index 83bdb8a5c757..2983c441b546 100644
--- a/sc/source/ui/app/inputwin.cxx
+++ b/sc/source/ui/app/inputwin.cxx
@@ -1109,29 +1109,18 @@ ScMultiTextWnd::~ScMultiTextWnd()
{
}
-int ScMultiTextWnd::GetLineCount()
+void ScMultiTextWnd::Paint( const Rectangle& rRec )
{
- if(pEditView)
- {
- return pEditEngine->GetLineCount(0);
- }
- return 1;
+ GetEditView()->Paint( rRec );
}
-void ScMultiTextWnd::Paint( const Rectangle& rRec )
+EditView* ScMultiTextWnd::GetEditView()
{
- // We always use edit engine to draw text at all times.
- if (!pEditEngine)
- InitEditEngine(SfxObjectShell::Current());
- //StartEditEngine();
-
- if (pEditView)
- {
- pEditView->Paint(rRec);
- }
+ if ( !pEditView )
+ InitEditEngine( SfxObjectShell::Current() );
+ return pEditView;
}
-
long ScMultiTextWnd::GetPixelHeightForLines( long nLines )
{
long height = ( LogicToPixel(Size(0,GetTextHeight())).Height() );
@@ -1229,7 +1218,6 @@ ScMultiTextWnd::DoScroll()
void ScMultiTextWnd::StartEditEngine()
{
// Bei "eigener Modalitaet" (Doc-modale Dialoge) nicht aktivieren
-
SfxObjectShell* pObjSh = SfxObjectShell::Current();
if ( pObjSh && pObjSh->IsInModalMode() )
return;
@@ -1393,11 +1381,18 @@ void ScMultiTextWnd::InitEditEngine(SfxObjectShell* pObjSh)
void ScMultiTextWnd::StopEditEngine( sal_Bool bAll )
{
+ if ( pEditEngine )
+ pEditEngine->SetNotifyHdl(Link());
ScTextWnd::StopEditEngine( bAll );
}
void ScMultiTextWnd::SetTextString( const String& rNewString )
{
+ // Ideally it would be best to create on demand the EditEngine/EditView here, but... for
+ // the initialisation scenario where a cell is first clicked on we end up with the text in the
+ // inputbar window scrolled to the bottom if we do that here ( because the tableview and topview
+ // are synced I guess ).
+ // should fix that I suppose :-/ need to look a bit further into that
if ( pEditView )
pEditView->Invalidate();
ScTextWnd::SetTextString( rNewString );
diff --git a/sc/source/ui/inc/inputwin.hxx b/sc/source/ui/inc/inputwin.hxx
index c0f42349f339..9f70ecb597fd 100644
--- a/sc/source/ui/inc/inputwin.hxx
+++ b/sc/source/ui/inc/inputwin.hxx
@@ -176,8 +176,8 @@ public:
virtual ~ScMultiTextWnd();
virtual void StartEditEngine();
virtual void StopEditEngine( sal_Bool bAll );
- int GetLineCount();
virtual void Resize();
+ virtual EditView* GetEditView();
long GetPixelHeightForLines( long nLines );
long GetEditEngTxtHeight();