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

Rosemary Sebastian rosemary.seb8 at gmail.com
Wed Jul 20 02:18:04 UTC 2016


 sw/source/filter/xml/XMLRedlineImportHelper.cxx       |   26 +-----------------
 xmloff/source/text/XMLTrackedChangesImportContext.cxx |   13 ++++++---
 2 files changed, 11 insertions(+), 28 deletions(-)

New commits:
commit cc046697174c878d184e183a1aa28a1167ede6f9
Author: Rosemary Sebastian <rosemary.seb8 at gmail.com>
Date:   Sat Jul 16 13:36:05 2016 +0530

    WIP Insert redline into document
    
    Change-Id: I51bb9e5572b0265c41cc17ae06f26a76b584fde3

diff --git a/sw/source/filter/xml/XMLRedlineImportHelper.cxx b/sw/source/filter/xml/XMLRedlineImportHelper.cxx
index 0767c50..f95d944 100644
--- a/sw/source/filter/xml/XMLRedlineImportHelper.cxx
+++ b/sw/source/filter/xml/XMLRedlineImportHelper.cxx
@@ -511,29 +511,8 @@ void XMLRedlineImportHelper::InsertWithinParagraph(const OUString& rParaPos, boo
     {
         // 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);
-        }
+        pInfo->aAnchorStart.Set(rRange);
+        pInfo->aAnchorEnd.Set(rRange);
 
         // if this Cursor was the last missing info, we insert the
         // node into the document
@@ -722,7 +701,6 @@ void XMLRedlineImportHelper::InsertIntoDocument(RedlineInfo* pRedlineInfo)
             pRedline->SetMark();
             *(pRedline->GetMark()) = *aPaM.GetMark();
         }
-
         // set content node (if necessary)
         if (nullptr != pRedlineInfo->pContentIndex)
         {
diff --git a/xmloff/source/text/XMLTrackedChangesImportContext.cxx b/xmloff/source/text/XMLTrackedChangesImportContext.cxx
index ccd3f7b..244d655 100644
--- a/xmloff/source/text/XMLTrackedChangesImportContext.cxx
+++ b/xmloff/source/text/XMLTrackedChangesImportContext.cxx
@@ -108,10 +108,15 @@ SvXMLImportContext* XMLTrackedChangesImportContext::CreateChildContext(
         // from the ODF 1.2 standard :
         // The <text:changed-region> element has the following child elements:
         // <text:deletion>, <text:format-change> and <text:insertion>.
+        OUString sChangeType;
         if ( IsXMLToken( rLocalName, XML_INSERTION ) ||
              IsXMLToken( rLocalName, XML_DELETION ) ||
              IsXMLToken( rLocalName, XML_FORMAT_CHANGE ) )
         {
+            if( rLocalName == GetXMLToken( XML_INSERTION ) )
+                sChangeType = GetXMLToken( XML_DELETION );
+            else
+                sChangeType = GetXMLToken( XML_INSERTION );
             sal_Int16 nLength = xAttrList->getLength();
             for( sal_Int16 i = 0; i < nLength; i++ )
             {
@@ -121,7 +126,7 @@ SvXMLImportContext* XMLTrackedChangesImportContext::CreateChildContext(
                 const OUString sValue = xAttrList->getValueByIndex(i);
                 if (XML_NAMESPACE_C == nPrefix)
                 {
-                    if (IsXMLToken(sLocalName, xmloff::token::XML_START))
+                    if (IsXMLToken(sLocalName, XML_START))
                     {
                         sStart = sValue.pData->buffer + 1;
                         if(sStart.indexOf('/') != -1)
@@ -156,12 +161,12 @@ SvXMLImportContext* XMLTrackedChangesImportContext::CreateChildContext(
                     }
                 }
             }
-            SetChangeInfo( rLocalName, sAuthor, sComment, sDate, sStartParaPos, sStartTextPos );
+            SetChangeInfo( sChangeType, sAuthor, sComment, sDate, sStartParaPos, sStartTextPos );
 
             // create XMLChangeElementImportContext for all kinds of changes
             pContext = new XMLChangeElementImportContext(
-                GetImport(), nPrefix, rLocalName,
-                IsXMLToken( rLocalName, XML_DELETION ),
+                GetImport(), nPrefix, sChangeType,
+                IsXMLToken( sChangeType, XML_DELETION ),
                 *this);
         }
         // else: it may be a text element, see below


More information about the Libreoffice-commits mailing list