summaryrefslogtreecommitdiff
path: root/sot/source/base/filelist.cxx
diff options
context:
space:
mode:
authorjp <jp@openoffice.org>2001-09-06 12:47:09 +0000
committerjp <jp@openoffice.org>2001-09-06 12:47:09 +0000
commit4141ccb19788abe56b15348cd9a2c2869301256a (patch)
treeb008067bc13c784cf8ec0edb489fbf1885738d65 /sot/source/base/filelist.cxx
parent3f9617ead7985e534057ed4a1443a6e64c2779eb (diff)
Task #91670#: handle Unicode strings correct in the read method
Diffstat (limited to 'sot/source/base/filelist.cxx')
-rw-r--r--sot/source/base/filelist.cxx66
1 files changed, 42 insertions, 24 deletions
diff --git a/sot/source/base/filelist.cxx b/sot/source/base/filelist.cxx
index 8623b247d281..608a8ae1164e 100644
--- a/sot/source/base/filelist.cxx
+++ b/sot/source/base/filelist.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: filelist.cxx,v $
*
- * $Revision: 1.2 $
+ * $Revision: 1.3 $
*
- * last change: $Author: jp $ $Date: 2001-05-04 15:46:38 $
+ * last change: $Author: jp $ $Date: 2001-09-06 13:47:09 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -241,35 +241,53 @@ SvStream& operator>>( SvStream& rIStm, FileList& rFileList )
rFileList.pStrList = new FileStringList();
// String-Liste aufbauen
- ByteString aStr;
- char c, cLast;
-
- // 1. Zeichen lesen
- rIStm >> c;
- do
+ // Unicode ?
+ if( aSv_DROPFILES.fWide )
{
- aStr = ByteString();
+ // no, only ANSI
+ String aStr;
+ sal_uInt16 c;
+
+ // 1. Zeichen lesen
+ rIStm >> c;
+ do {
+ aStr.Erase();
+
+ // String bis '\0' lesen
+ while( c && !rIStm.IsEof() )
+ {
+ aStr += (sal_Unicode)c;
+ rIStm >> c;
+ }
- // String bis '\0' lesen
- do
- {
- if( c )
+ // String in die Liste stopfen
+ rFileList.AppendFile( aStr );
+ }
+ while( c && !rIStm.IsEof() ); // c == 0 && cLast == 0 -> Ende
+ }
+ else
+ {
+ // no, only ANSI
+ ByteString aStr;
+ sal_Char c;
+
+ // 1. Zeichen lesen
+ rIStm >> c;
+ do {
+ aStr.Erase();
+
+ // String bis '\0' lesen
+ while( c && !rIStm.IsEof() )
+ {
aStr += c;
- cLast = c; // Zeichen merken
-
- // Bei Unicode eins mehr weg
- if( aSv_DROPFILES.fWide )
rIStm >> c;
+ }
- rIStm >> c;
+ // String in die Liste stopfen
+ rFileList.AppendFile( String(aStr, RTL_TEXTENCODING_ASCII_US));
}
- while( cLast && !rIStm.IsEof() );
-
- // String in die Liste stopfen
- rFileList.AppendFile( String(aStr, RTL_TEXTENCODING_ASCII_US));
+ while( c && !rIStm.IsEof() ); // c == 0 && cLast == 0 -> Ende
}
- while( c && !rIStm.IsEof() ); // c == 0 && cLast == 0 -> Ende
-
return rIStm;
}