[ooo-build-commit] Branch 'ooo/OOO320' - sc/source

Jan Holesovsky kendy at kemper.freedesktop.org
Mon Nov 2 19:24:04 PST 2009


 sc/source/core/data/cell.cxx       |    6 ++++--
 sc/source/core/data/document.cxx   |    6 ++++++
 sc/source/core/data/table1.cxx     |   17 +++++++++++++++++
 sc/source/core/data/table5.cxx     |    6 ++++++
 sc/source/ui/docshell/arealink.cxx |    4 ++++
 sc/source/ui/docshell/docfunc.cxx  |    6 ++++++
 sc/source/ui/docshell/docsh.cxx    |   12 +++++++++++-
 sc/source/ui/docshell/docsh5.cxx   |    3 ++-
 sc/source/ui/docshell/olinefun.cxx |   12 ++++++++++++
 9 files changed, 68 insertions(+), 4 deletions(-)

New commits:
commit d73688a44d4bdb21f955111a544cad4c8d79f7e4
Author: Oliver Bolte <obo at openoffice.org>
Date:   Mon Nov 2 14:42:48 2009 +0000

    CWS-TOOLING: integrate CWS calc32stopper4
    2009-10-23 14:55:31 +0200 nn  r277165 : #i101139# MoveTable: nDestTab must be target position, not APPEND
    2009-10-22 17:10:43 +0200 nn  r277129 : #i106045# renaming a sheet has to reset all xml stream flags
    2009-10-21 10:34:25 +0200 nn  r277078 : #i106045# invalidate stream positions for sheet operations, better handling of loaded formula results
    2009-10-19 13:45:37 +0200 nn  r277023 : #i105960# SID_UNDO and friends are no longer volatile
    2009-10-16 17:21:16 +0200 nn  r276990 : #i105945# no optimization for textsearch on unxsoli

diff --git a/sc/source/core/data/cell.cxx b/sc/source/core/data/cell.cxx
index 2ae9972..b3c7714 100644
--- a/sc/source/core/data/cell.cxx
+++ b/sc/source/core/data/cell.cxx
@@ -1641,8 +1641,9 @@ void ScFormulaCell::InterpretTail( ScInterpretTailParameter eTailParam )
                     if ( eOld == svHybridCell )     // string result from SetFormulaResultString?
                         eOld = svString;            // ScHybridCellToken has a valid GetString method
 
+                    // #i106045# use approxEqual to compare with stored value
                     bContentChanged = (eOld != eNew ||
-                            (eNew == svDouble && aResult.GetDouble() != aNewResult.GetDouble()) ||
+                            (eNew == svDouble && !rtl::math::approxEqual( aResult.GetDouble(), aNewResult.GetDouble() )) ||
                             (eNew == svString && aResult.GetString() != aNewResult.GetString()));
                 }
             }
@@ -1662,7 +1663,8 @@ void ScFormulaCell::InterpretTail( ScInterpretTailParameter eTailParam )
             if ( bChanged && !bContentChanged && pDocument->IsStreamValid(aPos.Tab()) )
             {
                 if ( ( eOld == svUnknown && ( eNew == svError || ( eNew == svDouble && aNewResult.GetDouble() == 0.0 ) ) ) ||
-                     ( eOld == svHybridCell && eNew == svString && aResult.GetString() == aNewResult.GetString() ) )
+                     ( eOld == svHybridCell && eNew == svString && aResult.GetString() == aNewResult.GetString() ) ||
+                     ( eOld == svDouble && eNew == svDouble && rtl::math::approxEqual( aResult.GetDouble(), aNewResult.GetDouble() ) ) )
                 {
                     // no change, see above
                 }
diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx
index 73aa794..590d1eb 100644
--- a/sc/source/core/data/document.cxx
+++ b/sc/source/core/data/document.cxx
@@ -476,6 +476,12 @@ BOOL ScDocument::RenameTab( SCTAB nTab, const String& rName, BOOL /* bUpdateRef
                 if ( pChartListenerCollection )
                     pChartListenerCollection->UpdateChartsContainingTab( nTab );
                 pTab[nTab]->SetName(rName);
+
+                // If formulas refer to the renamed sheet, the TokenArray remains valid,
+                // but the XML stream must be re-generated.
+                for (i=0; i<=MAXTAB; ++i)
+                    if (pTab[i] && pTab[i]->IsStreamValid())
+                        pTab[i]->SetStreamValid( FALSE );
             }
         }
     return bValid;
diff --git a/sc/source/core/data/table1.cxx b/sc/source/core/data/table1.cxx
index 15db733..22d9f64 100644
--- a/sc/source/core/data/table1.cxx
+++ b/sc/source/core/data/table1.cxx
@@ -238,6 +238,8 @@ void ScTable::SetName( const String& rNewName )
         bIsOlk = bOderSo = TRUE;
     aName = rNewName;
     aUpperName.Erase();         // invalidated if the name is changed
+
+    // SetStreamValid is handled in ScDocument::RenameTab
 }
 
 const String& ScTable::GetUpperName() const
@@ -291,6 +293,9 @@ void ScTable::SetLink( BYTE nMode,
     aLinkOpt = rOpt;		// Filter-Optionen
     aLinkTab = rTab;		// Tabellenname in Quelldatei
     nLinkRefreshDelay = nRefreshDelay;	// refresh delay in seconds, 0==off
+
+    if (IsStreamValid())
+        SetStreamValid(FALSE);
 }
 
 USHORT ScTable::GetOptimalColWidth( SCCOL nCol, OutputDevice* pDev,
@@ -1457,17 +1462,26 @@ void ScTable::DoColResize( SCCOL nCol1, SCCOL nCol2, SCSIZE nAdd )
 void ScTable::SetRepeatColRange( const ScRange* pNew )
 {
     SET_PRINTRANGE( pRepeatColRange, pNew );
+
+    if (IsStreamValid())
+        SetStreamValid(FALSE);
 }
 
 void ScTable::SetRepeatRowRange( const ScRange* pNew )
 {
     SET_PRINTRANGE( pRepeatRowRange, pNew );
+
+    if (IsStreamValid())
+        SetStreamValid(FALSE);
 }
 
 void ScTable::ClearPrintRanges()
 {
     aPrintRanges.clear();
     bPrintEntireSheet = FALSE;
+
+    if (IsStreamValid())
+        SetStreamValid(FALSE);
 }
 
 void ScTable::AddPrintRange( const ScRange& rNew )
@@ -1475,6 +1489,9 @@ void ScTable::AddPrintRange( const ScRange& rNew )
     bPrintEntireSheet = FALSE;
     if( aPrintRanges.size() < 0xFFFF )
         aPrintRanges.push_back( rNew );
+
+    if (IsStreamValid())
+        SetStreamValid(FALSE);
 }
 
 //UNUSED2009-05 void ScTable::SetPrintRange( const ScRange& rNew )
diff --git a/sc/source/core/data/table5.cxx b/sc/source/core/data/table5.cxx
index d6a741a..e2002ab 100644
--- a/sc/source/core/data/table5.cxx
+++ b/sc/source/core/data/table5.cxx
@@ -249,6 +249,9 @@ void ScTable::RemoveManualBreaks()
 
     if (pRowFlags)
         pRowFlags->AndValue( 0, MAXROW, sal::static_int_cast<BYTE>(~CR_MANUALBREAK) );
+
+    if (IsStreamValid())
+        SetStreamValid(FALSE);
 }
 
 BOOL ScTable::HasManualBreaks() const
@@ -287,6 +290,9 @@ void ScTable::SetProtection(const ScTableProtection* pProtect)
         pTabProtection.reset(new ScTableProtection(*pProtect));
     else
         pTabProtection.reset(NULL);
+
+    if (IsStreamValid())
+        SetStreamValid(FALSE);
 }
 
 ScTableProtection* ScTable::GetProtection()
diff --git a/sc/source/ui/docshell/arealink.cxx b/sc/source/ui/docshell/arealink.cxx
index bd37d41..d13ac27 100644
--- a/sc/source/ui/docshell/arealink.cxx
+++ b/sc/source/ui/docshell/arealink.cxx
@@ -172,6 +172,10 @@ void __EXPORT ScAreaLink::Closed()
         bAddUndo = FALSE;	// nur einmal
     }
 
+    SCTAB nDestTab = aDestArea.aStart.Tab();
+    if (pDoc->IsStreamValid(nDestTab))
+        pDoc->SetStreamValid(nDestTab, FALSE);
+
     SvBaseLink::Closed();
 }
 
diff --git a/sc/source/ui/docshell/docfunc.cxx b/sc/source/ui/docshell/docfunc.cxx
index 5d24180..57468bd 100644
--- a/sc/source/ui/docshell/docfunc.cxx
+++ b/sc/source/ui/docshell/docfunc.cxx
@@ -3079,6 +3079,9 @@ BOOL ScDocFunc::InsertPageBreak( BOOL bColumn, const ScAddress& rPos,
         pDoc->SetRowFlags( static_cast<SCROW>(nPos), nTab, nFlags );
     pDoc->UpdatePageBreaks( nTab );
 
+    if (pDoc->IsStreamValid(nTab))
+        pDoc->SetStreamValid(nTab, FALSE);
+
     if (bColumn)
     {
         rDocShell.PostPaint( static_cast<SCCOL>(nPos)-1, 0, nTab, MAXCOL, MAXROW, nTab, PAINT_GRID );
@@ -3135,6 +3138,9 @@ BOOL ScDocFunc::RemovePageBreak( BOOL bColumn, const ScAddress& rPos,
         pDoc->SetRowFlags( static_cast<SCROW>(nPos), nTab, nFlags );
     pDoc->UpdatePageBreaks( nTab );
 
+    if (pDoc->IsStreamValid(nTab))
+        pDoc->SetStreamValid(nTab, FALSE);
+
     if (bColumn)
     {
         rDocShell.PostPaint( static_cast<SCCOL>(nPos)-1, 0, nTab, MAXCOL, MAXROW, nTab, PAINT_GRID );
diff --git a/sc/source/ui/docshell/docsh.cxx b/sc/source/ui/docshell/docsh.cxx
index 5d810f0..5ff6174 100644
--- a/sc/source/ui/docshell/docsh.cxx
+++ b/sc/source/ui/docshell/docsh.cxx
@@ -2390,9 +2390,9 @@ void ScDocShell::SetDrawModified( BOOL bIsModified /* = TRUE */ )
 
     SetModified( bIsModified );
 
+    SfxBindings* pBindings = GetViewBindings();
     if (bUpdate)
     {
-        SfxBindings* pBindings = GetViewBindings();
         if (pBindings)
         {
             pBindings->Invalidate( SID_SAVEDOC );
@@ -2402,6 +2402,16 @@ void ScDocShell::SetDrawModified( BOOL bIsModified /* = TRUE */ )
 
     if (bIsModified)
     {
+        if (pBindings)
+        {
+            // #i105960# Undo etc used to be volatile.
+            // They always have to be invalidated, including drawing layer or row height changes
+            // (but not while pPaintLockData is set).
+            pBindings->Invalidate( SID_UNDO );
+            pBindings->Invalidate( SID_REDO );
+            pBindings->Invalidate( SID_REPEAT );
+        }
+
         if ( aDocument.IsChartListenerCollectionNeedsUpdate() )
         {
             aDocument.UpdateChartListenerCollection();
diff --git a/sc/source/ui/docshell/docsh5.cxx b/sc/source/ui/docshell/docsh5.cxx
index 071b3e1..0ad5e50 100644
--- a/sc/source/ui/docshell/docsh5.cxx
+++ b/sc/source/ui/docshell/docsh5.cxx
@@ -840,8 +840,9 @@ BOOL ScDocShell::MoveTable( SCTAB nSrcTab, SCTAB nDestTab, BOOL bCopy, BOOL bRec
     ScDocShellModificator aModificator( *this );
 
     // #i92477# be consistent with ScDocFunc::InsertTable: any index past the last sheet means "append"
+    // #i101139# nDestTab must be the target position, not APPEND (for CopyTabProtection etc.)
     if ( nDestTab >= aDocument.GetTableCount() )
-        nDestTab = SC_TAB_APPEND;
+        nDestTab = aDocument.GetTableCount();
 
     if (bCopy)
     {
diff --git a/sc/source/ui/docshell/olinefun.cxx b/sc/source/ui/docshell/olinefun.cxx
index 812cbbc..9498be3 100644
--- a/sc/source/ui/docshell/olinefun.cxx
+++ b/sc/source/ui/docshell/olinefun.cxx
@@ -137,6 +137,9 @@ BOOL ScOutlineDocFunc::MakeOutline( const ScRange& rRange, BOOL bColumns, BOOL b
                                         pUndoTab, bColumns, TRUE ) );
         }
 
+        if (pDoc->IsStreamValid(nTab))
+            pDoc->SetStreamValid(nTab, FALSE);
+
         USHORT nParts = 0;				// Datenbereich nicht geaendert
         if ( bColumns )
             nParts |= PAINT_TOP;
@@ -200,6 +203,9 @@ BOOL ScOutlineDocFunc::RemoveOutline( const ScRange& rRange, BOOL bColumns, BOOL
                                             pUndoTab, bColumns, FALSE ) );
             }
 
+            if (pDoc->IsStreamValid(nTab))
+                pDoc->SetStreamValid(nTab, FALSE);
+
             USHORT nParts = 0;				// Datenbereich nicht geaendert
             if ( bColumns )
                 nParts |= PAINT_TOP;
@@ -265,6 +271,9 @@ BOOL ScOutlineDocFunc::RemoveAllOutlines( SCTAB nTab, BOOL bRecord, BOOL bApi )
 
         pDoc->UpdatePageBreaks( nTab );
 
+        if (pDoc->IsStreamValid(nTab))
+            pDoc->SetStreamValid(nTab, FALSE);
+
         rDocShell.PostPaint( 0,0,nTab, MAXCOL,MAXROW,nTab,
                                     PAINT_GRID | PAINT_LEFT | PAINT_TOP | PAINT_SIZE );
         rDocShell.SetDocumentModified();
@@ -333,6 +342,9 @@ BOOL ScOutlineDocFunc::AutoOutline( const ScRange& rRange, BOOL bRecord, BOOL bA
                                     pUndoDoc, pUndoTab ) );
     }
 
+    if (pDoc->IsStreamValid(nTab))
+        pDoc->SetStreamValid(nTab, FALSE);
+
     rDocShell.PostPaint( 0,0,nTab, MAXCOL,MAXROW,nTab, PAINT_LEFT | PAINT_TOP | PAINT_SIZE );
     rDocShell.SetDocumentModified();
     lcl_InvalidateOutliner( rDocShell.GetViewBindings() );


More information about the ooo-build-commit mailing list