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

List:       kde-commits
Subject:    =?utf-8?q?=5Bcalligra=5D_libs/kotext=3A_Allow_a_pointer_to_an_?=
From:       Casper Boemann <cbo () boemann ! dk>
Date:       2011-05-16 9:13:34
Message-ID: 20110516091334.DCB5DA60E5 () git ! kde ! org
[Download RAW message or body]

Git commit 0b1f1d128ef09c102d85811039beed9367bb4c38 by Casper Boemann.
Committed on 15/05/2011 at 14:13.
Pushed by boemann into branch 'master'.

Allow a pointer to an "undefined" ToCgenerator to be stored.

M  +14   -0    libs/kotext/KoTableOfContentsGeneratorInfo.cpp     
M  +7    -0    libs/kotext/KoTableOfContentsGeneratorInfo.h     

http://commits.kde.org/calligra/0b1f1d128ef09c102d85811039beed9367bb4c38

diff --git a/libs/kotext/KoTableOfContentsGeneratorInfo.cpp \
b/libs/kotext/KoTableOfContentsGeneratorInfo.cpp index 4aab0be..731ee6c 100644
--- a/libs/kotext/KoTableOfContentsGeneratorInfo.cpp
+++ b/libs/kotext/KoTableOfContentsGeneratorInfo.cpp
@@ -227,6 +227,7 @@ int \
KoTableOfContentsGeneratorInfo::styleNameToStyleId(KoTextSharedLoadingData *  
 
 KoTableOfContentsGeneratorInfo::KoTableOfContentsGeneratorInfo()
+  : m_generator(0)
 {
 }
 
@@ -235,6 +236,8 @@ KoTableOfContentsGeneratorInfo::~KoTableOfContentsGeneratorInfo()
     foreach (const TocEntryTemplate &entryTemplate, m_entryTemplate) {
         qDeleteAll(entryTemplate.indexEntries);
     }
+    delete m_generator;
+    m_generator = 0; // just to be safe
 }
 
 
@@ -364,3 +367,14 @@ void KoTableOfContentsGeneratorInfo::saveOdf(KoXmlWriter * \
writer) const  
     writer->endElement(); // text:table-of-content-source
 }
+
+void KoTableOfContentsGeneratorInfo::setGenerator(ToCGenerator *generator)
+{
+    delete m_generator;
+    m_generator = generator;
+}
+
+ToCGenerator *KoTableOfContentsGeneratorInfo::generator() const
+{
+    return m_generator;
+}
diff --git a/libs/kotext/KoTableOfContentsGeneratorInfo.h \
b/libs/kotext/KoTableOfContentsGeneratorInfo.h index 97d2697..4f91bee 100644
--- a/libs/kotext/KoTableOfContentsGeneratorInfo.h
+++ b/libs/kotext/KoTableOfContentsGeneratorInfo.h
@@ -33,6 +33,7 @@
 #include <KoXmlWriter.h>
 
 class KoTextSharedLoadingData;
+class ToCGenerator; // not actually defined in kotext, a textlayouter is free to \
define  
 const int INVALID_OUTLINE_LEVEL = 0;
 
@@ -166,6 +167,11 @@ public:
     void loadOdf(KoTextSharedLoadingData *sharedLoadingData, const KoXmlElement \
&element);  void saveOdf(KoXmlWriter *writer) const;
 
+    void setGenerator(ToCGenerator *generator);
+
+    ToCGenerator *generator() const;
+
+
     QString m_name;
     QString m_styleName;
     // TODO: add support for those according ODF v1.2
@@ -186,6 +192,7 @@ public:
 
 private:
     int styleNameToStyleId(KoTextSharedLoadingData *sharedLoadingData, QString \
styleName); +    ToCGenerator * m_generator;
 };
 
 Q_DECLARE_METATYPE(KoTableOfContentsGeneratorInfo *)


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

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