diff options
author | Shivam Kumar Singh <shivamhere247@gmail.com> | 2020-07-15 16:24:52 +0530 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2020-07-15 15:46:11 +0200 |
commit | 8f121c1a9d5583e187f5468fc197c92e4c019f16 (patch) | |
tree | 67d3a4d7b143746e10645f1d2b13a6f4881a6fe3 /sw | |
parent | 7870fc222ab9833ab1f7af0633e18c1afaa40119 (diff) |
tdf#134816 Crash when using a parentless style other than DPS
Change-Id: I2da764a50c7018eb28a63dd47c2c4e2c2975bdb1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98816
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Tested-by: Jenkins
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/uibase/sidebar/WriterInspectorTextPanel.cxx | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/sw/source/uibase/sidebar/WriterInspectorTextPanel.cxx b/sw/source/uibase/sidebar/WriterInspectorTextPanel.cxx index 5273a6a022d1..83c48c41815a 100644 --- a/sw/source/uibase/sidebar/WriterInspectorTextPanel.cxx +++ b/sw/source/uibase/sidebar/WriterInspectorTextPanel.cxx @@ -193,7 +193,7 @@ static void UpdateTree(SwDocShell* pDocSh, std::vector<svx::sidebar::TreeNode>& xStyleFamily.set(xStyleFamilies->getByName("ParagraphStyles"), uno::UNO_QUERY_THROW); - while (true) + while (!sCurrentParaStyle.isEmpty()) { uno::Reference<style::XStyle> xPropertiesStyle(xStyleFamily->getByName(sCurrentParaStyle), uno::UNO_QUERY_THROW); @@ -205,12 +205,10 @@ static void UpdateTree(SwDocShell* pDocSh, std::vector<svx::sidebar::TreeNode>& svx::sidebar::TreeNode pCurrentChild; pCurrentChild.sNodeName = sDisplayName; - const bool bStandardStyle = sCurrentParaStyle == "Standard"; // Last Parent Style - for (const beans::Property& rProperty : std::as_const(aProperties)) { OUString sPropName = rProperty.Name; - if (bStandardStyle + if (aParentParaStyle.isEmpty() // root of style hierarchy || xPropertiesState->getPropertyState(sPropName) == beans::PropertyState_DIRECT_VALUE) { @@ -232,8 +230,6 @@ static void UpdateTree(SwDocShell* pDocSh, std::vector<svx::sidebar::TreeNode>& pParaNode.children.push_back(pCurrentChild); sCurrentParaStyle = aParentParaStyle; - if (bStandardStyle) - break; } std::reverse(pParaNode.children.begin(), |