[Libreoffice-commits] core.git: sw/qa sw/source

László Németh (via logerrit) logerrit at kemper.freedesktop.org
Sat Apr 17 21:08:41 UTC 2021


 sw/qa/uitest/styleInspector/styleInspector.py         |   18 ++++++++++--------
 sw/source/uibase/sidebar/WriterInspectorTextPanel.cxx |    3 +++
 2 files changed, 13 insertions(+), 8 deletions(-)

New commits:
commit 11a4e270450089238c4ec6fc8548a98c0999edfe
Author:     László Németh <nemeth at numbertext.org>
AuthorDate: Sat Apr 17 14:12:26 2021 +0200
Commit:     László Németh <nemeth at numbertext.org>
CommitDate: Sat Apr 17 23:08:00 2021 +0200

    tdf#30709 sw Style Inspector: show metadata xml:id
    
    Follow-up of commit dd45df62d217db59be3f515b6c7e1bfd17ec4350
    "tdf#30709 sw: show RDF metadata in Style Inspector".
    
    Change-Id: Id488f268e3c2d668680735f2092eddb252966cd5
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114224
    Tested-by: Jenkins
    Reviewed-by: László Németh <nemeth at numbertext.org>

diff --git a/sw/qa/uitest/styleInspector/styleInspector.py b/sw/qa/uitest/styleInspector/styleInspector.py
index d26c21f2a9ed..a869df19baa3 100644
--- a/sw/qa/uitest/styleInspector/styleInspector.py
+++ b/sw/qa/uitest/styleInspector/styleInspector.py
@@ -159,10 +159,11 @@ class styleNavigator(UITestCase):
         self.assertEqual("Metadata Reference", get_state_as_dict(xParDirFormatting.getChild('0'))['Text'])
 
         xMetadata = xParDirFormatting.getChild('0')
-        self.assertEqual(3, len(xMetadata.getChildren()))
-        self.assertEqual("http://www.w3.org/1999/02/22-rdf-syntax-ns#type\tParagraph", get_state_as_dict(xMetadata.getChild('0'))['Text'])
-        self.assertEqual("http://www.w3.org/2000/01/rdf-schema#comment\tAbout this paragraph...", get_state_as_dict(xMetadata.getChild('1'))['Text'])
-        self.assertEqual("http://www.w3.org/2000/01/rdf-schema#label\tAnnotated paragraph", get_state_as_dict(xMetadata.getChild('2'))['Text'])
+        self.assertEqual(4, len(xMetadata.getChildren()))
+        self.assertEqual("xml:id\tpara1", get_state_as_dict(xMetadata.getChild('0'))['Text'])
+        self.assertEqual("http://www.w3.org/1999/02/22-rdf-syntax-ns#type\tParagraph", get_state_as_dict(xMetadata.getChild('1'))['Text'])
+        self.assertEqual("http://www.w3.org/2000/01/rdf-schema#comment\tAbout this paragraph...", get_state_as_dict(xMetadata.getChild('2'))['Text'])
+        self.assertEqual("http://www.w3.org/2000/01/rdf-schema#label\tAnnotated paragraph", get_state_as_dict(xMetadata.getChild('3'))['Text'])
 
         self.xUITest.executeCommand(".uno:GoDown")
         # FIXME jump over the control character (not visible in getString(), but it affects
@@ -176,10 +177,11 @@ class styleNavigator(UITestCase):
         self.assertEqual("Nested Text Content\tAnnotated text range", get_state_as_dict(xDirFormatting.getChild('1'))['Text'])
 
         xMetadata = xDirFormatting.getChild('0')
-        self.assertEqual(3, len(xMetadata.getChildren()))
-        self.assertEqual("http://www.w3.org/1999/02/22-rdf-syntax-ns#type\tText span", get_state_as_dict(xMetadata.getChild('0'))['Text'])
-        self.assertEqual("http://www.w3.org/2000/01/rdf-schema#comment\tComment...", get_state_as_dict(xMetadata.getChild('1'))['Text'])
-        self.assertEqual("http://www.w3.org/2000/01/rdf-schema#label\tAnnotated paragraph portion", get_state_as_dict(xMetadata.getChild('2'))['Text'])
+        self.assertEqual(4, len(xMetadata.getChildren()))
+        self.assertEqual("xml:id\tid2758386667", get_state_as_dict(xMetadata.getChild('0'))['Text'])
+        self.assertEqual("http://www.w3.org/1999/02/22-rdf-syntax-ns#type\tText span", get_state_as_dict(xMetadata.getChild('1'))['Text'])
+        self.assertEqual("http://www.w3.org/2000/01/rdf-schema#comment\tComment...", get_state_as_dict(xMetadata.getChild('2'))['Text'])
+        self.assertEqual("http://www.w3.org/2000/01/rdf-schema#label\tAnnotated paragraph portion", get_state_as_dict(xMetadata.getChild('3'))['Text'])
 
         self.assertEqual(0, len(xListBox.getChild('1').getChildren()))
         self.assertEqual(0, len(xListBox.getChild('2').getChildren()))
diff --git a/sw/source/uibase/sidebar/WriterInspectorTextPanel.cxx b/sw/source/uibase/sidebar/WriterInspectorTextPanel.cxx
index f1d23ad05ad7..cac18dab66e0 100644
--- a/sw/source/uibase/sidebar/WriterInspectorTextPanel.cxx
+++ b/sw/source/uibase/sidebar/WriterInspectorTextPanel.cxx
@@ -391,6 +391,9 @@ static void MetadataToTreeNode(const css::uno::Reference<css::uno::XInterface>&
         aCurNode.sNodeName = PropertyNametoRID("MetadataReference");
         aCurNode.NodeType = svx::sidebar::TreeNode::ComplexProperty;
 
+        aCurNode.children.push_back(
+            SimplePropToTreeNode("xml:id", uno::makeAny(xMeta->getMetadataReference().Second)));
+
         // list associated (predicate, object) pairs of the actual subject
         // under the tree node "Metadata Reference"
         SwDocShell* pDocSh = static_cast<SwDocShell*>(SfxObjectShell::Current());


More information about the Libreoffice-commits mailing list