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

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Wed Nov 28 06:16:57 PST 2012


 sc/inc/document.hxx                  |    1 +
 sc/inc/docuno.hxx                    |    1 +
 sc/source/core/data/colorscale.cxx   |   15 ++-------------
 sc/source/core/data/conditio.cxx     |    4 +---
 sc/source/core/data/documen8.cxx     |   10 ++++++++++
 sc/source/core/data/table2.cxx       |    2 +-
 sc/source/filter/excel/xecontent.cxx |   12 +-----------
 sc/source/ui/unoobj/docuno.cxx       |    6 ++++++
 8 files changed, 23 insertions(+), 28 deletions(-)

New commits:
commit 4d4ce886672194a76ef1de327c97c484f7a50e51
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Wed Nov 28 15:11:55 2012 +0100

    prevent some nasty ScRangeList->ScRange->ScRangeList conversion
    
    Change-Id: I9dac82ffeed920ce39aab16d89a91e2f9083908b

diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx
index f114ecb..1612b2f 100644
--- a/sc/inc/document.hxx
+++ b/sc/inc/document.hxx
@@ -1523,6 +1523,7 @@ public:
     bool            ContinueOnlineSpelling();   // TRUE = found s.th.
 
     void            RepaintRange( const ScRange& rRange );
+    void            RepaintRange( const ScRangeList& rRange );
 
     bool        IsIdleDisabled() const      { return bIdleDisabled; }
     void            DisableIdle(bool bDo)   { bIdleDisabled = bDo; }
diff --git a/sc/inc/docuno.hxx b/sc/inc/docuno.hxx
index 4ec4463..6985235 100644
--- a/sc/inc/docuno.hxx
+++ b/sc/inc/docuno.hxx
@@ -136,6 +136,7 @@ public:
     ScSheetSaveData*        GetSheetSaveData();
 
     void                    RepaintRange( const ScRange& rRange );
+    void                    RepaintRange( const ScRangeList& rRange );
 
     bool                    HasChangesListeners() const;
 
diff --git a/sc/source/core/data/colorscale.cxx b/sc/source/core/data/colorscale.cxx
index 5c087e0..897f1b8 100644
--- a/sc/source/core/data/colorscale.cxx
+++ b/sc/source/core/data/colorscale.cxx
@@ -542,12 +542,7 @@ void ScColorScaleFormat::DataChanged(const ScRange& rRange)
     bool bNeedUpdate = CheckEntriesForRel(rRange);
     if(bNeedUpdate)
     {
-        size_t n = GetRange().size();
-        for(size_t i = 0; i < n; ++i)
-        {
-            const ScRange* pRange = GetRange()[i];
-            mpDoc->RepaintRange(*pRange);
-        }
+        mpDoc->RepaintRange(GetRange());
     }
 }
 
@@ -648,12 +643,7 @@ void ScDataBarFormat::DataChanged(const ScRange& rRange)
 
     if(bNeedUpdate)
     {
-        size_t n = GetRange().size();
-        for(size_t i = 0; i < n; ++i)
-        {
-            const ScRange* pRange = GetRange()[i];
-            mpDoc->RepaintRange(*pRange);
-        }
+        mpDoc->RepaintRange(GetRange());
     }
 }
 
@@ -929,7 +919,6 @@ condformat::ScFormatEntryType ScIconSetFormat::GetType() const
 
 void ScIconSetFormat::DataChanged( const ScRange& )
 {
-
 }
 
 void ScIconSetFormat::UpdateMoveTab( SCTAB nOldTab, SCTAB nNewTab )
diff --git a/sc/source/core/data/conditio.cxx b/sc/source/core/data/conditio.cxx
index 7d3815f..f2d4aa0 100644
--- a/sc/source/core/data/conditio.cxx
+++ b/sc/source/core/data/conditio.cxx
@@ -1947,9 +1947,7 @@ void ScConditionalFormat::DoRepaint( const ScRange* pModified )
     else
     {
         // all conditional format cells
-        size_t n = maRanges.size();
-        for(size_t i = 0; i < n; ++i)
-            pDoc->RepaintRange(*maRanges[i]);
+        pDoc->RepaintRange( maRanges );
     }
 }
 
diff --git a/sc/source/core/data/documen8.cxx b/sc/source/core/data/documen8.cxx
index 23d4e80..a8f2ff9 100644
--- a/sc/source/core/data/documen8.cxx
+++ b/sc/source/core/data/documen8.cxx
@@ -898,6 +898,16 @@ void ScDocument::RepaintRange( const ScRange& rRange )
     }
 }
 
+void ScDocument::RepaintRange( const ScRangeList& rRange )
+{
+    if ( bIsVisible && pShell )
+    {
+        ScModelObj* pModel = ScModelObj::getImplementation( pShell->GetModel() );
+        if ( pModel )
+            pModel->RepaintRange( rRange );     // locked repaints are checked there
+    }
+}
+
 //------------------------------------------------------------------------
 
 bool ScDocument::IdleCheckLinks()           // true = demnaechst wieder versuchen
diff --git a/sc/source/ui/unoobj/docuno.cxx b/sc/source/ui/unoobj/docuno.cxx
index 388145c..ac32d63 100644
--- a/sc/source/ui/unoobj/docuno.cxx
+++ b/sc/source/ui/unoobj/docuno.cxx
@@ -449,6 +449,12 @@ void ScModelObj::RepaintRange( const ScRange& rRange )
         pDocShell->PostPaint( rRange, PAINT_GRID );
 }
 
+void ScModelObj::RepaintRange( const ScRangeList& rRange )
+{
+    if (pDocShell)
+        pDocShell->PostPaint( rRange, PAINT_GRID );
+}
+
 uno::Any SAL_CALL ScModelObj::queryInterface( const uno::Type& rType )
                                                 throw(uno::RuntimeException)
 {
commit a9b7b4ab6bdec13341c8bdd4b359e5a2f501774c
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Wed Nov 28 15:03:21 2012 +0100

    use the correct flag to remove notes
    
    Change-Id: Ib7713cace98c732e9fbcc4e9689ca223544d5e4c

diff --git a/sc/source/core/data/table2.cxx b/sc/source/core/data/table2.cxx
index ce11688..1137eff 100644
--- a/sc/source/core/data/table2.cxx
+++ b/sc/source/core/data/table2.cxx
@@ -740,7 +740,7 @@ void ScTable::CopyFromClip(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2,
             aCol[i].CopyFromClip(nRow1, nRow2, nDy, nInsFlag, bAsLink, bSkipAttrForEmpty, pTable->aCol[i - nDx]);
 
         //remove old notes
-        if (nInsFlag & IDF_CONTENTS)
+        if (nInsFlag & (IDF_NOTE|IDF_ADDNOTES))
             maNotes.erase(nCol1, nRow1, nCol2, nRow2);
 
         bool bAddNotes = nInsFlag & (IDF_NOTE | IDF_ADDNOTES);
commit 381fe610a2216b898a91437fcc1330a7a43ef09f
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Mon Nov 26 23:45:16 2012 +0100

    workaround Excel bug when importing OOXML documents
    
    Change-Id: Ifc3b56d081b1318a0e201cb6cd7fd85ce2dc2534

diff --git a/sc/source/filter/excel/xecontent.cxx b/sc/source/filter/excel/xecontent.cxx
index d03afa8..3f0c592 100644
--- a/sc/source/filter/excel/xecontent.cxx
+++ b/sc/source/filter/excel/xecontent.cxx
@@ -784,7 +784,7 @@ namespace {
 
 const char* GetOperatorString(ScConditionMode eMode, bool& bFrmla2)
 {
-    const char *pRet = "";
+    const char *pRet = NULL;
     switch(eMode)
     {
         case SC_COND_EQUAL:
@@ -824,7 +824,6 @@ const char* GetOperatorString(ScConditionMode eMode, bool& bFrmla2)
             break;
         case SC_COND_NONE:
         default:
-            pRet = "equal";
             break;
     }
     return pRet;
@@ -1194,7 +1193,6 @@ void XclExpCondfmt::SaveXml( XclExpXmlStream& rStrm )
 
     maCFList.SaveXml( rStrm );
 
-    // OOXTODO: XML_extLst
     rWorksheet->endElement( XML_conditionalFormatting );
 }
 
@@ -1236,8 +1234,6 @@ void XclExpColorScale::SaveXml( XclExpXmlStream& rStrm )
     rWorksheet->endElement( XML_colorScale );
 
     rWorksheet->endElement( XML_cfRule );
-
-    // OOXTODO: XML_extLst
 }
 
 namespace {
@@ -1327,9 +1323,6 @@ void XclExpDataBar::SaveXml( XclExpXmlStream& rStrm )
     rWorksheet->endElement( XML_extLst );
 
     rWorksheet->endElement( XML_cfRule );
-
-    // OOXTODO: XML_extLst
-
 }
 
 XclExpIconSet::XclExpIconSet( const XclExpRoot& rRoot, const ScIconSetFormat& rFormat, sal_Int32 nPriority ):
@@ -1384,9 +1377,6 @@ void XclExpIconSet::SaveXml( XclExpXmlStream& rStrm )
 
     rWorksheet->endElement( XML_iconSet );
     rWorksheet->endElement( XML_cfRule );
-
-    // OOXTODO: XML_extLst
-
 }
 
 // ----------------------------------------------------------------------------


More information about the Libreoffice-commits mailing list