[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    =?utf-8?q?=5Bkoffice/koffice/change-tracking=5D_libs/kotext/open?=
From:       Ganesh Paramasivam <ganesh () crystalfab ! com>
Date:       2011-03-08 8:59:57
Message-ID: 20110308085957.0248FA60B0 () git ! kde ! org
[Download RAW message or body]

Git commit 10a42e52607bfd61251bffe3e0c974ea1a9bf865 by Ganesh Paramasivam.
Committed on 08/03/2011 at 09:59.
Pushed by ganeshp into branch 'koffice/change-tracking'.

Bug-fixes in the saving of ODF 1.2 changes

M  +10   -1    libs/kotext/opendocument/KoTextWriter.cpp     

http://commits.kde.org/koffice/10a42e52607bfd61251bffe3e0c974ea1a9bf865

diff --git a/libs/kotext/opendocument/KoTextWriter.cpp b/libs/kotext/opendocument/KoTextWriter.cpp
index 6d8bff8..826156e 100644
--- a/libs/kotext/opendocument/KoTextWriter.cpp
+++ b/libs/kotext/opendocument/KoTextWriter.cpp
@@ -294,7 +294,7 @@ void KoTextWriter::Private::saveODF12Change(QTextCharFormat format)
     int changeId = format.property(KoCharacterStyle::ChangeTrackerId).toInt();
 
     //First we need to check if the eventual already opened change regions are still valid
-    foreach(int change, changeStack) {
+    while (int change = changeStack.top()) {
         if (!changeId || !changeTracker->isParent(change, changeId)) {
             writer->startElement("text:change-end", false);
             writer->addAttribute("text:change-id", changeTransTable.value(change));
@@ -939,6 +939,15 @@ void KoTextWriter::Private::saveParagraph(const QTextBlock &block, int from, int
         }
     }
     
+    if (changeTracker->saveFormat() == KoChangeTracker::ODF_1_2) {
+        while (int change = changeStack.top()) {
+            writer->startElement("text:change-end", false);
+            writer->addAttribute("text:change-id", changeTransTable.value(change));
+            writer->endElement();
+            changeStack.pop();
+        }   
+    }
+
     closeTagRegion(changeId);
 }
 

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic