[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: =?utf-8?q?=5Bcalligra=5D_libs/kotext/opendocument=3A_check_wheth?=
From: Boudewijn Rempt <boud () valdyas ! org>
Date: 2011-04-12 13:22:44
Message-ID: 20110412132244.7EC7BA609B () git ! kde ! org
[Download RAW message or body]
Git commit 712f2a4b2d4bf19a911f28046dd754a3384da8ef by Boudewijn Rempt.
Committed on 12/04/2011 at 15:22.
Pushed by rempt into branch 'master'.
check whether the changetracker exists
M +6 -3 libs/kotext/opendocument/KoTextWriter.cpp
http://commits.kde.org/calligra/712f2a4b2d4bf19a911f28046dd754a3384da8ef
diff --git a/libs/kotext/opendocument/KoTextWriter.cpp \
b/libs/kotext/opendocument/KoTextWriter.cpp index ca6194e..a5a7580 100644
--- a/libs/kotext/opendocument/KoTextWriter.cpp
+++ b/libs/kotext/opendocument/KoTextWriter.cpp
@@ -282,6 +282,8 @@ void KoTextWriter::Private::saveChange(QTextCharFormat format)
void KoTextWriter::Private::saveChange(int changeId)
{
+ if (!changeTracker) return;
+
if(changeTransTable.value(changeId).length())
return;
@@ -345,6 +347,7 @@ void KoTextWriter::Private::saveODF12Change(QTextCharFormat \
format)
QString KoTextWriter::Private::generateDeleteChangeXml(KoDeleteChangeMarker *marker)
{
+ if (!changeTracker) return
//Create a QTextDocument from the Delete Fragment
QTextDocument doc;
QTextCursor cursor(&doc);
@@ -1703,13 +1706,13 @@ int KoTextWriter::Private::checkForMergeOrSplit(const \
QTextBlock &block, KoGenCh
nextBlockChangeId = \
endBlock.next().blockFormat().property(KoCharacterStyle::ChangeTrackerId).toInt(); }
- if (changeTracker->isDuplicateChangeId(nextBlockChangeId)) {
+ if (changetracker && changeTracker->isDuplicateChangeId(nextBlockChangeId)) \
{
nextBlockChangeId = changeTracker->originalChangeId(nextBlockChangeId);
}
if (!changeId) {
splitMergeChangeId = changeId = nextBlockChangeId;
- if ((changeId) && \
(changeTracker->elementById(nextBlockChangeId)->getChangeType() == changeType)) { + \
if ((changeId) && (changeTracker && \
changeTracker->elementById(nextBlockChangeId)->getChangeType() == changeType)) { \
endBlock = endBlock.next(); } else {
changeId = 0;
@@ -1728,7 +1731,7 @@ int KoTextWriter::Private::checkForMergeOrSplit(const \
QTextBlock &block, KoGenCh QTextFragment lastFragment = \
(--(endBlock.end())).fragment(); QTextCharFormat lastFragmentFormat = \
lastFragment.charFormat();
int lastFragmentChangeId = \
lastFragmentFormat.intProperty(KoCharacterStyle::ChangeTrackerId);
- if (changeTracker->isDuplicateChangeId(lastFragmentChangeId)) {
+ if (changeTracker && \
gchangeTracker->isDuplicateChangeId(lastFragmentChangeId)) {
lastFragmentChangeId = \
changeTracker->originalChangeId(lastFragmentChangeId); }
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic