[Libreoffice-commits] .: oox/inc oox/source sw/source

Noel Power noelp at kemper.freedesktop.org
Tue Sep 6 09:32:24 PDT 2011


 oox/inc/oox/ole/vbaproject.hxx  |    2 +-
 oox/source/ole/vbaproject.cxx   |    4 +++-
 sw/source/filter/ww8/ww8par.cxx |    2 +-
 3 files changed, 5 insertions(+), 3 deletions(-)

New commits:
commit c3db5332558d35adc8374836fd17025220e73180
Author: Noel Power <noel.power at novell.com>
Date:   Tue Sep 6 17:32:53 2011 +0100

    make sure we can detect if vba code was imported

diff --git a/oox/inc/oox/ole/vbaproject.hxx b/oox/inc/oox/ole/vbaproject.hxx
index 91f399d..ca6c8ad 100644
--- a/oox/inc/oox/ole/vbaproject.hxx
+++ b/oox/inc/oox/ole/vbaproject.hxx
@@ -131,7 +131,7 @@ public:
                             const GraphicHelper& rGraphicHelper,
                             bool bDefaultColorBgr = true );
 
-    void                importVbaProject(
+    bool                importVbaProject(
                             StorageBase& rVbaPrjStrg );
 
     /** Registers a macro atatcher object. For details, see description of the
diff --git a/oox/source/ole/vbaproject.cxx b/oox/source/ole/vbaproject.cxx
index 1173783..3685c2d 100644
--- a/oox/source/ole/vbaproject.cxx
+++ b/oox/source/ole/vbaproject.cxx
@@ -169,7 +169,7 @@ VbaProject::~VbaProject()
 }
 
 
-void VbaProject::importVbaProject( StorageBase& rVbaPrjStrg )
+bool VbaProject::importVbaProject( StorageBase& rVbaPrjStrg )
 {
    // create GraphicHelper
    Reference< ::com::sun::star::frame::XFrame > xFrame;
@@ -184,6 +184,8 @@ void VbaProject::importVbaProject( StorageBase& rVbaPrjStrg )
    // to do that when importing VBA projects
    GraphicHelper grfHlp( mxContext, xFrame, noStorage );
    importVbaProject( rVbaPrjStrg, grfHlp );
+   // return true if something has been imported
+   return hasModules() || hasDialogs();
 }
 
 void VbaProject::importVbaProject( StorageBase& rVbaPrjStrg, const GraphicHelper& rGraphicHelper, bool bDefaultColorBgr )
diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx
index c708a2c..7ebd722 100644
--- a/sw/source/filter/ww8/ww8par.cxx
+++ b/sw/source/filter/ww8/ww8par.cxx
@@ -208,7 +208,7 @@ bool BasicProjImportHelper::import( const uno::Reference< io::XInputStream >& rx
         if ( vbaStg.get() )
         {
             oox::ole::VbaProject aVbaPrj( mxCtx, mrDocShell.GetModel(), CREATE_CONST_ASC( "Writer") );
-            aVbaPrj.importVbaProject( *vbaStg );
+            bRet = aVbaPrj.importVbaProject( *vbaStg );
         }
     }
     catch( const uno::Exception& )


More information about the Libreoffice-commits mailing list