Date: prev next · Thread: first prev next last
2013 Archives by date, by thread · List index


Hi,

I have submitted a patch for review:

    https://gerrit.libreoffice.org/1683

To pull it, you can do:

    git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/83/1683/1

for error value in matrix force recalc, fdo#59293

Change-Id: I202526bb3cf6e0f6c55913b44a15694e0794e273
---
M sc/source/filter/xml/xmlcelli.cxx
1 file changed, 28 insertions(+), 6 deletions(-)



diff --git a/sc/source/filter/xml/xmlcelli.cxx b/sc/source/filter/xml/xmlcelli.cxx
index bdf5748..6e73782 100644
--- a/sc/source/filter/xml/xmlcelli.cxx
+++ b/sc/source/filter/xml/xmlcelli.cxx
@@ -736,7 +736,7 @@
             pFCell->SetHybridDouble(fValue);
             pFCell->ResetDirty();
         }
-
+        pFCell->StartListeningTo(rXMLImport.GetDocument());
         // Leave the cell dirty when the cached result is not given.
     }
 }
@@ -754,15 +754,36 @@
         if ( bDoIncrement )
         {
             ScFormulaCell* pFCell = static_cast<ScFormulaCell*>(pCell);
+            OUString aCellString;
             if (pOUTextValue && !pOUTextValue->isEmpty())
-                pFCell->SetHybridString( *pOUTextValue );
+                aCellString = *pOUTextValue;
             else if (pOUTextContent && !pOUTextContent->isEmpty())
-                pFCell->SetHybridString( *pOUTextContent );
+                aCellString = *pOUTextContent;
             else if ( nCurrentCol > 0 && pOUText && !pOUText->isEmpty() )
-                pFCell->SetHybridString( *pOUText );
+                aCellString = *pOUText;
             else
                 bDoIncrement = false;
-            pFCell->ResetDirty();
+
+            if(!aCellString.isEmpty())
+            {
+                if (bDoIncrement && !GetScImport().IsFormulaErrorConstant(aCellString))
+                {
+                    pFCell->SetHybridString( aCellString );
+                    pFCell->ResetDirty();
+                }
+                else
+                {
+                    ScAddress aTopLeftMatrixCell;
+                    if(pFCell->GetMatrixOrigin(aTopLeftMatrixCell))
+                    {
+                        ScBaseCell* pMatrixCell = rXMLImport.GetDocument()->GetCell( 
aTopLeftMatrixCell );
+                        static_cast<ScFormulaCell*>(pMatrixCell)->SetDirty();
+                    }
+                    else
+                        SAL_WARN("sc", "matrix cell without matrix");
+                }
+            }
+            pFCell->StartListeningTo(rXMLImport.GetDocument());
         }
     }
     else //regular text cells
@@ -800,6 +821,7 @@
             ScFormulaCell* pFCell = static_cast<ScFormulaCell*>(pCell);
             SetFormulaCell(pFCell);
         }
+
     }
     else  //regular value cell
     {
@@ -1036,7 +1058,6 @@
             pNewCell = new ScFormulaCell( pDoc, rCellPos, pCode.get(), eGrammar, MM_NONE );
 
             ScFormulaCell* pFCell = static_cast<ScFormulaCell*>(pNewCell);
-            pFCell->StartListeningTo(pDoc);
             SetFormulaCell(pFCell);
         }
         else if ( aText[0] == '\'' && aText.getLength() > 1 )
@@ -1105,6 +1126,7 @@
                         nMatrixCols, nMatrixRows, pMat, new formula::FormulaDoubleToken(fValue));
                     pFCell->ResetDirty();
                 }
+                pFCell->StartListeningTo(rXMLImport.GetDocument());
             }
         }
         else

-- 
To view, visit https://gerrit.libreoffice.org/1683
To unsubscribe, visit https://gerrit.libreoffice.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I202526bb3cf6e0f6c55913b44a15694e0794e273
Gerrit-PatchSet: 1
Gerrit-Project: core
Gerrit-Branch: libreoffice-4-0
Gerrit-Owner: Markus Mohrhard <markus.mohrhard@googlemail.com>


Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.