summaryrefslogtreecommitdiff
path: root/sw/qa
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2015-02-02 11:59:04 +0100
committerMiklos Vajna <vmiklos@collabora.co.uk>2015-02-02 13:24:51 +0000
commitd334dd956a594c2fdda43706417ebf4d489f206a (patch)
tree80a574ef0e018a8f3cedbbd6983ac6c220c7c510 /sw/qa
parentc33c309f13dee335d81eb0e00363d4ae2d7c911a (diff)
tdf#68183 sw: config option for disabling the creation of automatic RSID marks
It was a problem since the initial commit 062eaeffe7cb986255063bb9b0a5f3fb3fc8e34c (sw: Improved document comparison based on RSIDs., 2011-12-22) that this new feature -- which is annoying for some use-cases -- could not be disabled, let's allow that. Change-Id: I33fa77382919586fb00198246f737caa68dcbd85 Reviewed-on: https://gerrit.libreoffice.org/14277 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
Diffstat (limited to 'sw/qa')
-rw-r--r--sw/qa/extras/uiwriter/uiwriter.cxx26
1 files changed, 26 insertions, 0 deletions
diff --git a/sw/qa/extras/uiwriter/uiwriter.cxx b/sw/qa/extras/uiwriter/uiwriter.cxx
index 047d0b05cb99..0fb6c821a881 100644
--- a/sw/qa/extras/uiwriter/uiwriter.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter.cxx
@@ -26,6 +26,8 @@
#include <view.hxx>
#include <hhcwrp.hxx>
#include <swacorr.hxx>
+#include <swmodule.hxx>
+#include <modcfg.hxx>
#include <editeng/acorrcfg.hxx>
#include <unotools/streamwrap.hxx>
#include <test/mtfxmldump.hxx>
@@ -76,6 +78,7 @@ public:
void testBookmarkUndo();
void testFdo85876();
void testFdo87448();
+ void testTdf68183();
CPPUNIT_TEST_SUITE(SwUiWriterTest);
CPPUNIT_TEST(testReplaceForward);
@@ -106,6 +109,7 @@ public:
CPPUNIT_TEST(testBookmarkUndo);
CPPUNIT_TEST(testFdo85876);
CPPUNIT_TEST(testFdo87448);
+ CPPUNIT_TEST(testTdf68183);
CPPUNIT_TEST_SUITE_END();
@@ -805,6 +809,28 @@ void SwUiWriterTest::testFdo87448()
CPPUNIT_ASSERT_MESSAGE(aMsg.getStr(), abs(nFirstEnd - nSecondEnd) < 10);
}
+void SwUiWriterTest::testTdf68183()
+{
+ // First disable RSID and check if indeed no such attribute is inserted.
+ SwDoc* pDoc = createDoc();
+ SW_MOD()->GetModuleConfig()->SetStoreRsid(false);
+ SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell();
+ pWrtShell->Insert2("X");
+
+ SwNodeIndex aIdx(pDoc->GetNodes().GetEndOfContent(), -1);
+ SwPaM aPaM(aIdx);
+ SwTxtNode* pTxtNode = aPaM.GetNode().GetTxtNode();
+ CPPUNIT_ASSERT_EQUAL(false, pTxtNode->GetSwAttrSet().HasItem(RES_PARATR_RSID));
+
+ // Then enable storing of RSID and make sure that the attribute is inserted.
+ SW_MOD()->GetModuleConfig()->SetStoreRsid(true);
+
+ pWrtShell->DelToStartOfLine();
+ pWrtShell->Insert2("X");
+
+ CPPUNIT_ASSERT_EQUAL(true, pTxtNode->GetSwAttrSet().HasItem(RES_PARATR_RSID));
+}
+
CPPUNIT_TEST_SUITE_REGISTRATION(SwUiWriterTest);
CPPUNIT_PLUGIN_IMPLEMENT();