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

List:       kde-commits
Subject:    [calligra/words-table-cell-borders] libs/kotext/styles: Fix crashes
From:       Pierre Ducroquet <pinaraf () pinaraf ! info>
Date:       2011-08-01 23:28:10
Message-ID: 20110801232810.BE338A60AE () git ! kde ! org
[Download RAW message or body]

Git commit c6338da588e10890d971532256443fbe58720403 by Pierre Ducroquet.
Committed on 02/08/2011 at 00:49.
Pushed by ducroquet into branch 'words-table-cell-borders'.

Fix crashes

M  +1    -0    libs/kotext/styles/KoTableCellStyle_p.h
M  +6    -1    libs/kotext/styles/KoTableCellStyle.h
M  +2    -0    libs/kotext/styles/KoTableCellStyle.cpp

http://commits.kde.org/calligra/c6338da588e10890d971532256443fbe58720403

diff --git a/libs/kotext/styles/KoTableCellStyle.cpp b/libs/kotext/styles/KoTableCellStyle.cpp
index 7b9f227..b6d0058 100644
--- a/libs/kotext/styles/KoTableCellStyle.cpp
+++ b/libs/kotext/styles/KoTableCellStyle.cpp
@@ -86,6 +86,7 @@ void KoTableCellStylePrivate::setProperty(int key, const QVariant &value)
 
 KoTableCellStyle::KoTableCellStyle(QObject *parent)
     : QObject(parent)
+    , d_ptr(new KoTableCellStylePrivate)
 {
     Q_D(KoTableCellStyle);
     d->charStyle = new KoCharacterStyle(this);
@@ -93,6 +94,7 @@ KoTableCellStyle::KoTableCellStyle(QObject *parent)
 
 KoTableCellStyle::KoTableCellStyle(const QTextTableCellFormat &format, QObject *parent)
     : QObject(parent)
+    , d_ptr(new KoTableCellStylePrivate)
 {
     Q_D(KoTableCellStyle);
     d->stylesPrivate = format.properties();
diff --git a/libs/kotext/styles/KoTableCellStyle.h b/libs/kotext/styles/KoTableCellStyle.h
index 0836c6a..8ae13a0 100644
--- a/libs/kotext/styles/KoTableCellStyle.h
+++ b/libs/kotext/styles/KoTableCellStyle.h
@@ -42,9 +42,10 @@ class KoGenStyle;
 class KoGenStyles;
 class KoCharacterStyle;
 #include "KoXmlReaderForward.h"
-class KoTableCellStylePrivate;
 class KoShapeLoadingContext;
 
+class KoTableCellStylePrivate;
+
 /**
  * A container for all properties for the table cell style.
  * Each tablecell in the main text either is based on a table cell style, or its not. Where
@@ -331,6 +332,9 @@ public:
 signals:
     void nameChanged(const QString &newName);
 
+protected:
+    KoTableCellStylePrivate * const d_ptr;
+    
 private:
     /**
      * Load the style from the \a KoStyleStack style stack using the
@@ -344,6 +348,7 @@ private:
     QColor propertyColor(int key) const;
 
     Q_DECLARE_PRIVATE(KoTableCellStyle)
+    
 };
 
 #endif
diff --git a/libs/kotext/styles/KoTableCellStyle_p.h b/libs/kotext/styles/KoTableCellStyle_p.h
index f716846..8d8263c 100644
--- a/libs/kotext/styles/KoTableCellStyle_p.h
+++ b/libs/kotext/styles/KoTableCellStyle_p.h
@@ -36,6 +36,7 @@ public:
     int next;
     StylePrivate stylesPrivate;
     
+    ///@TODO: kill the next two members
     KoTableBorderStyle::Edge edges[6];
     KoBorder::BorderStyle borderstyle[6];
 };


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

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