summaryrefslogtreecommitdiff
path: root/sot/source/base/filelist.cxx
diff options
context:
space:
mode:
authorRĂ¼diger Timm <rt@openoffice.org>2004-10-22 06:53:19 +0000
committerRĂ¼diger Timm <rt@openoffice.org>2004-10-22 06:53:19 +0000
commit36b524858c73c6ebfd8ef0e05f3d66464f361f37 (patch)
treeae5129a318a2f694d3896ccbab093c333a6096fd /sot/source/base/filelist.cxx
parent4a797602fd9a6141e16c5cb5289861cd036b73cd (diff)
INTEGRATION: CWS dtransfix (1.5.180); FILE MERGED
2004/10/08 06:49:55 tra 1.5.180.1: #i28176#the windows clipboard bridge now provides a double 0 terminated string list of file names where windows shell links are already resolved, input stream operator has been adapted accordingly, the output stream operator does nothing anymore and all Windows specific code has been removed
Diffstat (limited to 'sot/source/base/filelist.cxx')
-rw-r--r--sot/source/base/filelist.cxx139
1 files changed, 24 insertions, 115 deletions
diff --git a/sot/source/base/filelist.cxx b/sot/source/base/filelist.cxx
index bdcd5e68f7cb..9e942a5499c4 100644
--- a/sot/source/base/filelist.cxx
+++ b/sot/source/base/filelist.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: filelist.cxx,v $
*
- * $Revision: 1.5 $
+ * $Revision: 1.6 $
*
- * last change: $Author: pb $ $Date: 2002-03-22 13:54:11 $
+ * last change: $Author: rt $ $Date: 2004-10-22 07:53:19 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -123,7 +123,6 @@ FileList& FileList::operator=( const FileList& rFileList )
return *this;
}
-
/*************************************************************************
|*
|* FileList::GetFormatName()
@@ -135,7 +134,6 @@ ULONG FileList::GetFormat()
return FORMAT_FILE_LIST;
}
-
/******************************************************************************
|*
|* virtuelle SvData-Methoden
@@ -157,52 +155,12 @@ void FileList::Assign( const SvDataCopyStream& rCopyStream )
*this = (const FileList&)rCopyStream;
}
-
/******************************************************************************
|*
|* Stream-Operatoren
|*
\******************************************************************************/
-// Windows-Struktur nachdefinieren
-// Typen entsprechend der Groesse der Original-Typen gewaehlt
-// In den Kommentaren sind jeweils die Original-Typen angegeben.
-// Hier werden immer die 32-Bit-Varianten der Typen gewaehlt, um
-// eine einheitliche Struktur fuer alle Plattformen zu erhalten.
-// Diese Struktor ist zwar nicht Win16-kompatibel, dort kann aber
-// die Struktur auch nicht direkt per Drag&Drop uebertragen werden.
-struct Sv_DROPFILES
-{
- /*DWORD = unsigned long*/ UINT32 pFiles; // offset of file list
- /*POINT = { long, long }*/ INT32 pt_x; // drop point
- INT32 pt_y;
- /*BOOL = int*/ INT32 fNC;
- /*BOOL = int*/ INT32 fWide; // wide character-flag
-
- // Konstruktor
- Sv_DROPFILES( void )
- {
- pFiles = 20; // 5 x 4 Bytes, sizeof gefaehrlich wegen alignment
- pt_x = 0L;
- pt_y = 0L;
- fNC = FALSE;
- fWide = FALSE; // NOTE: Unicode not allowed for Windows 95 !!
- }
-
-};
-
-// Stream-Operatoren fuer Sv_DROPFILES
-SvStream& operator<<( SvStream& rOStm, const Sv_DROPFILES& r )
-{
- rOStm << r.pFiles << r.pt_x << r.pt_y << r.fNC << r.fWide;
- return rOStm;
-}
-SvStream& operator>>( SvStream& rIStm, Sv_DROPFILES& r )
-{
- rIStm >> r.pFiles >> r.pt_x >> r.pt_y >> r.fNC >> r.fWide;
- return rIStm;
-}
-
/*
* NOTE: to correctly handle this Protocol with Unicode, native Win32 must be called:
* e.g. DropQueryFile
@@ -210,92 +168,43 @@ SvStream& operator>>( SvStream& rIStm, Sv_DROPFILES& r )
SvStream& operator<<( SvStream& rOStm, const FileList& rFileList )
{
- // Windows-kompatible Struktur anlegen und streamen
- Sv_DROPFILES aSv_DROPFILES;
- rOStm << aSv_DROPFILES;
-
- // String-Liste anhaengen
- ULONG nCount = rFileList.pStrList->Count();
- for( ULONG i = 0 ; i < nCount ; i++ )
- {
- String* pStr = rFileList.pStrList->GetObject( i );
-// rOStm << pStr->GetBuffer();
- rOStm << "invalid.txt"; //
-
- // Noch eine 0 anhaengen
- rOStm << (char)0;
- }
- // Noch eine 0 anhaengen
- rOStm << (char)0;
-
+ OSL_ENSURE(false, "Not implemented!");
return rOStm;
}
+/* #i28176#
+ The Windows clipboard bridge now provides a double '\0'
+ terminated list of file names for format SOT_FORMAT_FILE_LIST
+ instead of the original Windows Sv_DROPFILES structure. All strings
+ in this list are UTF16 strings. Shell link files will be already
+ resolved by the Windows clipboard bridge.*/
SvStream& operator>>( SvStream& rIStm, FileList& rFileList )
{
- // Windows-kompatible Struktur anlegen und aus Stream lesen
- Sv_DROPFILES aSv_DROPFILES;
- rIStm >> aSv_DROPFILES;
-
- // Bestehende Liste loeschen und neue anlegen
rFileList.ClearAll();
rFileList.pStrList = new FileStringList();
- // String-Liste aufbauen
- // Unicode ?
- if( aSv_DROPFILES.fWide )
- {
- // yes, Unicode
- String aStr;
- sal_uInt16 c;
-
- while( !rIStm.IsEof() )
- {
- aStr.Erase();
+ String aStr;
+ sal_uInt16 c;
- // read first character of filepath; c==0 > reach end of stream
- rIStm >> c;
- if ( !c )
- break;
-
- // read string till c==0
- while( c && !rIStm.IsEof() )
- {
- aStr += (sal_Unicode)c;
- rIStm >> c;
- }
-
- // append the filepath
- rFileList.AppendFile( aStr );
- }
- }
- else
+ while (!rIStm.IsEof())
{
- // no, only ANSI
- ByteString aStr;
- sal_Char c;
+ aStr.Erase();
- while( !rIStm.IsEof() )
- {
- aStr.Erase();
+ // read first character of filepath; c==0 > reach end of stream
+ rIStm >> c;
+ if (!c)
+ break;
- // read first character of filepath; c==0 > reach end of stream
+ // read string till c==0
+ while (c && !rIStm.IsEof())
+ {
+ aStr += (sal_Unicode)c;
rIStm >> c;
- if ( !c )
- break;
-
- // read string till c==0
- while( c && !rIStm.IsEof() )
- {
- aStr += c;
- rIStm >> c;
- }
-
- // append the filepath
- rFileList.AppendFile( String( aStr, osl_getThreadTextEncoding() ) );
}
- }
+ // append the filepath
+ rFileList.AppendFile(aStr);
+ }
return rIStm;
}