From f63fda8c8194b9bc55d548d57fe3ede0dd0c5edd Mon Sep 17 00:00:00 2001 From: Jason Height Date: Sat, 26 Aug 2006 08:52:24 +0000 Subject: [PATCH] Forgot to reset shared formula option during conversion git-svn-id: https://svn.apache.org/repos/asf/jakarta/poi/trunk@437128 13f79535-47bb-0310-9956-ffa450edef68 --- src/java/org/apache/poi/hssf/record/FormulaRecord.java | 6 +++++- .../org/apache/poi/hssf/record/SharedFormulaRecord.java | 2 ++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/java/org/apache/poi/hssf/record/FormulaRecord.java b/src/java/org/apache/poi/hssf/record/FormulaRecord.java index 1b9428da8c..bddd4e4db0 100644 --- a/src/java/org/apache/poi/hssf/record/FormulaRecord.java +++ b/src/java/org/apache/poi/hssf/record/FormulaRecord.java @@ -195,12 +195,16 @@ public class FormulaRecord public short getOptions() { return field_5_options; - } + } public boolean isSharedFormula() { return sharedFormula.isSet(field_5_options); } + public void setSharedFormula(boolean flag) { + sharedFormula.setBoolean(field_5_options, flag); + } + /** * get the length (in number of tokens) of the expression * @return expression length diff --git a/src/java/org/apache/poi/hssf/record/SharedFormulaRecord.java b/src/java/org/apache/poi/hssf/record/SharedFormulaRecord.java index b74284eb46..8f52760e9a 100755 --- a/src/java/org/apache/poi/hssf/record/SharedFormulaRecord.java +++ b/src/java/org/apache/poi/hssf/record/SharedFormulaRecord.java @@ -254,6 +254,8 @@ public class SharedFormulaRecord newPtgStack.add(ptg); } formula.setParsedExpression(newPtgStack); + //Now its not shared! + formula.setSharedFormula(false); } else { throw new RuntimeException("Shared Formula Conversion: Coding Error"); } -- 2.39.5