summaryrefslogtreecommitdiff
path: root/desktop
diff options
context:
space:
mode:
authorHenry Castro <hcastro@collabora.com>2018-02-13 20:54:05 -0400
committerAron Budea <aron.budea@collabora.com>2018-02-14 14:51:56 +0100
commit0df89c0fdaaff10272fb74b196ade0bcc9ea1ff6 (patch)
treef8f0aaf71cdaef0221dd2aff290d2292d7e8a688 /desktop
parent41db188ded84e1d3b5a56513663c4b8ad28d4f0f (diff)
lok: check if an element exists in the container
Change-Id: I5987e90d92a2ebff654a993fb77e389bd036a8f8 Reviewed-on: https://gerrit.libreoffice.org/49693 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Henry Castro <hcastro@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/49712 Reviewed-by: Aron Budea <aron.budea@collabora.com> Tested-by: Aron Budea <aron.budea@collabora.com>
Diffstat (limited to 'desktop')
-rw-r--r--desktop/source/lib/init.cxx5
1 files changed, 3 insertions, 2 deletions
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 2598da695e0a..eafdf21f88ce 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -2819,11 +2819,12 @@ static char* getStyles(LibreOfficeKitDocument* pThis, const char* pCommand)
OUString sName;
bool bIsPhysical;
boost::property_tree::ptree aChild;
- uno::Reference<beans::XPropertySet> xProperty;
boost::property_tree::ptree aChildren;
+ const OUString sPageStyles("PageStyles");
+ uno::Reference<beans::XPropertySet> xProperty;
uno::Reference<container::XNameContainer> xContainer;
- if (xStyleFamilies->getByName("PageStyles") >>= xContainer)
+ if (xStyleFamilies->hasByName(sPageStyles) && (xStyleFamilies->getByName(sPageStyles) >>= xContainer))
{
uno::Sequence<OUString> aSeqNames = xContainer->getElementNames();
for (sal_Int32 itName = 0; itName < aSeqNames.getLength(); itName++)