tdf#137105: crash in table with Style Inspector active
xParaEnum->nextElement() is not an XTextRange then, it'd be
an XTextTable. Since the Style Inspector doesn't support
inspecting table properties, yet, simply avoid that case.
Change-Id: I4ae211713433ccc30d397c04f6cbf7f1f4d1f9e7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104327
Tested-by: Jenkins
Reviewed-by: Aron Budea <aron.budea@collabora.com>
diff --git a/sw/source/uibase/sidebar/WriterInspectorTextPanel.cxx b/sw/source/uibase/sidebar/WriterInspectorTextPanel.cxx
index d7b3990..6dfaf8c 100644
--- a/sw/source/uibase/sidebar/WriterInspectorTextPanel.cxx
+++ b/sw/source/uibase/sidebar/WriterInspectorTextPanel.cxx
@@ -500,9 +500,9 @@ static void UpdateTree(SwDocShell* pDocSh, std::vector<svx::sidebar::TreeNode>&
// Collect paragraph direct formatting
uno::Reference<container::XEnumerationAccess> xParaEnumAccess(xRange, uno::UNO_QUERY_THROW);
uno::Reference<container::XEnumeration> xParaEnum = xParaEnumAccess->createEnumeration();
uno::Reference<text::XTextRange> xThisParagraphRange(xParaEnum->nextElement(),
uno::UNO_QUERY_THROW);
InsertValues(xThisParagraphRange, aIsDefined, aParaDFNode, false, aHiddenProperties);
uno::Reference<text::XTextRange> xThisParagraphRange(xParaEnum->nextElement(), uno::UNO_QUERY);
if (xThisParagraphRange.is())
InsertValues(xThisParagraphRange, aIsDefined, aParaDFNode, false, aHiddenProperties);
xStyleFamily.set(xStyleFamilies->getByName("ParagraphStyles"), uno::UNO_QUERY_THROW);