summaryrefslogtreecommitdiff
path: root/sw/qa
diff options
context:
space:
mode:
authorValentin Kettner <vakevk+libreoffice@gmail.com>2014-07-16 22:19:33 +0200
committerValentin Kettner <vakevk+libreoffice@gmail.com>2014-08-12 23:26:36 +0200
commit274f1811b92b870b8d450423d9b280b0889ca130 (patch)
tree3a917bc576cc1ae8fdcc02074da08696e475a6ce /sw/qa
parentb513f288275ae96f55e232f07bf94294c66e95a1 (diff)
Refactored IDocumentRedlineAccess out of SwDoc.
Into the new class DocumentRedlineManager. Added an non const version of GetRedlineTbl to the interface. Also Moved SetAutoFmtRedlineComment which is not part of interface. Change-Id: I600d5821d5d5831557f5fc5375fb1203fe67a295
Diffstat (limited to 'sw/qa')
-rw-r--r--sw/qa/core/uwriter.cxx25
-rw-r--r--sw/qa/extras/uiwriter/uiwriter.cxx2
2 files changed, 14 insertions, 13 deletions
diff --git a/sw/qa/core/uwriter.cxx b/sw/qa/core/uwriter.cxx
index 75cbf77806bc..d58f5bc39f68 100644
--- a/sw/qa/core/uwriter.cxx
+++ b/sw/qa/core/uwriter.cxx
@@ -32,6 +32,7 @@
#include "breakit.hxx"
#include "doc.hxx"
+#include <IDocumentRedlineAccess.hxx>
#include "docsh.hxx"
#include "docstat.hxx"
#include "docufld.hxx"
@@ -252,9 +253,9 @@ void SwDocTest::testModelToViewHelper()
aPaM.DeleteMark();
//turn on red-lining and show changes
- m_pDoc->SetRedlineMode(nsRedlineMode_t::REDLINE_ON | nsRedlineMode_t::REDLINE_SHOW_DELETE|nsRedlineMode_t::REDLINE_SHOW_INSERT);
- CPPUNIT_ASSERT_MESSAGE("redlining should be on", m_pDoc->IsRedlineOn());
- CPPUNIT_ASSERT_MESSAGE("redlines should be visible", IDocumentRedlineAccess::IsShowChanges(m_pDoc->GetRedlineMode()));
+ m_pDoc->getIDocumentRedlineAccess().SetRedlineMode(nsRedlineMode_t::REDLINE_ON | nsRedlineMode_t::REDLINE_SHOW_DELETE|nsRedlineMode_t::REDLINE_SHOW_INSERT);
+ CPPUNIT_ASSERT_MESSAGE("redlining should be on", m_pDoc->getIDocumentRedlineAccess().IsRedlineOn());
+ CPPUNIT_ASSERT_MESSAGE("redlines should be visible", IDocumentRedlineAccess::IsShowChanges(m_pDoc->getIDocumentRedlineAccess().GetRedlineMode()));
//set start of selection to last A
aPaM.GetPoint()->nContent.Assign(aPaM.GetCntntNode(), 4);
@@ -623,9 +624,9 @@ void SwDocTest::testSwScanner()
CPPUNIT_ASSERT_EQUAL(aDocStat.nWord, static_cast<sal_uLong>(2));
//turn on red-lining and show changes
- m_pDoc->SetRedlineMode(nsRedlineMode_t::REDLINE_ON | nsRedlineMode_t::REDLINE_SHOW_DELETE|nsRedlineMode_t::REDLINE_SHOW_INSERT);
- CPPUNIT_ASSERT_MESSAGE("redlining should be on", m_pDoc->IsRedlineOn());
- CPPUNIT_ASSERT_MESSAGE("redlines should be visible", IDocumentRedlineAccess::IsShowChanges(m_pDoc->GetRedlineMode()));
+ m_pDoc->getIDocumentRedlineAccess().SetRedlineMode(nsRedlineMode_t::REDLINE_ON | nsRedlineMode_t::REDLINE_SHOW_DELETE|nsRedlineMode_t::REDLINE_SHOW_INSERT);
+ CPPUNIT_ASSERT_MESSAGE("redlining should be on", m_pDoc->getIDocumentRedlineAccess().IsRedlineOn());
+ CPPUNIT_ASSERT_MESSAGE("redlines should be visible", IDocumentRedlineAccess::IsShowChanges(m_pDoc->getIDocumentRedlineAccess().GetRedlineMode()));
//delete everything except the first word
aPaM.SetMark(); //set start of selection to current pos
@@ -642,9 +643,9 @@ void SwDocTest::testSwScanner()
pTxtNode->SetWordCountDirty(true);
//keep red-lining on but hide changes
- m_pDoc->SetRedlineMode(nsRedlineMode_t::REDLINE_ON);
- CPPUNIT_ASSERT_MESSAGE("redlining should be still on", m_pDoc->IsRedlineOn());
- CPPUNIT_ASSERT_MESSAGE("redlines should be invisible", !IDocumentRedlineAccess::IsShowChanges(m_pDoc->GetRedlineMode()));
+ m_pDoc->getIDocumentRedlineAccess().SetRedlineMode(nsRedlineMode_t::REDLINE_ON);
+ CPPUNIT_ASSERT_MESSAGE("redlining should be still on", m_pDoc->getIDocumentRedlineAccess().IsRedlineOn());
+ CPPUNIT_ASSERT_MESSAGE("redlines should be invisible", !IDocumentRedlineAccess::IsShowChanges(m_pDoc->getIDocumentRedlineAccess().GetRedlineMode()));
aDocStat.Reset();
pTxtNode->CountWords(aDocStat, 0, pTxtNode->Len()); //but word-counting the text should only count the non-deleted text
@@ -653,7 +654,7 @@ void SwDocTest::testSwScanner()
OUString sLorem = pTxtNode->GetTxt();
CPPUNIT_ASSERT(sLorem == "Lorem");
- const SwRedlineTbl& rTbl = m_pDoc->GetRedlineTbl();
+ const SwRedlineTbl& rTbl = m_pDoc->getIDocumentRedlineAccess().GetRedlineTbl();
SwNodes& rNds = m_pDoc->GetNodes();
CPPUNIT_ASSERT(rTbl.size() == 1);
@@ -876,7 +877,7 @@ getRandomPosition(SwDoc *pDoc, int /* nOffset */)
void SwDocTest::randomTest()
{
- CPPUNIT_ASSERT_MESSAGE("SwDoc::IsRedlineOn()", !m_pDoc->IsRedlineOn());
+ CPPUNIT_ASSERT_MESSAGE("SwDoc::IsRedlineOn()", !m_pDoc->getIDocumentRedlineAccess().IsRedlineOn());
RedlineMode_t modes[] = {
nsRedlineMode_t::REDLINE_ON,
nsRedlineMode_t::REDLINE_SHOW_MASK,
@@ -896,7 +897,7 @@ void SwDocTest::randomTest()
m_pDoc->ClearDoc();
// setup redlining
- m_pDoc->SetRedlineMode(modes[rlm]);
+ m_pDoc->getIDocumentRedlineAccess().SetRedlineMode(modes[rlm]);
SW_MOD()->SetRedlineAuthor(OUString::createFromAscii(authors[0]));
for( int i = 0; i < 2000; i++ )
diff --git a/sw/qa/extras/uiwriter/uiwriter.cxx b/sw/qa/extras/uiwriter/uiwriter.cxx
index f13d1c7c8d7f..10cb4545bb84 100644
--- a/sw/qa/extras/uiwriter/uiwriter.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter.cxx
@@ -330,7 +330,7 @@ void SwUiWriterTest::testCp1000071()
SwDoc* pDoc = createDoc("cp1000071.odt");
SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell();
- const SwRedlineTbl& rTbl = pDoc->GetRedlineTbl();
+ const SwRedlineTbl& rTbl = pDoc->getIDocumentRedlineAccess().GetRedlineTbl();
CPPUNIT_ASSERT_EQUAL( size_t( 2 ), rTbl.size());
sal_uLong redlineStart0NodeIndex = rTbl[ 0 ]->Start()->nNode.GetIndex();
sal_Int32 redlineStart0Index = rTbl[ 0 ]->Start()->nContent.GetIndex();