[Libreoffice-commits] core.git: Branch 'libreoffice-4-2-1' - 2 commits - sc/source

Kohei Yoshida kohei.yoshida at collabora.com
Tue Feb 18 01:21:18 CET 2014


 sc/source/core/tool/token.cxx  |    3 +++
 sc/source/ui/app/inputhdl.cxx  |    8 +++++++-
 sc/source/ui/inc/inputhdl.hxx  |    3 +++
 sc/source/ui/view/tabvwsh4.cxx |    3 +++
 4 files changed, 16 insertions(+), 1 deletion(-)

New commits:
commit 3cc0ed80291b521375d00c1e0a15aa66e712ced6
Author: Kohei Yoshida <kohei.yoshida at collabora.com>
Date:   Fri Feb 14 12:28:03 2014 -0500

    fdo#73773: Check if the *document* is closing, not the *app*.
    
    Otherwise it would crash if the app has multiple document instances open
    and only one of them is being closed.
    
    Change-Id: Ib6e370037ab6097c9c6eff8035249663944b3a6c
    (cherry picked from commit 76bdf523981d2bd983dac4e01bc5cc934118a73f)
    Reviewed-on: https://gerrit.libreoffice.org/8054
    Reviewed-by: Markus Mohrhard <markus.mohrhard at googlemail.com>
    Reviewed-by: Michael Meeks <michael.meeks at collabora.com>
    Tested-by: Jacobo Aragunde Pérez <jaragunde at igalia.com>
    Reviewed-by: Jacobo Aragunde Pérez <jaragunde at igalia.com>

diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx
index 0c6bbc5..d964312 100644
--- a/sc/source/ui/app/inputhdl.cxx
+++ b/sc/source/ui/app/inputhdl.cxx
@@ -299,6 +299,11 @@ handle_r1c1:
     }
 }
 
+void ScInputHandler::SetDocumentDisposing( bool b )
+{
+    mbDocumentDisposing = b;
+}
+
 static void lcl_Replace( EditView* pView, const OUString& rNewStr, const ESelection& rOldSel )
 {
     if ( pView )
@@ -519,6 +524,7 @@ ScInputHandler::ScInputHandler()
         bProtected( false ),
         bCellHasPercentFormat( false ),
         bLastIsSymbol( false ),
+        mbDocumentDisposing(false),
         nValidation( 0 ),
         eAttrAdjust( SVX_HOR_JUSTIFY_STANDARD ),
         aScaleX( 1,1 ),
@@ -542,7 +548,7 @@ ScInputHandler::~ScInputHandler()
     //  Wenn dies der Applikations-InputHandler ist, wird der dtor erst nach SfxApplication::Main
     //  gerufen, darf sich also auf keine Sfx-Funktionen mehr verlassen
 
-    if ( !SFX_APP()->IsDowning() )          // inplace
+    if (!mbDocumentDisposing)          // inplace
         EnterHandler();                     // Eingabe noch abschliessen
 
     if (SC_MOD()->GetRefInputHdl()==this)
diff --git a/sc/source/ui/inc/inputhdl.hxx b/sc/source/ui/inc/inputhdl.hxx
index 1c2d9c3..528d5c1 100644
--- a/sc/source/ui/inc/inputhdl.hxx
+++ b/sc/source/ui/inc/inputhdl.hxx
@@ -100,6 +100,7 @@ private:
     bool                    bProtected:1;
     bool                    bCellHasPercentFormat:1;
     bool                    bLastIsSymbol:1;
+    bool                    mbDocumentDisposing:1;
     sal_uLong                   nValidation;
     SvxCellHorJustify       eAttrAdjust;
 
@@ -256,6 +257,8 @@ public:
                     // actually private, public for SID_INPUT_SUM
     void            InitRangeFinder(const OUString& rFormula);
 
+    void SetDocumentDisposing( bool b );
+
     static void     SetAutoComplete(bool bSet)  { bAutoComplete = bSet; }
 };
 
diff --git a/sc/source/ui/view/tabvwsh4.cxx b/sc/source/ui/view/tabvwsh4.cxx
index 1c73dbe..ec192da 100644
--- a/sc/source/ui/view/tabvwsh4.cxx
+++ b/sc/source/ui/view/tabvwsh4.cxx
@@ -1739,6 +1739,9 @@ ScTabViewShell::~ScTabViewShell()
     //  alles auf NULL, falls aus dem TabView-dtor noch darauf zugegriffen wird
     //! (soll eigentlich nicht !??!?!)
 
+    if (pInputHandler)
+        pInputHandler->SetDocumentDisposing(true);
+
     DELETEZ(pFontworkBarShell);
     DELETEZ(pExtrusionBarShell);
     DELETEZ(pCellShell);
commit 30363f94b94b183f4e9b0f6d9699e76f398154dc
Author: Kohei Yoshida <kohei.yoshida at collabora.com>
Date:   Fri Feb 14 20:39:18 2014 -0500

    fdo#72691: Allow overwriting of string value with numeric one.
    
    This can legitimately happen when you have a matrix with a reference to
    another cell inside, and the referenced cell originally contained a
    string value then later overwritten by a numeric value.
    
    Example.  Put a "Text" in A1, and in B1 put a 1x1 matrix {=A1}.  It
    displays "Text" in B1.  Then put 11 in A1.  Prior to this change, B1
    would become blank.  With this change, B1 will display 11.
    
    Change-Id: I3feba3a8658e1a5ebf6f9e5ac34de2d579464ddb
    (cherry picked from commit 9bf907a8278cecd816368db7b8c4ab745a914a59)
    Reviewed-on: https://gerrit.libreoffice.org/8065
    Reviewed-by: Markus Mohrhard <markus.mohrhard at googlemail.com>
    Reviewed-by: Michael Meeks <michael.meeks at collabora.com>
    Reviewed-by: Jacobo Aragunde Pérez <jaragunde at igalia.com>
    Tested-by: Jacobo Aragunde Pérez <jaragunde at igalia.com>

diff --git a/sc/source/core/tool/token.cxx b/sc/source/core/tool/token.cxx
index ff456eb..fc9ad75 100644
--- a/sc/source/core/tool/token.cxx
+++ b/sc/source/core/tool/token.cxx
@@ -1146,6 +1146,9 @@ void ScMatrixFormulaCellToken::SetUpperLeftDouble( double f )
         case svDouble:
             const_cast<FormulaToken*>(xUpperLeft.get())->GetDoubleAsReference() = f;
             break;
+        case svString:
+            xUpperLeft = new FormulaDoubleToken( f);
+            break;
         case svUnknown:
             if (!xUpperLeft)
             {


More information about the Libreoffice-commits mailing list