From koffice-devel Mon Aug 26 13:44:28 2002 From: Ariya Hidayat Date: Mon, 26 Aug 2002 13:44:28 +0000 To: koffice-devel Subject: patch to fix bug #28049 X-MARC-Message: https://marc.info/?l=koffice-devel&m=103037298617633 MIME-Version: 1 Content-Type: multipart/mixed; boundary="--------------Boundary-00=_46EGFCDHCBB0WNCQE8M9" --------------Boundary-00=_46EGFCDHCBB0WNCQE8M9 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8bit The following patch fixes bug #28049 (MS Excel filter doesn't translate sheet name). I only tested it on some Cyrillic Excel files but should work well. Please review. PS: Thanks to Vadim for the XLS files. --------------Boundary-00=_46EGFCDHCBB0WNCQE8M9 Content-Type: text/x-diff; charset="us-ascii"; name="sheetname.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="sheetname.patch" Index: worker.cc =================================================================== RCS file: /home/kde/koffice/filters/olefilters/excel97/worker.cc,v retrieving revision 1.11 diff -u -3 -p -r1.11 worker.cc --- worker.cc 2002/06/16 18:45:30 1.11 +++ worker.cc 2002/08/26 14:41:10 @@ -192,7 +192,8 @@ bool Worker::op_boundsheet(Q_UINT32, QDa { Q_UINT32 lbPlyPos; Q_UINT16 grbit; - Q_UINT16 cch; + Q_UINT8 cch; + Q_UINT8 flag; Q_UINT8 tmp8; QDomElement *e; @@ -203,16 +204,34 @@ bool Worker::op_boundsheet(Q_UINT32, QDa cch = tmp8; break; case BIFF_8: - body >> lbPlyPos >> grbit >> cch; + body >> lbPlyPos >> grbit >> cch >> flag; break; default: return false; } - char *name = new char[cch]; - body.readRawBytes(name, cch); - QString s = QString::fromLatin1(name, cch); - delete []name; + QString s; // name of sheet/macro/chart + + if( flag & 1 ) + { + // Unicode + for( int i=0; i> ch; + s.append( QChar( ch ) ); + } + } + else + { + // Latin1 + for( int i=0; i> ch; + s.append( (char)ch ); + } + } if((grbit & 0x0f) == 0) { --------------Boundary-00=_46EGFCDHCBB0WNCQE8M9-- _______________________________________________ koffice-devel mailing list koffice-devel@mail.kde.org http://mail.kde.org/mailman/listinfo/koffice-devel