summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sc/source/filter/excel/excdoc.cxx2
-rw-r--r--sc/source/filter/excel/excimp8.cxx6
-rw-r--r--sc/source/filter/excel/xestream.cxx15
-rw-r--r--sc/source/filter/inc/xestream.hxx3
4 files changed, 16 insertions, 10 deletions
diff --git a/sc/source/filter/excel/excdoc.cxx b/sc/source/filter/excel/excdoc.cxx
index 2cf2d8f580c0..ec0fc0b60b6e 100644
--- a/sc/source/filter/excel/excdoc.cxx
+++ b/sc/source/filter/excel/excdoc.cxx
@@ -791,7 +791,7 @@ void ExcDocument::WriteXml( SvStream& rStrm )
{
InitializeSave();
- XclExpXmlStream aStrm( ::comphelper::getProcessServiceFactory(), rStrm, GetRoot() );
+ XclExpXmlStream aStrm( ::comphelper::getProcessComponentContext(), rStrm, GetRoot() );
sax_fastparser::FSHelperPtr& rWorkbook = aStrm.GetCurrentStream();
rWorkbook->startElement( XML_workbook,
diff --git a/sc/source/filter/excel/excimp8.cxx b/sc/source/filter/excel/excimp8.cxx
index a61008014ed2..e5d220f0ba4b 100644
--- a/sc/source/filter/excel/excimp8.cxx
+++ b/sc/source/filter/excel/excimp8.cxx
@@ -323,11 +323,11 @@ void ImportExcel8::AttachDocumentEvents()
SfxObjectShell* pShell = GetDocShell();
if( HasBasic() && pShell )
{
- uno::Reference< lang::XMultiServiceFactory > xGlobalFactory = ::comphelper::getProcessServiceFactory();
+ uno::Reference< uno::XComponentContext > xContext = ::comphelper::getProcessComponentContext();
uno::Reference< sheet::XSpreadsheetDocument > xDocument( pShell->GetModel(), uno::UNO_QUERY );
- if( xGlobalFactory.is() && xDocument.is() )
+ if( xContext.is() && xDocument.is() )
{
- ::oox::xls::ExcelVbaProject aVbaProject( xGlobalFactory, xDocument );
+ ::oox::xls::ExcelVbaProject aVbaProject( xContext, xDocument );
aVbaProject.attachToEvents();
}
}
diff --git a/sc/source/filter/excel/xestream.cxx b/sc/source/filter/excel/xestream.cxx
index f828079c8735..4afd5f4ca722 100644
--- a/sc/source/filter/excel/xestream.cxx
+++ b/sc/source/filter/excel/xestream.cxx
@@ -46,6 +46,7 @@
#include "compiler.hxx"
#include <oox/core/tokens.hxx>
+#include <oox/xls/excelvbaproject.hxx>
#include <formula/grammar.hxx>
#define DEBUG_XL_ENCRYPTION 0
@@ -56,14 +57,13 @@ using ::com::sun::star::io::XStream;
using ::com::sun::star::lang::XComponent;
using ::com::sun::star::lang::XMultiServiceFactory;
using ::com::sun::star::lang::XServiceInfo;
-using ::com::sun::star::uno::Reference;
-using ::com::sun::star::uno::Sequence;
-using ::com::sun::star::uno::UNO_QUERY;
+using ::com::sun::star::sheet::XSpreadsheetDocument;
using ::rtl::OString;
using ::rtl::OUString;
using ::utl::OStreamWrapper;
using ::std::vector;
+using namespace ::com::sun::star::uno;
using namespace formula;
// ============================================================================
@@ -813,8 +813,8 @@ const char* XclXmlUtils::ToPsz( bool b )
// ============================================================================
-XclExpXmlStream::XclExpXmlStream( const Reference< XMultiServiceFactory >& rSMgr, SvStream& rStrm, const XclExpRoot& rRoot )
- : XmlFilterBase( rSMgr )
+XclExpXmlStream::XclExpXmlStream( const Reference< XComponentContext >& rxContext, SvStream& rStrm, const XclExpRoot& rRoot )
+ : XmlFilterBase( rxContext )
, mrRoot( rRoot )
{
Sequence< PropertyValue > aArgs( 1 );
@@ -1019,6 +1019,11 @@ bool XclExpXmlStream::exportDocument() throw()
return false;
}
+::oox::ole::VbaProject* XclExpXmlStream::implCreateVbaProject() const
+{
+ return new ::oox::xls::ExcelVbaProject( getComponentContext(), Reference< XSpreadsheetDocument >( getModel(), UNO_QUERY ) );
+}
+
::rtl::OUString XclExpXmlStream::implGetImplementationName() const
{
return CREATE_OUSTRING( "TODO" );
diff --git a/sc/source/filter/inc/xestream.hxx b/sc/source/filter/inc/xestream.hxx
index 3308827441dd..3f16fc602495 100644
--- a/sc/source/filter/inc/xestream.hxx
+++ b/sc/source/filter/inc/xestream.hxx
@@ -304,7 +304,7 @@ public:
class XclExpXmlStream : public oox::core::XmlFilterBase
{
public:
- XclExpXmlStream( const com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >& rSMgr, SvStream& rStrm, const XclExpRoot& rRoot );
+ XclExpXmlStream( const com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >& rxContext, SvStream& rStrm, const XclExpRoot& rRoot );
virtual ~XclExpXmlStream();
/** Returns the filter root data. */
@@ -340,6 +340,7 @@ public:
void Trace( const char* format, ...);
private:
+ virtual ::oox::ole::VbaProject* implCreateVbaProject() const;
virtual ::rtl::OUString implGetImplementationName() const;
typedef std::map< ::rtl::OUString,