diff options
author | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2017-07-10 13:30:38 +0200 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2017-07-10 13:39:57 +0200 |
commit | 38936ae9ab79fc6d46ef91695034cdeec1cc6486 (patch) | |
tree | ce60ee174d025de26548be4c4216557ae36efa39 /sd/source | |
parent | 5bb46252cc89b82d9579eb15068e6f01fb06f737 (diff) |
sd: fix unitialized "pItem" pointer in SlideBackground::SlideBackground
/sd/source/ui/sidebar/SlideBackground.cxx:176:17: runtime error:
downcast of misaligned address 0x00009cf8cd67 for type 'const
SvxSizeItem', which requires 8 byte alignment
(regression from fba28df77d7e98663d1cf77ac206f8799fce4108)
Change-Id: I822efe57f35c851b6f63e1e5489ab2448a19963d
Reviewed-on: https://gerrit.libreoffice.org/39753
Reviewed-by: Michael Stahl <mstahl@redhat.com>
Tested-by: Michael Stahl <mstahl@redhat.com>
Diffstat (limited to 'sd/source')
-rw-r--r-- | sd/source/ui/sidebar/SlideBackground.cxx | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/sd/source/ui/sidebar/SlideBackground.cxx b/sd/source/ui/sidebar/SlideBackground.cxx index 2c881f2a4acb..5011f7a58c01 100644 --- a/sd/source/ui/sidebar/SlideBackground.cxx +++ b/sd/source/ui/sidebar/SlideBackground.cxx @@ -168,13 +168,15 @@ SlideBackground::SlideBackground( get(m_pTopMarginEdit, "top"); get(m_pBottomMarginEdit, "bottom"); - const SfxPoolItem* pItem; - const SvxSizeItem* pSize = nullptr; if ( SfxViewFrame::Current() ) { + const SfxPoolItem* pItem = nullptr; SfxViewFrame::Current()->GetBindings().GetDispatcher()->QueryState( SID_ATTR_PAGE_SIZE, pItem ); - pSize = static_cast<const SvxSizeItem*>( pItem ); - m_aPageSize = pSize->GetSize(); + if (pItem) + { + const SvxSizeItem* pSize = static_cast<const SvxSizeItem*>( pItem ); + m_aPageSize = pSize->GetSize(); + } } SetFieldUnit( *m_pTopMarginEdit, meFieldUnit ); SetFieldUnit( *m_pBottomMarginEdit, meFieldUnit ); |