sw/source/core/access/AccessibilityCheck.cxx | 10 +++--- sw/source/uibase/sidebar/WriterInspectorTextPanel.cxx | 30 +++++++++--------- 2 files changed, 20 insertions(+), 20 deletions(-)
New commits: commit 9e65a20996a8e5dca794a3813ac548bb7333c474 Author: Noel Grandin <[email protected]> AuthorDate: Mon Dec 1 10:52:04 2025 +0200 Commit: Noel Grandin <[email protected]> CommitDate: Mon Dec 1 17:05:15 2025 +0100 use more concrete UNO in AccessibilityCheck Change-Id: Ib9ff6ef19e9192107ec9ad5b4a8d0409796aeb4a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/194861 Tested-by: Jenkins Reviewed-by: Noel Grandin <[email protected]> diff --git a/sw/source/core/access/AccessibilityCheck.cxx b/sw/source/core/access/AccessibilityCheck.cxx index 7488f03237ab..80b4a59b5d21 100644 --- a/sw/source/core/access/AccessibilityCheck.cxx +++ b/sw/source/core/access/AccessibilityCheck.cxx @@ -54,6 +54,7 @@ #include <svl/fstathelper.hxx> #include <osl/file.h> #include <unotxdoc.hxx> +#include <unostyle.hxx> namespace sw { @@ -2647,16 +2648,15 @@ public: rtl::Reference<SwXTextDocument> xDoc = pDocShell->GetBaseModel(); if (!xDoc) return; - uno::Reference<container::XNameAccess> xStyleFamilies = xDoc->getStyleFamilies(); - uno::Reference<container::XNameAccess> xStyleFamily( - xStyleFamilies->getByName(u"PageStyles"_ustr), uno::UNO_QUERY); + rtl::Reference<SwXStyleFamilies> xStyleFamilies = xDoc->getSwStyleFamilies(); + rtl::Reference<SwXStyleFamily> xStyleFamily = xStyleFamilies->GetPageStyles(); if (!xStyleFamily.is()) return; const uno::Sequence<OUString> xStyleFamilyNames = xStyleFamily->getElementNames(); for (const OUString& rStyleFamilyName : xStyleFamilyNames) { - uno::Reference<beans::XPropertySet> xPropertySet( - xStyleFamily->getByName(rStyleFamilyName), uno::UNO_QUERY); + rtl::Reference<SwXBaseStyle> xPropertySet( + xStyleFamily->getStyleByName(rStyleFamilyName)); if (!xPropertySet.is()) continue; auto aFillStyleContainer = xPropertySet->getPropertyValue(u"FillStyle"_ustr); commit 13bb98da960f64b50c946e1c72e9a6bd5e1fff4e Author: Noel Grandin <[email protected]> AuthorDate: Mon Dec 1 10:48:23 2025 +0200 Commit: Noel Grandin <[email protected]> CommitDate: Mon Dec 1 17:05:05 2025 +0100 use more concrete UNO in WriterInspectorTextPanel Change-Id: I25c7eed251f310c225dd5aa79c1227ba2bb57cac Reviewed-on: https://gerrit.libreoffice.org/c/core/+/194860 Tested-by: Jenkins Reviewed-by: Noel Grandin <[email protected]> diff --git a/sw/source/uibase/sidebar/WriterInspectorTextPanel.cxx b/sw/source/uibase/sidebar/WriterInspectorTextPanel.cxx index 0a56541db974..45cb68790b87 100644 --- a/sw/source/uibase/sidebar/WriterInspectorTextPanel.cxx +++ b/sw/source/uibase/sidebar/WriterInspectorTextPanel.cxx @@ -50,6 +50,8 @@ #include <rdfhelper.hxx> #include <unotxdoc.hxx> #include <unobookmark.hxx> +#include <unostyle.hxx> +#include <unoxstyle.hxx> namespace sw::sidebar { @@ -603,25 +605,24 @@ static void UpdateTree(SwDocShell& rDocSh, const SwEditShell& rEditSh, aHiddenProperties, aFieldsNode); rtl::Reference<SwXTextDocument> pSwTextDocument(rDocSh.GetBaseModel()); - uno::Reference<container::XNameAccess> xStyleFamilies = pSwTextDocument->getStyleFamilies(); + rtl::Reference<SwXStyleFamilies> xStyleFamilies = pSwTextDocument->getSwStyleFamilies(); OUString sCurrentCharStyle, sCurrentParaStyle, sDisplayName; - uno::Reference<container::XNameAccess> xStyleFamily( - xStyleFamilies->getByName(u"CharacterStyles"_ustr), uno::UNO_QUERY_THROW); + rtl::Reference<SwXStyleFamily> xStyleFamily = xStyleFamilies->GetCharacterStyles(); xRange->getPropertyValue(u"CharStyleName"_ustr) >>= sCurrentCharStyle; xRange->getPropertyValue(u"ParaStyleName"_ustr) >>= sCurrentParaStyle; if (!sCurrentCharStyle.isEmpty()) { - uno::Reference<beans::XPropertySet> xPropertiesSet( - xStyleFamily->getByName(sCurrentCharStyle), css::uno::UNO_QUERY_THROW); + rtl::Reference<SwXBaseStyle> xPropertiesSet + = xStyleFamily->getStyleByName(sCurrentCharStyle); xPropertiesSet->getPropertyValue(u"DisplayName"_ustr) >>= sDisplayName; svx::sidebar::TreeNode aCurrentChild; aCurrentChild.sNodeName = sDisplayName; aCurrentChild.NodeType = svx::sidebar::TreeNode::ComplexProperty; - InsertValues(xPropertiesSet, aIsDefined, aCurrentChild, false, aHiddenCharacterProperties, - aFieldsNode); + InsertValues(cppu::getXWeak(xPropertiesSet.get()), aIsDefined, aCurrentChild, false, + aHiddenCharacterProperties, aFieldsNode); aCharNode.children.push_back(std::move(aCurrentChild)); } @@ -637,22 +638,21 @@ static void UpdateTree(SwDocShell& rDocSh, const SwEditShell& rEditSh, aFieldsNode); } - xStyleFamily.set(xStyleFamilies->getByName(u"ParagraphStyles"_ustr), uno::UNO_QUERY_THROW); + xStyleFamily = xStyleFamilies->GetParagraphStyles(); while (!sCurrentParaStyle.isEmpty()) { - uno::Reference<style::XStyle> xPropertiesStyle(xStyleFamily->getByName(sCurrentParaStyle), - uno::UNO_QUERY_THROW); - uno::Reference<beans::XPropertySet> xPropertiesSet(xPropertiesStyle, - css::uno::UNO_QUERY_THROW); - xPropertiesSet->getPropertyValue(u"DisplayName"_ustr) >>= sDisplayName; + rtl::Reference<SwXStyle> xPropertiesStyle( + xStyleFamily->getParagraphStyleByName(sCurrentParaStyle)); + xPropertiesStyle->getPropertyValue(u"DisplayName"_ustr) >>= sDisplayName; OUString aParentParaStyle = xPropertiesStyle->getParentStyle(); svx::sidebar::TreeNode aCurrentChild; aCurrentChild.sNodeName = sDisplayName; aCurrentChild.NodeType = svx::sidebar::TreeNode::ComplexProperty; - InsertValues(xPropertiesSet, aIsDefined, aCurrentChild, aParentParaStyle.isEmpty(), - aHiddenCharacterProperties, aFieldsNode); + InsertValues(uno::Reference<beans::XPropertySet>(xPropertiesStyle), aIsDefined, + aCurrentChild, aParentParaStyle.isEmpty(), aHiddenCharacterProperties, + aFieldsNode); aParaNode.children.push_back(std::move(aCurrentChild)); sCurrentParaStyle = aParentParaStyle;
