[Libreoffice-commits] .: Branch 'libreoffice-3-4' - 13 commits -

Petr Mladek pmladek at kemper.freedesktop.org
Wed Apr 6 05:09:58 PDT 2011


 0 files changed

New commits:
commit c795417300fb66479af9c6513f6b8ec1864949f9
Merge: 32dc6bc... f2f1ab6...
Author: Petr Mladek <pmladek at suse.cz>
Date:   Wed Apr 6 14:07:14 2011 +0200

    Merge branch 'libreoffice-3-4' of ssh://git.freedesktop.org/git/libreoffice/calc into libreoffice-3-4

commit 32dc6bcd3e449c684a461b9e62c392cd25840a18
Merge: c3cf9bd... 8f34ffa...
Author: Petr Mladek <pmladek at suse.cz>
Date:   Tue Apr 5 17:52:16 2011 +0200

    Merge remote-tracking branch 'origin/libreoffice-3-3' into libreoffice-3-4
    
    Conflicts:
    	sc/source/core/tool/makefile.mk
    	sc/source/ui/dbgui/filtdlg.cxx

commit 8f34ffa5677bfc86ef5aa33811955c577f8799c3
Author: Kohei Yoshida <kyoshida at novell.com>
Date:   Mon Mar 21 16:01:47 2011 -0400

    Fix seg faults on sheet deletion.
    
    Sometimes a simple sheet removal causes segfault in certain types of
    documents.  Not always reproducible, but this fix is certainly safer.
    (n#680272)
    
    Signed-off-by: Noel Power <nopower at novell.com>

diff --git a/sc/source/ui/docshell/docfunc.cxx b/sc/source/ui/docshell/docfunc.cxx
index abe1c58..e45ded8 100644
--- a/sc/source/ui/docshell/docfunc.cxx
+++ b/sc/source/ui/docshell/docfunc.cxx
@@ -2720,7 +2720,7 @@ void VBA_DeleteModule( ScDocShell& rDocSh, String& sModuleName )
         uno::Reference< script::vba::XVBAModuleInfo > xVBAModuleInfo( xLib, uno::UNO_QUERY );
         if( xLib->hasByName( sModuleName ) )
             xLib->removeByName( sModuleName );
-        if ( xVBAModuleInfo.is() )
+        if ( xVBAModuleInfo.is() && xVBAModuleInfo->hasModuleInfo(sModuleName) )
             xVBAModuleInfo->removeModuleInfo( sModuleName );
 
     }
commit e54c3699db11dc1bcc7bd7fa069c9c4124715839
Author: Tibby Lickle <tibbylickle at googlemail.com>
Date:   Thu Mar 10 19:08:18 2011 +0000

    Disabled auto-complete in Calc filter dialog - fix for bug 34898.
    
    A hyphen character caused auto-complete to kick in, changing the user's choice of conditional operator to "=". This was not changed back if auto-complete option is overridden.
    
    Signed-off-by: Kohei Yoshida <kyoshida at novell.com>

diff --git a/sc/source/ui/dbgui/filtdlg.cxx b/sc/source/ui/dbgui/filtdlg.cxx
index d33a674..7613cc7 100644
--- a/sc/source/ui/dbgui/filtdlg.cxx
+++ b/sc/source/ui/dbgui/filtdlg.cxx
@@ -263,6 +263,7 @@ void __EXPORT ScFilterDlg::Init( const SfxItemSet& rArgSet )
         aFieldLbArr[i]->SelectEntryPos( nFieldSelPos );
         aCondLbArr [i]->SelectEntryPos( nCondPos );
         aValueEdArr[i]->SetText( aValStr );
+        aValueEdArr[i]->EnableAutocomplete( FALSE );
         aValueEdArr[i]->SetModifyHdl( LINK( this, ScFilterDlg, ValModifyHdl ) );
         UpdateValueList( static_cast<USHORT>(i+1) );
     }
commit 9210ccb8cf4d50babe7a3a8bb6445a19d17178bd
Author: Petr Mladek <pmladek at suse.cz>
Date:   Tue Mar 8 15:31:08 2011 +0100

    Version 3.3.2.1, tag libreoffice-3.3.2.1 (3.3.2-rc1)
commit 1ebf64611845c4324ddb930d685365b6cb83382b
Author: Kohei Yoshida <kyoshida at novell.com>
Date:   Tue Mar 8 10:55:13 2011 +0100

    Properly invalidate cached sheet XML streams during reference update.
    
    Failure to invalidate sheet streams during reference update caused
    formula cross referenceing between sheets to totallly get borked.
    
    The bug was originally reported in i#116833.
    
    Signed off by Petr Mladek <pmladek at suse.cz>

diff --git a/sc/inc/cell.hxx b/sc/inc/cell.hxx
index 1f2693b..8fd9da3 100644
--- a/sc/inc/cell.hxx
+++ b/sc/inc/cell.hxx
@@ -440,7 +440,7 @@ public:
     BOOL			HasRelNameReference() const;
     BOOL			HasColRowName() const;
 
-    void			UpdateReference(UpdateRefMode eUpdateRefMode,
+    bool			UpdateReference(UpdateRefMode eUpdateRefMode,
                                     const ScRange& r,
                                     SCsCOL nDx, SCsROW nDy, SCsTAB nDz,
                                     ScDocument* pUndoDoc = NULL,
diff --git a/sc/inc/column.hxx b/sc/inc/column.hxx
index cf193de..e0ef949 100644
--- a/sc/inc/column.hxx
+++ b/sc/inc/column.hxx
@@ -286,7 +286,7 @@ public:
 
     void		ResetChanged( SCROW nStartRow, SCROW nEndRow );
 
-    void		UpdateReference( UpdateRefMode eUpdateRefMode, SCCOL nCol1, SCROW nRow1, SCTAB nTab1,
+    bool        UpdateReference( UpdateRefMode eUpdateRefMode, SCCOL nCol1, SCROW nRow1, SCTAB nTab1,
                                      SCCOL nCol2, SCROW nRow2, SCTAB nTab2,
                                      SCsCOL nDx, SCsROW nDy, SCsTAB nDz,
                                      ScDocument* pUndoDoc = NULL );
diff --git a/sc/source/core/data/cell2.cxx b/sc/source/core/data/cell2.cxx
index 7471fdb..b6fa4b7 100644
--- a/sc/source/core/data/cell2.cxx
+++ b/sc/source/core/data/cell2.cxx
@@ -829,11 +829,13 @@ BOOL ScFormulaCell::HasColRowName() const
     return (pCode->GetNextColRowName() != NULL);
 }
 
-void ScFormulaCell::UpdateReference(UpdateRefMode eUpdateRefMode,
+bool ScFormulaCell::UpdateReference(UpdateRefMode eUpdateRefMode,
                                     const ScRange& r,
                                     SCsCOL nDx, SCsROW nDy, SCsTAB nDz,
                                     ScDocument* pUndoDoc, const ScAddress* pUndoCellPos )
 {
+    bool bCellStateChanged = false;
+
     SCCOL nCol1 = r.aStart.Col();
     SCROW nRow1 = r.aStart.Row();
     SCTAB nTab1 = r.aStart.Tab();
@@ -862,6 +864,7 @@ void ScFormulaCell::UpdateReference(UpdateRefMode eUpdateRefMode,
                     nCol = 0;
                 else if ( nCol > MAXCOL )
                     nCol = MAXCOL;
+                bCellStateChanged = aPos.Col() != nCol;
                 aPos.SetCol( nCol );
 //              bPosChanged = TRUE;
             }
@@ -876,6 +879,7 @@ void ScFormulaCell::UpdateReference(UpdateRefMode eUpdateRefMode,
                     nRow = 0;
                 else if ( nRow > MAXROW )
                     nRow = MAXROW;
+                bCellStateChanged = aPos.Row() != nRow;
                 aPos.SetRow( nRow );
 //              bPosChanged = TRUE;
             }
@@ -891,6 +895,7 @@ void ScFormulaCell::UpdateReference(UpdateRefMode eUpdateRefMode,
                     nTab = 0;
                 else if ( nTab > nMaxTab )
                     nTab = nMaxTab;
+                bCellStateChanged = aPos.Tab() != nTab;
                 aPos.SetTab( nTab );
 //              bPosChanged = TRUE;
             }
@@ -940,6 +945,9 @@ void ScFormulaCell::UpdateReference(UpdateRefMode eUpdateRefMode,
             bRangeModified = FALSE;
             bRefSizeChanged = FALSE;
         }
+
+        bCellStateChanged |= bValChanged;
+
         if ( bOnRefMove )
             bOnRefMove = (bValChanged || (aPos != aOldPos));
             // Cell may reference itself, e.g. ocColumn, ocRow without parameter
@@ -1126,6 +1134,7 @@ void ScFormulaCell::UpdateReference(UpdateRefMode eUpdateRefMode,
 
         delete pOld;
     }
+    return bCellStateChanged;
 }
 
 void ScFormulaCell::UpdateInsertTab(SCTAB nTable)
diff --git a/sc/source/core/data/column.cxx b/sc/source/core/data/column.cxx
index 0ae30f5..4998d3a 100644
--- a/sc/source/core/data/column.cxx
+++ b/sc/source/core/data/column.cxx
@@ -1622,10 +1622,11 @@ void ScColumn::MoveTo(SCROW nStartRow, SCROW nEndRow, ScColumn& rCol)
 }
 
 
-void ScColumn::UpdateReference( UpdateRefMode eUpdateRefMode, SCCOL nCol1, SCROW nRow1, SCTAB nTab1,
+bool ScColumn::UpdateReference( UpdateRefMode eUpdateRefMode, SCCOL nCol1, SCROW nRow1, SCTAB nTab1,
              SCCOL nCol2, SCROW nRow2, SCTAB nTab2, SCsCOL nDx, SCsROW nDy, SCsTAB nDz,
              ScDocument* pUndoDoc )
 {
+    bool bUpdated = false;
     if (pItems)
     {
         ScRange aRange( ScAddress( nCol1, nRow1, nTab1 ),
@@ -1637,7 +1638,8 @@ void ScColumn::UpdateReference( UpdateRefMode eUpdateRefMode, SCCOL nCol1, SCROW
             {
                 ScFormulaCell* pCell = (ScFormulaCell*) pItems[nIndex].pCell;
                 if( pCell->GetCellType() == CELLTYPE_FORMULA)
-                    pCell->UpdateReference(	eUpdateRefMode, aRange, nDx, nDy, nDz, pUndoDoc );
+                    bUpdated |= pCell->UpdateReference(
+                        eUpdateRefMode, aRange, nDx, nDy, nDz, pUndoDoc );
             }
         }
         else
@@ -1658,7 +1660,8 @@ void ScColumn::UpdateReference( UpdateRefMode eUpdateRefMode, SCCOL nCol1, SCROW
                     ScBaseCell* pCell = pItems[i].pCell;
                     if( pCell->GetCellType() == CELLTYPE_FORMULA)
                     {
-                        ((ScFormulaCell*)pCell)->UpdateReference( eUpdateRefMode, aRange, nDx, nDy, nDz, pUndoDoc );
+                        bUpdated |= ((ScFormulaCell*)pCell)->UpdateReference(
+                            eUpdateRefMode, aRange, nDx, nDy, nDz, pUndoDoc );
                         if ( nRow != pItems[i].nRow )
                             Search( nRow, i );  // Listener removed/inserted?
                     }
@@ -1676,7 +1679,8 @@ void ScColumn::UpdateReference( UpdateRefMode eUpdateRefMode, SCCOL nCol1, SCROW
                         // When deleting rows on several sheets, the formula's position may be updated with the first call,
                         // so the undo position must be passed from here.
                         ScAddress aUndoPos( nCol, nRow, nTab );
-                        ((ScFormulaCell*)pCell)->UpdateReference( eUpdateRefMode, aRange, nDx, nDy, nDz, pUndoDoc, &aUndoPos );
+                        bUpdated |= ((ScFormulaCell*)pCell)->UpdateReference(
+                            eUpdateRefMode, aRange, nDx, nDy, nDz, pUndoDoc, &aUndoPos );
                         if ( nRow != pItems[i].nRow )
                             Search( nRow, i );  // Listener removed/inserted?
                     }
@@ -1684,6 +1688,7 @@ void ScColumn::UpdateReference( UpdateRefMode eUpdateRefMode, SCCOL nCol1, SCROW
             }
         }
     }
+    return bUpdated;
 }
 
 
diff --git a/sc/source/core/data/table1.cxx b/sc/source/core/data/table1.cxx
index 68904d2..6e1ecff 100644
--- a/sc/source/core/data/table1.cxx
+++ b/sc/source/core/data/table1.cxx
@@ -1288,6 +1288,7 @@ void ScTable::UpdateReference( UpdateRefMode eUpdateRefMode, SCCOL nCol1, SCROW
                      SCCOL nCol2, SCROW nRow2, SCTAB nTab2, SCsCOL nDx, SCsROW nDy, SCsTAB nDz,
                      ScDocument* pUndoDoc, BOOL bIncludeDraw, bool bUpdateNoteCaptionPos )
 {
+    bool bUpdated = false;
     SCCOL i;
     SCCOL iMax;
     if ( eUpdateRefMode == URM_COPY )
@@ -1301,8 +1302,8 @@ void ScTable::UpdateReference( UpdateRefMode eUpdateRefMode, SCCOL nCol1, SCROW
         iMax = MAXCOL;
     }
     for ( ; i<=iMax; i++)
-        aCol[i].UpdateReference( eUpdateRefMode, nCol1, nRow1, nTab1, nCol2, nRow2, nTab2,
-                                    nDx, nDy, nDz, pUndoDoc );
+        bUpdated |= aCol[i].UpdateReference(
+            eUpdateRefMode, nCol1, nRow1, nTab1, nCol2, nRow2, nTab2, nDx, nDy, nDz, pUndoDoc );
 
     if ( bIncludeDraw )
         UpdateDrawRef( eUpdateRefMode, nCol1, nRow1, nTab1, nCol2, nRow2, nTab2, nDx, nDy, nDz, bUpdateNoteCaptionPos );
@@ -1387,6 +1388,9 @@ void ScTable::UpdateReference( UpdateRefMode eUpdateRefMode, SCCOL nCol1, SCROW
                                     PAINT_GRID ) );
         }
     }
+
+    if (bUpdated && IsStreamValid())
+        SetStreamValid(false);
 }
 
 void ScTable::UpdateTranspose( const ScRange& rSource, const ScAddress& rDest,
diff --git a/sc/source/core/data/table2.cxx b/sc/source/core/data/table2.cxx
index a852f7c..8c26824 100644
--- a/sc/source/core/data/table2.cxx
+++ b/sc/source/core/data/table2.cxx
@@ -179,6 +179,11 @@ void ScTable::InsertRow( SCCOL nStartCol, SCCOL nEndCol, SCROW nStartRow, SCSIZE
     DecRecalcLevel( false );
 
     InvalidatePageBreaks();
+
+    if (IsStreamValid())
+        // TODO: In the future we may want to check if the table has been
+        // really modified before setting the stream invalid.
+        SetStreamValid(false);
 }
 
 
@@ -224,6 +229,11 @@ void ScTable::DeleteRow( SCCOL nStartCol, SCCOL nEndCol, SCROW nStartRow, SCSIZE
     DecRecalcLevel();
 
     InvalidatePageBreaks();
+
+    if (IsStreamValid())
+        // TODO: In the future we may want to check if the table has been
+        // really modified before setting the stream invalid.
+        SetStreamValid(false);
 }
 
 
@@ -311,6 +321,11 @@ void ScTable::InsertCol( SCCOL nStartCol, SCROW nStartRow, SCROW nEndRow, SCSIZE
     DecRecalcLevel();
 
     InvalidatePageBreaks();
+
+    if (IsStreamValid())
+        // TODO: In the future we may want to check if the table has been
+        // really modified before setting the stream invalid.
+        SetStreamValid(false);
 }
 
 
@@ -371,6 +386,11 @@ void ScTable::DeleteCol( SCCOL nStartCol, SCROW nStartRow, SCROW nEndRow, SCSIZE
     DecRecalcLevel();
 
     InvalidatePageBreaks();
+
+    if (IsStreamValid())
+        // TODO: In the future we may want to check if the table has been
+        // really modified before setting the stream invalid.
+        SetStreamValid(false);
 }
 
 
@@ -398,9 +418,12 @@ void ScTable::DeleteArea(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, USH
             aPattern.GetItemSet().Put( ScProtectionAttr( FALSE ) );
             ApplyPatternArea( nCol1, nRow1, nCol2, nRow2, aPattern );
         }
-
-//		DecRecalcLevel();
     }
+
+    if (IsStreamValid())
+        // TODO: In the future we may want to check if the table has been
+        // really modified before setting the stream invalid.
+        SetStreamValid(false);
 }
 
 
@@ -424,6 +447,11 @@ void ScTable::DeleteSelection( USHORT nDelFlag, const ScMarkData& rMark )
         SfxItemPoolCache aCache( pPool, &aSet );
         ApplySelectionCache( &aCache, rMark );
     }
+
+    if (IsStreamValid())
+        // TODO: In the future we may want to check if the table has been
+        // really modified before setting the stream invalid.
+        SetStreamValid(false);
 }
 
 
commit a200691a5081bb4b1f2008da6e503d73c0c70b85
Author: Kohei Yoshida <kyoshida at novell.com>
Date:   Wed Mar 2 16:13:48 2011 -0500

    Make sure these values are positive; we use them to resize arrays.
    
    This fixes fdo#34350.
    
    Signed-off-by: Michael Meeks <michael.meeks at novell.com>

diff --git a/chart2/source/view/axes/TickmarkHelper.cxx b/chart2/source/view/axes/TickmarkHelper.cxx
index aa616ca..ddf9888 100644
--- a/chart2/source/view/axes/TickmarkHelper.cxx
+++ b/chart2/source/view/axes/TickmarkHelper.cxx
@@ -597,6 +597,9 @@ void TickmarkHelper::getAllTicks( ::std::vector< ::std::vector< TickInfo > >& rA
     sal_Int32 nDepthCount = this->getTickDepth();
     sal_Int32 nMaxMajorTickCount = this->getMaxTickCount( 0 );
 
+    if (nDepthCount <= 0 || nMaxMajorTickCount <= 0)
+        return;
+
     aAllTicks.realloc(nDepthCount);
     aAllTicks[0].realloc(nMaxMajorTickCount);
 
commit 863d358b594750d68f0cbb9692c7f0023589cee9
Author: Kohei Yoshida <kyoshida at novell.com>
Date:   Thu Mar 3 14:30:45 2011 -0500

    I forgot to say that the last commit was signed off by Thorsten.
    
    Commit hash: e301739e4439be4214de0ff9b1bd6c2142d6806e
    Signed-off-by: Thorsten Behrens <thb at documentfoundation.org>
commit e301739e4439be4214de0ff9b1bd6c2142d6806e
Author: Kohei Yoshida <kyoshida at novell.com>
Date:   Fri Feb 11 19:31:30 2011 -0500

    Fixed incorrect cursor navigation. (fdo#33756)
    
    Block selection with keyboard was incorrect when the selected range
    included hidden cells.  This also fixes one crasher on block
    selection during formula reference mode i.e. type '=SUM(' and select
    range via keyboard afterward.

diff --git a/sc/source/ui/view/tabview2.cxx b/sc/source/ui/view/tabview2.cxx
index b9cb8be..a4e75a4 100644
--- a/sc/source/ui/view/tabview2.cxx
+++ b/sc/source/ui/view/tabview2.cxx
@@ -441,8 +441,9 @@ void ScTabView::GetAreaMoveEndPosition(SCsCOL nMovX, SCsROW nMovY, ScFollowMode
 {
     SCCOL nNewX = -1;
     SCROW nNewY = -1;
-    SCCOL nCurX = -1;
-    SCROW nCurY = -1;
+    // current cursor position.
+    SCCOL nCurX = aViewData.GetCurX();
+    SCROW nCurY = aViewData.GetCurY();
 
     if (aViewData.IsRefMode())
     {
@@ -456,8 +457,8 @@ void ScTabView::GetAreaMoveEndPosition(SCsCOL nMovX, SCsROW nMovY, ScFollowMode
     }
     else
     {
-        nNewX = nCurX = aViewData.GetCurX();
-        nNewY = nCurY = aViewData.GetCurY();
+        nNewX = nCurX;
+        nNewY = nCurY;
     }
 
     ScDocument* pDoc = aViewData.GetDocument();
@@ -627,7 +628,7 @@ void ScTabView::SkipCursorVertical(SCsCOL& rCurX, SCsROW& rCurY, SCsROW nOldY, S
 
 namespace {
 
-bool lcl_isCellQualified(ScDocument* pDoc, SCCOL nCol, SCROW nRow, SCTAB nTab, bool bSelectLocked, bool bSelectUnlocked)
+bool isCellQualified(ScDocument* pDoc, SCCOL nCol, SCROW nRow, SCTAB nTab, bool bSelectLocked, bool bSelectUnlocked)
 {
     bool bCellProtected = pDoc->HasAttrib(
         nCol, nRow, nTab, nCol, nRow, nTab, HASATTR_PROTECTED);
@@ -641,33 +642,7 @@ bool lcl_isCellQualified(ScDocument* pDoc, SCCOL nCol, SCROW nRow, SCTAB nTab, b
     return true;
 }
 
-void skipHiddenRows(ScDocument* pDoc, SCTAB nTab, SCROW& rRow, bool bForward)
-{
-    SCROW nFirst, nLast;
-    if (!pDoc->RowHidden(rRow, nTab, &nFirst, &nLast))
-        // This row is visible.  Nothing to do.
-        return;
-
-    if (bForward)
-        rRow = nLast < MAXROW ? nLast + 1 : MAXROW;
-    else
-        rRow = nFirst > 0 ? nFirst - 1 : 0;
-}
-
-void skipHiddenCols(ScDocument* pDoc, SCTAB nTab, SCCOL& rCol, bool bForward)
-{
-    SCCOL nFirst, nLast;
-    if (!pDoc->ColHidden(rCol, nTab, &nFirst, &nLast))
-        // This row is visible.  Nothing to do.
-        return;
-
-    if (bForward)
-        rCol = nLast < MAXCOL ? nLast + 1 : MAXCOL;
-    else
-        rCol = nFirst > 0 ? nFirst - 1 : 0;
-}
-
-void lcl_moveCursorByProtRule(
+void moveCursorByProtRule(
     SCCOL& rCol, SCROW& rRow, SCsCOL nMovX, SCsROW nMovY, SCTAB nTab, ScDocument* pDoc)
 {
     bool bSelectLocked = true;
@@ -685,10 +660,9 @@ void lcl_moveCursorByProtRule(
         {
             for (SCCOL i = 0; i < nMovX; ++i)
             {
-                if (!lcl_isCellQualified(pDoc, rCol+1, rRow, nTab, bSelectLocked, bSelectUnlocked))
+                if (!isCellQualified(pDoc, rCol+1, rRow, nTab, bSelectLocked, bSelectUnlocked))
                     break;
                 ++rCol;
-                skipHiddenCols(pDoc, nTab, rCol, true);
             }
         }
     }
@@ -699,10 +673,9 @@ void lcl_moveCursorByProtRule(
             nMovX = -nMovX;
             for (SCCOL i = 0; i < nMovX; ++i)
             {
-                if (!lcl_isCellQualified(pDoc, rCol-1, rRow, nTab, bSelectLocked, bSelectUnlocked))
+                if (!isCellQualified(pDoc, rCol-1, rRow, nTab, bSelectLocked, bSelectUnlocked))
                     break;
                 --rCol;
-                skipHiddenCols(pDoc, nTab, rCol, false);
             }
         }
     }
@@ -713,10 +686,9 @@ void lcl_moveCursorByProtRule(
         {
             for (SCROW i = 0; i < nMovY; ++i)
             {
-                if (!lcl_isCellQualified(pDoc, rCol, rRow+1, nTab, bSelectLocked, bSelectUnlocked))
+                if (!isCellQualified(pDoc, rCol, rRow+1, nTab, bSelectLocked, bSelectUnlocked))
                     break;
                 ++rRow;
-                skipHiddenRows(pDoc, nTab, rRow, true);
             }
         }
     }
@@ -727,10 +699,9 @@ void lcl_moveCursorByProtRule(
             nMovY = -nMovY;
             for (SCROW i = 0; i < nMovY; ++i)
             {
-                if (!lcl_isCellQualified(pDoc, rCol, rRow-1, nTab, bSelectLocked, bSelectUnlocked))
+                if (!isCellQualified(pDoc, rCol, rRow-1, nTab, bSelectLocked, bSelectUnlocked))
                     break;
                 --rRow;
-                skipHiddenRows(pDoc, nTab, rRow, false);
             }
         }
     }
@@ -769,7 +740,7 @@ void ScTabView::ExpandBlock(SCsCOL nMovX, SCsROW nMovY, ScFollowMode eMode)
             bSelectUnlocked = pTabProtection->isOptionEnabled(ScTableProtection::SELECT_UNLOCKED_CELLS);
         }
 
-        lcl_moveCursorByProtRule(nNewX, nNewY, nMovX, nMovY, nRefTab, pDoc);
+        moveCursorByProtRule(nNewX, nNewY, nMovX, nMovY, nRefTab, pDoc);
 
         if (nMovX)
         {
@@ -781,7 +752,7 @@ void ScTabView::ExpandBlock(SCsCOL nMovX, SCsROW nMovY, ScFollowMode eMode)
                 else
                     --nTempX;
             }
-            if (lcl_isCellQualified(pDoc, nTempX, nNewY, nRefTab, bSelectLocked, bSelectUnlocked))
+            if (isCellQualified(pDoc, nTempX, nNewY, nRefTab, bSelectLocked, bSelectUnlocked))
                 nNewX = nTempX;
         }
 
@@ -795,7 +766,7 @@ void ScTabView::ExpandBlock(SCsCOL nMovX, SCsROW nMovY, ScFollowMode eMode)
                 else
                     --nTempY;
             }
-            if (lcl_isCellQualified(pDoc, nNewX, nTempY, nRefTab, bSelectLocked, bSelectUnlocked))
+            if (isCellQualified(pDoc, nNewX, nTempY, nRefTab, bSelectLocked, bSelectUnlocked))
                 nNewY = nTempY;
         }
 
@@ -812,7 +783,7 @@ void ScTabView::ExpandBlock(SCsCOL nMovX, SCsROW nMovY, ScFollowMode eMode)
         if (!IsBlockMode())
             InitBlockMode(aViewData.GetCurX(), aViewData.GetCurY(), nTab, true);
 
-        lcl_moveCursorByProtRule(nBlockEndX, nBlockEndY, nMovX, nMovY, nTab, pDoc);
+        moveCursorByProtRule(nBlockEndX, nBlockEndY, nMovX, nMovY, nTab, pDoc);
 
         if (nBlockEndX < 0)
             nBlockEndX = 0;
commit 3c9f5bcc67e077448aaade2f0aed597e9afc1326
Author: Kohei Yoshida <kyoshida at novell.com>
Date:   Wed Mar 2 21:33:09 2011 -0500

    Better fix for fdo#31939.
    
    Turns out that the token array's recalc mode is set to "recalc always"
    when it contains a volatile token during compilation.  We can re-use
    that to mark the token array volatile before the interpretation starts.
    The end result is the same, with better performance since we can avoid
    re-scanning of the token array.
    
    Signed-off-by: Michael Meeks <michael.meeks at novell.com>

diff --git a/sc/source/core/inc/interpre.hxx b/sc/source/core/inc/interpre.hxx
index e2eae90..6e5fd10 100644
--- a/sc/source/core/inc/interpre.hxx
+++ b/sc/source/core/inc/interpre.hxx
@@ -813,13 +813,6 @@ double GetGammaDistPDF(double fX, double fAlpha, double fLambda);
 // cumulative distribution function; fLambda is "scale" parameter
 double GetGammaDist(double fX, double fAlpha, double fLambda);
 
-/**
- * Go through all tokens to see if the array contains a volatile token.  We
- * need to do this since a conditional token such as IF function may skip
- * some tokens and it may incorrectly mark the token array non-volatile.
- */
-void CheckForVolatileToken();
-
 public:
     ScInterpreter( ScFormulaCell* pCell, ScDocument* pDoc,
                     const ScAddress&, ScTokenArray& );
diff --git a/sc/source/core/tool/interpr4.cxx b/sc/source/core/tool/interpr4.cxx
index 6751531..502c62a 100644
--- a/sc/source/core/tool/interpr4.cxx
+++ b/sc/source/core/tool/interpr4.cxx
@@ -3594,7 +3594,7 @@ ScInterpreter::ScInterpreter( ScFormulaCell* pCell, ScDocument* pDoc,
     pFormatter( pDoc->GetFormatTable() ),
     mnStringNoValueError( errNoValue),
     bCalcAsShown( pDoc->GetDocOptions().IsCalcAsShown() ),
-    meVolaileType(NOT_VOLATILE)
+    meVolaileType(r.IsRecalcModeAlways() ? VOLATILE : NOT_VOLATILE)
 {
     RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::ScTTT" );
 //  pStack = new ScToken*[ MAXSTACK ];
@@ -3663,8 +3663,6 @@ StackVar ScInterpreter::Interpret()
     // so reassure exceptions are really off.
     SAL_MATH_FPEXCEPTIONS_OFF();
 
-    CheckForVolatileToken();
-
     aCode.Reset();
     while( ( pCur = aCode.Next() ) != NULL
             && (!nGlobalError || nErrorFunction <= nErrorFunctionCount) )
diff --git a/sc/source/core/tool/interpr7.cxx b/sc/source/core/tool/interpr7.cxx
index c7674d6..ffac3d6 100644
--- a/sc/source/core/tool/interpr7.cxx
+++ b/sc/source/core/tool/interpr7.cxx
@@ -32,18 +32,7 @@
 // INCLUDE ---------------------------------------------------------------
 
 #include "interpre.hxx"
-#include "formula/FormulaCompiler.hxx"
 
-void ScInterpreter::CheckForVolatileToken()
-{
-    for (const formula::FormulaToken* p = aCode.First(); p; p = aCode.Next())
-    {
-        if (formula::FormulaCompiler::IsOpCodeVolatile(p->GetOpCode()))
-        {
-            meVolaileType = VOLATILE;
-            return;
-        }
-    }
-}
+// TODO: Add new methods for ScInterpreter here.
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit 2108280e847a78da3cc401dd07dbcfd9bab3e7d1
Author: Kohei Yoshida <kyoshida at novell.com>
Date:   Wed Mar 2 20:44:56 2011 -0500

    Go through all tokens to look for a volatile one. (fdo#31939)
    
    When a volatile token is inside a conditional function (such as IF),
    *and* the evaluation of that conditional skips the volatile token
    it would incorrectly mark the cell non-volatile.  The solution is
    to scan through all tokens in the token array in the beginning of
    the calculation and mark the cell volatile if one is found.

diff --git a/sc/source/core/inc/interpre.hxx b/sc/source/core/inc/interpre.hxx
index f356dbe..e2eae90 100644
--- a/sc/source/core/inc/interpre.hxx
+++ b/sc/source/core/inc/interpre.hxx
@@ -813,7 +813,13 @@ double GetGammaDistPDF(double fX, double fAlpha, double fLambda);
 // cumulative distribution function; fLambda is "scale" parameter
 double GetGammaDist(double fX, double fAlpha, double fLambda);
 
-//----------------------------------------------------------------------------
+/**
+ * Go through all tokens to see if the array contains a volatile token.  We
+ * need to do this since a conditional token such as IF function may skip
+ * some tokens and it may incorrectly mark the token array non-volatile.
+ */
+void CheckForVolatileToken();
+
 public:
     ScInterpreter( ScFormulaCell* pCell, ScDocument* pDoc,
                     const ScAddress&, ScTokenArray& );
diff --git a/sc/source/core/tool/interpr4.cxx b/sc/source/core/tool/interpr4.cxx
index a1be445..6751531 100644
--- a/sc/source/core/tool/interpr4.cxx
+++ b/sc/source/core/tool/interpr4.cxx
@@ -3663,6 +3663,8 @@ StackVar ScInterpreter::Interpret()
     // so reassure exceptions are really off.
     SAL_MATH_FPEXCEPTIONS_OFF();
 
+    CheckForVolatileToken();
+
     aCode.Reset();
     while( ( pCur = aCode.Next() ) != NULL
             && (!nGlobalError || nErrorFunction <= nErrorFunctionCount) )
diff --git a/sc/source/core/tool/interpr7.cxx b/sc/source/core/tool/interpr7.cxx
new file mode 100644
index 0000000..c7674d6
--- /dev/null
+++ b/sc/source/core/tool/interpr7.cxx
@@ -0,0 +1,49 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * Version: MPL 1.1 / GPLv3+ / LGPLv3+
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Initial Developer of the Original Code is
+ *       Kohei Yoshida <kyoshida at novell.com> (Novell, Inc.)
+ * Portions created by the Initial Developer are Copyright (C) 2010 the
+ * Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):  Kohei Yoshida <kyoshida at novell.com>
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 3 or later (the "GPLv3+"), or
+ * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
+ * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
+ * instead of those above.
+ */
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_sc.hxx"
+
+// INCLUDE ---------------------------------------------------------------
+
+#include "interpre.hxx"
+#include "formula/FormulaCompiler.hxx"
+
+void ScInterpreter::CheckForVolatileToken()
+{
+    for (const formula::FormulaToken* p = aCode.First(); p; p = aCode.Next())
+    {
+        if (formula::FormulaCompiler::IsOpCodeVolatile(p->GetOpCode()))
+        {
+            meVolaileType = VOLATILE;
+            return;
+        }
+    }
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/core/tool/makefile.mk b/sc/source/core/tool/makefile.mk
index b1cad58..bd241b3 100644
--- a/sc/source/core/tool/makefile.mk
+++ b/sc/source/core/tool/makefile.mk
@@ -82,6 +82,7 @@ SLOFILES =  \
         $(SLO)$/interpr4.obj \
         $(SLO)$/interpr5.obj \
         $(SLO)$/interpr6.obj \
+        $(SLO)$/interpr7.obj \
         $(SLO)$/lookupcache.obj \
         $(SLO)$/navicfg.obj \
         $(SLO)$/odffmap.obj \
commit 90db49dae7076e255a6f37787492f5206682cb41
Author: Jean-Baptiste Faure <jbf.faure at orange.fr>
Date:   Sun Feb 20 16:09:30 2011 +0100

    Changed label size and position for BTN_GENERAL_PREC, FT_PREC and ED_PREC
    
    FT_PREC overwrote BTN_GENERAL_PREC so that French translation was truncated

diff --git a/sc/source/ui/src/optdlg.src b/sc/source/ui/src/optdlg.src
index 3f13db0..86c47fd 100644
--- a/sc/source/ui/src/optdlg.src
+++ b/sc/source/ui/src/optdlg.src
@@ -152,20 +152,20 @@ TabPage RID_SCPAGE_CALC
     CheckBox BTN_GENERAL_PREC
     {
         Pos = MAP_APPFONT ( 12 , 147 ) ;
-        Size = MAP_APPFONT ( 148 , 10 ) ;
-        Text [ en-US ] = "Limit decimals for general number format" ;
+        Size = MAP_APPFONT ( 164 , 10 ) ;
+        Text [ en-US ] = "~Limit decimals for general number format" ;
     };
     FixedText FT_PREC
     {
-        Pos = MAP_APPFONT ( 138 , 148 ) ;
-        Size = MAP_APPFONT ( 84 , 8 ) ;
+        Pos = MAP_APPFONT ( 169 , 147 ) ;
+        Size = MAP_APPFONT ( 53 , 8 ) ;
         Text [ en-US ] = "~Decimal places" ;
         Right = TRUE ;
     };
     NumericField ED_PREC
     {
         Border = TRUE ;
-        Pos = MAP_APPFONT ( 226 , 146 ) ;
+        Pos = MAP_APPFONT ( 226 , 145 ) ;
         Size = MAP_APPFONT ( 25 , 12 ) ;
         Maximum = 20 ;
         Spin = TRUE ;
commit 4f5dedef46bb48b19f063536b3c55cd8e46a9d41
Author: Kohei Yoshida <kyoshida at novell.com>
Date:   Thu Feb 17 15:30:42 2011 -0500

    Properly update column and row header selections. (fdo#34383)
    
    When making range selection by mouse, Calc wouldn't highlight the
    new range in the column and row headers.  It was because we weren't
    calling ScTabView::SelectionChanged() when the selection range
    is updated.  This SelectionChanged() call then puts in queue a
    re-paint request for column and row headers.

diff --git a/sc/source/ui/view/tabview2.cxx b/sc/source/ui/view/tabview2.cxx
index a42cb46..b9cb8be 100644
--- a/sc/source/ui/view/tabview2.cxx
+++ b/sc/source/ui/view/tabview2.cxx
@@ -394,6 +394,7 @@ void ScTabView::MarkCursor( SCCOL nCurX, SCROW nCurY, SCTAB nCurZ,
         }
 #endif
         UpdateSelectionOverlay();
+        SelectionChanged();
 
         nOldCurX = nCurX;
         nOldCurY = nCurY;


More information about the Libreoffice-commits mailing list