From 242891d48e1b09efb95bdf38c6591bec6473f566 Mon Sep 17 00:00:00 2001 From: Pino Toscano Date: Sat, 19 Apr 2008 20:15:40 +0000 Subject: [PATCH] create the style information object only during the conversion; this way, there are no stale information across multiple openings svn path=/trunk/KDE/kdegraphics/okular/; revision=798890 --- generators/ooo/converter.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/generators/ooo/converter.cpp b/generators/ooo/converter.cpp index 0427e0fbe..15f194128 100644 --- a/generators/ooo/converter.cpp +++ b/generators/ooo/converter.cpp @@ -62,14 +62,12 @@ QTextCharFormat Style::textFormat() const Converter::Converter() : mTextDocument( 0 ), mCursor( 0 ), - mStyleInformation( new StyleInformation ) + mStyleInformation( 0 ) { } Converter::~Converter() { - delete mStyleInformation; - mStyleInformation = 0; } QTextDocument* Converter::convert( const QString &fileName ) @@ -99,6 +97,8 @@ QTextDocument* Converter::convert( const QString &fileName ) return false; } + mStyleInformation = new StyleInformation(); + /** * Read the style properties, so the are available when * parsing the content. @@ -160,6 +160,8 @@ QTextDocument* Converter::convert( const QString &fileName ) } delete mCursor; + delete mStyleInformation; + mStyleInformation = 0; return mTextDocument; }