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

List:       kde-commits
Subject:    [KOffice/koffice/change-tracking] 56127f7: Fixing a character style
From:       Ganesh Paramasivam <ganesh () crystalfab ! com>
Date:       2011-01-17 13:15:04
Message-ID: 20110117131504.0F3C7A6090 () git ! kde ! org
[Download RAW message or body]

commit 56127f781a98bfa21b6c3067ce85a4c649313c0b
branch koffice/change-tracking
Author: Ganesh Paramasivam <ganesh@crystalfab.com>
Date:   Mon Jan 17 18:44:26 2011 +0530

    Fixing a character style bug by storing and restoring the charformat during the \
processing of a deleted span

diff --git a/libs/kotext/opendocument/KoTextLoader.cpp \
b/libs/kotext/opendocument/KoTextLoader.cpp index 355c5c2..4f0beb8 100644
--- a/libs/kotext/opendocument/KoTextLoader.cpp
+++ b/libs/kotext/opendocument/KoTextLoader.cpp
@@ -1399,6 +1399,7 @@ void KoTextLoader::loadSpan(const KoXmlElement &element, \
                QTextCursor &cursor, bo
         } else if (isDeltaNS && localName == "remove-leaving-content-end") {
             d->closeChangeRegion(ts);
         } else if (isDeltaNS && localName == "removed-content") {
+            QTextCharFormat cf = cursor.charFormat(); // store the current cursor \
                char format
             QString changeId = ts.attributeNS(KoXmlNS::delta, \
"removal-change-idref");  int deleteStartPosition = cursor.position();
             bool stripLeadingSpace = true;
@@ -1409,6 +1410,7 @@ void KoTextLoader::loadSpan(const KoXmlElement &element, \
                QTextCursor &cursor, bo
                 KoDeleteChangeMarker *marker = \
                d->insertDeleteChangeMarker(tempCursor, changeId);
                 d->deleteChangeMarkerMap.insert(marker, \
QPair<int,int>(deleteStartPosition+1, cursor.position()));  }
+            cursor.setCharFormat(cf); // restore the cursor char format
         } else if (isDeltaNS && localName == "merge") {
             loadMerge(ts, cursor);
         } else if (isTextNS && localName == "change-start") { // text:change-start


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

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