[Libreoffice-commits] core.git: Branch 'private/Rosemary/change-tracking' - include/xmloff sw/source xmloff/source

2016-07-13 Thread Rosemary Sebastian
 include/xmloff/txtimp.hxx   |4 +-
 sw/source/filter/xml/XMLRedlineImportHelper.cxx |   44 
 sw/source/filter/xml/XMLRedlineImportHelper.hxx |3 +
 sw/source/filter/xml/xmltexti.cxx   |   13 ++-
 sw/source/filter/xml/xmltexti.hxx   |3 +
 xmloff/source/text/txtimp.cxx   |8 +++-
 xmloff/source/text/txtparai.cxx |5 ++
 xmloff/source/text/txtparai.hxx |3 +
 8 files changed, 75 insertions(+), 8 deletions(-)

New commits:
commit a6bc6c2b7138b7de5dcd45944eb5321fbd16d53b
Author: Rosemary Sebastian 
Date:   Wed Jul 13 13:53:30 2016 +0530

WIP Insert redline into document

Change-Id: I98857e98503176c812b0fb70a41cb8e79637da78

diff --git a/include/xmloff/txtimp.hxx b/include/xmloff/txtimp.hxx
index 01045d0..01b3f0a 100644
--- a/include/xmloff/txtimp.hxx
+++ b/include/xmloff/txtimp.hxx
@@ -678,7 +678,9 @@ public:
 
 virtual bool CheckRedlineExists(
 /// ID used to RedlineAdd() call
-const OUString& rId);
+const OUString& rStartParaPos);
+
+virtual void InsertRedlinesWithinParagraph(const OUString& rStartParaPos, 
bool bStart, bool bIsOutsideOfParagraph);
 
 virtual void RedlineSetCursor(
 /// ID used to RedlineAdd() call
diff --git a/sw/source/filter/xml/XMLRedlineImportHelper.cxx 
b/sw/source/filter/xml/XMLRedlineImportHelper.cxx
index 686d606..0767c50 100644
--- a/sw/source/filter/xml/XMLRedlineImportHelper.cxx
+++ b/sw/source/filter/xml/XMLRedlineImportHelper.cxx
@@ -503,6 +503,50 @@ bool XMLRedlineImportHelper::Check(
 return false;
 }
 
+void XMLRedlineImportHelper::InsertWithinParagraph(const OUString& rParaPos, 
bool bStart,
+Reference & rRange, bool bIsOutsideOfParagraph)
+{
+::std::map::iterator aFind = 
aRedlineMap[rParaPos].begin();
+for( ; aRedlineMap[rParaPos].end() != aFind; ++aFind )
+{
+// RedlineInfo found; now set Cursor
+RedlineInfo* pInfo = aFind->second;
+if (bIsOutsideOfParagraph)
+{
+// outside of paragraph: remember SwNodeIndex
+if (bStart)
+{
+pInfo->aAnchorStart.SetAsNodeIndex(rRange);
+}
+else
+{
+pInfo->aAnchorEnd.SetAsNodeIndex(rRange);
+}
+
+// also remember that we expect an adjustment for this redline
+pInfo->bNeedsAdjustment = true;
+}
+else
+{
+// inside of a paragraph: use regular XTextRanges (bookmarks)
+if (bStart)
+pInfo->aAnchorStart.Set(rRange);
+else
+pInfo->aAnchorEnd.Set(rRange);
+}
+
+// if this Cursor was the last missing info, we insert the
+// node into the document
+// then we can remove the entry from the map and destroy the object
+if (IsReady(pInfo))
+{
+InsertIntoDocument(pInfo);
+delete pInfo;
+}
+}
+aRedlineMap[rParaPos].clear();
+}
+
 void XMLRedlineImportHelper::SetCursor(
 const OUString& rParaPos,
 const OUString& rTextPos,
diff --git a/sw/source/filter/xml/XMLRedlineImportHelper.hxx 
b/sw/source/filter/xml/XMLRedlineImportHelper.hxx
index af3f6c9..adb5695 100644
--- a/sw/source/filter/xml/XMLRedlineImportHelper.hxx
+++ b/sw/source/filter/xml/XMLRedlineImportHelper.hxx
@@ -86,6 +86,9 @@ public:
 bool Check(
 const OUString& rParaPos);
 
+void InsertWithinParagraph(const OUString& rParaPos, bool bStart,
+css::uno::Reference & rRange, bool 
bIsOusideOfParagraph);
+
 // Set start or end position for a redline in the text body.
 // Accepts XTextRange objects.
 void SetCursor(
diff --git a/sw/source/filter/xml/xmltexti.cxx 
b/sw/source/filter/xml/xmltexti.cxx
index 1c4b2c4..05c1cb6 100644
--- a/sw/source/filter/xml/xmltexti.cxx
+++ b/sw/source/filter/xml/xmltexti.cxx
@@ -1001,14 +1001,23 @@ uno::Reference 
SwXMLTextImportHelper::RedlineCreateText(
 }
 
 bool SwXMLTextImportHelper::CheckRedlineExists(
-const OUString& rId)
+const OUString& rStartParaPos)
 {
 if(pRedlineHelper != nullptr)
-return pRedlineHelper->Check(rId);
+return pRedlineHelper->Check(rStartParaPos);
 return false;
 // else: ignore redline (wasn't added before, else we'd have a helper)
 }
 
+void SwXMLTextImportHelper::InsertRedlinesWithinParagraph(const OUString& 
rStartParaPos, bool bStart, bool bIsOutsideOfParagraph)
+{
+if(pRedlineHelper != nullptr)
+{
+uno::Reference xTextRange( GetCursor()->getStart() );
+pRedlineHelper->InsertWithinParagraph(rStartParaPos, bStart, 
xTextRange, bIsOutsideOfParagraph);
+}
+}
+
 void SwXMLTextImportHelper::RedlineSetCursor(
 const OUString& rParaPos,
 const OUString& rTextPos,
diff --git a/sw/source/filter/xml/xmltexti.hxx 

[Libreoffice-commits] core.git: Branch 'private/Rosemary/change-tracking' - include/xmloff sw/source xmloff/source

2016-07-12 Thread Rosemary Sebastian
 include/xmloff/XMLTrackedChangesImportContext.hxx |   15 +++--
 include/xmloff/txtimp.hxx |   23 +---
 sw/source/filter/xml/XMLRedlineImportHelper.cxx   |   48 +-
 sw/source/filter/xml/XMLRedlineImportHelper.hxx   |   18 +++---
 sw/source/filter/xml/xmltexti.cxx |   26 +
 sw/source/filter/xml/xmltexti.hxx |9 +--
 xmloff/source/text/XMLChangeElementImportContext.cxx  |2 
 xmloff/source/text/XMLChangeImportContext.cxx |4 -
 xmloff/source/text/XMLTrackedChangesImportContext.cxx |   42 +--
 xmloff/source/text/txtimp.cxx |   43 +++-
 xmloff/source/text/txtparai.cxx   |7 ++
 11 files changed, 142 insertions(+), 95 deletions(-)

New commits:
commit 45675aed3b9c121266d78e37bccc00dbfbcda09b
Author: Rosemary Sebastian 
Date:   Wed Jul 13 06:28:30 2016 +0530

Access aRedlineMap when parsing content.xml

- Moved aRedlineMap to global scope.
- Made it two-dimensional with the first index indicating the paragraph
  index and the second indicating the text position within the paragraph.

Change-Id: I1c21040e258344c2c42e880fd30dc0efc3689815

diff --git a/include/xmloff/XMLTrackedChangesImportContext.hxx 
b/include/xmloff/XMLTrackedChangesImportContext.hxx
index f19052a..5737e95 100644
--- a/include/xmloff/XMLTrackedChangesImportContext.hxx
+++ b/include/xmloff/XMLTrackedChangesImportContext.hxx
@@ -57,13 +57,15 @@ public:
 /// redline date
 OUString sDate;
 
-/// redline date
-OUString sStart;
+/// redline start
+OUString sStartParaPos;
+OUString sStartTextPos;
 
-/// redline date
-OUString sEnd;
+/// redline end
+OUString sEndParaPos;
+OUString sEndTextPos;
 
-/// redline date
+/// redline type
 OUString sType;
 
 /// merge-last-paragraph flag
@@ -89,7 +91,8 @@ public:
const OUString& rAuthor,
const OUString& rComment,
const OUString& rDate,
-   const sal_uInt32);
+   const OUString& rStartParaPos,
+   const OUString& rStartTextPos);
 
 /// create redline XText/XTextCursor on demand and register with
 /// XMLTextImportHelper
diff --git a/include/xmloff/txtimp.hxx b/include/xmloff/txtimp.hxx
index 12825dd..01045d0 100644
--- a/include/xmloff/txtimp.hxx
+++ b/include/xmloff/txtimp.hxx
@@ -390,7 +390,6 @@ private:
 static std::shared_ptr MakeBackpatcherImpl();
 
 sal_Int16nParaIdx = 0;
-bool bInsertRedline = false;
 protected:
 virtual SvXMLImportContext *CreateTableChildContext(
 SvXMLImport& rImport,
@@ -658,8 +657,6 @@ public:
 virtual void RedlineAdd(
 /// redline type (insert, del,... )
 const OUString& rType,
-/// use to identify this redline
-const OUString& rId,
 /// name of the author
 const OUString& rAuthor,
 /// redline comment
@@ -668,13 +665,16 @@ public:
 const css::util::DateTime& rDateTime,
 /// merge last paras
 bool bMergeLastParagraph,
-const sal_uInt32 nStartParaPos);
+/// start position
+const OUString& rStartParaPos,
+const OUString& rStartTextPos);
 
 virtual css::uno::Reference< css::text::XTextCursor> RedlineCreateText(
 /// needed to get the document
 css::uno::Reference< css::text::XTextCursor > & rOldCursor,
 /// ID used to RedlineAdd() call
-const OUString& rId);
+const OUString& rParaPos,
+const OUString& rTextPos);
 
 virtual bool CheckRedlineExists(
 /// ID used to RedlineAdd() call
@@ -682,7 +682,8 @@ public:
 
 virtual void RedlineSetCursor(
 /// ID used to RedlineAdd() call
-const OUString& rId,
+const OUString& rParaPos,
+const OUString& rTextPos,
 /// start or end Cursor
 bool bStart,
 /// range is not within 
@@ -695,11 +696,15 @@ public:
 const css::uno::Sequence & rProtectionKey );
 
 /// get the last open redline ID
-OUString GetOpenRedlineId();
+OUString GetOpenRedlineParaPos();
+/// get the last open redline ID
+OUString GetOpenRedlineTextPos();
+/// modify the last open redline ID
+void SetOpenRedlineParaPos( OUString const & rParaPos);
 /// modify the last open redline ID
-void SetOpenRedlineId( OUString const & rId);
+void SetOpenRedlineTextPos( OUString const & rTextPos);
 /// reset the last open redline ID
-void ResetOpenRedlineId();
+void ResetOpenRedlinePositions();
 
 /** redlining : Setter to remember the fact we are inside/outside
  * a  element (deleted redline section) */
diff 

[Libreoffice-commits] core.git: Branch 'private/Rosemary/change-tracking' - include/xmloff sw/source xmloff/source

2016-07-11 Thread Rosemary Sebastian
Rebased ref, commits from common ancestor:
commit 7b673a8524e43cfd2b445d386465d71d82e97dc5
Author: Rosemary Sebastian 
Date:   Mon Jul 11 19:58:40 2016 +0530

WIP Insert redline into document

Change-Id: I477ef0dc0e62b83059dc5877746c16071a88507b

diff --git a/include/xmloff/XMLTrackedChangesImportContext.hxx 
b/include/xmloff/XMLTrackedChangesImportContext.hxx
index c3a4414..f19052a 100644
--- a/include/xmloff/XMLTrackedChangesImportContext.hxx
+++ b/include/xmloff/XMLTrackedChangesImportContext.hxx
@@ -57,6 +57,15 @@ public:
 /// redline date
 OUString sDate;
 
+/// redline date
+OUString sStart;
+
+/// redline date
+OUString sEnd;
+
+/// redline date
+OUString sType;
+
 /// merge-last-paragraph flag
 bool bMergeLastPara;
 
@@ -79,7 +88,8 @@ public:
 void SetChangeInfo(const OUString& rType,
const OUString& rAuthor,
const OUString& rComment,
-   const OUString& rDate);
+   const OUString& rDate,
+   const sal_uInt32);
 
 /// create redline XText/XTextCursor on demand and register with
 /// XMLTextImportHelper
diff --git a/include/xmloff/txtimp.hxx b/include/xmloff/txtimp.hxx
index 92f2bf9..12825dd 100644
--- a/include/xmloff/txtimp.hxx
+++ b/include/xmloff/txtimp.hxx
@@ -389,6 +389,8 @@ private:
 std::shared_ptr m_xBackpatcherImpl;
 static std::shared_ptr MakeBackpatcherImpl();
 
+sal_Int16nParaIdx = 0;
+bool bInsertRedline = false;
 protected:
 virtual SvXMLImportContext *CreateTableChildContext(
 SvXMLImport& rImport,
@@ -665,7 +667,8 @@ public:
 /// date+time
 const css::util::DateTime& rDateTime,
 /// merge last paras
-bool bMergeLastParagraph);
+bool bMergeLastParagraph,
+const sal_uInt32 nStartParaPos);
 
 virtual css::uno::Reference< css::text::XTextCursor> RedlineCreateText(
 /// needed to get the document
@@ -673,6 +676,10 @@ public:
 /// ID used to RedlineAdd() call
 const OUString& rId);
 
+virtual bool CheckRedlineExists(
+/// ID used to RedlineAdd() call
+const OUString& rId);
+
 virtual void RedlineSetCursor(
 /// ID used to RedlineAdd() call
 const OUString& rId,
diff --git a/sw/source/filter/xml/XMLRedlineImportHelper.cxx 
b/sw/source/filter/xml/XMLRedlineImportHelper.cxx
index 0952c46..7a8d992 100644
--- a/sw/source/filter/xml/XMLRedlineImportHelper.cxx
+++ b/sw/source/filter/xml/XMLRedlineImportHelper.cxx
@@ -195,6 +195,7 @@ public:
 OUString sComment;  // change comment string
 util::DateTime aDateTime;   // change DateTime
 bool bMergeLastParagraph;   // the SwRangeRedline::IsDelLastPara flag
+sal_uInt32 nStartParagraphPos;
 
 // each position can may be either empty, an XTextRange, or an SwNodeIndex
 
@@ -373,7 +374,8 @@ void XMLRedlineImportHelper::Add(
 const OUString& rAuthor,
 const OUString& rComment,
 const util::DateTime& rDateTime,
-bool bMergeLastPara)
+bool bMergeLastPara,
+const sal_uInt32 nStartParaPos)
 {
 // we need to do the following:
 // 1) parse type string
@@ -411,6 +413,7 @@ void XMLRedlineImportHelper::Add(
 pInfo->sComment = rComment;
 pInfo->aDateTime = rDateTime;
 pInfo->bMergeLastParagraph = bMergeLastPara;
+pInfo->nStartParagraphPos = nStartParaPos;
 
 // ad 3)
 if (aRedlineMap.end() == aRedlineMap.find(rId))
@@ -487,6 +490,17 @@ Reference 
XMLRedlineImportHelper::CreateRedlineTextSection(
 return xReturn;
 }
 
+bool XMLRedlineImportHelper::Check(
+const OUString& rId)
+{
+RedlineMapType::iterator aFind = aRedlineMap.find(rId);
+if (aRedlineMap.end() != aFind)
+{
+return true;
+}
+return false;
+}
+
 void XMLRedlineImportHelper::SetCursor(
 const OUString& rId,
 bool bStart,
diff --git a/sw/source/filter/xml/XMLRedlineImportHelper.hxx 
b/sw/source/filter/xml/XMLRedlineImportHelper.hxx
index f78866b..240c36c 100644
--- a/sw/source/filter/xml/XMLRedlineImportHelper.hxx
+++ b/sw/source/filter/xml/XMLRedlineImportHelper.hxx
@@ -76,7 +76,8 @@ public:
 const OUString& rAuthor, // name of the author
 const OUString& rComment,// redline comment
 const css::util::DateTime& rDateTime, // date+time
-bool bMergeLastParagraph);  // merge last paragraph?
+bool bMergeLastParagraph,  // merge last paragraph?
+const sal_uInt32 nStartParaPos); // start paragraph position
 
 // create a text section for the redline, and return an
 // XText/XTextCursor that may be used to write into it.
@@ -84,6 +85,9 @@ public:
 css::uno::Reference xOldCursor, // needed 
to get the document
 const OUString& rId);// ID used to RedlineAdd() call
 
+bool 

[Libreoffice-commits] core.git: Branch 'private/Rosemary/change-tracking' - include/xmloff sw/source xmloff/source

2016-07-11 Thread Rosemary Sebastian
 include/xmloff/XMLTrackedChangesImportContext.hxx |   12 ++-
 include/xmloff/txtimp.hxx |9 -
 sw/source/filter/xml/XMLRedlineImportHelper.cxx   |   22 ++---
 sw/source/filter/xml/XMLRedlineImportHelper.hxx   |6 +++
 sw/source/filter/xml/swxml.cxx|   14 
 sw/source/filter/xml/xmltexti.cxx |   14 +++-
 sw/source/filter/xml/xmltexti.hxx |5 ++-
 xmloff/source/text/XMLChangeInfoContext.cxx   |4 --
 xmloff/source/text/XMLChangedRegionImportContext.cxx  |   14 
 xmloff/source/text/XMLChangedRegionImportContext.hxx  |6 ---
 xmloff/source/text/XMLTrackedChangesImportContext.cxx |   30 +++---
 xmloff/source/text/txtimp.cxx |   13 ++-
 xmloff/source/text/txtparai.cxx   |9 -
 xmloff/source/text/txtparai.hxx   |4 +-
 14 files changed, 112 insertions(+), 50 deletions(-)

New commits:
commit 56043029a387283dba933ab94bdd454aaa74dcc6
Author: Rosemary Sebastian 
Date:   Mon Jul 11 19:58:40 2016 +0530

WIP Insert redline into document

Change-Id: I477ef0dc0e62b83059dc5877746c16071a88507b

diff --git a/include/xmloff/XMLTrackedChangesImportContext.hxx 
b/include/xmloff/XMLTrackedChangesImportContext.hxx
index c3a4414..f19052a 100644
--- a/include/xmloff/XMLTrackedChangesImportContext.hxx
+++ b/include/xmloff/XMLTrackedChangesImportContext.hxx
@@ -57,6 +57,15 @@ public:
 /// redline date
 OUString sDate;
 
+/// redline date
+OUString sStart;
+
+/// redline date
+OUString sEnd;
+
+/// redline date
+OUString sType;
+
 /// merge-last-paragraph flag
 bool bMergeLastPara;
 
@@ -79,7 +88,8 @@ public:
 void SetChangeInfo(const OUString& rType,
const OUString& rAuthor,
const OUString& rComment,
-   const OUString& rDate);
+   const OUString& rDate,
+   const sal_uInt32);
 
 /// create redline XText/XTextCursor on demand and register with
 /// XMLTextImportHelper
diff --git a/include/xmloff/txtimp.hxx b/include/xmloff/txtimp.hxx
index 92f2bf9..12825dd 100644
--- a/include/xmloff/txtimp.hxx
+++ b/include/xmloff/txtimp.hxx
@@ -389,6 +389,8 @@ private:
 std::shared_ptr m_xBackpatcherImpl;
 static std::shared_ptr MakeBackpatcherImpl();
 
+sal_Int16nParaIdx = 0;
+bool bInsertRedline = false;
 protected:
 virtual SvXMLImportContext *CreateTableChildContext(
 SvXMLImport& rImport,
@@ -665,7 +667,8 @@ public:
 /// date+time
 const css::util::DateTime& rDateTime,
 /// merge last paras
-bool bMergeLastParagraph);
+bool bMergeLastParagraph,
+const sal_uInt32 nStartParaPos);
 
 virtual css::uno::Reference< css::text::XTextCursor> RedlineCreateText(
 /// needed to get the document
@@ -673,6 +676,10 @@ public:
 /// ID used to RedlineAdd() call
 const OUString& rId);
 
+virtual bool CheckRedlineExists(
+/// ID used to RedlineAdd() call
+const OUString& rId);
+
 virtual void RedlineSetCursor(
 /// ID used to RedlineAdd() call
 const OUString& rId,
diff --git a/sw/source/filter/xml/XMLRedlineImportHelper.cxx 
b/sw/source/filter/xml/XMLRedlineImportHelper.cxx
index 0952c46..9bd69be 100644
--- a/sw/source/filter/xml/XMLRedlineImportHelper.cxx
+++ b/sw/source/filter/xml/XMLRedlineImportHelper.cxx
@@ -195,6 +195,7 @@ public:
 OUString sComment;  // change comment string
 util::DateTime aDateTime;   // change DateTime
 bool bMergeLastParagraph;   // the SwRangeRedline::IsDelLastPara flag
+sal_uInt32 nStartParagraphPos;
 
 // each position can may be either empty, an XTextRange, or an SwNodeIndex
 
@@ -319,9 +320,9 @@ XMLRedlineImportHelper::~XMLRedlineImportHelper()
   "now deleted");
 }
 }
-delete pInfo;
-}
-aRedlineMap.clear();
+ delete pInfo;
+ }
+ aRedlineMap.clear();
 
 // set redline mode, either to info property set, or directly to
 // the document
@@ -373,7 +374,8 @@ void XMLRedlineImportHelper::Add(
 const OUString& rAuthor,
 const OUString& rComment,
 const util::DateTime& rDateTime,
-bool bMergeLastPara)
+bool bMergeLastPara,
+const sal_uInt32 nStartParaPos)
 {
 // we need to do the following:
 // 1) parse type string
@@ -411,6 +413,7 @@ void XMLRedlineImportHelper::Add(
 pInfo->sComment = rComment;
 pInfo->aDateTime = rDateTime;
 pInfo->bMergeLastParagraph = bMergeLastPara;
+pInfo->nStartParagraphPos = nStartParaPos;
 
 // ad 3)
 if (aRedlineMap.end() == aRedlineMap.find(rId))
@@ -487,6 +490,17 @@ Reference 

[Libreoffice-commits] core.git: Branch 'private/Rosemary/change-tracking' - include/xmloff sw/source xmloff/source

2016-06-23 Thread Rosemary Sebastian
 include/xmloff/txtparae.hxx|   31 -
 sw/source/filter/xml/xmlexp.cxx|2 
 sw/source/filter/xml/xmlfmte.cxx   |3 
 xmloff/source/text/XMLRedlineExport.cxx|  418 -
 xmloff/source/text/XMLRedlineExport.hxx|   43 --
 xmloff/source/text/XMLTextMasterPageExport.cxx |1 
 xmloff/source/text/txtparae.cxx|  370 --
 7 files changed, 19 insertions(+), 849 deletions(-)

New commits:
commit 1668fda4bfd7d2681b440497da2ab37f45cf47b8
Author: Rosemary Sebastian 
Date:   Thu Jun 23 09:56:09 2016 +0530

Clean up code

Change-Id: Ib44e072f42620a9b17e813996a4ea817cb280da4

diff --git a/include/xmloff/txtparae.hxx b/include/xmloff/txtparae.hxx
index ce851f8..92fae21 100644
--- a/include/xmloff/txtparae.hxx
+++ b/include/xmloff/txtparae.hxx
@@ -250,8 +250,7 @@ public:
 void exportUndoTextRangeEnumeration(
 const css::uno::Reference< css::container::XEnumeration > & rRangeEnum,
 const sal_uInt32& rParaIdx,
-bool bAutoStyles, bool bProgress,
-bool bPrvChrIsSpc = true );
+bool bAutoStyles );
 void exportTextRangeEnumeration(
 const css::uno::Reference< css::container::XEnumeration > & rRangeEnum,
 bool bAutoStyles, bool bProgress,
@@ -277,7 +276,7 @@ protected:
 void exportUndoText(
 const css::uno::Reference <
 css::text::XText > & rText,
-bool bAutoStyles, bool bProgress, bool bExportParagraph, TextPNS 
eExtensionNS = TextPNS::ODF );
+bool bAutoStyles, bool bProgress );
 
 void exportText(
 const css::uno::Reference <
@@ -293,11 +292,7 @@ protected:
 const css::uno::Reference< css::container::XEnumeration > & 
rContentEnum,
 bool bAutoStyles,
 const css::uno::Reference< css::text::XTextSection > & rBaseSection,
-bool bProgress,
-bool bExportParagraph = true,
-const css::uno::Reference< css::beans::XPropertySet > *pRangePropSet = 
nullptr,
-bool bExportLevels = true,
-TextPNS eExtensionNS = TextPNS::ODF);
+bool bProgress);
 bool exportTextContentEnumeration(
 const css::uno::Reference< css::container::XEnumeration > & 
rContentEnum,
 bool bAutoStyles,
@@ -311,9 +306,7 @@ protected:
 const css::uno::Reference< css::text::XTextContent > & rTextContent,
 const sal_uInt32& rParaIdx,
 bool bAutoStyles, bool bProgress,
-bool bExportParagraph,
-MultiPropertySetHelper& rPropSetHelper,
-TextPNS eExtensionNS = TextPNS::ODF);
+MultiPropertySetHelper& rPropSetHelper);
 void exportParagraph(
 const css::uno::Reference< css::text::XTextContent > & rTextContent,
 bool bAutoStyles, bool bProgress,
@@ -498,15 +491,6 @@ public:
 /// export all declarations
 void exportUsedDeclarations();
 
-/// Export the list of change information (enclosed by )
-/// (or the necessary automatic styles)
-void exportTrackedChanges(bool bAutoStyle);
-
-/// Export the list of change information (enclosed by )
-/// (or the necessary automatic styles)
-void exportTrackedChanges(const css::uno::Reference< css::text::XText > & 
rText,
-  bool bAutoStyle );
-
 /// Record tracked changes for this particular XText
 /// (empty reference stop recording)
 /// This should be used if tracked changes for e.g. footers are to
@@ -569,12 +553,11 @@ public:
 }
 
 // This method exports the given XText
-void exportUndoText(
+void exportTrackedChanges(
 const css::uno::Reference< css::text::XText > & rText,
-bool bIsProgress = false,
-bool bExportParagraph = true, TextPNS eExtensionNS = TextPNS::ODF)
+bool bIsProgress = false)
 {
-exportUndoText( rText, false, bIsProgress, bExportParagraph, 
eExtensionNS );
+exportUndoText( rText, false, bIsProgress );
 }
 
 void exportText(
diff --git a/sw/source/filter/xml/xmlexp.cxx b/sw/source/filter/xml/xmlexp.cxx
index 2812ec5..f9f2d40 100644
--- a/sw/source/filter/xml/xmlexp.cxx
+++ b/sw/source/filter/xml/xmlexp.cxx
@@ -497,7 +497,7 @@ void SwXMLExport::ExportUndo_()
 true, true );
 Reference < XTextDocument > xTextDoc( GetModel(), UNO_QUERY );
 Reference < XText > xText = xTextDoc->getText();
-GetTextParagraphExport()->exportUndoText( xText, bShowProgress );
+GetTextParagraphExport()->exportTrackedChanges( xText, bShowProgress );
 }
 
 namespace
diff --git a/sw/source/filter/xml/xmlfmte.cxx b/sw/source/filter/xml/xmlfmte.cxx
index 312b8b2..5247201 100644
--- a/sw/source/filter/xml/xmlfmte.cxx
+++ b/sw/source/filter/xml/xmlfmte.cxx
@@ -201,9 +201,6 @@ void SwXMLExport::ExportAutoStyles_()
 if( !(getExportFlags() & SvXMLExportFlags::STYLES) )
 GetTextParagraphExport()->exportUsedDeclarations();
 

[Libreoffice-commits] core.git: Branch 'private/Rosemary/change-tracking' - include/xmloff sw/source xmloff/source

2016-06-22 Thread Rosemary Sebastian
 include/xmloff/txtparae.hxx |   45 ++
 sw/source/core/unocore/unomapproperties.hxx |4 
 sw/source/filter/xml/xmlexp.cxx |4 
 xmloff/source/text/XMLRedlineExport.cxx |  132 ++
 xmloff/source/text/XMLRedlineExport.hxx |   17 
 xmloff/source/text/txtparae.cxx |  552 +++-
 6 files changed, 741 insertions(+), 13 deletions(-)

New commits:
commit 79651457952e910786474c9751178077ca121c06
Author: Rosemary Sebastian 
Date:   Wed Jun 22 14:37:36 2016 +0530

Implement export of insertion and deletion changes

Change-Id: I6a8b580dc43c744bb181961ff26c95acd10207cb

diff --git a/include/xmloff/txtparae.hxx b/include/xmloff/txtparae.hxx
index 5e445bd..ce851f8 100644
--- a/include/xmloff/txtparae.hxx
+++ b/include/xmloff/txtparae.hxx
@@ -92,6 +92,7 @@ class XMLOFF_DLLPUBLIC XMLTextParagraphExport : public 
XMLStyleExport
 
 /// may be NULL (if no redlines should be exported; e.g. in block mode)
 XMLRedlineExport*pRedlineExport;
+sal_uInt32  nParaIdx;
 
 boolbProgress;
 
@@ -246,6 +247,11 @@ public:
 const css::uno::Reference< css::beans::XPropertyState > & rPropState,
 const css::uno::Reference< css::beans::XPropertySetInfo > & 
rPropSetInfo );
 
+void exportUndoTextRangeEnumeration(
+const css::uno::Reference< css::container::XEnumeration > & rRangeEnum,
+const sal_uInt32& rParaIdx,
+bool bAutoStyles, bool bProgress,
+bool bPrvChrIsSpc = true );
 void exportTextRangeEnumeration(
 const css::uno::Reference< css::container::XEnumeration > & rRangeEnum,
 bool bAutoStyles, bool bProgress,
@@ -268,6 +274,11 @@ protected:
 
 void exportNumStyles( bool bUsed );
 
+void exportUndoText(
+const css::uno::Reference <
+css::text::XText > & rText,
+bool bAutoStyles, bool bProgress, bool bExportParagraph, TextPNS 
eExtensionNS = TextPNS::ODF );
+
 void exportText(
 const css::uno::Reference <
 css::text::XText > & rText,
@@ -278,6 +289,15 @@ protected:
 const css::uno::Reference< css::text::XTextSection > & rBaseSection,
 bool bAutoStyles, bool bProgress, bool bExportParagraph, TextPNS 
eExtensionNS = TextPNS::ODF );
 
+bool exportUndoTextContentEnumeration(
+const css::uno::Reference< css::container::XEnumeration > & 
rContentEnum,
+bool bAutoStyles,
+const css::uno::Reference< css::text::XTextSection > & rBaseSection,
+bool bProgress,
+bool bExportParagraph = true,
+const css::uno::Reference< css::beans::XPropertySet > *pRangePropSet = 
nullptr,
+bool bExportLevels = true,
+TextPNS eExtensionNS = TextPNS::ODF);
 bool exportTextContentEnumeration(
 const css::uno::Reference< css::container::XEnumeration > & 
rContentEnum,
 bool bAutoStyles,
@@ -287,6 +307,13 @@ protected:
 const css::uno::Reference< css::beans::XPropertySet > *pRangePropSet = 
nullptr,
 bool bExportLevels = true,
 TextPNS eExtensionNS = TextPNS::ODF);
+void exportUndoParagraph(
+const css::uno::Reference< css::text::XTextContent > & rTextContent,
+const sal_uInt32& rParaIdx,
+bool bAutoStyles, bool bProgress,
+bool bExportParagraph,
+MultiPropertySetHelper& rPropSetHelper,
+TextPNS eExtensionNS = TextPNS::ODF);
 void exportParagraph(
 const css::uno::Reference< css::text::XTextContent > & rTextContent,
 bool bAutoStyles, bool bProgress,
@@ -531,7 +558,25 @@ public:
 void exportTitleAndDescription( const css::uno::Reference< 
css::beans::XPropertySet > & rPropSet,
 const css::uno::Reference< 
css::beans::XPropertySetInfo > & rPropSetInfo );
 
+void setParaIdx(sal_uInt32 rParaIdx)
+{
+nParaIdx = rParaIdx;
+}
+
+sal_uInt32 getParaIdx()
+{
+return nParaIdx;
+}
+
 // This method exports the given XText
+void exportUndoText(
+const css::uno::Reference< css::text::XText > & rText,
+bool bIsProgress = false,
+bool bExportParagraph = true, TextPNS eExtensionNS = TextPNS::ODF)
+{
+exportUndoText( rText, false, bIsProgress, bExportParagraph, 
eExtensionNS );
+}
+
 void exportText(
 const css::uno::Reference< css::text::XText > & rText,
 bool bIsProgress = false,
diff --git a/sw/source/core/unocore/unomapproperties.hxx 
b/sw/source/core/unocore/unomapproperties.hxx
index e10b7d8..8edcb3b 100644
--- a/sw/source/core/unocore/unomapproperties.hxx
+++ b/sw/source/core/unocore/unomapproperties.hxx
@@ -74,8 +74,8 @@
 {OUString(UNO_NAME_IS_IN_HEADER_FOOTER), 0, cppu::UnoType::get(),
 
PropertyAttribute::MAYBEVOID|PropertyAttribute::READONLY, 0},\
 {OUString(UNO_NAME_REDLINE_TEXT), 0, 

[Libreoffice-commits] core.git: Branch 'private/Rosemary/change-tracking' - include/xmloff sw/source xmloff/source

2016-06-14 Thread Rosemary Sebastian
 include/xmloff/xmlnmspe.hxx |   15 +++---
 include/xmloff/xmltoken.hxx |2 
 sw/source/filter/xml/xmlexp.cxx |4 -
 xmloff/source/core/xmlexp.cxx   |3 -
 xmloff/source/core/xmltoken.cxx |2 
 xmloff/source/text/XMLRedlineExport.cxx |   74 
 6 files changed, 18 insertions(+), 82 deletions(-)

New commits:
commit baf57f89f63d24aa4592ed52c6cc9236fcde6635
Author: Rosemary Sebastian 
Date:   Tue Jun 14 21:59:32 2016 +0530

Rework the placeholder XML

Change-Id: I54d813588910bc2ea324873c8b41977e7ad6340c

diff --git a/include/xmloff/xmlnmspe.hxx b/include/xmloff/xmlnmspe.hxx
index ae588d2..e0cf19d 100644
--- a/include/xmloff/xmlnmspe.hxx
+++ b/include/xmloff/xmlnmspe.hxx
@@ -70,6 +70,7 @@ XML_NAMESPACE( REPORT,  33U )
 XML_NAMESPACE( OF,  34U )   // OpenFormula aka ODFF
 XML_NAMESPACE( XHTML,   35U )
 XML_NAMESPACE( GRDDL,   36U )
+XML_NAMESPACE( C,   37U )
 
 // namespaces for odf extended formats
 
@@ -77,14 +78,14 @@ XML_NAMESPACE( GRDDL,   36U )
 const sal_uInt16 XML_NAMESPACE_##prefix##_EXT   = key; \
 const sal_uInt16 XML_NAMESPACE_##prefix##_EXT_IDX   = key;
 
-XML_NAMESPACE_EXT( OFFICE,  37U )
-XML_NAMESPACE_EXT( TABLE,   38U )
-XML_NAMESPACE_EXT( CHART,   39U )
-XML_NAMESPACE_EXT( DRAW,40U )
-XML_NAMESPACE_EXT( CALC,41U )
-XML_NAMESPACE_EXT( LO,  42U )
+XML_NAMESPACE_EXT( OFFICE,  38U )
+XML_NAMESPACE_EXT( TABLE,   39U )
+XML_NAMESPACE_EXT( CHART,   40U )
+XML_NAMESPACE_EXT( DRAW,41U )
+XML_NAMESPACE_EXT( CALC,42U )
+XML_NAMESPACE_EXT( LO,  43U )
 
-#define XML_OLD_NAMESPACE_BASE 43U
+#define XML_OLD_NAMESPACE_BASE 44U
 
 // namespaces used in the technical preview (SO 5.2)
 XML_OLD_NAMESPACE( FO,  0U )
diff --git a/include/xmloff/xmltoken.hxx b/include/xmloff/xmltoken.hxx
index 4ddc061..425580d 100644
--- a/include/xmloff/xmltoken.hxx
+++ b/include/xmloff/xmltoken.hxx
@@ -99,6 +99,8 @@ namespace xmloff { namespace token {
 XML_N_XLINK_OLD,
 XML_NP_DC,
 XML_N_DC,
+XML_NP_C,
+XML_N_C,
 XML_NP_SVG,
 XML_N_SVG,
 XML_NP_FORM,
diff --git a/sw/source/filter/xml/xmlexp.cxx b/sw/source/filter/xml/xmlexp.cxx
index 4213eb5..75e2cd0 100644
--- a/sw/source/filter/xml/xmlexp.cxx
+++ b/sw/source/filter/xml/xmlexp.cxx
@@ -572,7 +572,7 @@ 
com_sun_star_comp_Writer_XMLUndoExporter_get_implementation(css::uno::XComponent
 css::uno::Sequence const &)
 {
 return cppu::acquire(new SwXMLExport(context, 
OUString("com.sun.star.comp.Writer.XMLUndoExporter"),
-SvXMLExportFlags::UNDO | SvXMLExportFlags::AUTOSTYLES));
+SvXMLExportFlags::UNDO));
 }
 
 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface* SAL_CALL
@@ -622,7 +622,7 @@ 
com_sun_star_comp_Writer_XMLOasisUndoExporter_get_implementation(css::uno::XComp
 css::uno::Sequence const &)
 {
 return cppu::acquire(new SwXMLExport(context, 
OUString("com.sun.star.comp.Writer.XMLOasisUndoExporter"),
-SvXMLExportFlags::UNDO | SvXMLExportFlags::AUTOSTYLES | 
SvXMLExportFlags::OASIS));
+SvXMLExportFlags::UNDO | SvXMLExportFlags::OASIS));
 }
 
 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface* SAL_CALL
diff --git a/xmloff/source/core/xmlexp.cxx b/xmloff/source/core/xmlexp.cxx
index 059bbd0..f2b20df 100644
--- a/xmloff/source/core/xmlexp.cxx
+++ b/xmloff/source/core/xmlexp.cxx
@@ -333,7 +333,7 @@ void SvXMLExport::InitCtor_()
 }
 
 // namespaces for documents
-if( getExportFlags() & 
(SvXMLExportFlags::STYLES|SvXMLExportFlags::AUTOSTYLES|SvXMLExportFlags::MASTERSTYLES|SvXMLExportFlags::CONTENT)
 )
+if( getExportFlags() & 
(SvXMLExportFlags::STYLES|SvXMLExportFlags::AUTOSTYLES|SvXMLExportFlags::MASTERSTYLES|SvXMLExportFlags::CONTENT|
 SvXMLExportFlags::UNDO) )
 {
 mpNamespaceMap->Add( GetXMLToken(XML_NP_DC),GetXMLToken(XML_N_DC), 
 XML_NAMESPACE_DC );
 mpNamespaceMap->Add( GetXMLToken(XML_NP_TEXT),  
GetXMLToken(XML_N_TEXT),XML_NAMESPACE_TEXT );
@@ -347,6 +347,7 @@ void SvXMLExport::InitCtor_()
 mpNamespaceMap->Add( GetXMLToken(XML_NP_OOOW),  
GetXMLToken(XML_N_OOOW),XML_NAMESPACE_OOOW );
 mpNamespaceMap->Add( GetXMLToken(XML_NP_OOOC),  
GetXMLToken(XML_N_OOOC),XML_NAMESPACE_OOOC );
 mpNamespaceMap->Add( GetXMLToken(XML_NP_OF),GetXMLToken(XML_N_OF), 
 XML_NAMESPACE_OF );
+mpNamespaceMap->Add( GetXMLToken(XML_NP_C), GetXMLToken(XML_N_C),  
 XML_NAMESPACE_C );
 
 if (getDefaultVersion() > SvtSaveOptions::ODFVER_012)
 {
diff --git a/xmloff/source/core/xmltoken.cxx b/xmloff/source/core/xmltoken.cxx
index 50920fd..1d30c0f 100644
--- a/xmloff/source/core/xmltoken.cxx
+++ b/xmloff/source/core/xmltoken.cxx
@@ -104,6 +104,8 @@ namespace xmloff { namespace