summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2018-03-26 09:32:14 +0100
committerAndras Timar <andras.timar@collabora.com>2018-04-07 13:26:39 +0200
commit4f90b5c2c0b7a6070ea5390b91cee08f8b711419 (patch)
tree9e6bcd73dbc7f3bd81256774eec87c0b1287b835
parent66013b9f6144ff2b4d3610598334e19c83a95390 (diff)
forcepoint #31 survive missing control model
Change-Id: I37e4af560b46b4f6d9e0b87fe58493818f366d3c Reviewed-on: https://gerrit.libreoffice.org/51878 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Stahl <Michael.Stahl@cib.de> (cherry picked from commit d98cfa4df4e6f7391b7790c625c1f8a650514e88)
-rw-r--r--oox/source/ole/vbacontrol.cxx10
1 files changed, 8 insertions, 2 deletions
diff --git a/oox/source/ole/vbacontrol.cxx b/oox/source/ole/vbacontrol.cxx
index 805bb2d7a504..e6f0d14b99da 100644
--- a/oox/source/ole/vbacontrol.cxx
+++ b/oox/source/ole/vbacontrol.cxx
@@ -431,7 +431,13 @@ void VbaFormControl::importStorage( StorageBase& rStrg, const AxClassTable& rCla
for ( ; it != it_end; ++it )
{
- if ( (*it)->mxCtrlModel->getControlType() == API_CONTROL_PAGE )
+ auto& elem = (*it)->mxCtrlModel;
+ if (!elem)
+ {
+ SAL_WARN("oox", "empty control model");
+ continue;
+ }
+ if (elem->getControlType() == API_CONTROL_PAGE)
{
VbaSiteModelRef xPageSiteRef = (*it)->mxSiteModel;
if ( xPageSiteRef.get() )
@@ -439,7 +445,7 @@ void VbaFormControl::importStorage( StorageBase& rStrg, const AxClassTable& rCla
}
else
{
- AxTabStripModel* pTabStrip = static_cast<AxTabStripModel*> ( (*it)->mxCtrlModel.get() );
+ AxTabStripModel* pTabStrip = static_cast<AxTabStripModel*>(elem.get());
sCaptions = pTabStrip->maItems;
pMultiPage->mnActiveTab = pTabStrip->mnListIndex;
pMultiPage->mnTabStyle = pTabStrip->mnTabStyle;