diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2013-05-31 16:33:40 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2013-05-31 18:11:29 +0200 |
commit | 779831307fe3da5f2226925972452c9aedeb67a8 (patch) | |
tree | a9a1e2f5937b823b477a93f2d7fd6ee7aa7a3051 /sc/source/filter | |
parent | 4e5e40e4c627775caf039870bcc28269a0d05937 (diff) |
Trivially merge ExcelFilterBase into ExcelFilter
Change-Id: I4c5080dd05ea7e00c56a820c8ce226c78d0a46b7
Diffstat (limited to 'sc/source/filter')
-rw-r--r-- | sc/source/filter/inc/excelfilter.hxx | 25 | ||||
-rw-r--r-- | sc/source/filter/oox/excelfilter.cxx | 48 | ||||
-rw-r--r-- | sc/source/filter/oox/workbookhelper.cxx | 8 |
3 files changed, 30 insertions, 51 deletions
diff --git a/sc/source/filter/inc/excelfilter.hxx b/sc/source/filter/inc/excelfilter.hxx index 6423996c92a9..5aa33104b6e0 100644 --- a/sc/source/filter/inc/excelfilter.hxx +++ b/sc/source/filter/inc/excelfilter.hxx @@ -29,24 +29,7 @@ class WorkbookGlobals; // ============================================================================ -class ExcelFilterBase -{ -public: - void registerWorkbookGlobals( WorkbookGlobals& rBookGlob ); - WorkbookGlobals& getWorkbookGlobals() const; - void unregisterWorkbookGlobals(); - -protected: - explicit ExcelFilterBase(); - virtual ~ExcelFilterBase(); - -private: - WorkbookGlobals* mpBookGlob; -}; - -// ============================================================================ - -class ExcelFilter : public ::oox::core::XmlFilterBase, public ExcelFilterBase +class ExcelFilter : public ::oox::core::XmlFilterBase { public: explicit ExcelFilter( @@ -54,6 +37,10 @@ public: throw( ::com::sun::star::uno::RuntimeException ); virtual ~ExcelFilter(); + void registerWorkbookGlobals( WorkbookGlobals& rBookGlob ); + WorkbookGlobals& getWorkbookGlobals() const; + void unregisterWorkbookGlobals(); + virtual bool importDocument() throw(); virtual bool exportDocument() throw(); @@ -68,6 +55,8 @@ private: virtual GraphicHelper* implCreateGraphicHelper() const; virtual ::oox::ole::VbaProject* implCreateVbaProject() const; virtual OUString implGetImplementationName() const; + + WorkbookGlobals* mpBookGlob; }; css::uno::Reference< css::uno::XInterface > SAL_CALL ExcelFilter_create( diff --git a/sc/source/filter/oox/excelfilter.cxx b/sc/source/filter/oox/excelfilter.cxx index 630e9d25d9ba..81ec4148e6b7 100644 --- a/sc/source/filter/oox/excelfilter.cxx +++ b/sc/source/filter/oox/excelfilter.cxx @@ -45,34 +45,6 @@ using ::oox::drawingml::table::TableStyleListPtr; // ============================================================================ -ExcelFilterBase::ExcelFilterBase() : - mpBookGlob( 0 ) -{ -} - -ExcelFilterBase::~ExcelFilterBase() -{ - OSL_ENSURE( !mpBookGlob, "ExcelFilterBase::~ExcelFilterBase - workbook data not cleared" ); -} - -void ExcelFilterBase::registerWorkbookGlobals( WorkbookGlobals& rBookGlob ) -{ - mpBookGlob = &rBookGlob; -} - -WorkbookGlobals& ExcelFilterBase::getWorkbookGlobals() const -{ - OSL_ENSURE( mpBookGlob, "ExcelFilterBase::getWorkbookGlobals - missing workbook data" ); - return *mpBookGlob; -} - -void ExcelFilterBase::unregisterWorkbookGlobals() -{ - mpBookGlob = 0; -} - -// ============================================================================ - OUString ExcelFilter_getImplementationName() { return OUString( "com.sun.star.comp.oox.xls.ExcelFilter" ); @@ -95,12 +67,30 @@ Reference< XInterface > ExcelFilter_create( // ---------------------------------------------------------------------------- ExcelFilter::ExcelFilter( const Reference< XComponentContext >& rxContext ) throw( RuntimeException ) : - XmlFilterBase( rxContext ) + XmlFilterBase( rxContext ), + mpBookGlob( 0 ) { } ExcelFilter::~ExcelFilter() { + OSL_ENSURE( !mpBookGlob, "ExcelFilter::~ExcelFilter - workbook data not cleared" ); +} + +void ExcelFilter::registerWorkbookGlobals( WorkbookGlobals& rBookGlob ) +{ + mpBookGlob = &rBookGlob; +} + +WorkbookGlobals& ExcelFilter::getWorkbookGlobals() const +{ + OSL_ENSURE( mpBookGlob, "ExcelFilter::getWorkbookGlobals - missing workbook data" ); + return *mpBookGlob; +} + +void ExcelFilter::unregisterWorkbookGlobals() +{ + mpBookGlob = 0; } bool ExcelFilter::importDocument() throw() diff --git a/sc/source/filter/oox/workbookhelper.cxx b/sc/source/filter/oox/workbookhelper.cxx index 6ab4ecab8450..51fd4266aafc 100644 --- a/sc/source/filter/oox/workbookhelper.cxx +++ b/sc/source/filter/oox/workbookhelper.cxx @@ -272,7 +272,7 @@ private: OUString maPageStyleServ; /// Service name for a page style. Reference< XSpreadsheetDocument > mxDoc; /// Document model. FilterBase& mrBaseFilter; /// Base filter object. - ExcelFilterBase& mrExcelBase; /// Base object for registration of this structure. + ExcelFilter& mrExcelFilter; /// Base object for registration of this structure. FilterType meFilterType; /// File type of the filter. ProgressBarPtr mxProgressBar; /// The progress bar. StorageRef mxVbaPrjStrg; /// Storage containing the VBA project. @@ -319,21 +319,21 @@ private: WorkbookGlobals::WorkbookGlobals( ExcelFilter& rFilter ) : mrBaseFilter( rFilter ), - mrExcelBase( rFilter ), + mrExcelFilter( rFilter ), meFilterType( FILTER_OOXML ), mpOoxFilter( &rFilter ), meBiff( BIFF_UNKNOWN ), mpDoc( NULL ) { // register at the filter, needed for virtual callbacks (even during construction) - mrExcelBase.registerWorkbookGlobals( *this ); + mrExcelFilter.registerWorkbookGlobals( *this ); initialize( true ); } WorkbookGlobals::~WorkbookGlobals() { finalize(); - mrExcelBase.unregisterWorkbookGlobals(); + mrExcelFilter.unregisterWorkbookGlobals(); } // document model ------------------------------------------------------------- |