[Libreoffice-commits] .: 10 commits - i18npool/source rsc/source svl/inc svl/source svtools/inc svtools/source tools/bootstrp tools/inc tools/source vcl/inc vcl/source vcl/unx

Thomas Arnhold tarnhold at kemper.freedesktop.org
Wed Feb 16 11:17:19 PST 2011


 i18npool/source/search/levdis.hxx  |   15 
 rsc/source/parser/rsclex.cxx       |    4 
 rsc/source/parser/rsclex.hxx       |    2 
 rsc/source/prj/makefile.mk         |    6 
 svl/inc/cntwids.hrc                |    6 
 svl/inc/svl/svarray.hxx            |    2 
 svl/source/svdde/ddedll.cxx        |   66 
 svl/source/svdde/ddeml1.cxx        | 2658 -------------------------------------
 svl/source/svdde/ddeml2.cxx        | 1013 --------------
 svl/source/svdde/ddemldeb.cxx      |  280 ---
 svl/source/svdde/ddemldeb.hxx      |   68 
 svl/source/svdde/ddemlimp.hxx      |  435 ------
 svtools/inc/svtools/brwbox.hxx     |    4 
 svtools/source/brwbox/brwbox1.cxx  |   50 
 svtools/source/brwbox/datwin.hxx   |   12 
 svtools/source/contnr/svimpbox.cxx |    8 
 svtools/source/svhtml/parhtml.cxx  |   13 
 svtools/source/svrtf/parrtf.cxx    |   12 
 tools/bootstrp/command.cxx         |    6 
 tools/inc/tools/inetdef.hxx        |    8 
 tools/inc/tools/solar.h            |    4 
 tools/source/fsys/unx.cxx          |   19 
 tools/source/stream/strmunx.cxx    |   17 
 vcl/inc/sft.hxx                    |   18 
 vcl/source/fontsubset/list.c       |  272 ---
 vcl/source/fontsubset/sft.cxx      |  581 --------
 vcl/source/gdi/outdev3.cxx         |   38 
 vcl/source/glyphs/gcach_ftyp.cxx   |   11 
 vcl/unx/inc/saldata.hxx            |    4 
 vcl/unx/inc/salunx.h               |    2 
 vcl/unx/source/gdi/salgdi3.cxx     |   15 
 vcl/unx/source/gdi/xfont.cxx       |    3 
 32 files changed, 16 insertions(+), 5636 deletions(-)

New commits:
commit 570386760394e505bf7dcc8c61c3948dc4a51659
Author: Thomas Arnhold <thomas at arnhold.org>
Date:   Wed Feb 16 13:11:31 2011 +0100

    Remove SCO support

diff --git a/rsc/source/parser/rsclex.cxx b/rsc/source/parser/rsclex.cxx
index 75c5ea3..f1e0938 100644
--- a/rsc/source/parser/rsclex.cxx
+++ b/rsc/source/parser/rsclex.cxx
@@ -295,7 +295,7 @@ int MakeToken( YYSTYPE * pTokenVal ){
     return( c1 );
 }
 
-#if defined( RS6000 ) || defined( SCO )
+#if defined( RS6000 )
 extern "C" int yylex()
 #else
 int yylex()
@@ -314,7 +314,7 @@ int yylex()
 /****************** yyerror **********************************************/
 #ifdef RS6000
 extern "C" void yyerror( char* pMessage )
-#elif defined SCO || defined SOLARIS
+#elif defined SOLARIS
 extern "C" void yyerror( const char* pMessage )
 #else
 void yyerror( char* pMessage )
diff --git a/rsc/source/parser/rsclex.hxx b/rsc/source/parser/rsclex.hxx
index a16a232..945eb4c 100644
--- a/rsc/source/parser/rsclex.hxx
+++ b/rsc/source/parser/rsclex.hxx
@@ -105,7 +105,7 @@ class ObjectStack {
 extern "C" int yyparse();   // forward Deklaration fuer erzeugte Funktion
 extern "C" void yyerror( char * );
 extern "C" int  yylex( void );
-#elif defined( SCO ) || defined ( SOLARIS )
+#elif defined ( SOLARIS )
 extern "C" int yyparse();   // forward Deklaration fuer erzeugte Funktion
 extern "C" void yyerror( const char * );
 extern "C" int  yylex( void );
diff --git a/rsc/source/prj/makefile.mk b/rsc/source/prj/makefile.mk
index 128d231..b8e0224 100644
--- a/rsc/source/prj/makefile.mk
+++ b/rsc/source/prj/makefile.mk
@@ -51,13 +51,7 @@ APP1STACK=64000
 APP1RPATH=NONE
 
 APP2TARGET= rsc2
-.IF "$(OS)"=="SCO"
-# SCO hat Probleme mit fork/exec und einigen shared libraries. 
-# rsc2 muss daher statisch gelinkt werden
-APP2STDLIBS=$(STATIC) -latools $(BPICONVLIB)  $(OSLLIB) $(RTLLIB) $(DYNAMIC)
-.ELSE
 APP2STDLIBS=$(TOOLSLIB) $(I18NISOLANGLIB)  $(SALLIB) # $(RTLLIB)
-.ENDIF
 APP2LIBS=   $(LB)$/rsctoo.lib \
             $(LB)$/rscres.lib \
             $(LB)$/rscpar.lib \
diff --git a/tools/bootstrp/command.cxx b/tools/bootstrp/command.cxx
index 99fa496..4c3b8ae 100644
--- a/tools/bootstrp/command.cxx
+++ b/tools/bootstrp/command.cxx
@@ -29,10 +29,6 @@
 // MARKER(update_precomp.py): autogen include statement, do not remove
 #include "precompiled_tools.hxx"
 
-#ifdef SCO
-#define _IOSTREAM_H
-#endif
-
 #ifdef PRECOMPILED
 #include "first.hxx"
 #endif
diff --git a/tools/inc/tools/inetdef.hxx b/tools/inc/tools/inetdef.hxx
index 6605928..2e35bd6 100644
--- a/tools/inc/tools/inetdef.hxx
+++ b/tools/inc/tools/inetdef.hxx
@@ -41,8 +41,6 @@
 #define TOOLS_INETDEF_OS "Solaris Sparc"
 #elif defined SOLARIS && defined INTEL
 #define TOOLS_INETDEF_OS "Solaris x86"
-#elif defined SCO
-#define TOOLS_INETDEF_OS "SCO"
 #elif defined NETBSD && defined X86
 #define TOOLS_INETDEF_OS "NetBSD/i386"
 #elif defined NETBSD && defined X86_64
diff --git a/tools/inc/tools/solar.h b/tools/inc/tools/solar.h
index bbd7ea4..1c1c6ab 100644
--- a/tools/inc/tools/solar.h
+++ b/tools/inc/tools/solar.h
@@ -293,8 +293,6 @@ template<typename T> inline T Abs(T a) { return (a>=0?a:-a); }
   #define __DLLEXTENSION "si.so"
 #elif defined SOLARIS && defined INTEL && defined __GNUC__
   #define __DLLEXTENSION "sogi.so"
-#elif defined SCO
-  #define __DLLEXTENSION "ci.so"
 #elif defined NETBSD && defined X86
   #define __DLLEXTENSION "bi.so"
 #elif defined NETBSD && defined X86_64
diff --git a/tools/source/fsys/unx.cxx b/tools/source/fsys/unx.cxx
index bec226c..e488c84 100644
--- a/tools/source/fsys/unx.cxx
+++ b/tools/source/fsys/unx.cxx
@@ -37,8 +37,6 @@
 #if defined LINUX
 #include <mntent.h>
 #define mnttab mntent
-#elif defined SCO
-#include <mnttab.h>
 #elif defined AIX
 #include <sys/mntctl.h>
 #include <sys/vmount.h>
@@ -71,10 +69,6 @@ struct mnttab
 #define MOUNTPOINT 	 mnt_mountp
 #define MOUNTOPTS    mnt_mntopts
 #define MOUNTFS      mnt_fstype
-#elif defined SCO
-#define MNTTAB 		 "/etc/mnttab"
-#define MOUNTSPECIAL mt_dev
-#define MOUNTPOINT   mt_filsys
 #else
 #define MOUNTSPECIAL mnt_fsname
 #define MOUNTPOINT   mnt_dir
@@ -143,12 +137,6 @@ static BOOL GetMountEntry(dev_t dev, struct mymnttab *mytab)
         return FALSE;
     struct mnttab mnt[1];
     while (getmntent (fp, mnt) != -1)
-#elif defined SCO
-    FILE *fp = fopen (MNTTAB, "r");
-    if (! fp)
-        return FALSE;
-    struct mnttab mnt[1];
-    while (fread (&mnt, sizeof mnt, 1, fp) > 0)
 #elif defined DECUNIX || defined AIX
     FILE *fp = NULL;
     if (! fp)
@@ -189,11 +177,8 @@ static BOOL GetMountEntry(dev_t dev, struct mymnttab *mytab)
         mytab->mountspecial = mnt->MOUNTSPECIAL;
         mytab->mountpoint 	= mnt->MOUNTPOINT;
         mytab->mountdevice 	= dev;
-#ifndef SCO
         mytab->mymnttab_filesystem = mnt->MOUNTFS;
-#else
-        mytab->mymnttab_filesystem = "ext2";		//default ist case sensitiv unter unix
-#endif
+
         return TRUE;
     }
 #	ifdef LINUX
diff --git a/vcl/unx/inc/saldata.hxx b/vcl/unx/inc/saldata.hxx
index 47dbf03..3b5c791 100644
--- a/vcl/unx/inc/saldata.hxx
+++ b/vcl/unx/inc/saldata.hxx
@@ -47,7 +47,7 @@ class SalPrinter;
 
 DECLARE_LIST( SalDisplays, SalDisplay* )
 
-#if defined SCO || defined LINUX || defined NETBSD || defined AIX || \
+#if defined LINUX || defined NETBSD || defined AIX || \
     defined FREEBSD || defined OPENBSD || defined DRAGONFLY
 #include <pthread.h>
 #else
diff --git a/vcl/unx/inc/salunx.h b/vcl/unx/inc/salunx.h
index 0c614dc..b7be551 100644
--- a/vcl/unx/inc/salunx.h
+++ b/vcl/unx/inc/salunx.h
@@ -30,7 +30,7 @@
 #define _SALUNX_H
 
 // -=-= #includes =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-#if defined SCO || defined LINUX || defined FREEBSD || \
+#if defined LINUX || defined FREEBSD || \
     defined NETBSD || defined OPENBSD || defined DRAGONFLY
 #include <sys/time.h>
 #elif defined AIX
commit 3facc3bc4b78f049412fc9aef81af462cfec01cd
Author: Thomas Arnhold <thomas at arnhold.org>
Date:   Wed Feb 16 13:07:49 2011 +0100

    Remove HPUX support

diff --git a/svl/inc/svl/svarray.hxx b/svl/inc/svl/svarray.hxx
index 6b53585..46c3c9b 100644
--- a/svl/inc/svl/svarray.hxx
+++ b/svl/inc/svl/svarray.hxx
@@ -1024,7 +1024,7 @@ public:\
 #define C40_PTR_REPLACE( c, p) Replace( (c const *) p )
 #define C40_GETPOS( c, r) GetPos( (c const *)r )
 #else
-#if defined WTC || defined ICC || defined HPUX || (defined GCC && __GNUC__ >= 3) || (defined(WNT) && _MSC_VER >= 1400)
+#if defined WTC || defined ICC || (defined GCC && __GNUC__ >= 3) || (defined(WNT) && _MSC_VER >= 1400)
 #define C40_INSERT( c, p, n ) Insert( (c const *&) p, n )
 #define C40_PUSH( c, p) Push( (c const *&) p )
 #define C40_PTR_INSERT( c, p ) Insert( (c const *&) p )
diff --git a/tools/bootstrp/command.cxx b/tools/bootstrp/command.cxx
index 2d705dd..99fa496 100644
--- a/tools/bootstrp/command.cxx
+++ b/tools/bootstrp/command.cxx
@@ -73,7 +73,7 @@
 #include <sys/types.h>
 #include <unistd.h>
 #if ( defined NETBSD ) || defined (FREEBSD) || defined (AIX) \
-    || defined (HPUX) || defined (MACOSX) || defined (OPENBSD) \
+    || defined (MACOSX) || defined (OPENBSD) \
     || defined(DRAGONFLY)
 #include <sys/wait.h>
 #else
diff --git a/tools/inc/tools/inetdef.hxx b/tools/inc/tools/inetdef.hxx
index 2188c57..6605928 100644
--- a/tools/inc/tools/inetdef.hxx
+++ b/tools/inc/tools/inetdef.hxx
@@ -37,8 +37,6 @@
 #elif defined UNX
 #if defined AIX
 #define TOOLS_INETDEF_OS "AIX"
-#elif defined HPUX
-#define TOOLS_INETDEF_OS "HP/UX"
 #elif defined SOLARIS && defined SPARC
 #define TOOLS_INETDEF_OS "Solaris Sparc"
 #elif defined SOLARIS && defined INTEL
@@ -67,9 +65,9 @@
 #define TOOLS_INETDEF_OS "DragonFly/i386"
 #elif defined DRAGONFLY && defined X86_64
 #define TOOLS_INETDEF_OS "DragonFly/amd64"
-#else // AIX, HPUX, SOLARIS, ...
+#else // AIX, SOLARIS, ...
 #define TOOLS_INETDEF_OS "Unix"
-#endif // AIX, HPUX, SOLARIS, ...
+#endif // AIX, SOLARIS, ...
 #else // WNT, ...
 #define TOOLS_INETDEF_OS "unknown OS"
 #endif // WN, ...
diff --git a/tools/inc/tools/solar.h b/tools/inc/tools/solar.h
index 389dbc6..bbd7ea4 100644
--- a/tools/inc/tools/solar.h
+++ b/tools/inc/tools/solar.h
@@ -283,8 +283,6 @@ template<typename T> inline T Abs(T a) { return (a>=0?a:-a); }
   #define __DLLEXTENSION "go"
 #elif defined AIX
   #define __DLLEXTENSION "ap.so"
-#elif defined HPUX
-  #define __DLLEXTENSION "hr.sl"
 #elif defined SOLARIS && defined SPARC && defined IS_LP64
   #define __DLLEXTENSION "su.so"
 #elif defined SOLARIS && defined SPARC && !defined __GNUC__
diff --git a/tools/source/fsys/unx.cxx b/tools/source/fsys/unx.cxx
index 9ae77c8..bec226c 100644
--- a/tools/source/fsys/unx.cxx
+++ b/tools/source/fsys/unx.cxx
@@ -34,7 +34,7 @@
 #include <stdlib.h>
 #include <unistd.h>
 #include <utime.h>
-#if defined HPUX || defined LINUX
+#if defined LINUX
 #include <mntent.h>
 #define mnttab mntent
 #elif defined SCO
diff --git a/tools/source/stream/strmunx.cxx b/tools/source/stream/strmunx.cxx
index ed27d7a..05511ee 100644
--- a/tools/source/stream/strmunx.cxx
+++ b/tools/source/stream/strmunx.cxx
@@ -504,8 +504,6 @@ sal_Bool SvFileStream::LockRange( sal_Size nByteOffset, sal_Size nBytes )
     // NFS-2-Server (kein Lockdaemon) zu verhindern.
     // File-Locking ?ber NFS ist generell ein Performancekiller.
     //						HR, 22.10.1997 fuer SOLARIS
-    //						CP, 30.11.1997 fuer HPUX
-    //						ER, 18.12.1997 fuer IRIX
     //						HR, 18.05.1998 Environmentvariable
 
     if ( pFileLockEnvVar == (char*)1 )
@@ -516,13 +514,6 @@ sal_Bool SvFileStream::LockRange( sal_Size nByteOffset, sal_Size nBytes )
     aflock.l_type = nLockMode;
     if (fcntl(pInstanceData->nHandle, F_GETLK, &aflock) == -1)
     {
-    #if ( defined HPUX && defined BAD_UNION )
-    #ifdef DBG_UTIL
-        fprintf( stderr, "***** FCNTL(lock):errno = %d\n", errno );
-    #endif
-        if ( errno == EINVAL || errno == ENOSYS )
-            return sal_True;
-    #endif
     #if defined SOLARIS
         if (errno == ENOSYS)
             return sal_True;
@@ -576,14 +567,6 @@ sal_Bool SvFileStream::UnlockRange( sal_Size nByteOffset, sal_Size nBytes )
     if (fcntl(pInstanceData->nHandle, F_SETLK, &aflock) != -1)
         return sal_True;
 
-#if ( defined HPUX && defined BAD_UNION )
-#ifdef DBG_UTIL
-        fprintf( stderr, "***** FCNTL(unlock):errno = %d\n", errno );
-#endif
-        if ( errno == EINVAL || errno == ENOSYS )
-            return sal_True;
-#endif
-
     SetError( ::GetSvError( errno ));
     return sal_False;
 }
diff --git a/vcl/source/glyphs/gcach_ftyp.cxx b/vcl/source/glyphs/gcach_ftyp.cxx
index c96ebfe..3b0d90a 100644
--- a/vcl/source/glyphs/gcach_ftyp.cxx
+++ b/vcl/source/glyphs/gcach_ftyp.cxx
@@ -80,10 +80,8 @@ typedef FT_Vector* FT_Vector_CPtr;
 
 // TODO: move file mapping stuff to OSL
 #if defined(UNX)
-    #if !defined(HPUX)
-        // PORTERS: dlfcn is used for getting symbols from FT versions newer than baseline
-        #include <dlfcn.h>
-    #endif
+    // PORTERS: dlfcn is used for getting symbols from FT versions newer than baseline
+    #include <dlfcn.h>
     #include <unistd.h>
     #include <fcntl.h>
     #include <sys/stat.h>
diff --git a/vcl/unx/inc/saldata.hxx b/vcl/unx/inc/saldata.hxx
index a6be9a5..47dbf03 100644
--- a/vcl/unx/inc/saldata.hxx
+++ b/vcl/unx/inc/saldata.hxx
@@ -48,7 +48,7 @@ class SalPrinter;
 DECLARE_LIST( SalDisplays, SalDisplay* )
 
 #if defined SCO || defined LINUX || defined NETBSD || defined AIX || \
-    defined HPUX || defined FREEBSD || defined OPENBSD || defined DRAGONFLY
+    defined FREEBSD || defined OPENBSD || defined DRAGONFLY
 #include <pthread.h>
 #else
 typedef	unsigned int pthread_t;
diff --git a/vcl/unx/inc/salunx.h b/vcl/unx/inc/salunx.h
index 0837801..0c614dc 100644
--- a/vcl/unx/inc/salunx.h
+++ b/vcl/unx/inc/salunx.h
@@ -30,7 +30,7 @@
 #define _SALUNX_H
 
 // -=-= #includes =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-#if defined SCO || defined LINUX || defined HPUX || defined FREEBSD || \
+#if defined SCO || defined LINUX || defined FREEBSD || \
     defined NETBSD || defined OPENBSD || defined DRAGONFLY
 #include <sys/time.h>
 #elif defined AIX
commit c413213c6cd34c6b126a7686f943da749ee2bce9
Author: Thomas Arnhold <thomas at arnhold.org>
Date:   Wed Feb 16 12:16:56 2011 +0100

    Remove TEST* and DEBUG*

diff --git a/vcl/inc/sft.hxx b/vcl/inc/sft.hxx
index 64757ca..5539d6e 100644
--- a/vcl/inc/sft.hxx
+++ b/vcl/inc/sft.hxx
@@ -543,24 +543,6 @@ namespace vcl
  */
     void GetTTGlobalFontInfo(TrueTypeFont *ttf, TTGlobalFontInfo *info);
 
-#ifdef TEST5
-/**
- * Returns kerning information for an array of glyphs.
- * Kerning is not cumulative.
- * kern[i] contains kerning information for a pair of glyphs at positions i and i+1
- *
- * @param ttf         pointer to a TrueTypeFont structure
- * @param glyphs      array of source glyphs
- * @param nglyphs     number of glyphs in the array
- * @param wmode       writing mode: 0 - horizontal, 1 - vertical
- * @param kern        array of KernData structures. It should contain nglyphs-1 elements
- * @see KernData
- * @ingroup sft
- *
- */
-    void KernGlyphs(TrueTypeFont *ttf, sal_uInt16 *glyphs, int nglyphs, int wmode, KernData *kern);
-#endif
-
 /**
  * Returns nonzero if font is a symbol encoded font
  */
diff --git a/vcl/source/fontsubset/list.c b/vcl/source/fontsubset/list.c
index 001b15c..38c7958 100644
--- a/vcl/source/fontsubset/list.c
+++ b/vcl/source/fontsubset/list.c
@@ -35,20 +35,12 @@
 /*[]---------------------------------------------------[]*/
 
 #include <stdlib.h>
-
-#if OSL_DEBUG_LEVEL == 0
-#  ifndef NDEBUG
-#    define NDEBUG
-#  endif
-#endif
-
 #include <assert.h>
 
 #ifdef MALLOC_TRACE
 #include <stdio.h>
 #include </usr/local/include/malloc.h>
 #endif
-/* #define TEST */
 #include "list.h"
 
 /*- private data types */
@@ -101,31 +93,6 @@ static lnode *appendPrim(list this, void *el)
     this->aCount++;
     return ptr;
 }
-#ifdef TEST
-static lnode *prependPrim(list this, void *el)
-{
-    lnode *ptr = newNode(el);
-    lnode *flink, **blink;
-
-    if (this->head != 0) {
-        blink = &(this->head->prev);
-        flink = this->head;
-    } else {
-        blink = &this->tail;
-        flink = 0;
-        this->cptr  = ptr;                        /*- list was empty - set current to this element */
-    }
-
-    *blink = ptr;
-    this->head   = ptr;
-
-    ptr->next = flink;
-    ptr->prev = 0;
-
-    this->aCount++;
-    return ptr;
-}
-#endif
 
 /*- public methods  */
 list listNewEmpty(void)                           /*- default ctor */
@@ -140,32 +107,6 @@ list listNewEmpty(void)                           /*- default ctor */
     return this;
 }
 
-#ifdef TEST
-list listNewCopy(list l)                          /*- copy ctor */
-{
-    lnode *ptr, *c;
-    list this;
-    assert(l != 0);
-
-    this = malloc(sizeof(struct _list));
-    assert(this != 0);
-
-    ptr = l->head;
-
-    this->aCount = 0;
-    this->eDtor = 0;
-    this->head = this->tail = this->cptr = 0;
-
-    while (ptr) {
-        c = appendPrim(this, ptr->value);
-        if (ptr == l->cptr) this->cptr = c;
-        ptr = ptr->next;
-    }
-
-    return this;
-}
-#endif
-
 void listDispose(list this)                       /*- dtor */
 {
     assert(this != 0);
@@ -199,36 +140,6 @@ int   listIsEmpty(list this)
     return this->aCount == 0;
 }
 
-
-#ifdef TEST
-int   listAtFirst(list this)
-{
-    assert(this != 0);
-    return this->cptr == this->head;
-}
-
-int   listAtLast(list this)
-{
-    assert(this != 0);
-    return this->cptr == this->tail;
-}
-
-int   listPosition(list this)
-{
-    int res = 0;
-    lnode *ptr;
-    assert(this != 0);
-
-    ptr = this->head;
-
-    while (ptr != this->cptr) {
-        ptr = ptr->next;
-        res++;
-    }
-
-    return res;
-}
-#endif
 int    listFind(list this, void *el)
 {
     lnode *ptr;
@@ -312,59 +223,7 @@ list   listAppend(list this, void *el)
     appendPrim(this, el);
     return this;
 }
-#ifdef TEST
-list   listPrepend(list this, void *el)
-{
-    assert(this != 0);
-
-    prependPrim(this, el);
-    return this;
-}
-
-list   listInsertAfter(list this, void *el)
-{
-    lnode *ptr;
-    assert(this != 0);
-
-    if (this->cptr == 0) return listAppend(this, el);
-
-    ptr = newNode(el);
-
-    ptr->prev  = this->cptr;
-    ptr->next  = this->cptr->next;
-    this->cptr->next = ptr;
-
-    if (ptr->next != 0) {
-        ptr->next->prev = ptr;
-    } else {
-        this->tail = ptr;
-    }
-    this->aCount++;
-    return this;
-}
-
-list   listInsertBefore(list this, void *el)
-{
-    lnode *ptr;
-    assert(this != 0);
-
-    if (this->cptr == 0) return listAppend(this, el);
-
-    ptr = newNode(el);
 
-    ptr->prev  = this->cptr->prev;
-    ptr->next  = this->cptr;
-    this->cptr->prev = ptr;
-
-    if (ptr->prev != 0) {
-        ptr->prev->next = ptr;
-    } else {
-        this->head = ptr;
-    }
-    this->aCount++;
-    return this;
-}
-#endif
 list   listRemove(list this)
 {
     lnode *ptr = 0;
@@ -409,135 +268,4 @@ list   listClear(list this)
     return this;
 }
 
-#ifdef TEST
-
-void   listForAll(list this, void (*f)(void *))
-{
-    lnode *ptr = this->head;
-    while (ptr) {
-        f(ptr->value);
-        ptr = ptr->next;
-    }
-}
-
-
-#include <stdio.h>
-
-void printlist(list l)
-{
-    int saved;
-    assert(l != 0);
-    saved = listPosition(l);
-
-    printf("[ ");
-
-    if (!listIsEmpty(l)) {
-        listToFirst(l);
-        do {
-            printf("%d ", (int) listCurrent(l));
-        } while (listNext(l));
-    }
-
-    printf("]\n");
-
-    listPositionAt(l, saved);
-}
-
-void printstringlist(list l)
-{
-    int saved;
-    assert(l != 0);
-    saved = listPosition(l);
-
-    printf("[ ");
-
-    if (!listIsEmpty(l)) {
-        listToFirst(l);
-        do {
-            printf("'%s' ", (char *) listCurrent(l));
-        } while (listNext(l));
-    }
-
-    printf("]\n");
-
-    listPositionAt(l, saved);
-}
-
-void printstat(list l)
-{
-    printf("count: %d, position: %d, isEmpty: %d, atFirst: %d, atLast: %d.\n",
-           listCount(l), listPosition(l), listIsEmpty(l), listAtFirst(l), listAtLast(l));
-}
-
-void allfunc(void *e)
-{
-    printf("%d ", e);
-}
-
-void edtor(void *ptr)
-{
-    printf("element dtor: 0x%08x\n", ptr);
-    free(ptr);
-}
-
-int main()
-{
-    list l1, l2;
-    char *ptr;
-    int i;
-
-#ifdef MALLOC_TRACE
-    mal_leaktrace(1);
-    mal_debug(2);
-#endif
-
-    l1 = listNewEmpty();
-    printstat(l1);
-
-    listAppend(l1, 1);
-    printstat(l1);
-
-    listAppend(l1, 2);
-    printstat(l1);
-
-    listAppend(l1, 3);
-    printstat(l1);
-
-    printlist(l1);
-
-    listToFirst(l1);
-    listInsertBefore(l1, -5);
-    printlist(l1);
-
-    l2 = listNewCopy(l1);
-    printlist(l2);
-
-    listForAll(l2, allfunc);
-    printf("\n");
-
-    listClear(l1);
-    listSetElementDtor(l1, edtor);
-
-    for(i=0; i<10; i++) {
-        ptr = malloc(20);
-        snprintf(ptr, 20, "element # %d", i);
-        listAppend(l1, ptr);
-    }
-
-    printstringlist(l1);
-
-
-    listDispose(l1);
-    listDispose(l2);
-
-#ifdef MALLOC_TRACE
-    mal_dumpleaktrace(stdout);
-#endif
-
-
-    return 0;
-}
-#endif
-
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/fontsubset/sft.cxx b/vcl/source/fontsubset/sft.cxx
index 038e569..60fb4f3 100644
--- a/vcl/source/fontsubset/sft.cxx
+++ b/vcl/source/fontsubset/sft.cxx
@@ -36,11 +36,6 @@
  *
  */
 
-#if OSL_DEBUG_LEVEL == 0
-#  ifndef NDEBUG
-#    define NDEBUG
-#  endif
-#endif
 #include <assert.h>
 
 #include <stdlib.h>
@@ -65,10 +60,6 @@
 #include <osl/endian.h>
 #include <algorithm>
 
-#ifdef TEST7
-#include <ctype.h>
-#endif
-
 namespace vcl
 {
 
@@ -676,10 +667,6 @@ static int GetCompoundTTOutline(TrueTypeFont *ttf, sal_uInt32 glyphID, ControlPo
 
         glyphlist.push_back( index );
 
-#ifdef DEBUG2
-        fprintf(stderr,"glyphlist: += %d\n", index);
-#endif
-
         if ((np = GetTTGlyphOutline(ttf, index, &nextComponent, 0, &glyphlist)) == 0)
         {
             /* XXX that probably indicates a corrupted font */
@@ -689,18 +676,6 @@ static int GetCompoundTTOutline(TrueTypeFont *ttf, sal_uInt32 glyphID, ControlPo
 #endif
         }
 
-#ifdef DEBUG2
-        fprintf(stderr,"%d [", (int)glyphlist.size() );
-        for( std::vector< sal_uInt32 >::const_iterator it = glyphlist.begin();
-            it != glyphlist.end(); ++it )
-        {
-            fprintf( stderr,"%d ", (int) *it );
-        }
-        fprintf(stderr, "]\n");
-        if( ! glyphlist.empty() )
-            fprintf(stderr, "glyphlist: -= %d\n", (int) glyphlist.back());
-
-#endif
         if( ! glyphlist.empty() )
             glyphlist.pop_back();
 
@@ -730,23 +705,14 @@ static int GetCompoundTTOutline(TrueTypeFont *ttf, sal_uInt32 glyphID, ControlPo
         b = c = 0;
 
         if (flags & WE_HAVE_A_SCALE) {
-#ifdef DEBUG2
-            fprintf(stderr, "WE_HAVE_A_SCALE\n");
-#endif
             a = GetInt16(ptr, 0, 1) << 2;
             d = a;
             ptr += 2;
         } else if (flags & WE_HAVE_AN_X_AND_Y_SCALE) {
-#ifdef DEBUG2
-            fprintf(stderr, "WE_HAVE_AN_X_AND_Y_SCALE\n");
-#endif
             a = GetInt16(ptr, 0, 1) << 2;
             d = GetInt16(ptr, 2, 1) << 2;
             ptr += 4;
         } else if (flags & WE_HAVE_A_TWO_BY_TWO) {
-#ifdef DEBUG2
-            fprintf(stderr, "WE_HAVE_A_TWO_BY_TWO\n");
-#endif
             a = GetInt16(ptr, 0, 1) << 2;
             b = GetInt16(ptr, 2, 1) << 2;
             c = GetInt16(ptr, 4, 1) << 2;
@@ -772,18 +738,6 @@ static int GetCompoundTTOutline(TrueTypeFont *ttf, sal_uInt32 glyphID, ControlPo
             assert(!"ARGS_ARE_XY_VALUES is not implemented!!!\n");
         }
 
-#ifdef DEBUG2
-        fprintf(stderr, "a: %f, b: %f, c: %f, d: %f, e: %f, f: %f, m: %f, n: %f\n",
-                ((double) a) / 65536,
-                ((double) b) / 65536,
-                ((double) c) / 65536,
-                ((double) d) / 65536,
-                ((double) e) / 65536,
-                ((double) f) / 65536,
-                ((double) m) / 65536,
-                ((double) n) / 65536);
-#endif
-
         for (i=0; i<np; i++) {
             F16Dot16 t;
             ControlPoint cp;
@@ -793,10 +747,6 @@ static int GetCompoundTTOutline(TrueTypeFont *ttf, sal_uInt32 glyphID, ControlPo
             t = fixedMulDiv(b, nextComponent[i].x << 16, n) + fixedMulDiv(d, nextComponent[i].y << 16, n) + (f << 16);
             cp.y = (sal_Int16)(fixedMul(t, n) >> 16);
 
-#ifdef DEBUG2
-            fprintf(stderr, "( %d %d ) -> ( %d %d )\n", nextComponent[i].x, nextComponent[i].y, cp.x, cp.y);
-#endif
-
             myPoints.push_back( cp );
         }
 
@@ -858,21 +808,6 @@ static int GetTTGlyphOutline(TrueTypeFont *ttf, sal_uInt32 glyphID, ControlPoint
         res = GetCompoundTTOutline(ttf, glyphID, pointArray, metrics, glyphlist ? *glyphlist : aPrivList );
     }
 
-#ifdef DEBUG3
-    {
-        int i;
-        FILE *out = fopen("points.dat", "a");
-        assert(out != 0);
-        fprintf(out, "Glyph: %d\nPoints: %d\n", glyphID, res);
-        for (i=0; i<res; i++) {
-            fprintf(out, "%c ", ((*pointArray)[i].flags & 0x8000) ? 'X' : '.');
-            fprintf(out, "%c ", ((*pointArray)[i].flags & 1) ? '+' : '-');
-            fprintf(out, "%d %d\n", (*pointArray)[i].x, (*pointArray)[i].y);
-        }
-        fclose(out);
-    }
-#endif
-
     return res;
 }
 
@@ -1546,79 +1481,6 @@ static void GetKern(TrueTypeFont *ttf)
     return;
 }
 
-#ifdef TEST5
-/* KernGlyphsPrim?() functions expect the caller to ensure the validity of their arguments and
- * that x and y elements of the kern array are initialized to zeroes
- */
-static void KernGlyphsPrim1(TrueTypeFont *ttf, sal_uInt16 *glyphs, int nglyphs, int wmode, KernData *kern)
-{
-    (void)ttf; /* avoid warning */
-    (void)glyphs; /* avoid warning */
-    (void)nglyphs; /* avoid warning */    
-    (void)wmode; /* avoid warning */    
-    (void)nglyphs; /* avoid warning */    
-    (void)kern; /* avoid warning */    
-    fprintf(stderr, "MacOS kerning tables have not been implemented yet!\n");
-}
-
-static void KernGlyphsPrim2(TrueTypeFont *ttf, sal_uInt16 *glyphs, int nglyphs, int wmode, KernData *kern)
-{
-    sal_uInt32 i, j;
-    sal_uInt32 gpair;
-
-    if( ! nglyphs )
-        return;
-
-    for (i = 0; i < (sal_uInt32)nglyphs - 1; i++) {
-        gpair = (glyphs[i] << 16) | glyphs[i+1];
-#ifdef DEBUG2
-        /* All fonts with MS kern table that I've seen so far contain just one kern subtable.
-         * MS kern documentation is very poor and I doubt that font developers will be using
-         * several subtables. I expect them to be using OpenType tables instead.
-         * According to MS documention, format 2 subtables are not supported by Windows and OS/2.
-         */
-        if (ttf->nkern > 1) {
-            fprintf(stderr, "KernGlyphsPrim2: %d kern tables found.\n", ttf->nkern);
-        }
-#endif
-        for (j = 0; j < ttf->nkern; j++) {
-            sal_uInt16 coverage = GetUInt16(ttf->kerntables[j], 4, 1);
-            sal_uInt8 *ptr;
-            int npairs;
-            sal_uInt32 t;
-            int l, r, k;
-
-            if (! ((coverage & 1) ^ wmode)) continue;
-            if ((coverage & 0xFFFE) != 0) {
-#ifdef DEBUG2
-                fprintf(stderr, "KernGlyphsPrim2: coverage flags are not supported: %04X.\n", coverage);
-#endif
-                continue;
-            }
-            ptr = ttf->kerntables[j];
-            npairs = GetUInt16(ptr, 6, 1);
-            ptr += 14;
-            l = 0;
-            r = npairs;
-            do {
-                k = (l + r) >> 1;
-                t = GetUInt32(ptr, k * 6, 1);
-                if (gpair >= t) l = k + 1;
-                if (gpair <= t) r = k - 1;
-            } while (l <= r);
-            if (l - r == 2) {
-                if (!wmode) {
-                    kern[i].x = XUnits(ttf->unitsPerEm, GetInt16(ptr, 4 + (l-1) * 6, 1));
-                } else {
-                    kern[i].y = XUnits(ttf->unitsPerEm, GetInt16(ptr, 4 + (l-1) * 6, 1));
-                }
-                /* !wmode ? kern[i].x : kern[i].y = GetInt16(ptr, 4 + (l-1) * 6, 1); */
-            }
-        }
-    }
-}
-#endif
-
 /*- Public functions */ /*FOLD00*/
 
 int CountTTCFonts(const char* fname)
@@ -1754,10 +1616,6 @@ static int doOpenTTFont( sal_uInt32 facenum, TrueTypeFont* t )
         return SF_TTFORMAT;
     }
 
-#ifdef DEBUG2
-    fprintf(stderr, "tdoffset: %d\n", tdoffset);
-#endif
-
     /* magic number */
     t->tag = TTFontClassTag;
 
@@ -2741,23 +2599,6 @@ void GetTTGlobalFontInfo(TrueTypeFont *ttf, TTGlobalFontInfo *info)
     }
 }
 
-#ifdef TEST5
-void KernGlyphs(TrueTypeFont *ttf, sal_uInt16 *glyphs, int nglyphs, int wmode, KernData *kern)
-{
-    int i;
-
-    if (!nglyphs || !glyphs || !kern) return;
-
-    for (i = 0; i < nglyphs-1; i++) kern[i].x = kern[i].y = 0;
-
-    switch (ttf->kerntype) {
-        case KT_APPLE_NEW: KernGlyphsPrim1(ttf, glyphs, nglyphs, wmode, kern);    return;
-        case KT_MICROSOFT: KernGlyphsPrim2(ttf, glyphs, nglyphs, wmode, kern);    return;
-        default: return;
-    }
-}
-#endif
-
 GlyphData *GetTTRawGlyphData(TrueTypeFont *ttf, sal_uInt32 glyphID)
 {
     const sal_uInt8* glyf = getTable(ttf, O_glyf);
@@ -2862,10 +2703,6 @@ int GetTTNameRecords(TrueTypeFont *ttf, NameRecord **nr)
             }
             else
             {
-#ifdef DEBUG
-                fprintf( stderr, "found invalid name record %d with name id %d for file %s\n",
-                         i, rec[i].nameID, ttf->fname );
-#endif
                 rec[i].sptr = 0;
                 rec[i].slen = 0;
             }
@@ -2892,422 +2729,4 @@ void DisposeNameRecords(NameRecord* nr, int n)
 
 } // namespace vcl
 
-
-#ifdef TEST1
-/* This example creates a subset of a TrueType font with two encoded characters */
-int main(int ac, char **av)
-{
-    TrueTypeFont *fnt;
-    int r;
-
-    /* Array of Unicode source characters */
-    sal_uInt16 chars[2];
-
-    /* Encoding vector maps character encoding to the ordinal number
-     * of the glyph in the output file */
-    sal_uInt8 encoding[2];
-
-    /* This array is for glyph IDs that  source characters map to */
-    sal_uInt16 g[2];
-
-
-    if (ac < 2) return 0;
-
-    if ((r = OpenTTFont(av[1], 0, &fnt)) != SF_OK) {
-        fprintf(stderr, "Error %d opening font file: `%s`.\n", r, av[1]);
-        return 0;
-    }
-
-
-    /* We want to create the output file that only contains two Unicode characters:
-     * L'a' and L'A' */
-
-    chars[0] = L'a';
-    chars[1] = L'A';
-
-    /* Figure out what glyphs do these characters map in our font */
-    MapString(fnt, chars, 2, g);
-
-    /* Encode the characters. Value of encoding[i] is the number 0..255 which maps to glyph i of the
-     * newly generated font */
-    encoding[0] = chars[0];
-    encoding[1] = chars[1];
-
-
-    /* Generate a subset */
-    CreateT3FromTTGlyphs(fnt, stdout, 0, g, encoding, 2, 0);
-
-    /* Now call the dtor for the font */
-    CloseTTFont(fnt);
-    return 0;
-}
-#endif
-
-#ifdef TEST2
-/* This example extracts first 224 glyphs from a TT fonts and encodes them starting at 32 */
-int main(int ac, char **av)
-{
-    TrueTypeFont *fnt;
-    int i, r;
-
-    /* Array of Unicode source characters */
-    sal_uInt16 glyphs[224];
-
-    /* Encoding vector maps character encoding to the ordinal number
-     * of the glyph in the output file */
-    sal_uInt8 encoding[224];
-
-
-
-    for (i=0; i<224; i++) {
-        glyphs[i] = i;
-        encoding[i] = 32 + i;
-    }
-
-    if (ac < 2) return 0;
-
-    if ((r = OpenTTFont(av[1], 0, &fnt)) != SF_OK) {
-        fprintf(stderr, "Error %d opening font file: `%s`.\n", r, av[1]);
-        return 0;
-    }
-
-
-    /* Encode the characters. Value of encoding[i] is the number 0..255 which maps to glyph i of the
-     * newly generated font */
-
-    /* Generate a subset */
-    CreateT3FromTTGlyphs(fnt, stdout, 0, glyphs, encoding, 224, 0);
-
-    /* Now call the dtor for the font */
-    CloseTTFont(fnt);
-    return 0;
-}
-#endif
-
-#ifdef TEST3
-/* Glyph metrics example */
-int main(int ac, char **av)
-{
-    TrueTypeFont *fnt;
-    int i, r;
-    sal_uInt16 glyphs[224];
-    TTSimpleGlyphMetrics *m;
-
-    for (i=0; i<224; i++) {
-        glyphs[i] = i;
-    }
-
-    if (ac < 2) return 0;
-
-    if ((r = OpenTTFont(av[1], 0, &fnt)) != SF_OK) {
-        fprintf(stderr, "Error %d opening font file: `%s`.\n", r, av[1]);
-        return 0;
-    }
-
-    if ((m = GetTTSimpleGlyphMetrics(fnt, glyphs, 224, 0)) == 0) {
-        printf("Requested metrics is not available\n");
-    } else {
-        for (i=0; i<224; i++) {
-            printf("%d. advWid: %5d, LSBear: %5d\n", i, m[i].adv, m[i].sb);
-        }
-    }
-
-    /* Now call the dtor for the font */
-    free(m);
-    CloseTTFont(fnt);
-    return 0;
-}
-#endif
-
-#ifdef TEST4
-int main(int ac, char **av)
-{
-    TrueTypeFont *fnt;
-    TTGlobalFontInfo info;
-    int i, r;
-
-
-    if ((r = OpenTTFont(av[1], 0, &fnt)) != SF_OK) {
-        fprintf(stderr, "Error %d opening font file: `%s`.\n", r, av[1]);
-        return 0;
-    }
-
-    printf("Font file: %s\n", av[1]);
-
-#ifdef PRINT_KERN
-    switch (fnt->kerntype) {
-        case KT_MICROSOFT:
-            printf("\tkern: MICROSOFT, ntables: %d.", fnt->nkern);
-            if (fnt->nkern) {
-                printf(" [");
-                for (i=0; i<fnt->nkern; i++) {
-                    printf("%04X ", GetUInt16(fnt->kerntables[i], 4, 1));
-                }
-                printf("]");
-            }
-            printf("\n");
-            break;
-
-        case KT_APPLE_NEW:
-            printf("\tkern: APPLE_NEW, ntables: %d.", fnt->nkern);
-            if (fnt->nkern) {
-                printf(" [");
-                for (i=0; i<fnt->nkern; i++) {
-                    printf("%04X ", GetUInt16(fnt->kerntables[i], 4, 1));
-                }
-                printf("]");
-            }
-            printf("\n");
-            break;
-
-        case KT_NONE:
-            printf("\tkern: none.\n");
-            break;
-
-        default:
-            printf("\tkern: unrecoginzed.\n");
-            break;
-    }
-    printf("\n");
-#endif
-
-    GetTTGlobalFontInfo(fnt, &info);
-    printf("\tfamily name: `%s`\n", info.family);
-    printf("\tsubfamily name: `%s`\n", info.subfamily);
-    printf("\tpostscript name: `%s`\n", info.psname);
-    printf("\tweight: %d\n", info.weight);
-    printf("\twidth: %d\n", info.width);
-    printf("\tpitch: %d\n", info.pitch);
-    printf("\titalic angle: %d\n", info.italicAngle);
-    printf("\tbouding box: [%d %d %d %d]\n", info.xMin, info.yMin, info.xMax, info.yMax);
-    printf("\tascender: %d\n", info.ascender);
-    printf("\tdescender: %d\n", info.descender);
-    printf("\tlinegap: %d\n", info.linegap);
-    printf("\tvascent: %d\n", info.vascent);
-    printf("\tvdescent: %d\n", info.vdescent);
-    printf("\ttypoAscender: %d\n", info.typoAscender);
-    printf("\ttypoDescender: %d\n", info.typoDescender);
-    printf("\ttypoLineGap: %d\n", info.typoLineGap);
-    printf("\twinAscent: %d\n", info.winAscent);
-    printf("\twinDescent: %d\n", info.winDescent);
-    printf("\tUnicode ranges:\n");
-    for (i = 0; i < 32; i++) {
-        if ((info.ur1 >> i) & 1) {
-            printf("\t\t\t%s\n", UnicodeRangeName(i));
-        }
-    }
-    for (i = 0; i < 32; i++) {
-        if ((info.ur2 >> i) & 1) {
-            printf("\t\t\t%s\n", UnicodeRangeName(i+32));
-        }
-    }
-    for (i = 0; i < 32; i++) {
-        if ((info.ur3 >> i) & 1) {
-            printf("\t\t\t%s\n", UnicodeRangeName(i+64));
-        }
-    }
-    for (i = 0; i < 32; i++) {
-        if ((info.ur4 >> i) & 1) {
-            printf("\t\t\t%s\n", UnicodeRangeName(i+96));
-        }
-    }
-
-    CloseTTFont(fnt);
-    return 0;
-}
-#endif
-
-#ifdef TEST5
-/* Kerning example */
-int main(int ac, char **av)
-{
-    TrueTypeFont *fnt;
-    sal_uInt16 g[224];
-    KernData d[223];
-    int r, i, k = 0;
-
-    g[k++] = 11;
-    g[k++] = 36;
-    g[k++] = 11;
-    g[k++] = 98;
-    g[k++] = 11;
-    g[k++] = 144;
-    g[k++] = 41;
-    g[k++] = 171;
-    g[k++] = 51;
-    g[k++] = 15;
-
-    if (ac < 2) return 0;
-
-    if ((r = OpenTTFont(av[1], 0, &fnt)) != SF_OK) {
-        fprintf(stderr, "Error %d opening font file: `%s`.\n", r, av[1]);
-        return 0;
-    }
-
-    KernGlyphs(fnt, g, k, 0, d);
-
-    for (i = 0; i < k-1; i++) {
-        printf("%3d %3d: [%3d %3d]\n", g[i], g[i+1], d[i].x, d[i].y);
-    }
-
-    CloseTTFont(fnt);
-    return 0;
-}
-#endif
-
-
-
-#ifdef TEST6
-/* This example extracts a single glyph from a font */
-int main(int ac, char **av)
-{
-    TrueTypeFont *fnt;
-    int r, i;
-
-    sal_uInt16 glyphs[256];
-    sal_uInt8 encoding[256];
-
-    for (i=0; i<256; i++) {
-        glyphs[i] = 512 + i;
-        encoding[i] = i;
-    }
-
-    if (ac < 2) return 0;
-
-    if ((r = OpenTTFont(av[1], 0, &fnt)) != SF_OK) {
-        fprintf(stderr, "Error %d opening font file: `%s`.\n", r, av[1]);
-        return 0;
-    }
-
-    /* Generate a subset */
-    CreateT3FromTTGlyphs(fnt, stdout, 0, glyphs, encoding, 256, 0);
-
-    fprintf(stderr, "UnitsPerEm: %d.\n", fnt->unitsPerEm);
-
-    /* Now call the dtor for the font */
-    CloseTTFont(fnt);
-    return 0;
-}
-#endif
-
-#ifdef TEST7
-/* NameRecord extraction example */
-int main(int ac, char **av)
-{
-    TrueTypeFont *fnt;
-    int r, i, j,  n;
-    NameRecord *nr;
-
-    if ((r = OpenTTFont(av[1], 0, &fnt)) != SF_OK) {
-        fprintf(stderr, "Error %d opening font file: `%s`.\n", r, av[1]);
-        return 0;
-    }
-
-    if ((n = GetTTNameRecords(fnt, &nr)) == 0) {
-        fprintf(stderr, "No name records in the font.\n");
-        return 0;
-    }
-
-    printf("Number of name records: %d.\n", n);
-    for (i = 0; i < n; i++) {
-        printf("%d %d %04X %d [", nr[i].platformID, nr[i].encodingID, nr[i].languageID, nr[i].nameID);
-        for (j=0; j<nr[i].slen; j++) {
-            printf("%c", isprint(nr[i].sptr[j]) ? nr[i].sptr[j] : '.');
-        }
-        printf("]\n");
-    }
-
-
-    DisposeNameRecords(nr, n);
-    CloseTTFont(fnt);
-    return 0;
-}
-#endif
-
-#ifdef TEST8
-/* TrueType -> TrueType subsetting */
-int main(int ac, char **av)
-{
-    TrueTypeFont *fnt;
-    sal_uInt16 glyphArray[] = { 0,  98,  99,  22,  24, 25, 26,  27,  28,  29, 30, 31, 1270, 1289, 34};
-    sal_uInt8 encoding[]     = {32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46};
-    int r;
-
-    if ((r = OpenTTFont(av[1], 0, &fnt)) != SF_OK) {
-        fprintf(stderr, "Error %d opening font file: `%s`.\n", r, av[1]);
-        return 0;
-    }
-
-    CreateTTFromTTGlyphs(fnt, "subfont.ttf", glyphArray, encoding, 15, 0, 0, TTCF_AutoName | TTCF_IncludeOS2);
-
-
-    CloseTTFont(fnt);
-
-    return 0;
-}
-#endif
-
-#ifdef TEST9
-/* TrueType -> Type42 subsetting */
-int main(int ac, char **av)
-{
-    TrueTypeFont *fnt;
-    /*
-      sal_uInt16 glyphArray[] = { 0,  20,  21,  22,  24, 25, 26,  27,  28,  29, 30, 31, 32, 33, 34};
-      sal_uInt8 encoding[]     = {32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46};
-    */
-    sal_uInt16 glyphArray[] = { 0,  6711,  6724,  11133,  11144, 14360, 26,  27,  28,  29, 30, 31, 1270, 1289, 34};
-    sal_uInt8 encoding[]     = {32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46};
-    int r;
-
-    if ((r = OpenTTFont(av[1], 0, &fnt)) != SF_OK) {
-        fprintf(stderr, "Error %d opening font file: `%s`.\n", r, av[1]);
-        return 0;
-    }
-
-    CreateT42FromTTGlyphs(fnt, stdout, "testfont", glyphArray, encoding, 15);
-
-    CloseTTFont(fnt);
-
-    return 0;
-}
-#endif
-
-#ifdef TEST10
-/* Component glyph test */
-int main(int ac, char **av)
-{
-    TrueTypeFont *fnt;
-    int r, i;
-    list glyphlist = listNewEmpty();
-
-
-    if ((r = OpenTTFont(av[1], 0, &fnt)) != SF_OK) {
-        fprintf(stderr, "Error %d opening font file: `%s`.\n", r, av[1]);
-        return 0;
-    }
-
-    for (i = 0; i < fnt->nglyphs; i++) {
-        r = GetTTGlyphComponents(fnt, i, glyphlist);
-        if (r > 1) {
-            printf("%d -> ", i);
-            listToFirst(glyphlist);
-            do {
-                printf("%d ", (int) listCurrent(glyphlist));
-            } while (listNext(glyphlist));
-            printf("\n");
-        } else {
-            printf("%d: single glyph.\n", i);
-        }
-        listClear(glyphlist);
-    }
-
-    CloseTTFont(fnt);
-    listDispose(glyphlist);
-
-    return 0;
-}
-#endif
-
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit e9479d2d6f11c876695f84eba3f6e90e25f90c52
Author: Thomas Arnhold <thomas at arnhold.org>
Date:   Wed Feb 16 12:08:23 2011 +0100

    Remove HDU_DEBUG
    
    OSL_DEBUG_LEVEL > 2 isn't activated anyway so I removed it at this point.

diff --git a/vcl/source/gdi/outdev3.cxx b/vcl/source/gdi/outdev3.cxx
index 5cd252e..162a20f 100644
--- a/vcl/source/gdi/outdev3.cxx
+++ b/vcl/source/gdi/outdev3.cxx
@@ -1392,16 +1392,6 @@ void ImplDevFontList::InitGenericGlyphFallback( void ) const
         pFallbackList[ j+1 ] = pTestFont;
     }
 
-#if defined(HDU_DEBUG)
-    for( int i = 0; i < nMaxLevel; ++i )
-    {
-        ImplDevFontListData* pFont = pFallbackList[ i ];
-        ByteString aFontName( pFont->GetFamilyName(), RTL_TEXTENCODING_UTF8 );
-        fprintf( stderr, "GlyphFallbackFont[%d] (quality=%05d): \"%s\"\n",
-            i, pFont->GetMinQuality(), aFontName.GetBuffer() );
-    }
-#endif
-
     mnFallbackCount = nMaxLevel;
     mpFallbackList  = pFallbackList;
 }
@@ -5032,12 +5022,6 @@ void OutputDevice::SetFont( const Font& rNewFont )
         mpMetaFile->AddAction( new MetaTextFillColorAction( aFont.GetFillColor(), !aFont.IsTransparent() ) );
     }
 
-#if (OSL_DEBUG_LEVEL > 2) || defined (HDU_DEBUG)
-    fprintf( stderr, "   OutputDevice::SetFont( name=\"%s\", h=%ld)\n",
-         OUStringToOString( aFont.GetName(), RTL_TEXTENCODING_UTF8 ).getStr(),
-         aFont.GetSize().Height() );
-#endif
-
     if ( !maFont.IsSameInstance( aFont ) )
     {
         // Optimization MT/HDU: COL_TRANSPARENT means SetFont should ignore the font color,
@@ -6029,17 +6013,6 @@ SalLayout* OutputDevice::ImplGlyphFallbackLayout( SalLayout* pSalLayout, ImplLay
     rLayoutArgs.PrepareFallback();
     rLayoutArgs.mnFlags |= SAL_LAYOUT_FOR_FALLBACK;
 
-#if defined(HDU_DEBUG)
-    {
-        int nCharPos = -1;
-        bool bRTL = false;
-        fprintf(stderr,"OD:ImplLayout Glyph Fallback for");
-        for( int i=0; i<8 && rLayoutArgs.GetNextPos( &nCharPos, &bRTL); ++i )
-            fprintf(stderr," U+%04X", rLayoutArgs.mpStr[ nCharPos ] );
-        fprintf(stderr,"\n");
-        rLayoutArgs.ResetPos();
-    }
-#endif
     // get list of unicodes that need glyph fallback
     int nCharPos = -1;
     bool bRTL = false;
@@ -6087,17 +6060,6 @@ SalLayout* OutputDevice::ImplGlyphFallbackLayout( SalLayout* pSalLayout, ImplLay
             }
         }
 
-#if defined(HDU_DEBUG)
-        {
-            ByteString aOrigFontName( maFont.GetName(), RTL_TEXTENCODING_UTF8);
-            ByteString aFallbackName( aFontSelData.mpFontData->GetFamilyName(),
-                RTL_TEXTENCODING_UTF8);
-            fprintf(stderr,"\tGlyphFallback[lvl=%d] \"%s\" -> \"%s\" (q=%d)\n",
-                nFallbackLevel, aOrigFontName.GetBuffer(), aFallbackName.GetBuffer(),
-                aFontSelData.mpFontData->GetQuality());
-        }
-#endif
-
         ImplFontMetricData aSubstituteMetric(aFontSelData);
         pFallbackFont->mnSetFontFlags = mpGraphics->SetFont( &aFontSelData, nFallbackLevel );
         mpGraphics->GetFontMetric(&aSubstituteMetric, nFallbackLevel);
diff --git a/vcl/source/glyphs/gcach_ftyp.cxx b/vcl/source/glyphs/gcach_ftyp.cxx
index 544224d..c96ebfe 100644
--- a/vcl/source/glyphs/gcach_ftyp.cxx
+++ b/vcl/source/glyphs/gcach_ftyp.cxx
@@ -710,11 +710,6 @@ FreetypeServerFont::FreetypeServerFont( const ImplFontSelectData& rFSD, FtFontIn
 {
     maFaceFT = pFI->GetFaceFT();
 
-#ifdef HDU_DEBUG
-    fprintf( stderr, "FTSF::FTSF(\"%s\", h=%d, w=%d, sy=%d) => %d\n",
-        pFI->GetFontFileName()->getStr(), rFSD.mnHeight, rFSD.mnWidth, pFI->IsSymbolFont(), maFaceFT!=0 );
-#endif
-
     if( !maFaceFT )
         return;
 
diff --git a/vcl/unx/source/gdi/salgdi3.cxx b/vcl/unx/source/gdi/salgdi3.cxx
index 2a6dc92..7ddc565 100644
--- a/vcl/unx/source/gdi/salgdi3.cxx
+++ b/vcl/unx/source/gdi/salgdi3.cxx
@@ -575,21 +575,6 @@ X11SalGraphics::SelectFont()
 
 bool X11SalGraphics::setFont( const ImplFontSelectData *pEntry, int nFallbackLevel )
 {
-#ifdef HDU_DEBUG
-    ByteString aReqName( "NULL" );
-    if( pEntry )
-        aReqName = ByteString( pEntry->maName, RTL_TEXTENCODING_UTF8 );
-    ByteString aUseName( "NULL" );
-    if( pEntry && pEntry->mpFontData )
-        aUseName = ByteString( pEntry->mpFontData->GetFamilyName(), RTL_TEXTENCODING_UTF8 );
-    fprintf( stderr, "SetFont(lvl=%d,\"%s\", %d*%d, naa=%d,b=%d,i=%d) => \"%s\"\n",
-        nFallbackLevel, aReqName.GetBuffer(),
-    !pEntry?-1:pEntry->mnWidth, !pEntry?-1:pEntry->mnHeight,
-        !pEntry?-1:pEntry->mbNonAntialiased,
-    !pEntry?-1:pEntry->meWeight, !pEntry?-1:pEntry->meItalic,
-        aUseName.GetBuffer() );
-#endif
-
     // release all no longer needed font resources
     for( int i = nFallbackLevel; i < MAX_FALLBACK; ++i )
     {
diff --git a/vcl/unx/source/gdi/xfont.cxx b/vcl/unx/source/gdi/xfont.cxx
index e932431..c040d80 100644
--- a/vcl/unx/source/gdi/xfont.cxx
+++ b/vcl/unx/source/gdi/xfont.cxx
@@ -127,9 +127,6 @@ LoadXFont (Display* pDisplay, const char* pFontName)
     if ((pFont != NULL) && (pFont->fid == 0))
          pFont->fid = XLoadFont(pDisplay, pFontName);
 
-#ifdef HDU_DEBUG
-    fprintf( stderr, "XLoadFont \"%s\" => %d\n", pFontName, (pFont!= NULL) );
-#endif
     return pFont;
 }
 
commit 62197ad2d0a8073817d8406d304afd0b58372dd5
Author: Thomas Arnhold <thomas at arnhold.org>
Date:   Wed Feb 16 12:05:12 2011 +0100

    Remove unused USED ;)

diff --git a/svtools/source/svhtml/parhtml.cxx b/svtools/source/svhtml/parhtml.cxx
index ad3e1e6..c7a4b64 100644
--- a/svtools/source/svhtml/parhtml.cxx
+++ b/svtools/source/svhtml/parhtml.cxx
@@ -2087,19 +2087,6 @@ BOOL HTMLParser::InternalImgToPrivateURL( String& rURL )
     return bFound;
 }
 
-#ifdef USED
-void HTMLParser::SaveState( int nToken )
-{
-    SvParser::SaveState( nToken );
-}
-
-void HTMLParser::RestoreState()
-{
-    SvParser::RestoreState();
-}
-#endif
-
-
 enum eHtmlMetas {
     HTML_META_NONE = 0,
     HTML_META_AUTHOR,
diff --git a/svtools/source/svrtf/parrtf.cxx b/svtools/source/svrtf/parrtf.cxx
index 23f5c7a..862dbbe 100644
--- a/svtools/source/svrtf/parrtf.cxx
+++ b/svtools/source/svrtf/parrtf.cxx
@@ -687,16 +687,4 @@ void SvRTFParser::SetEncoding( rtl_TextEncoding eEnc )
     SetSrcEncoding(eEnc);
 }
 
-#ifdef USED
-void SvRTFParser::SaveState( int nToken )
-{
-    SvParser::SaveState( nToken );
-}
-
-void SvRTFParser::RestoreState()
-{
-    SvParser::RestoreState();
-}
-#endif
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit 0e32eb42cef44d79b7fe3b6837f2057a0383d155
Author: Thomas Arnhold <thomas at arnhold.org>
Date:   Wed Feb 16 12:03:44 2011 +0100

    Remove XX_OV

diff --git a/svtools/source/contnr/svimpbox.cxx b/svtools/source/contnr/svimpbox.cxx
index 5bd60c9..a7118d3 100644
--- a/svtools/source/contnr/svimpbox.cxx
+++ b/svtools/source/contnr/svimpbox.cxx
@@ -912,14 +912,6 @@ void SvImpLBox::Paint( const Rectangle& rRect )
         pStartEntry = pView->First();
     }
 
-#ifdef XX_OV
-    ULONG nXAbsPos = (USHORT)pTree->GetAbsPos( pStartEntry );
-    ULONG nXVisPos = pView->GetVisiblePos( pStartEntry );
-    SvLBoxString* pXStr = (SvLBoxString*)pStartEntry->GetFirstItem( SV_ITEM_ID_LBOXSTRING);
-#endif
-
-
-
     if( nNodeBmpTabDistance == NODE_BMP_TABDIST_NOTVALID )
         SetNodeBmpTabDistance();
 
commit 297372733552610b7b260110e8d55dce381bb9b4
Author: Thomas Arnhold <thomas at arnhold.org>
Date:   Wed Feb 16 12:02:39 2011 +0100

    Remove DBG_MI

diff --git a/svtools/inc/svtools/brwbox.hxx b/svtools/inc/svtools/brwbox.hxx
index 6500d6a..2c806f3 100644
--- a/svtools/inc/svtools/brwbox.hxx
+++ b/svtools/inc/svtools/brwbox.hxx
@@ -243,10 +243,6 @@ class SVT_DLLPUBLIC BrowseBox
     friend class BrowserDataWin;
     friend class ::svt::BrowseBoxImpl;
 
-#ifdef DBG_MI
-    friend void DoLog_Impl( const BrowseBox *pThis, const char *pWhat, const char *pWho );
-#endif
-
 #ifdef DBG_UTIL
     friend const char* BrowseBoxCheckInvariants( const void * pVoid );
 #endif
diff --git a/svtools/source/brwbox/brwbox1.cxx b/svtools/source/brwbox/brwbox1.cxx
index 26b2fac..a6d1599 100644
--- a/svtools/source/brwbox/brwbox1.cxx
+++ b/svtools/source/brwbox/brwbox1.cxx
@@ -59,27 +59,6 @@ using namespace svt;
 
 //-------------------------------------------------------------------
 
-#ifdef DBG_MI
-void DoLog_Impl( const BrowseBox *pThis, const char *pWhat, const char *pWho )
-{
-    SvFileStream aLog( "d:\\cursor.log", STREAM_WRITE|STREAM_NOCREATE );
-    if ( aLog.IsOpen() )
-    {
-        aLog.Seek( STREAM_SEEK_TO_END );
-        String aEntry( (long) pThis );
-        aEntry += "(row=";
-        aEntry += pThis->GetCurRow();
-        aEntry += "): ";
-        aEntry += pWhat;
-        aEntry += " from ";
-        aEntry += pWho;
-        aEntry += " => ";
-        aEntry += pThis->GetCursorHideCount();
-        aLog.WriteLine( aEntry );
-    }
-}
-#endif
-
 namespace
 {
     void disposeAndClearHeaderCell(::svt::BrowseBoxImpl::THeaderCellMap& _rHeaderCell)
@@ -146,7 +125,6 @@ void BrowseBox::ConstructImpl( BrowserMode nMode )
     bHasFocus = HasChildPathFocus();
     getDataWindow()->nCursorHidden =
                 ( bHasFocus ? 0 : 1 ) + ( GetUpdateMode() ? 0 : 1 );
-    LOG( this, "ConstructImpl", "*" );
 }
 
 //-------------------------------------------------------------------
@@ -211,11 +189,7 @@ short BrowseBox::GetCursorHideCount() const
 
 //-------------------------------------------------------------------
 
-void BrowseBox::DoShowCursor( const char *
-#ifdef DBG_MI
-pWhoLogs
-#endif
-)
+void BrowseBox::DoShowCursor( const char * )
 {
     short nHiddenCount = --getDataWindow()->nCursorHidden;
     if (PaintCursorIfHiddenOnce())
@@ -228,16 +202,11 @@ pWhoLogs
         if (0 == nHiddenCount)
             DrawCursor();
     }
-    LOG( this, "DoShowCursor", pWhoLogs );
 }
 
 //-------------------------------------------------------------------
 
-void BrowseBox::DoHideCursor( const char *
-#ifdef DBG_MI
-pWhoLogs
-#endif
-)
+void BrowseBox::DoHideCursor( const char * )
 {
     short nHiddenCount = ++getDataWindow()->nCursorHidden;
     if (PaintCursorIfHiddenOnce())
@@ -250,7 +219,6 @@ pWhoLogs
         if (1 == nHiddenCount)
             DrawCursor();
     }
-    LOG( this, "DoHideCursor", pWhoLogs );
 }
 
 //-------------------------------------------------------------------
@@ -2453,20 +2421,6 @@ void BrowseBox::SetMode( BrowserMode nMode )
 {
     DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants);
 
-#ifdef DBG_MIx
-    Sound::Beep();
-    nMode =
-            BROWSER_THUMBDRAGGING |
-            BROWSER_KEEPHIGHLIGHT |
-            BROWSER_HLINES |
-            BROWSER_VLINES |
-            BROWSER_AUTO_VSCROLL |
-            BROWSER_AUTO_HSCROLL |
-            BROWSER_TRACKING_TIPS |
-            BROWSER_HEADERBAR_NEW |
-            0;
-#endif
-
     getDataWindow()->bAutoHScroll = BROWSER_AUTO_HSCROLL == ( nMode & BROWSER_AUTO_HSCROLL );
     getDataWindow()->bAutoVScroll = BROWSER_AUTO_VSCROLL == ( nMode & BROWSER_AUTO_VSCROLL );
     getDataWindow()->bNoHScroll   = BROWSER_NO_HSCROLL   == ( nMode & BROWSER_NO_HSCROLL );
diff --git a/svtools/source/brwbox/datwin.hxx b/svtools/source/brwbox/datwin.hxx
index 594abc9..2e5b436 100644
--- a/svtools/source/brwbox/datwin.hxx
+++ b/svtools/source/brwbox/datwin.hxx
@@ -235,18 +235,6 @@ void InitSettings_Impl( Window *pWin,
 
 //===================================================================
 
-#ifdef DBG_MI
-
-void DoLog_Impl( const BrowseBox *pThis, const char *pWhat, const char *pWho );
-#define LOG(pThis,what,who) DoLog_Impl(pThis,what,who)
-
-#else
-
-#define LOG(pThis,what,who)
-
-#endif
-
-
 #endif
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit 66e8b4cf1280c43b989dd6a704eb77ee0c953cfb
Author: Thomas Arnhold <thomas at arnhold.org>
Date:   Wed Feb 16 11:59:25 2011 +0100

    Remove unused files from svdde

diff --git a/svl/source/svdde/ddedll.cxx b/svl/source/svdde/ddedll.cxx
deleted file mode 100644
index bf2502e..0000000
--- a/svl/source/svdde/ddedll.cxx
+++ /dev/null
@@ -1,66 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- * 
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org.  If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_svl.hxx"
-#ifdef WIN
-
-
-#include <sysdep.hxx>	// included svwin.h
-
-// Statische DLL-Verwaltungs-Variablen
-static HINSTANCE hDLLInst = 0;      // HANDLE der DLL
-
-/***************************************************************************
-|*    LibMain()
-|*    Beschreibung       Initialisierungsfunktion der DLL
-***************************************************************************/
-extern "C" int CALLBACK LibMain( HINSTANCE hDLL, WORD, WORD nHeap, LPSTR )
-{
-#ifndef WNT
-    if ( nHeap )
-        UnlockData( 0 );
-#endif
-
-    hDLLInst = hDLL;
-
-    return TRUE;
-}
-
-/***************************************************************************
-|*    WEP()
-|*    Beschreibung      DLL-Deinitialisierung
-***************************************************************************/
-extern "C" int CALLBACK WEP( int )
-{
-    return 1;
-}
-
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svl/source/svdde/ddeml1.cxx b/svl/source/svdde/ddeml1.cxx
deleted file mode 100644
index a21f742..0000000
--- a/svl/source/svdde/ddeml1.cxx
+++ /dev/null
@@ -1,2658 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- * 
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org.  If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_svl.hxx"
-
-/*
-    ToDo / Bugs:
-
-    - DdeInitiate: Eigener Thread?
-    - Timeout bei Disconnects (IBM:nicht auf Ack warten!)
-    - Konzept Errorhandling (globale/lokale Fehler)
-    - Bedeutung/Anwendung Conversation-Contexte
-    - Bei Zugriffen auf ConversationHandles WindowHandles checken
-    - Namen der Partner-App ermitteln
-    - Codepage-Geraffel
-*/
-#define INCL_DOSPROCESS
-
-#include "ddemlimp.hxx"
-
-#define LOGFILE
-#define STATUSFILE
-#define DDEDATAFILE
-#include "ddemldeb.hxx"
-
-
-#if defined (OS2) && defined (__BORLANDC__)
-#pragma option -w-par
-#endif
-
-// static
-inline BOOL ImpDdeMgr::MyWinDdePostMsg( HWND hWndTo, HWND hWndFrom,
-    USHORT nMsg, PDDESTRUCT pData, ULONG nFlags )
-{
-    BOOL bSuccess = WinDdePostMsg( hWndTo,hWndFrom,nMsg,pData,nFlags);
-    if( !bSuccess )
-    {
-        WRITELOG("WinDdePostMsg:Failed!")
-        if ( !(nFlags & DDEPM_NOFREE) )
-        {
-            MyDosFreeMem( pData,"MyWinDdePostMsg" );
-        }
-    }
-    return bSuccess;
-}
-
-
-// *********************************************************************
-// ImpDdeMgr
-// *********************************************************************
-
-USHORT ImpDdeMgr::nLastErrInstance = 0;
-
-//
-// Conversation-WndProc
-// Steuert Transaktionen eines Conversationhandles
-//
-MRESULT EXPENTRY ConvWndProc(HWND hWnd,ULONG nMsg,MPARAM nPar1,MPARAM nPar2)
-{
-#if defined(DBG_UTIL) && defined(OV_DEBUG)
-    if( nMsg >= WM_DDE_FIRST && nMsg <= WM_DDE_LAST)
-    {
-        ////WRITELOG("::ConvWndProc:DDE-Msg received")
-    }
-#endif
-    ImpConvWndData* pObj = (ImpConvWndData*)WinQueryWindowULong( hWnd, 0 );
-    return pObj->pThis->ConvWndProc( hWnd, nMsg, nPar1, nPar2 );
-}
-
-//
-// Server-WndProc
-// DDE-Server-Window der App
-//
-MRESULT EXPENTRY ServerWndProc(HWND hWnd,ULONG nMsg,MPARAM nPar1,MPARAM nPar2)
-{
-#if defined(DBG_UTIL) && defined(OV_DEBUG)
-    if( nMsg >= WM_DDE_FIRST && nMsg <= WM_DDE_LAST)
-    {
-        ////WRITELOG("::ServerWndProc:DDE-Msg received")
-    }
-#endif
-    ImpDdeMgr* pObj = (ImpDdeMgr*)WinQueryWindowULong( hWnd, 0 );
-    return pObj->SrvWndProc( hWnd, nMsg, nPar1, nPar2 );
-}
-
-
-inline HDDEDATA ImpDdeMgr::Callback( USHORT nTransactionType,
-    USHORT nClipboardFormat, HCONV hConversationHandle, HSZ hsz1,
-    HSZ hsz2, HDDEDATA hData, ULONG nData1, ULONG nData2 )
-{
-    HDDEDATA hRet = (HDDEDATA)0;
-    if( pCallback )
-        hRet = (*pCallback)(nTransactionType, nClipboardFormat,
-            hConversationHandle, hsz1, hsz2, hData, nData1, nData2);
-    return hRet;
-}
-
-
-
-ImpDdeMgr::ImpDdeMgr()
-{
-    nLastErrInstance	= DMLERR_NO_ERROR;
-    pCallback			= 0;
-    nTransactFilter		= 0;
-    nServiceCount		= 0;
-    pServices			= 0;
-    pAppTable			= 0;
-    pConvTable 			= 0;
-    pTransTable			= 0;
-    bServFilterOn		= TRUE;
-    bInSyncTrans		= FALSE;
-
-    CreateServerWnd();
-    pData = InitAll();
-    if ( !pData )
-        nLastErrInstance = DMLERR_MEMORY_ERROR;
-    else
-        RegisterDDEMLApp();
-}
-
-ImpDdeMgr::~ImpDdeMgr()
-{
-    CleanUp();
-    DestroyServerWnd();
-// Named Shared Mem vom BS loeschen lassen, da nicht bekannt ist,
-// wieviele DDEML-Instanzen die App erzeugt hat, und OS/2
-// keinen App-Referenzzaehler fuer shared mem fuehrt.
-//	if ( pData )
-//		DosFreeMem( pData );
-}
-
-
-BOOL ImpDdeMgr::IsSameInstance( HWND hWnd )
-{
-    TID tid; PID pid;
-    WinQueryWindowProcess( hWnd, &pid, &tid );
-    return (BOOL)(pid == pidThis);
-}
-
-HSZ ImpDdeMgr::GetAppName( HWND hWnd )
-{
-    return 0;
-}
-
-// static
-ImpDdeMgr* ImpDdeMgr::GetImpDdeMgrInstance( HWND hWnd )
-{
-    ImpDdeMgrData* pData = ImpDdeMgr::AccessMgrData();
-    if( !pData )
-        return 0;
-
-    ImpDdeMgr* pResult = 0;
-    TID tid; PID pidApp;
-    WinQueryWindowProcess( hWnd, &pidApp, &tid );
-    HWND* pApp = ImpDdeMgr::GetAppTable( pData );
-    USHORT nCurApp = 0;
-    while( nCurApp < pData->nMaxAppCount )
-    {
-        HWND hCurWin = *pApp;
-        if( hCurWin )
-        {
-            PID pidCurApp;
-            WinQueryWindowProcess( hCurWin, &pidCurApp, &tid );
-            if( pidCurApp == pidApp )
-            {
-                pResult = (ImpDdeMgr*)WinQueryWindowULong( hCurWin, 0 );
-                break;
-            }
-        }
-        pApp++;
-        nCurApp++;
-    }
-    return pResult;
-}
-
-
-
-
-
-void ImpDdeMgr::CleanUp()
-{
-    DisconnectAll();
-    ImpService* pPtr = pServices;
-    if( pPtr )
-    {
-        for( USHORT nIdx = 0; nIdx < nServiceCount; nIdx++, pPtr++ )
-        {
-            HSZ hStr = pPtr->hBaseServName;
-            if( hStr )
-                DdeFreeStringHandle( hStr );
-            hStr = pPtr->hInstServName;
-            if( hStr )
-                DdeFreeStringHandle( hStr );
-        }
-        nServiceCount = 0;
-        delete pServices;
-        pServices = 0;
-    }
-    bServFilterOn = TRUE;  // default setting DDEML
-    UnregisterDDEMLApp();
-}
-
-void ImpDdeMgr::RegisterDDEMLApp()
-{
-    HWND* pPtr = pAppTable;
-    HWND hCur;
-    USHORT nPos = 0;
-    while( nPos < pData->nMaxAppCount )
-    {
-        hCur = *pPtr;
-        if (hCur == (HWND)0 )
-        {
-            // in Tabelle stellen
-            *pPtr = hWndServer;
-            break;
-        }
-        nPos++;
-        pPtr++;
-    }
-}
-
-void ImpDdeMgr::UnregisterDDEMLApp()
-{
-    HWND* pPtr = pAppTable;
-    USHORT nPos = 0;
-    while( nPos < pData->nMaxAppCount )
-    {
-        if (*pPtr == hWndServer )
-        {
-            *pPtr = 0;
-            break;
-        }
-        nPos++;
-        pPtr++;
-    }
-}
-
-// static
-ImpDdeMgrData* ImpDdeMgr::AccessMgrData()
-{
-    ImpDdeMgrData* pData = 0;
-    APIRET nRet = DosGetNamedSharedMem((PPVOID)&pData,DDEMLDATA,PAG_READ|PAG_WRITE);
-    DBG_ASSERT(!nRet,"DDE:AccessMgrData failed");
-    return pData;
-}
-
-USHORT ImpDdeMgr::DdeGetLastError()
-{
-    USHORT nErr;
-    if ( !pData )
-        nErr = DMLERR_DLL_NOT_INITIALIZED;
-    else if ( nLastErrInstance )
-        nErr = nLastErrInstance;
-    else
-        nErr = pData->nLastErr;
-
-    nLastErrInstance = 0;
-    pData->nLastErr = 0;
-    return nErr;
-}
-
-
-
-USHORT ImpDdeMgr::DdeInitialize( PFNCALLBACK pCallbackProc, ULONG nTransactionFilter )
-{
-    if ( !nLastErrInstance )
-    {
-        if ( !pCallbackProc )
-        {
-            nLastErrInstance = DMLERR_INVALIDPARAMETER;
-            return nLastErrInstance;
-        }
-        pCallback = pCallbackProc;
-        nTransactFilter = nTransactionFilter;
-        nTransactFilter |= CBF_FAIL_SELFCONNECTIONS;
-    }
-    return nLastErrInstance;
-}
-
-
-// static
-HWND ImpDdeMgr::NextFrameWin( HENUM hEnum )
-{
-    char aBuf[ 10 ];
-
-    HWND hWnd = WinGetNextWindow( hEnum );
-    while( hWnd )
-    {
-        WinQueryClassName( hWnd, sizeof(aBuf)-1, (PCH)aBuf );
-        // Frame-Window ?
-        if( !strcmp( aBuf, "#1" ) )	// #define WC_FRAME ((PSZ)0xffff0001L)
-            break;
-        hWnd = WinGetNextWindow( hEnum );
-    }
-    return hWnd;
-}
-
-
-HCONV ImpDdeMgr::DdeConnectImp( HSZ hszService,HSZ hszTopic,CONVCONTEXT* pCC)
-{
-    hCurConv = 0;
-    if( !pCC )
-        pCC = &aDefaultContext;
-
-    ULONG nBufLen;
-    PSZ pService = AllocAtomName( (ATOM)hszService, nBufLen );
-    PSZ pTopic = AllocAtomName( (ATOM)hszTopic, nBufLen );
-#if 0 && defined(OV_DEBUG)
-    String aStr("DdeConnectImp Service:");
-    aStr += pService;
-    aStr += " Topic:";
-    aStr += pTopic;
-    WRITELOG((char*)(const char*)aStr)
-#endif
-
-#if defined(OV_DEBUG)
-    if( !strcmp(pService,"oliver voeltz") )
-    {
-        WRITESTATUS("Table of connections");
-        MyDosFreeMem( pTopic,"DdeConnectImp" );
-        MyDosFreeMem( pService,"DdeConnectImp" );
-        return 0;
-    }
-#endif
-
-#if 0
-    // original pm-fkt benutzen
-    HWND hWndCurClient = CreateConversationWnd();
-    WinDdeInitiate( hWndCurClient, pService, pTopic, pCC );
-    if( GetConversationWndRefCount(hWndCurClient) == 0)
-        DestroyConversationWnd( hWndCurClient );
-#else
-    // eigener Verbindungsaufbau
-    HENUM hEnum = WinBeginEnumWindows( HWND_DESKTOP );
-    HWND hWndCurSrv = NextFrameWin( hEnum );
-    HWND hWndCurClient = CreateConversationWnd();
-    while( hWndCurSrv && !hCurConv )
-    {
-        if( hWndCurSrv != hWndServer ||
-            ((nTransactFilter & CBF_FAIL_SELFCONNECTIONS)==0 ))
-        {
-            // pro DDE-Server ein Conversation-Window erzeugen
-            if( GetConversationWndRefCount(hWndCurClient) >= 2)
-            {
-                DestroyConversationWnd( hWndCurClient );
-                hWndCurClient = CreateConversationWnd();
-            }
-            MyInitiateDde(hWndCurSrv,hWndCurClient,hszService,hszTopic,pCC);
-            if( !bListConnect && hCurConv )
-                break;
-        }
-        hWndCurSrv = NextFrameWin( hEnum );
-    }
-
-    if( GetConversationWndRefCount(hWndCurClient) == 0)
-        DestroyConversationWnd( hWndCurClient );
-    WinEndEnumWindows( hEnum );
-#endif
-
-    if( !hCurConv )
-        nLastErrInstance = DMLERR_NO_CONV_ESTABLISHED;
-
-#if 0 && defined(OV_DEBUG)
-    String aCStr( "DdeConnectImp:End ");
-    if( nLastErrInstance != DMLERR_NO_CONV_ESTABLISHED )
-        aCStr += "(Success)";
-    else
-        aCStr += "(Failed)";
-    WRITELOG((char*)aCStr.GetStr())
-#endif
-
-    MyDosFreeMem( pTopic,"DdeConnectImp" );
-    MyDosFreeMem( pService,"DdeConnectImp" );
-    return hCurConv;
-}
-
-HCONV ImpDdeMgr::DdeConnect( HSZ hszService, HSZ hszTopic, CONVCONTEXT* pCC)
-{
-    ////WRITELOG("DdeConnect:Start")
-    bListConnect = FALSE;
-    HCONV hResult = DdeConnectImp( hszService, hszTopic, pCC );
-    ////WRITELOG("DdeConnect:End")
-    ////WRITESTATUS("DdeConnect:End")
-    return hResult;
-}
-
-
-HCONVLIST ImpDdeMgr::DdeConnectList( HSZ hszService, HSZ hszTopic,
-    HCONVLIST hConvList, CONVCONTEXT* pCC )
-{
-    nPrevConv = 0;
-    ////WRITESTATUS("Before DdeConnectList")
-    if( hConvList )
-    {
-        HCONV hLastConvInList;
-
-        hCurListId		= hConvList;
-        ImpHCONV* pConv = pConvTable;
-        pConv		   += (USHORT)hConvList;
-        if( (USHORT)hConvList >= pData->nMaxConvCount ||pConv->hWndThis==0 )
-        {
-            nLastErrInstance = DMLERR_INVALIDPARAMETER;
-            return 0;
-        }
-        GetLastServer(pData, hConvList, hLastConvInList);
-        nPrevConv = (USHORT)hLastConvInList;
-    }
-    else
-        hCurListId = (HCONVLIST)WinCreateWindow( HWND_OBJECT, WC_FRAME,
-            CONVLISTNAME, 0,0,0,0,0, HWND_DESKTOP, HWND_BOTTOM, 0,0,0);
-
-    bListConnect = TRUE;
-    DdeConnectImp( hszService, hszTopic, pCC );
-#if 0 && defined(OV_DEBUG)
-    WRITELOG("DdeConnectList:ConnectionList:")
-    HCONV hDebug = 0;
-    do
-    {
-        hDebug = DdeQueryNextServer( hCurListId, hDebug);
-        String aStr( (ULONG)hDebug );
-        WRITELOG((char*)(const char*)aStr)
-    } while( hDebug );
-#endif
-    ////WRITESTATUS("After DdeConnectList")
-    return (HCONVLIST)hCurListId;
-}
-
-DDEINIT* ImpDdeMgr::CreateDDEInitData( HWND hWndDestination, HSZ hszService,
-    HSZ hszTopic, CONVCONTEXT* pCC )
-{
-    ULONG nLen1 = 0, nLen2 = 0;
-    HATOMTBL hAtomTable = WinQuerySystemAtomTable();
-
-    if( hszService )
-        nLen1 = WinQueryAtomLength( hAtomTable, hszService );
-    if( hszTopic )
-        nLen2 = WinQueryAtomLength( hAtomTable, hszTopic );
-    nLen1++; nLen2++;
-
-    DDEINIT* pBuf = 0;
-
-    ULONG nLen = sizeof(DDEINIT) + nLen1+ nLen2 + sizeof(CONVCONTEXT);
-    if( !(MyDosAllocSharedMem((PPVOID)&pBuf, NULL, nLen,
-            PAG_COMMIT | PAG_READ | PAG_WRITE | OBJ_GIVEABLE | OBJ_ANY,
-            "CreateDDEInitData")))
-    {
-        memset( pBuf, 0, nLen );
-
-        /*
-        PID pid; TID tid;
-        WinQueryWindowProcess( hWndDestination, &pid, &tid );
-        APIRET nRet = DosGiveSharedMem( pBuf, pid, PAG_READ | PAG_WRITE );
-        */
-
-        pBuf->cb = nLen;
-        pBuf->offConvContext = sizeof( DDEINIT );
-        char* pBase = (char*)pBuf;
-        pBase += sizeof(DDEINIT);
-        if( pCC )
-            memcpy( pBase, pCC, sizeof(CONVCONTEXT) );
-        pBase += sizeof(CONVCONTEXT);
-        pBuf->pszAppName = pBase;
-        if( hszService )
-            WinQueryAtomName( hAtomTable, hszService, pBase, nLen1 );
-        pBase += nLen1;
-        pBuf->pszTopic = pBase;
-        if( hszTopic )
-            WinQueryAtomName( hAtomTable, hszTopic, pBase, nLen2 );
-    }
-    return pBuf;
-}
-
-
-
-void ImpDdeMgr::MyInitiateDde( HWND hWndSrv, HWND hWndClient,
-    HSZ hszService, HSZ hszTopic, CONVCONTEXT* pCC )
-{
-    DDEINIT* pBuf = CreateDDEInitData( hWndSrv, hszService,	hszTopic, pCC );
-    if( pBuf )
-    {
-        PID pid; TID tid;
-        WinQueryWindowProcess( hWndSrv, &pid, &tid );
-        APIRET nRet = DosGiveSharedMem( pBuf, pid, PAG_READ | PAG_WRITE );
-        WinSendMsg( hWndSrv,WM_DDE_INITIATE,(MPARAM)hWndClient,(MPARAM)pBuf);
-        MyDosFreeMem( pBuf,"MyInitiateDde" );
-    }
-}
-
-// static
-ImpHCONV* ImpDdeMgr::GetFirstServer(ImpDdeMgrData* pData, HCONVLIST hConvList,
-    HCONV& rhConv )
-{
-    ImpHCONV* pPtr = GetConvTable( pData );
-    HCONV hConv;
-    if( !rhConv )
-    {
-        pPtr++;
-        hConv = 1;
-    }
-    else
-    {
-        // Startposition
-        pPtr += (USHORT)rhConv;
-        hConv = rhConv;
-        pPtr++; hConv++;	// auf den naechsten
-    }
-    while( hConv < pData->nMaxConvCount )
-    {
-        if( pPtr->hConvList == hConvList )
-        {
-            rhConv = hConv;
-            return pPtr;
-        }
-        pPtr++;
-        hConv++;
-    }
-    rhConv = 0;
-    return 0;
-}
-
-// static
-ImpHCONV* ImpDdeMgr::GetLastServer(ImpDdeMgrData* pData, HCONVLIST hConvList,
-    HCONV& rhConv )
-{
-    ImpHCONV* pPtr = GetConvTable( pData );
-    pPtr += pData->nMaxConvCount;
-    pPtr--;
-    HCONV hConv = pData->nMaxConvCount;
-    hConv--;
-    while( hConv > 0 )
-    {
-        if( pPtr->hConvList == hConvList )
-        {
-            rhConv = hConv;
-            return pPtr;
-        }
-        pPtr--;
-        hConv--;
-    }
-    rhConv = 0;
-    return 0;
-}
-
-// static
-BOOL ImpDdeMgr::CheckConvListId( HCONVLIST hConvListId )
-{
-    HAB hAB	= WinQueryAnchorBlock( (HWND)hConvListId );
-    if( hAB )
-        return WinIsWindow( hAB, (HWND)hConvListId );
-    return FALSE;
-    /*
-    HAB hAB	= WinQueryAnchorBlock( (HWND)hConvListId );
-    if( hAB )
-    {
-        char aBuf[ 16 ];
-        WinQueryWindowText( (HWND)hConvListId, sizeof(aBuf), aBuf );
-        if( strcmp(aBuf, CONVLISTNAME ) == 0 )
-            return TRUE;
-    }
-    return FALSE;
-    */
-}
-
-// static
-HCONV ImpDdeMgr::DdeQueryNextServer(HCONVLIST hConvList, HCONV hConvPrev)
-{
-    if( !CheckConvListId( hConvList ) )
-        return (HCONV)0;
-    ImpDdeMgrData* pData = ImpDdeMgr::AccessMgrData();
-    GetFirstServer( pData, hConvList, hConvPrev );
-    return hConvPrev;
-}
-
-// static
-
-// Idee: DisconnectAll uebergibt das ServerWindow. Zu jedem HCONV
-// wird das Creator-Server-Wnd gespeichert. Disconnect braucht
-// dann nur noch die Window-Handles zu vergleichen
-BOOL ImpDdeMgr::DdeDisconnect( HCONV hConv )
-{
-    WRITELOG("DdeDisconnect:Start")
-    ////WRITESTATUS("DdeDisconnect:Start")
-
-    ImpDdeMgrData* pData = ImpDdeMgr::AccessMgrData();
-    if ( !pData )
-    {
-        ImpDdeMgr::nLastErrInstance = DMLERR_DLL_NOT_INITIALIZED;
-        return FALSE;
-    }
-    ImpHCONV* pConv = GetConvTable(pData) + (USHORT)hConv;
-
-    if( (USHORT)hConv >= pData->nMaxConvCount || pConv->hWndThis==0 )
-    {
-        nLastErrInstance = DMLERR_NO_CONV_ESTABLISHED;
-        return FALSE;
-    }
-
-    PID pidApp; TID tid;
-    HWND hWndDummy = WinCreateWindow( HWND_OBJECT, WC_FRAME,
-        "Bla", 0, 0,0,0,0, HWND_DESKTOP, HWND_BOTTOM, 0, 0,  0 );
-    WinQueryWindowProcess( hWndDummy, &pidApp, &tid );
-    WinDestroyWindow( hWndDummy );
-    PID pidThis; PID pidPartner;
-
-    HWND hWndThis = pConv->hWndThis;
-    HWND hWndPartner = pConv->hWndPartner;
-
-    WinQueryWindowProcess( hWndThis, &pidThis, &tid );
-    WinQueryWindowProcess( hWndPartner, &pidPartner, &tid );
-    if( pidApp != pidThis && pidApp != pidPartner )
-        return TRUE;  // gehoert nicht der App -> ueberspringen
-
-    HCONV hConvPartner = pConv->hConvPartner;
-
-    // die App benachrichtigen, dass alle offenen Advise-Loops
-    // beendet werden, egal ob sie vom Server oder Client
-    // initiiert wurden. Die Dinger aber nicht loeschen, da sie evtl.
-    // noch vom Partner gebraucht werden.
-    ImpConvWndData* pObj =
-        (ImpConvWndData*)WinQueryWindowULong( pConv->hWndThis, 0 );
-    ImpDdeMgr* pThis = pObj->pThis;
-    pThis->SendUnadvises( hConv, 0, FALSE ); // alle Formate & NICHT loeschen
-    pThis->SendUnadvises( hConvPartner, 0, FALSE ); // alle Formate & NICHT loeschen
-
-    pConv->nStatus |= ST_TERMINATED;
-
-    HAB hAB	= WinQueryAnchorBlock( pConv->hWndThis );
-    // um die MessageQueue inne Gaenge zu halten
-    ULONG nTimerId = WinStartTimer( hAB, 0, 0, 50 );
-
-    /*
-       Die Partner-App muss ein DDE_TERMINATE posten, auf das
-       wir warten muessen, um alle Messages zu bearbeiten, die
-       _vor_ dem DdeDisconnect von der Partner-App gepostet
-       wurden.
-    */
-    WRITELOG("DdeDisconnect:Waiting for acknowledge...")
-    WinDdePostMsg( hWndPartner, hWndThis, WM_DDE_TERMINATE,
-        (PDDESTRUCT)0,DDEPM_RETRY);
-
-    QMSG aQueueMsg;
-    BOOL bContinue = TRUE;
-    while( bContinue )
-    {
-        if( WinGetMsg( hAB, &aQueueMsg, 0, 0, 0 ))
-        {
-            WinDispatchMsg( hAB, &aQueueMsg );
-            if( (!WinIsWindow( hAB, hWndPartner)) ||
-                (pConv->nStatus & ST_TERMACKREC) )
-            {
-                bContinue = FALSE;
-                if( pConv->nStatus & ST_TERMACKREC )
-                {
-                    WRITELOG("DdeDisconnect: TermAck received")
-                }
-                else
-                {
-                    WRITELOG("DdeDisconnect: Partner died")
-                }
-            }
-        }
-        else
-            bContinue = FALSE;
-    }
-
-    WinStopTimer( hAB, 0, nTimerId );
-
-    // WRITELOG("DdeDisconnect:Freeing data")
-    // Transaktionstabelle aufraeumen
-    FreeTransactions( pData, hConv );
-    if( hConvPartner )
-        FreeTransactions( pData, hConvPartner );
-
-    FreeConvHandle( pData, hConv );
-
-    WRITELOG("DdeDisconnect:End")
-    //WRITESTATUS("DdeDisconnect:End")
-    return TRUE;
-}
-
-// static
-BOOL ImpDdeMgr::DdeDisconnectList( HCONVLIST hConvList )
-{
-    if( !CheckConvListId( hConvList ) )
-    {
-        ImpDdeMgr::nLastErrInstance = DMLERR_INVALIDPARAMETER;
-        return FALSE;
-    }
-
-    ImpDdeMgrData* pData = ImpDdeMgr::AccessMgrData();
-    if ( !pData )
-    {
-        ImpDdeMgr::nLastErrInstance = DMLERR_DLL_NOT_INITIALIZED;
-        return FALSE;
-    }
-    HCONV hConv = 0;
-    GetFirstServer( pData, hConvList, hConv );
-    while( hConv )
-    {
-        DdeDisconnect( hConv );
-        GetFirstServer( pData, hConvList, hConv );
-    }
-    WinDestroyWindow( (HWND)hConvList );
-    return TRUE;
-}
-
-
-
-// static
-HCONV ImpDdeMgr::DdeReconnect(HCONV hConv)
-{
-    ImpDdeMgrData* pData = ImpDdeMgr::AccessMgrData();
-    if ( !pData )
-    {
-        ImpDdeMgr::nLastErrInstance = DMLERR_DLL_NOT_INITIALIZED;
-        return 0;
-    }
-    return 0;
-}
-
-// static
-USHORT ImpDdeMgr::DdeQueryConvInfo(HCONV hConv, ULONG nTransId, CONVINFO* pCI)
-{
-    if( !pCI || pCI->nSize == 0)
-        return 0;
-    ImpDdeMgrData* pData = ImpDdeMgr::AccessMgrData();
-    if ( !pData )
-    {
-        ImpDdeMgr::nLastErrInstance = DMLERR_DLL_NOT_INITIALIZED;
-        return 0;
-    }
-    Transaction* pTrans;
-    if( nTransId != QID_SYNC )
-    {
-        pTrans = ImpDdeMgr::GetTransTable( pData );
-        pTrans += nTransId;
-        if( nTransId >= pData->nMaxTransCount || pTrans->hConvOwner == 0 )
-        {
-            ImpDdeMgr::nLastErrInstance = DMLERR_UNFOUND_QUEUE_ID;
-            return 0;
-        }
-    }
-    else
-        pTrans = 0;
-
-    ImpHCONV* pConv = ImpDdeMgr::GetConvTable( pData );
-    pConv += (ULONG)hConv;
-    if( hConv >= pData->nMaxConvCount || pConv->hWndThis == 0 )
-    {
-        ImpDdeMgr::nLastErrInstance = DMLERR_NO_CONV_ESTABLISHED;
-        return 0;
-    }
-
-    USHORT nSize = pCI->nSize;
-    if( nSize > sizeof(CONVINFO) )
-        nSize = sizeof(CONVINFO);
-    CONVINFO aTempInfo;
-    memset( &aTempInfo, 0, sizeof(CONVINFO) );
-    aTempInfo.nSize 		= pCI->nSize;
-    aTempInfo.hConvPartner	= pConv->hConvPartner;
-    aTempInfo.hszPartner	= pConv->hszPartner;
-    aTempInfo.hszServiceReq	= pConv->hszServiceReq;
-    aTempInfo.hszTopic		= pConv->hszTopic;
-    aTempInfo.nStatus  		= pConv->nStatus;
-    aTempInfo.hConvList 	= pConv->hConvList;
-    aTempInfo.aConvCtxt 	= pConv->aConvContext;
-    if( pTrans )
-    {
-        aTempInfo.nUser 	= pTrans->nUser;
-        aTempInfo.hszItem	= pTrans->hszItem;
-        aTempInfo.nFormat	= pTrans->nFormat;
-        aTempInfo.nType		= pTrans->nType;
-        aTempInfo.nConvst	= pTrans->nConvst;
-        aTempInfo.nLastError= pTrans->nLastError;
-    }
-    memcpy( pCI, &aTempInfo, nSize );
-
-    return nSize;
-}
-
-// static
-BOOL ImpDdeMgr::DdeSetUserHandle(HCONV hConv, ULONG nTransId, ULONG hUser)
-{
-    ImpDdeMgrData* pData = ImpDdeMgr::AccessMgrData();
-    if ( !pData )
-    {
-        ImpDdeMgr::nLastErrInstance = DMLERR_DLL_NOT_INITIALIZED;
-        return FALSE;
-    }
-    Transaction* pTrans = GetTransTable( pData );
-    pTrans += nTransId;
-    if( !nTransId || !hConv || nTransId >= pData->nMaxTransCount ||
-        pTrans->hConvOwner != hConv )
-    {
-        ImpDdeMgr::nLastErrInstance = DMLERR_INVALIDPARAMETER;
-        return FALSE;
-    }
-    if( !pTrans->hConvOwner)
-    {
-        ImpDdeMgr::nLastErrInstance = DMLERR_UNFOUND_QUEUE_ID;
-        return FALSE;
-    }
-    pTrans->nUser = hUser;
-    return TRUE;
-}
-
-BOOL ImpDdeMgr::DdeAbandonTransaction( HCONV hConv, ULONG nTransId )
-{
-    ////WRITELOG("DdeAbandonTransaction:Start")
-    if( !pData )
-    {
-        nLastErrInstance = DMLERR_DLL_NOT_INITIALIZED;
-        return FALSE;
-    }
-    ImpHCONV* pConv = pConvTable;
-    pConv += (USHORT)hConv;
-    if( nTransId < 1 || nTransId >= pData->nMaxTransCount ||
-        hConv < 1 || hConv >= pData->nMaxConvCount || !pConv->hWndThis)
-    {
-        nLastErrInstance = DMLERR_INVALIDPARAMETER;
-        return FALSE;
-    }
-    if( !hConv )
-    {
-        DBG_ASSERT(0,"DdeAbandonTransaction:NULL-hConv not supported");
-        nLastErrInstance = DMLERR_INVALIDPARAMETER;
-        return FALSE;
-    }
-    Transaction* pTrans = pTransTable;
-    pTrans += (USHORT)nTransId;
-    if( pTrans->hConvOwner != hConv )
-    {
-        nLastErrInstance = DMLERR_UNFOUND_QUEUE_ID;
-        return FALSE;
-    }
-
-    if( bInSyncTrans && nTransId == nSyncTransId )
-    {
-        bSyncAbandonTrans = TRUE;
-        return TRUE;
-    }
-    USHORT nTempType = pTrans->nType;
-    nTempType &= (~XTYPF_MASK);
-    if( nTempType == (XTYP_ADVREQ & ~(XTYPF_NOBLOCK)))
-    {
-        ////WRITELOG("DdeAbandTrans:Advise Loop")
-
-// ----------------------------------------------------------------------
-// Der von der Deutschen Bank eingesetzte DDE-Server
-// "Invision V2.71 Build 36 Mar 12 1999 V4.8.2" hat einen Bug, der
-// dazu fuehrt, dass auf per WM_DDE_TERMINATE geschlossene Verbindungen
-// nicht mit einem WM_DDE_TERMINATE geantwortet wird, wenn der
-// entsprechende Link vorher per WM_DDE_UNADVISE beendet wurde. Dieser
-// Bug tritt ab zwei parallel laufenden Links auf. Auf Wunsch der DB
-// wurde das folgende Workaround eingebaut.
-// ----------------------------------------------------------------------
-#define DEUTSCHE_BANK
-#ifndef DEUTSCHE_BANK
-
-// Acknowledge ist beim Unadvise nicht ueblich
-//#define SO_DDE_ABANDON_TRANSACTION_WAIT_ACK
-#ifdef SO_DDE_ABANDON_TRANSACTION_WAIT_ACK
-        DDESTRUCT* pOutDDEData = MakeDDEObject( pConv->hWndPartner,
-            pTrans->hszItem, DDE_FACKREQ, 0 /*pTrans->nFormat*/, 0, 0);
-#else
-        DDESTRUCT* pOutDDEData = MakeDDEObject( pConv->hWndPartner,
-            pTrans->hszItem, 0, 0 /*pTrans->nFormat*/, 0, 0);
-#endif
-        WRITELOG("DdeAbandTrans:Waiting for acknowledge...")
-        pTrans->nConvst = XST_UNADVSENT;
-        if ( !MyWinDdePostMsg( pConv->hWndPartner, pConv->hWndThis,
-            WM_DDE_UNADVISE, pOutDDEData, DDEPM_RETRY ) )
-        {
-            WRITELOG("DdeAbandTrans:PostMsg Failed")
-            return FALSE;
-        }
-#ifdef SO_DDE_ABANDON_TRANSACTION_WAIT_ACK
-        WaitTransState( pTrans, nTransId, XST_UNADVACKRCVD, 0 );
-#else
-        pTrans->nConvst = XST_UNADVACKRCVD;
-#endif
-
-#endif // DEUTSCHE_BANK
-
-        WRITELOG("DdeAbandTrans:Ack received->Freeing transaction")
-        FreeTransaction( pData, nTransId );
-    }
-    WRITELOG("DdeAbandonTransaction:End")
-    return TRUE;
-}
-
-// wird von einem Server aufgerufen, wenn sich die Daten des
-// Topic/Item-Paars geaendert haben. Diese Funktion fordert
-// dann den Server auf, die Daten zu rendern (bei Hotlinks) und
-// benachrichtigt die Clients
-BOOL ImpDdeMgr::DdePostAdvise( HSZ hszTopic, HSZ hszItem)
-{
-    ////WRITELOG("DdePostAdvise:Start")
-    ////WRITESTATUS("DdePostAdvise:Start")
-
-#if 0 && defined( OV_DEBUG )
-    String aDebStr("DdePostAdvise:Item ");
-    aDebStr += (ULONG)hszItem;
-    WRITELOG((char*)(const char*)aDebStr)
-#endif
-
-    Transaction* pTrans = pTransTable;
-    pTrans++;
-    USHORT nCurTrans = 1;
-    USHORT nUsedTransactions = pData->nCurTransCount;
-    while( nUsedTransactions && nCurTrans < pData->nMaxTransCount )
-    {
-        HCONV hOwner = pTrans->hConvOwner;
-        if( hOwner )
-        {
-            nUsedTransactions--;
-            USHORT nTempType = pTrans->nType;
-            nTempType &= (~XTYPF_MASK);
-            if( nTempType == (XTYP_ADVREQ & (~XTYPF_NOBLOCK) ) )
-            {
-                ImpHCONV* pConv = pConvTable;
-                pConv += (USHORT)hOwner;
-                if(hszItem == pTrans->hszItem && pConv->hszTopic == hszTopic)
-                {
-                    if( pConv->hConvPartner )
-                    {
-                        // Transaktionen werden immer vom Client erzeugt
-                        // -> auf Server-HCONV umschalten
-                        hOwner = pConv->hConvPartner;
-                        pConv = pConvTable;
-                        pConv += (USHORT)hOwner;
-                    }
-                    HWND hWndClient = pConv->hWndPartner;
-                    HWND hWndServer = pConv->hWndThis;
-#if 0 && defined( OV_DEBUG )
-                    String aDebStr("DdePostAdvise: Server:");
-                    aDebStr += (ULONG)hWndServer;
-                    aDebStr += " Client:";
-                    aDebStr += (ULONG)hWndClient;
-                    WRITELOG((char*)(const char*)aDebStr)
-#endif
-                    DDESTRUCT* pOutDDEData;
-                    if ( pTrans->nType & XTYPF_NODATA )
-                    {
-                        // Warm link
-                        ////WRITELOG("DdePostAdvise:Warm link found")
-                        pOutDDEData = MakeDDEObject( hWndClient, hszItem,
-                            DDE_FNODATA, pTrans->nFormat, 0, 0  );
-                    }
-                    else
-                    {
-                        // Hot link
-                        ////WRITELOG("DdePostAdvise:Hot link found")
-                        pOutDDEData = Callback( XTYP_ADVREQ,
-                            pTrans->nFormat, hOwner, hszTopic,
-                            hszItem, (HDDEDATA)0, 1, 0 );
-                    }
-                    if( pOutDDEData )
-                    {
-                        // todo: FACK_REQ in Out-Data setzen, wenn pTrans->nType & XTYPF_ACKREQ
-                        ////WRITELOG("DdePostAdvise:Sending data/notification")
-                        BOOL bSuccess =	MyWinDdePostMsg( hWndClient,
-                            hWndServer,WM_DDE_DATA, pOutDDEData, DDEPM_RETRY);
-                        if( bSuccess )
-                        {
-                            // auf Acknowledge des Partners warten ?
-                            if( pTrans->nType & XTYPF_ACKREQ )
-                            {
-                                pTrans->nConvst = XST_ADVDATASENT;
-                                // Impl. ist falsch! => korrekt: XST_ADVDATAACKRCVD
-                                WaitTransState(pTrans, nCurTrans,
-                                    XST_UNADVACKRCVD, 0);
-                            }
-                        }
-                        else
-                        {
-                            ////WRITELOG("DdePostAdvise:PostMsg failed")
-                            nLastErrInstance = DMLERR_POSTMSG_FAILED;
-                        }
-                    }
-                    else
-                    {
-                        ////WRITELOG("DdePostAdvise:No data to send")
-                    }
-                }
-            }
-        }
-        nCurTrans++;
-        pTrans++;
-    }
-    ////WRITELOG("DdePostAdvise:End")
-    return TRUE;
-}
-
-BOOL ImpDdeMgr::DdeEnableCallback( HCONV hConv, USHORT wCmd)
-{
-    return FALSE;
-}
-
-// Rueckgabe: 0==Service nicht registriert; sonst Pointer auf Service-Eintrag
-ImpService* ImpDdeMgr::GetService( HSZ hszService )
-{
-    ImpService* pPtr = pServices;
-    if( !pPtr || !hszService )
-        return 0;
-    for( ULONG nIdx = 0; nIdx < nServiceCount; nIdx++, pPtr++ )
-    {
-        if(( hszService == pPtr->hBaseServName )    ||
-           ( hszService == pPtr->hInstServName ) )
-            return pPtr;
-    }
-    return 0;
-}
-
-
-// legt Service in Service-Tabelle ab. Tabelle wird ggf. expandiert
-ImpService* ImpDdeMgr::PutService( HSZ hszService )
-{
-    if( !pServices )
-    {
-        DBG_ASSERT(nServiceCount==0,"DDE:Bad ServiceCount");
-        pServices = new ImpService[ DDEMLSERVICETABLE_INISIZE ];
-        memset( pServices, 0, DDEMLSERVICETABLE_INISIZE* sizeof(ImpService));
-        nServiceCount = DDEMLSERVICETABLE_INISIZE;
-    }
-    ImpService* pPtr = pServices;
-    USHORT nCurPos = 0;
-    while( pPtr )
-    {
-        if( pPtr->hBaseServName == 0 )
-            break;
-        nCurPos++;
-        if( nCurPos < nServiceCount )
-            pPtr++;
-        else
-            pPtr = 0;
-    }
-    if( !pPtr )
-    {
-        // Tabelle vergroessern
-        pPtr = new ImpService[ nServiceCount + DDEMLSERVICETABLE_INISIZE ];
-        memset( pPtr, 0, DDEMLSERVICETABLE_INISIZE* sizeof(ImpService));
-        memcpy( pPtr, pServices, nServiceCount * sizeof(ImpService) );
-#ifdef DBG_UTIL
-        memset( pServices, 0, nServiceCount * sizeof(ImpService) );
-#endif
-        delete pServices;
-        pServices = pPtr;
-        pPtr += nServiceCount; // zeigt auf erste neue Position
-        nServiceCount += DDEMLSERVICETABLE_INISIZE;
-    }
-    DBG_ASSERT(pPtr->hBaseServName==0,"DDE:Service not empty");
-    DBG_ASSERT(pPtr->hInstServName==0,"DDE:Service not empty");
-
-    DdeKeepStringHandle( hszService );
-
-    USHORT nStrLen = (USHORT)DdeQueryString( hszService, 0, 0, 0);
-    char* pBuf = new char[ nStrLen + 1 ];
-    DdeQueryString(hszService, pBuf, nStrLen, 850 /* CodePage*/ );
-    pBuf[ nStrLen ] = 0;
-    String aStr( (ULONG)hWndServer );
-    aStr += pBuf;
-    HSZ hszInstServ = DdeCreateStringHandle( (PSZ)(const char*)pBuf, 850 );
-    delete [] pBuf;
-
-    pPtr->hBaseServName = hszService;
-    pPtr->hInstServName = hszInstServ;
-    return pPtr;
-}
-
-void ImpDdeMgr::BroadcastService( ImpService* pService, BOOL bRegistered )
-{
-    DBG_ASSERT(pService,"DDE:No Service");
-    if( !pService )
-        return;
-    MPARAM aMp1 = (MPARAM)(pService->hBaseServName);
-    MPARAM aMp2 = (MPARAM)(pService->hInstServName);
-    ULONG nMsg;
-    if( bRegistered )
-        nMsg = WM_DDEML_REGISTER;
-    else
-        nMsg = WM_DDEML_UNREGISTER;
-
-    HWND* pPtr = pAppTable;
-    for( USHORT nPos = 0; nPos < pData->nMaxAppCount; nPos++, pPtr++ )
-    {
-        HWND hWndCurWin = *pPtr;
-        if ( hWndCurWin && hWndCurWin != hWndServer )
-            WinSendMsg( hWndCurWin, nMsg, aMp1, aMp2 );
-    }
-}
-
-HDDEDATA ImpDdeMgr::DdeNameService( HSZ hszService, USHORT afCmd )
-{
-    HDDEDATA hRet = (HDDEDATA)1;
-
-    if( afCmd & DNS_FILTERON )
-        bServFilterOn = TRUE;
-    else if( afCmd & DNS_FILTEROFF )
-        bServFilterOn = FALSE;
-    ImpService* pService = GetService( hszService );
-    BOOL bRegister = (BOOL)(afCmd & DNS_REGISTER);
-    if( bRegister )
-    {
-        if( !pService )
-        {
-            pService = PutService( hszService );
-            BroadcastService( pService, TRUE );
-        }
-    }
-    else
-    {
-        if( pService )
-        {
-            BroadcastService( pService, FALSE );
-            DdeFreeStringHandle( pService->hBaseServName );
-            pService->hBaseServName = 0;
-            DdeFreeStringHandle( pService->hInstServName );
-            pService->hInstServName = 0;
-        }
-            hRet = (HDDEDATA)0;  // Service nicht gefunden
-    }
-    return hRet;
-}
-
-
-// static
-HDDEDATA ImpDdeMgr::DdeClientTransaction(void* pDdeData, ULONG cbData,
-    HCONV hConv, HSZ hszItem, USHORT nFormat, USHORT nType,
-    ULONG nTimeout, ULONG* pResult)
-{
-    //WRITELOG("DdeClientTransaction:Start")
-
-#if 0 && defined(OV_DEBUG)
-    if( nType == XTYP_REQUEST )
-    {
-        WRITELOG("Start XTYP_REQUEST");
-        WinMessageBox(HWND_DESKTOP,HWND_DESKTOP,
-            "Start XTYP_REQUEST","DdeClientTransaction",
-            HWND_DESKTOP,MB_OK);
-    }
-#endif
-
-    if( pResult )
-        *pResult = 0;
-
-    ImpDdeMgrData* pData = ImpDdeMgr::AccessMgrData();
-    if ( !pData )
-    {
-        ImpDdeMgr::nLastErrInstance = DMLERR_DLL_NOT_INITIALIZED;
-        return (HDDEDATA)0;
-    }
-
-    BOOL bIsDdeHandle = (BOOL)(pDdeData && cbData==0xffffffff);
-    BOOL bAppOwnsHandle = (BOOL)( bIsDdeHandle &&
-        (((DDESTRUCT*)pDdeData)->fsStatus & IMP_HDATAAPPOWNED) );
-
-    BOOL bNoData  = (BOOL)(nType & XTYPF_NODATA)!=0;
-    BOOL bAckReq  = (BOOL)(nType & XTYPF_ACKREQ)!=0;
-    USHORT nTypeFlags = nType & XTYPF_MASK;
-    nType &= (~XTYPF_MASK);
-
-    BOOL bSync = (BOOL)( nTimeout != TIMEOUT_ASYNC ) != 0;
-    if( nType == XTYP_ADVSTART )
-        bSync = TRUE;
-
-    // Mapping transaction -> OS/2-Message
-    USHORT nTimeoutErr, nMsg;
-    switch ( nType )
-    {
-        case XTYP_ADVSTART:
-            nMsg = WM_DDE_ADVISE;
-            nTimeoutErr = DMLERR_ADVACKTIMEOUT;
-{
-            nTimeout = 60000;
-#if 0 && defined(OV_DEBUG)
-            char aBuf[ 128 ];
-            ImpDdeMgr::DdeQueryString( hszItem,aBuf,127,850);
-            String aXXStr("Establishing hotlink ");
-            aXXStr += aBuf;
-            WRITELOG((char*)aXXStr.GetStr());
-#endif
-
-}
-            break;
-
-        case XTYP_ADVSTOP:
-            nMsg = WM_DDE_UNADVISE;
-            nTimeoutErr = DMLERR_UNADVACKTIMEOUT;
-            break;
-
-        case XTYP_REQUEST:
-            nMsg = WM_DDE_REQUEST;
-            nTimeoutErr = DMLERR_DATAACKTIMEOUT;
-            break;
-
-        case XTYP_POKE:
-            nMsg = WM_DDE_POKE;
-            nTimeoutErr = DMLERR_POKEACKTIMEOUT;
-            break;
-
-        case XTYP_EXECUTE:
-            nMsg = WM_DDE_EXECUTE;
-            nTimeoutErr = DMLERR_EXECACKTIMEOUT;
-            break;
-
-        default:
-            nMsg = 0;
-    }
-    if(!hConv || (USHORT)hConv>= pData->nMaxConvCount || !nType || !nMsg ||
-       (nType != XTYP_EXECUTE && (!hszItem || !nFormat)) )
-    {
-        WRITELOG("DdeClientTransaction:Invalid parameter")
-        ImpDdeMgr::nLastErrInstance = DMLERR_INVALIDPARAMETER;
-        if( bIsDdeHandle && !bAppOwnsHandle )
-            DdeFreeDataHandle( (HDDEDATA)pDdeData );
-        return (HDDEDATA)0;
-    }
-
-    // ueber den Conversation handle das ImpDdeMgr-Objekt holen
-    ImpHCONV* pConv = GetConvTable( pData );
-    pConv += (USHORT)hConv;
-    ImpConvWndData* pObj =
-        (ImpConvWndData*)WinQueryWindowULong( pConv->hWndThis, 0 );
-    ImpDdeMgr* pThis = pObj->pThis;
-
-    if( bSync && pThis->bInSyncTrans )
-    {
-        WRITELOG("DdeClientTransaction:Already in sync. transaction")
-        ImpDdeMgr::nLastErrInstance = DMLERR_REENTRANCY;
-        if( bIsDdeHandle && !bAppOwnsHandle )
-            DdeFreeDataHandle( (HDDEDATA)pDdeData );
-        return (HDDEDATA)0;
-    }
-
-    Transaction* pTrans;
-
-    BOOL bReqOnAdvLoop = FALSE;
-    ULONG nTransId = GetTransaction( pData, hConv, hszItem, nFormat );
-    if( nTransId )
-    {
-        // WRITELOG("DdeClientTransaction:Transaction found")
-        pTrans = GetTransTable( pData );
-        pTrans += (USHORT)nTransId;
-        USHORT nTransType = pTrans->nType;
-        nTransType &= (~XTYPF_MASK);
-        if( (nType != XTYP_REQUEST && nTransType == nType) ||
-             // wird Advise-Loop schon zum requesten missbraucht ?
-             (nType == XTYP_REQUEST &&
-             nTransType == XTYP_ADVREQ &&
-             pTrans->nConvst == XST_WAITING_REQDATA))
-        {
-            // dieser Kanal ist dicht!
-            WRITELOG("DdeClientTransaction:Transaction already used")
-            ImpDdeMgr::nLastErrInstance = DMLERR_REENTRANCY;
-            if( bIsDdeHandle && !bAppOwnsHandle )
-                DdeFreeDataHandle( (HDDEDATA)pDdeData );
-            return (HDDEDATA)0;
-        }
-        else if( nTransType == XTYP_ADVREQ )
-        {
-            switch( nType )
-            {
-                case XTYP_ADVSTOP:
-                    //WRITELOG("DdeClientTransaction:Stopping advise trans")
-                    pTrans->nType = XTYP_ADVSTOP;
-                    break;
-
-                case XTYP_ADVSTART:
-                    //WRITELOG("DdeClientTransaction:Adj. Advise-Params")
-                    pTrans->nType = XTYP_ADVREQ;
-                    if( bNoData )
-                        pTrans->nType |= XTYPF_NODATA;
-                    if( bAckReq )
-                        pTrans->nType |= XTYPF_ACKREQ;
-                    if( pResult )
-                        *pResult = nTransId;
-                    return (HDDEDATA)TRUE;
-
-                case XTYP_REQUEST:
-                    // WRITELOG("DdeClientTransaction:Using adv trans for req")
-                    // nConvst wird unten auf XST_WAITING_REQDATA gesetzt
-                    bReqOnAdvLoop = TRUE;
-                    break;
-
-                default:
-                    WRITELOG("DdeClientTransaction:Invalid parameter")
-                    ImpDdeMgr::nLastErrInstance = DMLERR_INVALIDPARAMETER;
-                    if( bIsDdeHandle && !bAppOwnsHandle )
-                        DdeFreeDataHandle( (HDDEDATA)pDdeData );
-                    return (HDDEDATA)FALSE;
-            }
-        }
-    }
-    else
-    {
-        // WRITELOG("DdeClientTransaction:Creating transaction")
-        nTransId = CreateTransaction(pData, hConv, hszItem, nFormat, nType);
-    }
-
-    pTrans = GetTransTable( pData );
-    pTrans += (USHORT)nTransId;
-    pTrans->nConvst = XST_WAITING_ACK;
-    if( nType == XTYP_REQUEST )
-        pTrans->nConvst = XST_WAITING_REQDATA;
-
-    HWND hWndServer = pConv->hWndPartner;
-    HWND hWndClient = pConv->hWndThis;
-
-    HDDEDATA pOutDDEData;
-    if( bIsDdeHandle )
-    {
-        if( bAppOwnsHandle )
-        {
-            // wir muessen leider leider duplizieren, da uns OS/2
-            // keine Chance laesst, diesen Status im Datenobjekt
-            // zu versenken.
-            ////WRITELOG("DdeClientTransaction:Copying handle")
-            HDDEDATA pNew;
-            HDDEDATA pData = (HDDEDATA)pDdeData;
-            if( !(MyDosAllocSharedMem((PPVOID)&pNew, NULL, pData->cbData,
-                PAG_COMMIT | PAG_READ | PAG_WRITE | OBJ_GIVEABLE | OBJ_ANY,
-                "MakeDDEObject")))
-            {
-                memcpy( pNew, pData, pData->cbData );
-                pOutDDEData = pNew;
-            }
-            else
-            {
-                WRITELOG("DdeClientTransaction:No Memory")
-                ImpDdeMgr::nLastErrInstance = DMLERR_LOW_MEMORY;
-                return (HDDEDATA)0;
-            }
-        }
-        else
-            pOutDDEData = (HDDEDATA)pDdeData;
-    }
-    else
-        pOutDDEData=MakeDDEObject(hWndServer,hszItem,0,nFormat,pDdeData,cbData);
-
-    pOutDDEData->fsStatus |= nTypeFlags;
-
-    HDDEDATA pDDEInData = 0;
-    if( bSync )
-    {
-        if( nType != XTYP_REQUEST )
-            pOutDDEData->fsStatus |= DDE_FACKREQ;
-
-        // WRITELOG("DdeClientTransaction:Starting sync. trans.")
-        pThis->hSyncResponseData = (HDDEDATA)0;
-        pThis->nSyncResponseMsg	 = 0;
-        pThis->bInSyncTrans 	 = TRUE;
-        pThis->nSyncTransId		 = nTransId;
-        pThis->bSyncAbandonTrans = FALSE;
-
-        if ( !MyWinDdePostMsg( hWndServer, hWndClient, nMsg, pOutDDEData,
-                DDEPM_RETRY) )
-        {
-            WRITELOG("DdeClientTransaction:PostMsg failed")
-            nLastErrInstance = DMLERR_POSTMSG_FAILED;
-            if( !bReqOnAdvLoop )
-                FreeTransaction( pData, nTransId );
-            else
-            {
-                DBG_ASSERT(pTrans->nType==XTYP_ADVREQ,"DDE:Error!")
-                pTrans->nConvst = 0;
-            }
-            return FALSE;
-        }
-        HAB hAB	= WinQueryAnchorBlock( hWndClient );
-        ULONG nDummyTimer = WinStartTimer( hAB, 0, 0, 50 );
-        ULONG nTimeoutId = TID_USERMAX - nTransId;
-        WinStartTimer( hAB, hWndClient, nTimeoutId, nTimeout );
-        QMSG aQueueMsg;
-        BOOL bLoop = TRUE;
-        while( bLoop )
-        {
-            if( pThis->nSyncResponseMsg )
-                bLoop = FALSE;
-            else
-            {
-                if( WinGetMsg(hAB,&aQueueMsg,0,0,0 ))
-                {
-                    WinDispatchMsg( hAB, &aQueueMsg );
-                }
-                else
-                    bLoop = FALSE;
-            }
-        }
-
-        WinStopTimer( hAB, hWndClient, nTimeoutId );
-        WinStopTimer( hAB, 0, nDummyTimer );
-
-        //
-        // Der Speicherblock pOutDDEData muss vom Server geloescht worden sein!
-        // Ueberlegen: Nochmal loeschen, falls Server buggy ist, ansonsten
-        // platzt uns bald der Adressraum!
-        //
-        if( !pThis->nSyncResponseMsg )
-        {
-            // unsere App wurde beendet
-            ////WRITELOG("DdeClientTransaction:App terminated")
-            return 0;
-        }
-        pDDEInData = pThis->hSyncResponseData;
-        nMsg = pThis->nSyncResponseMsg;
-        pThis->hSyncResponseData= 0;
-        pThis->nSyncResponseMsg = 0;
-        pThis->bInSyncTrans		= FALSE;
-        pThis->nSyncTransId 	= 0;
-        if( !pDDEInData && nMsg != WM_TIMER )
-        {
-            DBG_ASSERT(0,"Dde:No data!");
-            WRITELOG("DdeClientTransaction: No Data!")
-            return (HDDEDATA)0;
-        }
-        switch( nMsg )
-        {
-            case WM_TIMER:
-                WRITELOG("DdeClientTransaction:Timeout!")
-                nLastErrInstance = nTimeoutErr;
-                if( bReqOnAdvLoop )
-                    // auf normalen Loop-Betrieb zurueckschalten
-                    pTrans->nConvst = XST_WAITING_ADVDATA;
-                break;
-
-            case WM_DDE_ACK:
-                {
-                // WRITELOG("DdeClientTransaction:Ack received")
-                BOOL bPositive = (BOOL)(pDDEInData->fsStatus & DDE_FACK);
-                MyDosFreeMem( pDDEInData,"DdeClientTransaction" );
-                pDDEInData = (HDDEDATA)bPositive;
-                if( nType == XTYP_ADVSTART && pDDEInData )
-                {
-
-#if 0 && defined(OV_DEBUG)
-                    char aBuf[ 128 ];
-                    ImpDdeMgr::DdeQueryString( pTrans->hszItem,aBuf,128,850);
-                    String aXXStr("Hotlink ");
-#endif
-
-                    if( bPositive )
-                    {
-                        pTrans->nType = XTYP_ADVREQ;
-                        // Hot/Warmlink, Ack
-                        pTrans->nType |= nTypeFlags;
-                        // XST_WAITING_ACK ==> XST_WAITING_ADVDATA
-                        pTrans->nConvst = XST_WAITING_ADVDATA;
-
-#if 0 && defined(OV_DEBUG)
-                        aXXStr += "established ";
-                        aXXStr += aBuf;
-#endif
-
-                    }
-
-#if 0 && defined(OV_DEBUG)
-                    else
-                    {
-                        aXXStr += "failed ";
-                        aXXStr += aBuf;
-                    }
-                    WRITELOG((char*)aXXStr.GetStr());
-#endif
-
-                }
-                }
-                break;
-
-            case WM_DDE_DATA:
-                // WRITELOG("DdeClientTransaction:Data received")
-                // WRITEDATA(pDDEInData)
-                if( bReqOnAdvLoop )
-                {
-                    DBG_ASSERT(pTrans->nConvst==XST_WAITING_REQDATA,"DDE:Bad state");
-                    DBG_ASSERT(pTrans->nType==XTYP_ADVREQ,"DDE:Bad state");
-                    // auf Loop-Betrieb umschalten

... etc. - the rest is truncated


More information about the Libreoffice-commits mailing list