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


Hello,

this patch solves the problem that shared formulas are not imported
correctly from xlsx. The cell containing the shared formula displayed =#Name
because the range name that is internally used is global but the formula
compiler thought it is local. We have a second independent issue here that
needs some more investigation. Except for the base cell no cell contains
formulas, only the value. As much as I see now this is a more complex
problem and needs some more debugging.

The situation is already better than in our 3.4.1 release. I hope I get the
second problem fixed for 3.4.2 too.

I think this patch should be included into 3.4 and 3.4.2 because it prevents
data loss.

Regards,
Markus
From 1ee0adcf59a5a757acf39bdc37e5b95af917f884 Mon Sep 17 00:00:00 2001
From: Markus Mohrhard <markus.mohrhard@googlemail.com>
Date: Tue, 12 Jul 2011 01:51:46 +0200
Subject: [PATCH] fix for fdo#39023: shared formulas are not imported correctly

---
 oox/source/xls/formulaparser.cxx |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/oox/source/xls/formulaparser.cxx b/oox/source/xls/formulaparser.cxx
index 2d919a6..429bc13 100644
--- a/oox/source/xls/formulaparser.cxx
+++ b/oox/source/xls/formulaparser.cxx
@@ -32,6 +32,7 @@
 #include <com/sun/star/sheet/ComplexReference.hpp>
 #include <com/sun/star/sheet/ExternalReference.hpp>
 #include <com/sun/star/sheet/FormulaToken.hpp>
+#include <com/sun/star/sheet/NameToken.hpp>
 #include <com/sun/star/sheet/ReferenceFlags.hpp>
 #include <com/sun/star/sheet/SingleReference.hpp>
 #include "oox/core/filterbase.hxx"
@@ -2798,7 +2799,10 @@ void FormulaParser::convertNameToFormula( FormulaContext& rContext, 
sal_Int32 nT
     {
         ApiTokenSequence aTokens( 1 );
         aTokens[ 0 ].OpCode = OPCODE_NAME;
-        aTokens[ 0 ].Data <<= nTokenIndex;
+        NameToken aNameTokenData;
+        aNameTokenData.Global = sal_True;
+        aNameTokenData.Index= nTokenIndex;
+        aTokens[ 0 ].Data <<= aNameTokenData;
         mxImpl->setFormula( rContext, aTokens );
     }
     else
-- 
1.7.3.4


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.