summaryrefslogtreecommitdiff
path: root/sw/source/uibase/sidebar
diff options
context:
space:
mode:
authorAron Budea <aron.budea@collabora.com>2020-09-19 02:11:25 +0200
committerMike Kaganski <mike.kaganski@collabora.com>2020-09-19 23:00:09 +0200
commitbb369dd4f372f606a9a63ecefbd1c7d3b725cd02 (patch)
tree3c397b558d13c46287d9f114560a3a6bf11668f5 /sw/source/uibase/sidebar
parent5f3f17a9c64e33fb787a79dc94d902147da77d71 (diff)
tdf#135115: show paragraph direct formatting in Styles Inspector
Change-Id: I2300dadeb87870fe800d533d80ec4bbf5211b894 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103028 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'sw/source/uibase/sidebar')
-rw-r--r--sw/source/uibase/sidebar/WriterInspectorTextPanel.cxx31
1 files changed, 25 insertions, 6 deletions
diff --git a/sw/source/uibase/sidebar/WriterInspectorTextPanel.cxx b/sw/source/uibase/sidebar/WriterInspectorTextPanel.cxx
index 8ea4fda5e213..589cec4a967c 100644
--- a/sw/source/uibase/sidebar/WriterInspectorTextPanel.cxx
+++ b/sw/source/uibase/sidebar/WriterInspectorTextPanel.cxx
@@ -425,25 +425,35 @@ static void UpdateTree(SwDocShell* pDocSh, std::vector<svx::sidebar::TreeNode>&
svx::sidebar::TreeNode aDFNode;
svx::sidebar::TreeNode aCharNode;
svx::sidebar::TreeNode aParaNode;
+ svx::sidebar::TreeNode aParaDFNode;
aDFNode.sNodeName = "Direct Formatting";
aCharNode.sNodeName = "Character Styles";
aParaNode.sNodeName = "Paragraph Styles";
+ aParaDFNode.sNodeName = "Paragraph Direct Formatting";
aDFNode.NodeType = svx::sidebar::TreeNode::Category;
aCharNode.NodeType = svx::sidebar::TreeNode::Category;
aParaNode.NodeType = svx::sidebar::TreeNode::Category;
+ aParaDFNode.NodeType = svx::sidebar::TreeNode::Category;
uno::Reference<text::XTextRange> xRange(
SwXTextRange::CreateXTextRange(*pDoc, *pCursor->GetPoint(), nullptr));
uno::Reference<beans::XPropertySet> xPropertiesSet(xRange, uno::UNO_QUERY_THROW);
std::unordered_map<OUString, bool> aIsDefined;
- InsertValues(xRange, aIsDefined, aDFNode, false,
- { UNO_NAME_RSID, UNO_NAME_PARA_IS_NUMBERING_RESTART, UNO_NAME_PARA_STYLE_NAME,
- UNO_NAME_PARA_CONDITIONAL_STYLE_NAME, UNO_NAME_PAGE_STYLE_NAME,
- UNO_NAME_NUMBERING_START_VALUE, UNO_NAME_NUMBERING_IS_NUMBER,
- UNO_NAME_PARA_CONTINUEING_PREVIOUS_SUB_TREE, UNO_NAME_CHAR_STYLE_NAME,
- UNO_NAME_NUMBERING_LEVEL });
+ const std::vector<OUString> aHiddenProperties{ UNO_NAME_RSID,
+ UNO_NAME_PARA_IS_NUMBERING_RESTART,
+ UNO_NAME_PARA_STYLE_NAME,
+ UNO_NAME_PARA_CONDITIONAL_STYLE_NAME,
+ UNO_NAME_PAGE_STYLE_NAME,
+ UNO_NAME_NUMBERING_START_VALUE,
+ UNO_NAME_NUMBERING_IS_NUMBER,
+ UNO_NAME_PARA_CONTINUEING_PREVIOUS_SUB_TREE,
+ UNO_NAME_CHAR_STYLE_NAME,
+ UNO_NAME_NUMBERING_LEVEL,
+ UNO_NAME_PARRSID };
+
+ InsertValues(xRange, aIsDefined, aDFNode, false, aHiddenProperties);
uno::Reference<style::XStyleFamiliesSupplier> xStyleFamiliesSupplier(pDocSh->GetBaseModel(),
uno::UNO_QUERY);
@@ -469,6 +479,13 @@ static void UpdateTree(SwDocShell* pDocSh, std::vector<svx::sidebar::TreeNode>&
aCharNode.children.push_back(aCurrentChild);
}
+ // 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);
+
xStyleFamily.set(xStyleFamilies->getByName("ParagraphStyles"), uno::UNO_QUERY_THROW);
while (!sCurrentParaStyle.isEmpty())
@@ -494,10 +511,12 @@ static void UpdateTree(SwDocShell* pDocSh, std::vector<svx::sidebar::TreeNode>&
/*
Display Order :-
PARAGRAPH STYLE
+ PARAGRAPH DIRECT FORMATTING
CHARACTER STYLE
DIRECT FORMATTING
*/
aStore.push_back(aParaNode);
+ aStore.push_back(aParaDFNode);
aStore.push_back(aCharNode);
aStore.push_back(aDFNode);
}