summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorMuthu Subramanian <sumuthu@suse.com>2013-07-09 13:31:16 +0530
committerAndras Timar <andras.timar@collabora.com>2013-10-17 11:13:42 +0200
commit4db2664536d5d442775f05c4e013f04405b13150 (patch)
tree025db7ec165a23cdb7982ad8b63901100c717eb2 /sc
parente3af0e4f7d3d4921cc984bf00416de4ceda3dc97 (diff)
n#819822: XLSX Chart import with internal data table.
When the import with xlsx ranges fail - try with internal data table.
Diffstat (limited to 'sc')
-rw-r--r--sc/source/filter/inc/excelfilter.hxx1
-rw-r--r--sc/source/filter/inc/workbookhelper.hxx4
-rw-r--r--sc/source/filter/oox/excelfilter.cxx5
-rw-r--r--sc/source/filter/oox/workbookhelper.cxx21
4 files changed, 27 insertions, 4 deletions
diff --git a/sc/source/filter/inc/excelfilter.hxx b/sc/source/filter/inc/excelfilter.hxx
index fc108c311f09..de7d6df55795 100644
--- a/sc/source/filter/inc/excelfilter.hxx
+++ b/sc/source/filter/inc/excelfilter.hxx
@@ -61,6 +61,7 @@ public:
virtual ::oox::vml::Drawing* getVmlDrawing();
virtual const ::oox::drawingml::table::TableStyleListPtr getTableStyles();
virtual ::oox::drawingml::chart::ChartConverter* getChartConverter();
+ virtual void useInternalChartDataTable( bool bInternal );
virtual sal_Bool SAL_CALL filter( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& rDescriptor ) throw( ::com::sun::star::uno::RuntimeException );
diff --git a/sc/source/filter/inc/workbookhelper.hxx b/sc/source/filter/inc/workbookhelper.hxx
index fa1ce19529b6..f4ce1cc1e37c 100644
--- a/sc/source/filter/inc/workbookhelper.hxx
+++ b/sc/source/filter/inc/workbookhelper.hxx
@@ -23,6 +23,7 @@
#include <boost/shared_ptr.hpp>
#include <rtl/ref.hxx>
#include "oox/helper/storagebase.hxx"
+#include "oox/drawingml/chart/chartconverter.hxx"
#include "biffhelper.hxx"
#include "rangenam.hxx"
@@ -144,6 +145,7 @@ public:
void setCurrentSheetIndex( sal_Int16 nSheet );
/** Final conversion after importing the workbook. */
void finalizeWorkbookImport();
+ void useInternalChartDataTable( bool bInternal );
// document model ---------------------------------------------------------
ScDocument& getScDocument() const;
@@ -248,7 +250,7 @@ public:
/** Returns the converter for string to cell address/range conversion. */
AddressConverter& getAddressConverter() const;
/** Returns the chart object converter. */
- ExcelChartConverter* getChartConverter() const;
+ oox::drawingml::chart::ChartConverter* getChartConverter() const;
/** Returns the page and print settings converter. */
PageSettingsConverter& getPageSettingsConverter() const;
diff --git a/sc/source/filter/oox/excelfilter.cxx b/sc/source/filter/oox/excelfilter.cxx
index b54d09cedd92..333e3a51e4ac 100644
--- a/sc/source/filter/oox/excelfilter.cxx
+++ b/sc/source/filter/oox/excelfilter.cxx
@@ -157,6 +157,11 @@ const TableStyleListPtr ExcelFilter::getTableStyles()
return WorkbookHelper( getWorkbookGlobals() ).getChartConverter();
}
+void ExcelFilter::useInternalChartDataTable( bool bInternal )
+{
+ return WorkbookHelper( getWorkbookGlobals() ).useInternalChartDataTable( bInternal );
+}
+
GraphicHelper* ExcelFilter::implCreateGraphicHelper() const
{
return new ExcelGraphicHelper( getWorkbookGlobals() );
diff --git a/sc/source/filter/oox/workbookhelper.cxx b/sc/source/filter/oox/workbookhelper.cxx
index 09c6947c1477..8a180ebf8d1d 100644
--- a/sc/source/filter/oox/workbookhelper.cxx
+++ b/sc/source/filter/oox/workbookhelper.cxx
@@ -178,6 +178,8 @@ public:
Reference< XDatabaseRange > createUnnamedDatabaseRangeObject( const CellRangeAddress& rRangeAddr ) const;
/** Creates and returns a com.sun.star.style.Style object for cells or pages. */
Reference< XStyle > createStyleObject( OUString& orStyleName, bool bPageStyle ) const;
+ /** Helper to switch chart data table - specifically for xlsx imports */
+ void useInternalChartDataTable( bool bInternal );
// buffers ----------------------------------------------------------------
@@ -218,7 +220,7 @@ public:
/** Returns the converter for string to cell address/range conversion. */
inline AddressConverter& getAddressConverter() const { return *mxAddrConverter; }
/** Returns the chart object converter. */
- inline ExcelChartConverter* getChartConverter() const { return mxChartConverter.get(); }
+ inline oox::drawingml::chart::ChartConverter* getChartConverter() const { return mxChartConverter.get(); }
/** Returns the page/print settings converter. */
inline PageSettingsConverter& getPageSettingsConverter() const { return *mxPageSettConverter; }
@@ -262,7 +264,7 @@ private:
typedef ::std::auto_ptr< FormulaParser > FormulaParserPtr;
typedef ::std::auto_ptr< UnitConverter > UnitConvPtr;
typedef ::std::auto_ptr< AddressConverter > AddressConvPtr;
- typedef ::std::auto_ptr< ExcelChartConverter > ExcelChartConvPtr;
+ typedef ::std::auto_ptr< oox::drawingml::chart::ChartConverter > ExcelChartConvPtr;
typedef ::std::auto_ptr< PageSettingsConverter > PageSettConvPtr;
typedef ::std::auto_ptr< BiffCodecHelper > BiffCodecHelperPtr;
@@ -507,6 +509,14 @@ Reference< XStyle > WorkbookGlobals::createStyleObject( OUString& orStyleName, b
return xStyle;
}
+void WorkbookGlobals::useInternalChartDataTable( bool bInternal )
+{
+ if( bInternal )
+ mxChartConverter.reset( new oox::drawingml::chart::ChartConverter() );
+ else
+ mxChartConverter.reset( new ExcelChartConverter( *this ) );
+}
+
// BIFF specific --------------------------------------------------------------
// private --------------------------------------------------------------------
@@ -897,11 +907,16 @@ AddressConverter& WorkbookHelper::getAddressConverter() const
return mrBookGlob.getAddressConverter();
}
-ExcelChartConverter* WorkbookHelper::getChartConverter() const
+oox::drawingml::chart::ChartConverter* WorkbookHelper::getChartConverter() const
{
return mrBookGlob.getChartConverter();
}
+void WorkbookHelper::useInternalChartDataTable( bool bInternal )
+{
+ mrBookGlob.useInternalChartDataTable( bInternal );
+}
+
PageSettingsConverter& WorkbookHelper::getPageSettingsConverter() const
{
return mrBookGlob.getPageSettingsConverter();