[Libreoffice-commits] core.git: Branch 'libreoffice-5-2' - include/oox oox/source sc/source
Justin Luth
justin_luth at sil.org
Sat Oct 29 16:45:21 UTC 2016
include/oox/ole/vbaproject.hxx | 6 +++---
oox/source/ole/vbaproject.cxx | 5 ++---
sc/source/filter/oox/workbookfragment.cxx | 3 +++
3 files changed, 8 insertions(+), 6 deletions(-)
New commits:
commit 255c751c48955b56b96e1cf945b800ee4c1c917c
Author: Justin Luth <justin_luth at sil.org>
Date: Thu Oct 27 19:31:50 2016 +0300
tdf#63846 assign macros after VBA project fully loaded.
fixes regression caused by d4743045a0b320449d07a957463a76bb8b13f939.
see the documentation for VbaMacroAttacherBase, which indicates that
the macros are to be attached after all objects are finished loading.
Made attachMacros() public so it could be called separately since so
many things are inter-dependent in the logic flow.
Reviewed-on: https://gerrit.libreoffice.org/30337
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Justin Luth <justin_luth at sil.org>
Reviewed-by: Markus Mohrhard <markus.mohrhard at googlemail.com>
Conflicts:
oox/source/ole/vbaproject.cxx
Change-Id: I11f7f4a1a75d6f77a97e12e3359d6ea8a995f518
Reviewed-on: https://gerrit.libreoffice.org/30371
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Justin Luth <justin_luth at sil.org>
Reviewed-by: Markus Mohrhard <markus.mohrhard at googlemail.com>
diff --git a/include/oox/ole/vbaproject.hxx b/include/oox/ole/vbaproject.hxx
index ea7ffcc..cc9763c 100644
--- a/include/oox/ole/vbaproject.hxx
+++ b/include/oox/ole/vbaproject.hxx
@@ -139,6 +139,9 @@ public:
VbaMacroAttacherBase class. */
void registerMacroAttacher( const VbaMacroAttacherRef& rxAttacher );
+ /** Attaches VBA macros to objects registered via registerMacroAttacher(). */
+ void attachMacros();
+
/** Returns true, if the document contains at least one code module. */
bool hasModules() const;
@@ -178,9 +181,6 @@ private:
const GraphicHelper& rGraphicHelper,
bool bDefaultColorBgr );
- /** Attaches VBA macros to objects registered via registerMacroAttacher(). */
- void attachMacros();
-
/** Copies the entire VBA project storage to the passed document model. */
void copyStorage( StorageBase& rVbaPrjStrg );
diff --git a/oox/source/ole/vbaproject.cxx b/oox/source/ole/vbaproject.cxx
index 7aa47ce..9ac4bff 100644
--- a/oox/source/ole/vbaproject.cxx
+++ b/oox/source/ole/vbaproject.cxx
@@ -253,6 +253,8 @@ void VbaProject::importVba( StorageBase& rVbaPrjStrg, const GraphicHelper& rGrap
{
readVbaModules( rVbaPrjStrg );
importModulesAndForms(rVbaPrjStrg, rGraphicHelper, bDefaultColorBgr );
+ // attach macros to registered objects
+ attachMacros();
}
void VbaProject::readVbaModules( StorageBase& rVbaPrjStrg )
@@ -502,9 +504,6 @@ void VbaProject::importModulesAndForms( StorageBase& rVbaPrjStrg, const GraphicH
}
}
}
-
- // attach macros to registered objects
- attachMacros();
}
void VbaProject::attachMacros()
diff --git a/sc/source/filter/oox/workbookfragment.cxx b/sc/source/filter/oox/workbookfragment.cxx
index 6e6e101..32510db 100644
--- a/sc/source/filter/oox/workbookfragment.cxx
+++ b/sc/source/filter/oox/workbookfragment.cxx
@@ -522,6 +522,9 @@ void WorkbookFragment::finalizeImport()
rtl::Reference<oox::core::FragmentHandler> xFragment(new RevisionHeadersFragment(*this, aRevHeadersPath));
importOoxFragment(xFragment, *xParser);
}
+
+ // attach macros to registered objects now that all objects have been created.
+ getBaseFilter().getVbaProject().attachMacros();
}
namespace {
More information about the Libreoffice-commits
mailing list