[Libreoffice-commits] .: sc/inc sc/source

Markus Mohrhard mmohrhard at kemper.freedesktop.org
Thu Mar 29 11:39:11 PDT 2012


 sc/inc/document.hxx              |    5 +++++
 sc/source/core/data/document.cxx |    3 ++-
 2 files changed, 7 insertions(+), 1 deletion(-)

New commits:
commit f826a5b56ac12e0b85c380f7d26c379e3d1f7281
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Thu Mar 29 20:36:12 2012 +0200

    quick and ugly hack for ScEditableTester in ucalc
    
    Fix this as soon as possible with a clean fix

diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx
index 6b2139b..2fbd0eb 100644
--- a/sc/inc/document.hxx
+++ b/sc/inc/document.hxx
@@ -419,6 +419,10 @@ private:
 
     ::std::set<ScFormulaCell*> maSubTotalCells;
 
+    // quick and ugly hack to fix the ScEditableTester problem in ucalc
+    // write a clean fix for this as soon as possible
+    bool                mbIsInTest;
+
 public:
     SC_DLLPUBLIC sal_uLong          GetCellCount() const;       // all cells
     SCSIZE          GetCellCount(SCTAB nTab, SCCOL nCol) const;
@@ -1103,6 +1107,7 @@ public:
                                 bool bColInfo = false, bool bRowInfo = false );
     SC_DLLPUBLIC void           InitUndoSelected( ScDocument* pSrcDoc, const ScMarkData& rTabSelection,
                                 bool bColInfo = false, bool bRowInfo = false );
+    void            SetInTest() { mbIsInTest = true; }
 
                     //  don't use anymore:
     void            CopyToDocument(SCCOL nCol1, SCROW nRow1, SCTAB nTab1,
diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx
index 6e21d91..ef2a8c4 100644
--- a/sc/source/core/data/document.cxx
+++ b/sc/source/core/data/document.cxx
@@ -4766,7 +4766,8 @@ bool ScDocument::IsBlockEditable( SCTAB nTab, SCCOL nStartCol, SCROW nStartRow,
                                         bool* pOnlyNotBecauseOfMatrix /* = NULL */ ) const
 {
     // import into read-only document is possible
-    if ( !bImportingXML && !mbChangeReadOnlyEnabled && pShell && pShell->IsReadOnly() )
+    // TODO: come up with a clean solution for the testing problem
+    if ( !bImportingXML && !mbChangeReadOnlyEnabled && pShell && (pShell->IsReadOnly()&&!mbIsInTest) )
     {
         if ( pOnlyNotBecauseOfMatrix )
             *pOnlyNotBecauseOfMatrix = false;


More information about the Libreoffice-commits mailing list