summaryrefslogtreecommitdiff
path: root/oox/source
diff options
context:
space:
mode:
authorNoel Power <noel.power@novell.com>2011-09-05 10:45:21 +0100
committerNoel Power <noel.power@novell.com>2011-09-05 10:46:10 +0100
commit8be4261608251630017f88faae0fbf696016a96a (patch)
tree095936e00ccc5da66a0fd366dc510f1f45e8b88c /oox/source
parent9ced6d79edc66f7b2d5376ee9507e69126a0dcb7 (diff)
access oox vbaproject import directly
Diffstat (limited to 'oox/source')
-rw-r--r--oox/source/ole/vbaproject.cxx18
1 files changed, 18 insertions, 0 deletions
diff --git a/oox/source/ole/vbaproject.cxx b/oox/source/ole/vbaproject.cxx
index 8e5d2eb42427..1173783a36a0 100644
--- a/oox/source/ole/vbaproject.cxx
+++ b/oox/source/ole/vbaproject.cxx
@@ -168,6 +168,24 @@ VbaProject::~VbaProject()
{
}
+
+void VbaProject::importVbaProject( StorageBase& rVbaPrjStrg )
+{
+ // create GraphicHelper
+ Reference< ::com::sun::star::frame::XFrame > xFrame;
+ if ( mxDocModel.is() )
+ {
+ Reference< ::com::sun::star::frame::XController > xController = mxDocModel->getCurrentController();
+ xFrame = xController.is() ? xController->getFrame() : NULL;
+ }
+ StorageRef noStorage;
+ // if the GraphicHelper tries to use noStorage it will of course crash
+ // but.. this shouldn't happen as there is no reason for GraphicHelper
+ // to do that when importing VBA projects
+ GraphicHelper grfHlp( mxContext, xFrame, noStorage );
+ importVbaProject( rVbaPrjStrg, grfHlp );
+}
+
void VbaProject::importVbaProject( StorageBase& rVbaPrjStrg, const GraphicHelper& rGraphicHelper, bool bDefaultColorBgr )
{
if( rVbaPrjStrg.isStorage() )