[Libreoffice-commits] core.git: sfx2/source
Stephan Bergmann
sbergman at redhat.com
Fri Jun 20 08:28:23 PDT 2014
sfx2/source/doc/sfxbasemodel.cxx | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
New commits:
commit 12a4b8122227ca0527c282842fe30fa73a390500
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Fri Jun 20 17:22:50 2014 +0200
Missing null check
As Kendy found out, "In Writer: Enable the drawing functions [view -> toolbars
-> drawing], choose 'Line Callout 1' among the presets Callouts [to the left
from the stars], and attempt to click and drag in the document to insert it"
triggers assert in SvRef<T>::operator* introduced in
160ae9889e4d16217a7cca7d930f776f5a645ec8 "Catch illegal null pointer
dereferences early."
Given how most places in sfx2/source/doc/sfxbasemodel.cxx already check for null
m_pObjectShell, looks like this had just been missing here, and the
SfxDocInfoListener_Impl's modified has probably never been called, so it went
unnoticed that its m_rShell was a "null reference."
Change-Id: I6b6dad831938d5fa89340895b98797686b60c5cc
diff --git a/sfx2/source/doc/sfxbasemodel.cxx b/sfx2/source/doc/sfxbasemodel.cxx
index 15a76db..19dd94c 100644
--- a/sfx2/source/doc/sfxbasemodel.cxx
+++ b/sfx2/source/doc/sfxbasemodel.cxx
@@ -821,9 +821,12 @@ IMPL_SfxBaseModel_DataContainer::impl_setDocumentProperties(
const Reference< document::XDocumentProperties >& rxNewDocProps)
{
m_xDocumentProperties.set(rxNewDocProps, UNO_QUERY_THROW);
- Reference<util::XModifyBroadcaster> const xMB(m_xDocumentProperties,
- UNO_QUERY_THROW);
- xMB->addModifyListener(new SfxDocInfoListener_Impl(*m_pObjectShell));
+ if (m_pObjectShell.Is())
+ {
+ Reference<util::XModifyBroadcaster> const xMB(
+ m_xDocumentProperties, UNO_QUERY_THROW);
+ xMB->addModifyListener(new SfxDocInfoListener_Impl(*m_pObjectShell));
+ }
}
// document::XDocumentPropertiesSupplier:
More information about the Libreoffice-commits
mailing list