summaryrefslogtreecommitdiff
path: root/xmloff
diff options
context:
space:
mode:
authorGökay Şatır <gokaysatir@gmail.com>2023-09-01 14:14:37 +0300
committerMiklos Vajna <vmiklos@collabora.com>2023-09-05 14:21:41 +0200
commit18187c3aaf7280c01b7768d51e4588156412f554 (patch)
treeb27248090b16d45f12208fad96b9be5aa322adbe /xmloff
parentd849504f6d4b9f4b169b2848588cc890a29ac8f9 (diff)
Added test case to comment property test.
Signed-off-by: Gökay Şatır <gokaysatir@gmail.com> Change-Id: I033f6574b4875fcb76b16c8b5b9d9f7d55b52cbe Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156406 Tested-by: Miklos Vajna <vmiklos@collabora.com> Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Diffstat (limited to 'xmloff')
-rw-r--r--xmloff/qa/unit/text.cxx6
1 files changed, 5 insertions, 1 deletions
diff --git a/xmloff/qa/unit/text.cxx b/xmloff/qa/unit/text.cxx
index ab8a28448701..202a69819bdf 100644
--- a/xmloff/qa/unit/text.cxx
+++ b/xmloff/qa/unit/text.cxx
@@ -55,7 +55,7 @@ CPPUNIT_TEST_FIXTURE(XmloffStyleTest, testMailMergeInEditeng)
loadFromURL(u"mail-merge-editeng.odt");
}
-CPPUNIT_TEST_FIXTURE(XmloffStyleTest, testCommentResolved)
+CPPUNIT_TEST_FIXTURE(XmloffStyleTest, testCommentProperty)
{
mxComponent = loadFromDesktop("private:factory/swriter");
uno::Sequence<beans::PropertyValue> aCommentProps = comphelper::InitPropertySequence({
@@ -72,6 +72,7 @@ CPPUNIT_TEST_FIXTURE(XmloffStyleTest, testCommentResolved)
uno::Reference<beans::XPropertySet> xField(xPortion->getPropertyValue("TextField"),
uno::UNO_QUERY);
xField->setPropertyValue("Resolved", uno::Any(true));
+ xField->setPropertyValue("ParentName", uno::Any(OUString("parent_comment_name")));
saveAndReload("writer8");
xTextDocument.set(mxComponent, uno::UNO_QUERY);
@@ -83,6 +84,9 @@ CPPUNIT_TEST_FIXTURE(XmloffStyleTest, testCommentResolved)
xField.set(xPortion->getPropertyValue("TextField"), uno::UNO_QUERY);
bool bResolved = false;
xField->getPropertyValue("Resolved") >>= bResolved;
+ OUString parentName;
+ xField->getPropertyValue("ParentName") >>= parentName;
+ CPPUNIT_ASSERT_EQUAL(OUString("parent_comment_name"), parentName); // Check if the parent comment name is written and read correctly.
// Without the accompanying fix in place, this test would have failed, as the resolved state was
// not saved for non-range comments.
CPPUNIT_ASSERT(bResolved);