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; }