[Libreoffice-commits] .: Branch 'libreoffice-3-5' - 2 commits - sc/source

Noel Power noelp at kemper.freedesktop.org
Sun Dec 11 17:03:52 PST 2011


 sc/source/ui/app/inputhdl.cxx |    3 ++-
 sc/source/ui/app/inputwin.cxx |   33 +++++++++++++++------------------
 sc/source/ui/inc/inputwin.hxx |    2 +-
 3 files changed, 18 insertions(+), 20 deletions(-)

New commits:
commit 1b28a657678f2cc64861030cbe3bea13d1bebd95
Author: Noel Power <noel.power at novell.com>
Date:   Mon Dec 12 00:59:52 2011 +0000

    double check pEditView ( appears some re-entrency foo can zap it )

diff --git a/sc/source/ui/app/inputwin.cxx b/sc/source/ui/app/inputwin.cxx
index 2983c44..649050b 100644
--- a/sc/source/ui/app/inputwin.cxx
+++ b/sc/source/ui/app/inputwin.cxx
@@ -1111,7 +1111,9 @@ ScMultiTextWnd::~ScMultiTextWnd()
 
 void ScMultiTextWnd::Paint( const Rectangle& rRec )
 {
-    GetEditView()->Paint( rRec );
+    EditView* pView = GetEditView();
+    if ( pView )
+        pView->Paint( rRec );
 }
 
 EditView* ScMultiTextWnd::GetEditView()
commit 445d348837aca032b81edc92a23fee128758ee0f
Author: Noel Power <noel.power at novell.com>
Date:   Sun Dec 11 16:40:52 2011 +0000

    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

diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx
index f4fe965..98cfac2 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 83bdb8a..2983c44 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 c0f4234..9f70ecb 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();
 


More information about the Libreoffice-commits mailing list