@@ -57,7 +57,7 @@ EBook_CHM::EBook_CHM()
5757 m_filename = m_font = QString ();
5858
5959 m_textCodec = 0 ;
60- m_textCodecForSpecialFiles = 0 ;
60+ m_textCodecForInternalFiles = 0 ;
6161 m_detectedLCID = 0 ;
6262 m_currentEncoding = " UTF-8" ;
6363 m_htmlEntityDecoder = 0 ;
@@ -84,7 +84,7 @@ void EBook_CHM::close()
8484 m_indexFile.clear ();
8585
8686 m_textCodec = 0 ;
87- m_textCodecForSpecialFiles = 0 ;
87+ m_textCodecForInternalFiles = 0 ;
8888 m_detectedLCID = 0 ;
8989 m_currentEncoding = " UTF-8" ;
9090 m_lookupTablesValid = false ;
@@ -212,21 +212,6 @@ bool EBook_CHM::getFileContentAsBinary( QByteArray& data, const QUrl& url ) cons
212212 return getBinaryContent ( data, urlToPath ( url ) );
213213}
214214
215- bool EBook_CHM::getBinaryContent ( QByteArray& data, const QString& url ) const
216- {
217- chmUnitInfo ui;
218-
219- if ( !ResolveObject ( url, &ui ) )
220- return false ;
221-
222- data.resize ( ui.length );
223-
224- if ( RetrieveObject ( &ui, ( unsigned char * ) data.data (), 0 , ui.length ) )
225- return true ;
226-
227- return false ;
228- }
229-
230215bool EBook_CHM::getTextContent ( QString& str, const QString& url, bool internal_encoding ) const
231216{
232217 QByteArray buf;
@@ -248,6 +233,21 @@ bool EBook_CHM::getTextContent( QString& str, const QString& url, bool internal_
248233 return false ;
249234}
250235
236+ bool EBook_CHM::getBinaryContent ( QByteArray& data, const QString& url ) const
237+ {
238+ chmUnitInfo ui;
239+
240+ if ( !ResolveObject ( url, &ui ) )
241+ return false ;
242+
243+ data.resize ( ui.length );
244+
245+ if ( RetrieveObject ( &ui, ( unsigned char * ) data.data (), 0 , ui.length ) )
246+ return true ;
247+
248+ return false ;
249+ }
250+
251251int EBook_CHM::getContentSize ( const QString& url )
252252{
253253 chmUnitInfo ui;
@@ -290,7 +290,7 @@ bool EBook_CHM::load( const QString& archiveName )
290290
291291 // Reset encoding
292292 m_textCodec = 0 ;
293- m_textCodecForSpecialFiles = 0 ;
293+ m_textCodecForInternalFiles = 0 ;
294294 m_currentEncoding = " UTF-8" ;
295295
296296 // Get information from /#WINDOWS and /#SYSTEM files (encoding, title, context file and so)
@@ -892,7 +892,7 @@ bool EBook_CHM::changeFileEncoding( const QString& qtencoding )
892892 if ( p != -1 )
893893 {
894894 QString global = qtencoding.left ( p );
895- QString special = qtencoding.mid ( p + 1 );
895+ QString internal = qtencoding.mid ( p + 1 );
896896
897897 m_textCodec = QTextCodec::codecForName ( global.toUtf8 () );
898898
@@ -902,17 +902,17 @@ bool EBook_CHM::changeFileEncoding( const QString& qtencoding )
902902 return false ;
903903 }
904904
905- m_textCodecForSpecialFiles = QTextCodec::codecForName ( special .toUtf8 () );
905+ m_textCodecForInternalFiles = QTextCodec::codecForName ( internal .toUtf8 () );
906906
907- if ( !m_textCodecForSpecialFiles )
907+ if ( !m_textCodecForInternalFiles )
908908 {
909- qWarning ( " Could not set up Text Codec for encoding '%s'" , qPrintable ( special ) );
909+ qWarning ( " Could not set up Text Codec for encoding '%s'" , qPrintable ( internal ) );
910910 return false ;
911911 }
912912 }
913913 else
914914 {
915- m_textCodecForSpecialFiles = m_textCodec = QTextCodec::codecForName ( qtencoding.toUtf8 () );
915+ m_textCodecForInternalFiles = m_textCodec = QTextCodec::codecForName ( qtencoding.toUtf8 () );
916916
917917 if ( !m_textCodec )
918918 {
0 commit comments