diff options
author | Muthu Subramanian <sumuthu@suse.com> | 2013-07-18 14:04:32 +0530 |
---|---|---|
committer | Muthu Subramanian <sumuthu@suse.com> | 2013-07-18 14:06:07 +0530 |
commit | 675a50a26390fc7c98c107ec6728ccfdc32ec5c0 (patch) | |
tree | d86c113012f10f7e273c3bcfa64e0e30f6df2afe /sc | |
parent | 8bb2c7f1556c10508c8ac451c579539ccf5dacfb (diff) |
n#819822: XLSX Chart import with internal data table.
When the import with xlsx ranges fail - try with
internal data table.
Ported from: 7da06efd74be6500895bab6e5e8ed485914ff45e
and: da4ec594da45210a1f97d31ecb3e7f9c127954e5
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/filter/inc/excelfilter.hxx | 1 | ||||
-rw-r--r-- | sc/source/filter/inc/workbookhelper.hxx | 4 | ||||
-rw-r--r-- | sc/source/filter/oox/excelfilter.cxx | 5 | ||||
-rw-r--r-- | sc/source/filter/oox/workbookhelper.cxx | 21 |
4 files changed, 27 insertions, 4 deletions
diff --git a/sc/source/filter/inc/excelfilter.hxx b/sc/source/filter/inc/excelfilter.hxx index 5e826bd3e4a9..057c036ce214 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 a4265dcd8169..f183593856db 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" @@ -143,6 +144,7 @@ public: void setCurrentSheetIndex( sal_Int16 nSheet ); /** Final conversion after importing the workbook. */ void finalizeWorkbookImport(); + void useInternalChartDataTable( bool bInternal ); // document model --------------------------------------------------------- ScDocument& getScDocument() const; @@ -246,7 +248,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 dfddf86f1567..c3415f0b2782 100644 --- a/sc/source/filter/oox/excelfilter.cxx +++ b/sc/source/filter/oox/excelfilter.cxx @@ -158,6 +158,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 c3c2fbb2c3ee..252ee0c5003b 100644 --- a/sc/source/filter/oox/workbookhelper.cxx +++ b/sc/source/filter/oox/workbookhelper.cxx @@ -170,6 +170,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 ---------------------------------------------------------------- @@ -210,7 +212,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; } @@ -253,7 +255,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; @@ -496,6 +498,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 -------------------------------------------------------------------- @@ -872,11 +882,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(); |