diff options
author | Andreas Bregas <ab@openoffice.org> | 2001-03-02 14:56:48 +0000 |
---|---|---|
committer | Andreas Bregas <ab@openoffice.org> | 2001-03-02 14:56:48 +0000 |
commit | ea68094b747825af71d23c75f8402cf2004c9e94 (patch) | |
tree | 84c737f1db4199e4709d022985fea5fdc218abf7 /xmlscript | |
parent | eace5d7406c933f4c602aa78c190c6f9c00f9b4b (diff) |
listbox/combobox: Check if _popup is NULL
Diffstat (limited to 'xmlscript')
-rw-r--r-- | xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx | 34 |
1 files changed, 19 insertions, 15 deletions
diff --git a/xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx b/xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx index f55faf446dcc..563fdf10d8ae 100644 --- a/xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx +++ b/xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx @@ -2,9 +2,9 @@ * * $RCSfile: xmldlg_impmodels.cxx,v $ * - * $Revision: 1.8 $ + * $Revision: 1.9 $ * - * last change: $Author: dbo $ $Date: 2001-03-01 11:52:05 $ + * last change: $Author: ab $ $Date: 2001-03-02 15:56:48 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -1058,12 +1058,14 @@ void MenuListElement::endElement() OUString( RTL_CONSTASCII_USTRINGPARAM("linecount") ), _xAttributes ); - MenuPopupElement * p = static_cast< MenuPopupElement * >( _popup.get() ); - xControlModel->setPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM("StringItemList") ), - makeAny( p->getItemValues() ) ); - xControlModel->setPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM("SelectedItems") ), - makeAny( p->getSelectedItems() ) ); - + if (_popup.is()) + { + MenuPopupElement * p = static_cast< MenuPopupElement * >( _popup.get() ); + xControlModel->setPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM("StringItemList") ), + makeAny( p->getItemValues() ) ); + xControlModel->setPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM("SelectedItems") ), + makeAny( p->getSelectedItems() ) ); + } ctx.importEvents( _events ); } @@ -1139,14 +1141,16 @@ void ComboBoxElement::endElement() OUString( RTL_CONSTASCII_USTRINGPARAM("linecount") ), _xAttributes ); - MenuPopupElement * p = static_cast< MenuPopupElement * >( _popup.get() ); - xControlModel->setPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM("StringItemList") ), - makeAny( p->getItemValues() ) ); - - ctx.importStringProperty( OUString( RTL_CONSTASCII_USTRINGPARAM("Text") ), - OUString( RTL_CONSTASCII_USTRINGPARAM("value") ), - _xAttributes ); + if (_popup.is()) + { + MenuPopupElement * p = static_cast< MenuPopupElement * >( _popup.get() ); + xControlModel->setPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM("StringItemList") ), + makeAny( p->getItemValues() ) ); + ctx.importStringProperty( OUString( RTL_CONSTASCII_USTRINGPARAM("Text") ), + OUString( RTL_CONSTASCII_USTRINGPARAM("value") ), + _xAttributes ); + } ctx.importEvents( _events ); } |