diff options
Diffstat (limited to 'svx/source/tbxctrls')
-rw-r--r-- | svx/source/tbxctrls/StylesPreviewToolBoxControl.cxx | 15 | ||||
-rw-r--r-- | svx/source/tbxctrls/tbcontrl.cxx | 5 |
2 files changed, 12 insertions, 8 deletions
diff --git a/svx/source/tbxctrls/StylesPreviewToolBoxControl.cxx b/svx/source/tbxctrls/StylesPreviewToolBoxControl.cxx index 5496f4d4ae9a..a15d81f01be8 100644 --- a/svx/source/tbxctrls/StylesPreviewToolBoxControl.cxx +++ b/svx/source/tbxctrls/StylesPreviewToolBoxControl.cxx @@ -101,13 +101,16 @@ void StylesPreviewToolBoxControl::InitializeStyles( if (xCellStyles->hasByName(sStyleName)) { css::uno::Reference<css::beans::XPropertySet> xStyle( - xCellStyles->getByName(sStyleName), css::uno::UNO_QUERY_THROW); - OUString sName; - xStyle->getPropertyValue(u"DisplayName"_ustr) >>= sName; - if (!sName.isEmpty()) + xCellStyles->getByName(sStyleName), css::uno::UNO_QUERY); + if (xStyle) { - m_aDefaultStyles.push_back( - std::pair<OUString, OUString>(sStyleName, sName)); + OUString sName; + xStyle->getPropertyValue(u"DisplayName"_ustr) >>= sName; + if (!sName.isEmpty()) + { + m_aDefaultStyles.push_back( + std::pair<OUString, OUString>(sStyleName, sName)); + } } } } diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx index 95631463bd21..31e0fdc3f109 100644 --- a/svx/source/tbxctrls/tbcontrl.cxx +++ b/svx/source/tbxctrls/tbcontrl.cxx @@ -2832,8 +2832,9 @@ SvxLineWindow_Impl::SvxLineWindow_Impl(SvxFrameToolBoxControl* pControl, weld::W { try { - Reference< lang::XServiceInfo > xServices(m_xFrame->getController()->getModel(), UNO_QUERY_THROW); - m_bIsWriter = xServices->supportsService(u"com.sun.star.text.TextDocument"_ustr); + Reference< lang::XServiceInfo > xServices(m_xFrame->getController()->getModel(), UNO_QUERY); + if (xServices) + m_bIsWriter = xServices->supportsService(u"com.sun.star.text.TextDocument"_ustr); } catch(const uno::Exception& ) { |