From 510361e19b2e8f0955795a6007c0baf8cbafc9cd Mon Sep 17 00:00:00 2001 From: "Ocke Janssen [oj]" Date: Wed, 25 Nov 2009 10:12:45 +0100 Subject: dba33d: #i104712# qurtal expression fixed --- .../sun/star/report/pentaho/PentahoReportJob.java | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) (limited to 'reportbuilder/java') diff --git a/reportbuilder/java/com/sun/star/report/pentaho/PentahoReportJob.java b/reportbuilder/java/com/sun/star/report/pentaho/PentahoReportJob.java index fbfa211e112c..23f959e05943 100644 --- a/reportbuilder/java/com/sun/star/report/pentaho/PentahoReportJob.java +++ b/reportbuilder/java/com/sun/star/report/pentaho/PentahoReportJob.java @@ -265,18 +265,22 @@ public class PentahoReportJob implements ReportJob if (reportExp.getName().equals(name)) { - final LValue val = parser.parse(reportExp.getFormulaExpression()); - if (val instanceof FormulaFunction) + LValue val = parser.parse(reportExp.getFormulaExpression()); + while( !(val instanceof ContextLookup)) { - final FormulaFunction reportFunction = (FormulaFunction) val; - - final ContextLookup context = (ContextLookup) reportFunction.getChildValues()[0]; - name = context.getName(); + if (val instanceof Term) + { + val = ((Term)val).getHeadValue(); + } + else if (val instanceof FormulaFunction) + { + final FormulaFunction reportFunction = (FormulaFunction) val; + val = reportFunction.getChildValues()[0]; + } } - else if (val instanceof Term) + if (val instanceof ContextLookup) { - final Term term = (Term) val; - final ContextLookup context = (ContextLookup) term.getHeadValue().getChildValues()[0]; + final ContextLookup context = (ContextLookup) val; name = context.getName(); } break; -- cgit