From 8aa99f59a4ab4fba762c072b210620aa9f6a8ddd Mon Sep 17 00:00:00 2001 From: "Ocke Janssen [oj]" Date: Thu, 7 Jan 2010 09:16:59 +0100 Subject: [PATCH] check already quoted expression --- .../java/com/sun/star/report/SDBCReportDataFactory.java | 4 ++-- .../java/com/sun/star/report/pentaho/PentahoReportJob.java | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/reportbuilder/java/com/sun/star/report/SDBCReportDataFactory.java b/reportbuilder/java/com/sun/star/report/SDBCReportDataFactory.java index 5c3032e3a7f9..cbd215220bc9 100644 --- a/reportbuilder/java/com/sun/star/report/SDBCReportDataFactory.java +++ b/reportbuilder/java/com/sun/star/report/SDBCReportDataFactory.java @@ -210,7 +210,7 @@ public class SDBCReportDataFactory implements DataSourceFactory final Boolean escapeProcessing = (Boolean) parameters.get(ESCAPE_PROCESSING); final String filter = (String) parameters.get(UNO_FILTER); final Integer maxRows = (Integer) parameters.get("MaxRows"); - RowSetProperties rowSetProps = new RowSetProperties(escapeProcessing, commandType, command, filter, maxRows); + final RowSetProperties rowSetProps = new RowSetProperties(escapeProcessing, commandType, command, filter, maxRows); final Object[] p = createRowSet(rowSetProps, parameters); final XRowSet rowSet = (XRowSet) p[0]; @@ -260,7 +260,7 @@ public class SDBCReportDataFactory implements DataSourceFactory final Object[] pair = (Object[]) groupExpressions.get(i); String expression = (String) pair[0]; - if (columns.hasByName(expression)) + if (!expression.startsWith(quote) && columns.hasByName(expression)) { expression = quote + expression + quote; } diff --git a/reportbuilder/java/com/sun/star/report/pentaho/PentahoReportJob.java b/reportbuilder/java/com/sun/star/report/pentaho/PentahoReportJob.java index 23f959e05943..6641092ca6ee 100644 --- a/reportbuilder/java/com/sun/star/report/pentaho/PentahoReportJob.java +++ b/reportbuilder/java/com/sun/star/report/pentaho/PentahoReportJob.java @@ -257,6 +257,11 @@ public class PentahoReportJob implements ReportJob if (parameters.length > 0) { String name = parameters[0].toString(); + if (parameters[0] instanceof ContextLookup) + { + final ContextLookup context = (ContextLookup) parameters[0]; + name = context.getName(); + } for (int j = 0; j < reportFunctions.length; j++) { if (reportFunctions[j] instanceof FormulaExpression)