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
remotes/origin/KDE/4.1
Pino Toscano 18 years ago
parent 890367943b
commit 242891d48e
  1. 8
      generators/ooo/converter.cpp

@ -62,14 +62,12 @@ QTextCharFormat Style::textFormat() const
Converter::Converter() Converter::Converter()
: mTextDocument( 0 ), mCursor( 0 ), : mTextDocument( 0 ), mCursor( 0 ),
mStyleInformation( new StyleInformation ) mStyleInformation( 0 )
{ {
} }
Converter::~Converter() Converter::~Converter()
{ {
delete mStyleInformation;
mStyleInformation = 0;
} }
QTextDocument* Converter::convert( const QString &fileName ) QTextDocument* Converter::convert( const QString &fileName )
@ -99,6 +97,8 @@ QTextDocument* Converter::convert( const QString &fileName )
return false; return false;
} }
mStyleInformation = new StyleInformation();
/** /**
* Read the style properties, so the are available when * Read the style properties, so the are available when
* parsing the content. * parsing the content.
@ -160,6 +160,8 @@ QTextDocument* Converter::convert( const QString &fileName )
} }
delete mCursor; delete mCursor;
delete mStyleInformation;
mStyleInformation = 0;
return mTextDocument; return mTextDocument;
} }

Loading…
Cancel
Save