summaryrefslogtreecommitdiff
path: root/svx/source/tbxctrls/StylesPreviewToolBoxControl.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'svx/source/tbxctrls/StylesPreviewToolBoxControl.cxx')
-rw-r--r--svx/source/tbxctrls/StylesPreviewToolBoxControl.cxx15
1 files changed, 9 insertions, 6 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));
+ }
}
}
}