From f02029cece3bd78440d5f46decc648c2abcdbd94 Mon Sep 17 00:00:00 2001 From: Kurt Zenker Date: Mon, 5 May 2008 12:41:48 +0000 Subject: INTEGRATION: CWS dba30beta (1.4.6); FILE MERGED 2008/04/22 10:30:25 oj 1.4.6.1: #i88503# merge changes from rptchart02 --- .../com/sun/star/report/pentaho/SOReportJobFactory.java | 17 +++++++++++++---- .../com/sun/star/report/pentaho/StarReportData.java | 10 +++++----- 2 files changed, 18 insertions(+), 9 deletions(-) (limited to 'reportdesign') diff --git a/reportdesign/java/com/sun/star/report/pentaho/SOReportJobFactory.java b/reportdesign/java/com/sun/star/report/pentaho/SOReportJobFactory.java index 93f42d374a9a..5951e952839b 100644 --- a/reportdesign/java/com/sun/star/report/pentaho/SOReportJobFactory.java +++ b/reportdesign/java/com/sun/star/report/pentaho/SOReportJobFactory.java @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: SOReportJobFactory.java,v $ - * $Revision: 1.4 $ + * $Revision: 1.5 $ * * This file is part of OpenOffice.org. * @@ -86,12 +86,12 @@ public class SOReportJobFactory */ private static final String __serviceName = "com.sun.star.report.pentaho.SOReportJobFactory"; - private PropertySetMixin m_prophlp; + private final PropertySetMixin m_prophlp; /** * The initial component contextr, that gives access to the service manager, supported singletons, ... It's * often later used */ - private XComponentContext m_cmpCtx; + private final XComponentContext m_cmpCtx; private XConnection activeConnection; private XReportDefinition report; @@ -233,9 +233,18 @@ public class SOReportJobFactory } mimetype = report.getMimeType(); } + else + { + XPropertySet set = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, rowSet); + if ( set == null ) + { + throw new com.sun.star.lang.IllegalArgumentException(); + } + activeConnection = (XConnection) UnoRuntime.queryInterface(XConnection.class,set.getPropertyValue("ActiveConnection")); + } if (mimetype == null) { - mimetype = "application/vnd.oasis.opendocument.text"; + mimetype = PentahoReportEngineMetaData.OPENDOCUMENT_TEXT; } final DataSourceFactory dataFactory = new SDBCReportDataFactory(m_cmpCtx, activeConnection); diff --git a/reportdesign/java/com/sun/star/report/pentaho/StarReportData.java b/reportdesign/java/com/sun/star/report/pentaho/StarReportData.java index 831983947ebd..7d65f881ec6c 100644 --- a/reportdesign/java/com/sun/star/report/pentaho/StarReportData.java +++ b/reportdesign/java/com/sun/star/report/pentaho/StarReportData.java @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: StarReportData.java,v $ - * $Revision: 1.4 $ + * $Revision: 1.5 $ * * This file is part of OpenOffice.org. * @@ -36,9 +36,9 @@ import org.jfree.report.ReportData; public class StarReportData implements ReportData { - private DataSource dataSource; + private final DataSource dataSource; private int currentRow; - private int rowCount; + private final int rowCount; public StarReportData(final DataSource dataSource) throws com.sun.star.report.DataSourceException @@ -56,7 +56,7 @@ public class StarReportData implements ReportData { try { - boolean ret = dataSource.absolute(row); + final boolean ret = dataSource.absolute(row); if (ret) { currentRow = row; @@ -122,7 +122,7 @@ public class StarReportData implements ReportData public Object get(final int column) throws DataSourceException { - if (isReadable() == false) + if (!isReadable()) { throw new DataSourceException("Failed to query column."); } -- cgit v1.2.3