diff options
author | Mikhail Voytenko <mav@openoffice.org> | 2011-01-06 14:57:12 +0100 |
---|---|---|
committer | Mikhail Voytenko <mav@openoffice.org> | 2011-01-06 14:57:12 +0100 |
commit | 305315337b472eeee344c3ee174dded67da8d1af (patch) | |
tree | ea57d289a315e6a4b3b1f2ba80e8062f72dd59e5 /svl/source | |
parent | 3491b4ac4fe34cacea5f4d0a4594d4a88cbbe7b2 (diff) | |
parent | 7997ab5bac6fbdfe3b3427c322507a993d33acbc (diff) |
removetooltypes01: rebase to DEV300_m96
Diffstat (limited to 'svl/source')
48 files changed, 40 insertions, 5910 deletions
diff --git a/svl/source/config/makefile.mk b/svl/source/config/makefile.mk deleted file mode 100644 index beb696c0feaf..000000000000 --- a/svl/source/config/makefile.mk +++ /dev/null @@ -1,52 +0,0 @@ -#************************************************************************* -# -# 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. -# -#************************************************************************* -PRJ=..$/.. - -PRJNAME=svl -TARGET=config - -ENABLE_EXCEPTIONS := TRUE - -# --- Settings ----------------------------------------------------- - -.INCLUDE : settings.mk -.INCLUDE : $(PRJ)$/util$/svl.pmk - -# --- Files -------------------------------------------------------- - -SLOFILES= \ - $(SLO)$/asiancfg.obj \ - $(SLO)$/cjkoptions.obj \ - $(SLO)$/ctloptions.obj \ - $(SLO)$/srchcfg.obj \ - $(SLO)$/itemholder2.obj \ - $(SLO)$/languageoptions.obj - -# --- Targets ------------------------------------------------------ - -.INCLUDE : target.mk - diff --git a/svl/source/filepicker/makefile.mk b/svl/source/filepicker/makefile.mk deleted file mode 100644 index b3c2a829cf54..000000000000 --- a/svl/source/filepicker/makefile.mk +++ /dev/null @@ -1,46 +0,0 @@ -#************************************************************************* -# -# 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. -# -#************************************************************************* -PRJ=..$/.. - -PRJNAME=svl -TARGET=filepicker -ENABLE_EXCEPTIONS=TRUE - -# --- Settings ----------------------------------------------------------- - -.INCLUDE : settings.mk -.INCLUDE : $(PRJ)$/util$/svl.pmk - -# --- Files -------------------------------------------------------------- - -SLOFILES =\ - $(SLO)$/pickerhistory.obj - -# --- Targets ------------------------------------------------------- - -.INCLUDE : target.mk - diff --git a/svl/source/filepicker/pickerhistory.cxx b/svl/source/filepicker/pickerhistory.cxx index 4c372c48163d..27a217f1688c 100644 --- a/svl/source/filepicker/pickerhistory.cxx +++ b/svl/source/filepicker/pickerhistory.cxx @@ -27,8 +27,8 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_svl.hxx" -#include "pickerhistory.hxx" -#include "pickerhistoryaccess.hxx" +#include <svl/pickerhistory.hxx> +#include <svl/pickerhistoryaccess.hxx> #include <cppuhelper/weakref.hxx> #include <vector> diff --git a/svl/source/filerec/makefile.mk b/svl/source/filerec/makefile.mk deleted file mode 100644 index ea2b88d8d493..000000000000 --- a/svl/source/filerec/makefile.mk +++ /dev/null @@ -1,46 +0,0 @@ -#************************************************************************* -# -# 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. -# -#************************************************************************* - -PRJ=..$/.. - -PRJNAME=svl -TARGET=filerec - -# --- Settings ----------------------------------------------------- - -.INCLUDE : settings.mk -.INCLUDE : $(PRJ)$/util$/svl.pmk - -# --- Files -------------------------------------------------------- - -SLOFILES = \ - $(SLO)$/filerec.obj - -# --- Tagets ------------------------------------------------------- - -.INCLUDE : target.mk - diff --git a/svl/source/fsstor/makefile.mk b/svl/source/fsstor/makefile.mk deleted file mode 100644 index 1dd5d2307037..000000000000 --- a/svl/source/fsstor/makefile.mk +++ /dev/null @@ -1,74 +0,0 @@ -#************************************************************************* -# -# 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. -# -#************************************************************************* - -PRJ=..$/.. -PRJNAME=svl -TARGET=fsstorage.uno -LIBTARGET=NO -ENABLE_EXCEPTIONS=TRUE - -# --- Settings ---------------------------------- - -.INCLUDE : settings.mk -DLLPRE= - -# --- Files ------------------------------------- - -SLOFILES=\ - $(SLO)$/fsfactory.obj \ - $(SLO)$/fsstorage.obj \ - $(SLO)$/oinputstreamcontainer.obj \ - $(SLO)$/ostreamcontainer.obj - -SHL1TARGET= $(TARGET) -SHL1IMPLIB= i$(TARGET) -SHL1OBJS= $(SLOFILES) -SHL1STDLIBS=\ - $(UNOTOOLSLIB) \ - $(TOOLSLIB) \ - $(COMPHELPERLIB) \ - $(UCBHELPERLIB) \ - $(CPPUHELPERLIB) \ - $(CPPULIB) \ - $(SALLIB) - -SHL1VERSIONMAP=$(SOLARENV)/src/component.map -SHL1DEF= $(MISC)$/$(SHL1TARGET).def -DEF1NAME= $(SHL1TARGET) - -# --- Targets ---------------------------------- - -.INCLUDE : target.mk - - -ALLTAR : $(MISC)/fsstorage.component - -$(MISC)/fsstorage.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \ - fsstorage.component - $(XSLTPROC) --nonet --stringparam uri \ - '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \ - $(SOLARENV)/bin/createcomponent.xslt fsstorage.component diff --git a/svl/source/items/itemset.cxx b/svl/source/items/itemset.cxx index ce50cbbe84a3..69efd2e7aa2c 100644 --- a/svl/source/items/itemset.cxx +++ b/svl/source/items/itemset.cxx @@ -34,9 +34,6 @@ #include <cstdarg> #endif -#ifndef GCC -#endif - #define _SVSTDARR_USHORTS #define _SVSTDARR_ULONGS @@ -44,7 +41,7 @@ #include <svl/itemset.hxx> #include <svl/itempool.hxx> #include <svl/itemiter.hxx> -#include "whiter.hxx" +#include <svl/whiter.hxx> #include <svl/nranges.hxx> #include "whassert.hxx" diff --git a/svl/source/items/makefile.mk b/svl/source/items/makefile.mk deleted file mode 100644 index da602391239a..000000000000 --- a/svl/source/items/makefile.mk +++ /dev/null @@ -1,84 +0,0 @@ -#************************************************************************* -# -# 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. -# -#************************************************************************* - -PRJ=..$/.. -PRJNAME=svl -TARGET=items -ENABLE_EXCEPTIONS=TRUE - -# --- Settings ----------------------------------------------------- - -.INCLUDE : settings.mk -.INCLUDE : $(PRJ)$/util$/svl.pmk - -# --- Files -------------------------------------------------------- - -SLOFILES=\ - $(SLO)$/aeitem.obj \ - $(SLO)$/cenumitm.obj \ - $(SLO)$/cintitem.obj \ - $(SLO)$/cntwall.obj \ - $(SLO)$/ctypeitm.obj \ - $(SLO)$/custritm.obj \ - $(SLO)$/dateitem.obj \ - $(SLO)$/eitem.obj \ - $(SLO)$/flagitem.obj \ - $(SLO)$/globalnameitem.obj \ - $(SLO)$/ilstitem.obj \ - $(SLO)$/imageitm.obj \ - $(SLO)$/intitem.obj \ - $(SLO)$/itemiter.obj \ - $(SLO)$/itempool.obj \ - $(SLO)$/itemprop.obj \ - $(SLO)$/itemset.obj \ - $(SLO)$/lckbitem.obj \ - $(SLO)$/macitem.obj \ - $(SLO)$/poolcach.obj \ - $(SLO)$/poolio.obj \ - $(SLO)$/poolitem.obj \ - $(SLO)$/ptitem.obj \ - $(SLO)$/rectitem.obj \ - $(SLO)$/rngitem.obj \ - $(SLO)$/sfontitm.obj \ - $(SLO)$/sitem.obj \ - $(SLO)$/slstitm.obj \ - $(SLO)$/srchitem.obj \ - $(SLO)$/stritem.obj \ - $(SLO)$/style.obj \ - $(SLO)$/stylepool.obj \ - $(SLO)$/szitem.obj \ - $(SLO)$/visitem.obj \ - $(SLO)$/whiter.obj - -SRS1NAME=$(TARGET) -SRC1FILES=\ - cstitem.src - -# --- Targets ------------------------------------------------------- - -.INCLUDE : target.mk - diff --git a/svl/source/items/poolcach.cxx b/svl/source/items/poolcach.cxx index f07c19788764..6e13a3b77485 100644 --- a/svl/source/items/poolcach.cxx +++ b/svl/source/items/poolcach.cxx @@ -35,7 +35,7 @@ #include <svl/itempool.hxx> #include <svl/itemset.hxx> -#include "poolcach.hxx" +#include <svl/poolcach.hxx> // STATIC DATA ----------------------------------------------------------- diff --git a/svl/source/items/poolio.cxx b/svl/source/items/poolio.cxx index 054eb984d2fd..6982764af432 100644 --- a/svl/source/items/poolio.cxx +++ b/svl/source/items/poolio.cxx @@ -241,7 +241,7 @@ SvStream &SfxItemPool::Store(SvStream &rStream) const const SfxPoolItem *pItem = (*pArr)->operator[](j); if ( pItem && pItem->GetRefCount() ) //! siehe anderes MI-REF { - aItemsRec.NewContent(j, 'X' ); + aItemsRec.NewContent((USHORT)j, 'X' ); if ( pItem->GetRefCount() == SFX_ITEMS_SPECIAL ) rStream << (sal_uInt16) pItem->GetKind(); diff --git a/svl/source/items/stylepool.cxx b/svl/source/items/stylepool.cxx index c61faa93bd34..8ad8346af075 100644 --- a/svl/source/items/stylepool.cxx +++ b/svl/source/items/stylepool.cxx @@ -34,7 +34,7 @@ #include <vector> #include <map> -#include "stylepool.hxx" +#include <svl/stylepool.hxx> #include <svl/itemiter.hxx> #include <svl/itempool.hxx> diff --git a/svl/source/items/whiter.cxx b/svl/source/items/whiter.cxx index fe4a47b1dbaf..17e0e18115bb 100644 --- a/svl/source/items/whiter.cxx +++ b/svl/source/items/whiter.cxx @@ -28,10 +28,8 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_svl.hxx" // INCLUDE --------------------------------------------------------------- -#ifndef GCC -#endif -#include "whiter.hxx" +#include <svl/whiter.hxx> #include <svl/itemset.hxx> DBG_NAME(SfxWhichIter) diff --git a/svl/source/memtools/makefile.mk b/svl/source/memtools/makefile.mk deleted file mode 100644 index e19667214d13..000000000000 --- a/svl/source/memtools/makefile.mk +++ /dev/null @@ -1,46 +0,0 @@ -#************************************************************************* -# -# 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. -# -#************************************************************************* - -PRJ=..$/.. - -PRJNAME=svl -TARGET=svarray - -# --- Settings ----------------------------------------------------- - -.INCLUDE : settings.mk -.INCLUDE : $(PRJ)$/util$/svl.pmk - -# --- Files -------------------------------------------------------- - -SLOFILES=\ - $(SLO)$/svarray.obj - -# --- Targets ------------------------------------------------------- - -.INCLUDE : target.mk - diff --git a/svl/source/misc/PasswordHelper.cxx b/svl/source/misc/PasswordHelper.cxx index 05e9e8a65897..73e1c6c050a0 100644 --- a/svl/source/misc/PasswordHelper.cxx +++ b/svl/source/misc/PasswordHelper.cxx @@ -28,10 +28,7 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_svl.hxx" - -#ifndef GCC -#endif -#include "PasswordHelper.hxx" +#include <svl/PasswordHelper.hxx> #include <rtl/digest.h> #include <tools/string.hxx> diff --git a/svl/source/misc/adrparse.cxx b/svl/source/misc/adrparse.cxx index b6dfec5cbb63..f0faa8ca0504 100644 --- a/svl/source/misc/adrparse.cxx +++ b/svl/source/misc/adrparse.cxx @@ -28,7 +28,7 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_svl.hxx" #include <tools/inetmime.hxx> -#include <adrparse.hxx> +#include <svl/adrparse.hxx> namespace unnamed_svl_adrparse {} using namespace unnamed_svl_adrparse; diff --git a/svl/source/misc/filenotation.cxx b/svl/source/misc/filenotation.cxx index abec6bb310fc..61c98bf5a851 100644 --- a/svl/source/misc/filenotation.cxx +++ b/svl/source/misc/filenotation.cxx @@ -27,7 +27,7 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_svl.hxx" -#include "filenotation.hxx" +#include <svl/filenotation.hxx> #include <osl/file.h> #include <osl/diagnose.h> #include <tools/urlobj.hxx> diff --git a/svl/source/misc/folderrestriction.cxx b/svl/source/misc/folderrestriction.cxx index f7eef328de7d..412ef60e5627 100644 --- a/svl/source/misc/folderrestriction.cxx +++ b/svl/source/misc/folderrestriction.cxx @@ -28,7 +28,7 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_svl.hxx" -#include "folderrestriction.hxx" +#include <svl/folderrestriction.hxx> #include "osl/process.h" #include "tools/urlobj.hxx" #include "unotools/localfilehelper.hxx" diff --git a/svl/source/misc/fstathelper.cxx b/svl/source/misc/fstathelper.cxx index c373e035fe05..b90df8fb6f7e 100644 --- a/svl/source/misc/fstathelper.cxx +++ b/svl/source/misc/fstathelper.cxx @@ -32,8 +32,7 @@ #include <tools/string.hxx> #include <ucbhelper/content.hxx> #include <com/sun/star/util/DateTime.hpp> - -#include <fstathelper.hxx> +#include <svl/fstathelper.hxx> using namespace ::com::sun::star; using namespace ::com::sun::star::uno; diff --git a/svl/source/misc/lngmisc.cxx b/svl/source/misc/lngmisc.cxx index de53c0d2f63f..aba411079074 100644 --- a/svl/source/misc/lngmisc.cxx +++ b/svl/source/misc/lngmisc.cxx @@ -27,15 +27,13 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_svl.hxx" - -#include <lngmisc.hxx> +#include <svl/lngmisc.hxx> #include <tools/solar.h> #include <tools/string.hxx> #include <tools/debug.hxx> #include <rtl/ustrbuf.hxx> #include <rtl/ustring.hxx> - using namespace rtl; namespace linguistic diff --git a/svl/source/misc/makefile.mk b/svl/source/misc/makefile.mk deleted file mode 100644 index a68cb396f22c..000000000000 --- a/svl/source/misc/makefile.mk +++ /dev/null @@ -1,70 +0,0 @@ -#************************************************************************* -# -# 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. -# -#************************************************************************* - -PRJ=..$/.. -PRJNAME=svl -TARGET=misc - -# --- Settings ----------------------------------------------------- - -.INCLUDE : settings.mk -.INCLUDE : $(PRJ)$/util$/svl.pmk - -# --- Files -------------------------------------------------------- - -EXCEPTIONSFILES=\ - $(SLO)$/documentlockfile.obj \ - $(SLO)$/folderrestriction.obj \ - $(SLO)$/fstathelper.obj \ - $(SLO)$/lockfilecommon.obj \ - $(SLO)$/ownlist.obj \ - $(SLO)$/restrictedpaths.obj \ - $(SLO)$/sharecontrolfile.obj \ - $(SLO)$/strmadpt.obj \ - $(SLO)$/svldata.obj \ - $(SLO)$/urihelper.obj - -SLOFILES=\ - $(EXCEPTIONSFILES) \ - $(SLO)$/adrparse.obj \ - $(SLO)$/filenotation.obj \ - $(SLO)$/inethist.obj \ - $(SLO)$/inettype.obj \ - $(SLO)$/lngmisc.obj \ - $(SLO)$/PasswordHelper.obj - -SRS1NAME=$(TARGET) -SRC1FILES=\ - mediatyp.src - -# --- Targets ------------------------------------------------------- - -.INCLUDE : target.mk - - - - diff --git a/svl/source/misc/strmadpt.cxx b/svl/source/misc/strmadpt.cxx index 24ed126cde25..e726601f837d 100644 --- a/svl/source/misc/strmadpt.cxx +++ b/svl/source/misc/strmadpt.cxx @@ -35,9 +35,9 @@ #include <set> #include <rtl/alloc.h> #include <rtl/memory.h> -#include <instrm.hxx> -#include <outstrm.hxx> -#include <strmadpt.hxx> +#include <svl/instrm.hxx> +#include <svl/outstrm.hxx> +#include <svl/strmadpt.hxx> using namespace com::sun::star; diff --git a/svl/source/misc/svldata.cxx b/svl/source/misc/svldata.cxx index 35c9fca3aef2..f4eae26d2276 100644 --- a/svl/source/misc/svldata.cxx +++ b/svl/source/misc/svldata.cxx @@ -75,7 +75,7 @@ SimpleResMgr* ImpSvlData::GetSimpleRM(const ::com::sun::star::lang::Locale& rLoc = (*static_cast< SimpleResMgrMap * >(m_pThreadsafeRMs))[aISOcode]; if (!rResMgr) { - rResMgr = new SimpleResMgr(CREATEVERSIONRESMGR_NAME(svs), rLocale ); + rResMgr = new SimpleResMgr(CREATEVERSIONRESMGR_NAME(svl), rLocale ); } return rResMgr; } diff --git a/svl/source/misc/urihelper.cxx b/svl/source/misc/urihelper.cxx index 46063564193d..656000fceae3 100644 --- a/svl/source/misc/urihelper.cxx +++ b/svl/source/misc/urihelper.cxx @@ -27,7 +27,7 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_svl.hxx" -#include <urihelper.hxx> +#include <svl/urihelper.hxx> #include <com/sun/star/beans/XPropertySet.hpp> #include "com/sun/star/lang/WrappedTargetRuntimeException.hpp" #include "com/sun/star/lang/XMultiComponentFactory.hpp" diff --git a/svl/source/notify/broadcast.cxx b/svl/source/notify/broadcast.cxx index b09288cc83e4..046b584e4385 100644 --- a/svl/source/notify/broadcast.cxx +++ b/svl/source/notify/broadcast.cxx @@ -32,9 +32,9 @@ #endif #include <tools/debug.hxx> -#include "listener.hxx" -#include "listeneriter.hxx" -#include "broadcast.hxx" +#include <svl/listener.hxx> +#include <svl/listeneriter.hxx> +#include <svl/broadcast.hxx> #include <svl/smplhint.hxx> diff --git a/svl/source/notify/cancel.cxx b/svl/source/notify/cancel.cxx deleted file mode 100644 index 2ae43bfaf1ae..000000000000 --- a/svl/source/notify/cancel.cxx +++ /dev/null @@ -1,201 +0,0 @@ -/************************************************************************* - * - * 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" -#define _SFX_CANCEL_CXX -#include <svl/cancel.hxx> - -#include <vos/mutex.hxx> -#include <tools/debug.hxx> - -#include <svl/smplhint.hxx> -#include <svl/cnclhint.hxx> -#include <rtl/instance.hxx> - -namespace { struct lclMutex : public rtl::Static< ::vos::OMutex, lclMutex >{}; } - -//========================================================================= - -SfxCancelManager::SfxCancelManager( SfxCancelManager *pParent ) -: _pParent( pParent ) -{ -} - -//------------------------------------------------------------------------- - -SfxCancelManager::~SfxCancelManager() -{ - DBG_ASSERT( _pParent || !_aJobs.Count(), "deleting SfxCancelManager in use" ); - for ( sal_uInt16 n = _aJobs.Count(); n--; ) - _aJobs.GetObject(n)->SetManager( _pParent ); -} - -//------------------------------------------------------------------------- - -sal_Bool SfxCancelManager::CanCancel() const - -/* [Beschreibung] - - Liefert sal_True wenn an diesem CancelManager oder an einem Parent - ein Job l"auft. -*/ - -{ - ::vos::OGuard aGuard( lclMutex::get() ); - return _aJobs.Count() > 0 || ( _pParent && _pParent->CanCancel() ); -} - -//------------------------------------------------------------------------- - -void SfxCancelManager::Cancel( sal_Bool bDeep ) - -/* [Beschreibung] - - Diese Methode markiert alle angemeldeten <SfxCancellable>-Instanzen - als suspendiert. -*/ - -{ - ::vos::OGuard aGuard( lclMutex::get() ); - SfxCancelManagerWeak xWeak( this ); - for ( sal_uInt16 n = _aJobs.Count(); n-- && xWeak.Is(); ) - if ( n < _aJobs.Count() ) - _aJobs.GetObject(n)->Cancel(); - if ( xWeak.Is() && _pParent ) - _pParent->Cancel( bDeep ); -} - -//------------------------------------------------------------------------- - -void SfxCancelManager::InsertCancellable( SfxCancellable *pJob ) - -/* [Beschreibung] - - Diese interne Methode tr"agt 'pJob' in die Liste der unterbrechbaren - Jobs ein und Broadcastet dies. Jeder <SfxCancellable> darf nur - maximal einmal angemeldet sein, dies geschiet in seinem Ctor. -*/ - -{ -#ifdef GPF_ON_EMPTY_TITLE - if ( !pJob->GetTitle() ) - { - DBG_ERROR( "SfxCancellable: empty titles not allowed (Vermummungsverbot)" ) - *(int*)0 = 0; - } -#endif - - ::vos::OClearableGuard aGuard( lclMutex::get() ); - _aJobs.C40_INSERT( SfxCancellable, pJob, _aJobs.Count() ); - - aGuard.clear(); - Broadcast( SfxSimpleHint( SFX_HINT_CANCELLABLE ) ); -} - -//------------------------------------------------------------------------- - - -void SfxCancelManager::RemoveCancellable( SfxCancellable *pJob ) - -/* [Beschreibung] - - Diese interne Methode tr"agt 'pJob' aus die Liste der unterbrechbaren - Jobs aus und Broadcastet dies. Dieser Aufruf mu\s paarig nach einem - <InsertCancellable> erfolgen und wird im Dtor des <SfxCancellable> - ausgel"ost. -*/ - -{ - ::vos::OClearableGuard aGuard( lclMutex::get() ); - const SfxCancellable *pTmp = pJob; - sal_uInt16 nPos = _aJobs.GetPos( pTmp ); - if ( nPos != 0xFFFF ) - { - _aJobs.Remove( nPos , 1 ); - aGuard.clear(); - Broadcast( SfxSimpleHint( SFX_HINT_CANCELLABLE ) ); - Broadcast( SfxCancelHint( pJob, SFXCANCELHINT_REMOVED ) ); - } -} - -//------------------------------------------------------------------------- - -SfxCancellable::~SfxCancellable() -{ - SfxCancelManager* pMgr = _pMgr; - if ( pMgr ) - pMgr->RemoveCancellable( this ); -} - -//------------------------------------------------------------------------- - -void SfxCancellable::Cancel() - -/* [Description] - - This virtual function is called when the user hits the cancel-button. - If you overload it, you can stop your activities. Please always call - 'SfxCancellable::Cancel()'. -*/ - -{ -#ifdef GFP_ON_NO_CANCEL - if ( _bCancelled < 5 ) - ++_bCancelled; - else - { - delete this; - } -#else - _bCancelled = sal_True; -#endif -} - -//------------------------------------------------------------------------- - -void SfxCancellable::SetManager( SfxCancelManager *pMgr ) -{ - SfxCancelManager* pTmp = _pMgr; - if ( pTmp ) - pTmp->RemoveCancellable( this ); - _pMgr = pMgr; - if ( pMgr ) - pMgr->InsertCancellable( this ); -} - -//------------------------------------------------------------------------- - -TYPEINIT1(SfxCancelHint, SfxHint); - -SfxCancelHint::SfxCancelHint( SfxCancellable* pJob, sal_uInt16 _nAction ) -{ - pCancellable = pJob; - nAction = _nAction; -} - - diff --git a/svl/source/notify/listener.cxx b/svl/source/notify/listener.cxx index 7ee0f290ff31..8a90a0ddfd3c 100644 --- a/svl/source/notify/listener.cxx +++ b/svl/source/notify/listener.cxx @@ -27,17 +27,12 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_svl.hxx" -#ifndef GCC -#endif -#ifndef DEBUG_HXX #include <tools/debug.hxx> -#endif - -#include "broadcast.hxx" -#include "listener.hxx" +#include <svl/broadcast.hxx> +#include <svl/listener.hxx> #include "listenerbase.hxx" -#include "listeneriter.hxx" +#include <svl/listeneriter.hxx> //==================================================================== diff --git a/svl/source/notify/listenerbase.cxx b/svl/source/notify/listenerbase.cxx index ec899ee9d70b..4dedd24cbe0e 100644 --- a/svl/source/notify/listenerbase.cxx +++ b/svl/source/notify/listenerbase.cxx @@ -27,17 +27,12 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_svl.hxx" -#ifndef GCC -#endif -#ifndef DEBUG_HXX #include <tools/debug.hxx> -#endif - #include "listenerbase.hxx" -#include "listeneriter.hxx" -#include "listener.hxx" -#include "broadcast.hxx" +#include <svl/listeneriter.hxx> +#include <svl/listener.hxx> +#include <svl/broadcast.hxx> SvtListenerBase::SvtListenerBase( SvtListener& rLst, diff --git a/svl/source/notify/listeneriter.cxx b/svl/source/notify/listeneriter.cxx index 5dda8d0433b4..2078393822cb 100644 --- a/svl/source/notify/listeneriter.cxx +++ b/svl/source/notify/listeneriter.cxx @@ -27,14 +27,12 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_svl.hxx" -#ifndef GCC -#endif #include <tools/debug.hxx> #include "listenerbase.hxx" -#include "listeneriter.hxx" -#include "broadcast.hxx" -#include "listener.hxx" +#include <svl/listeneriter.hxx> +#include <svl/broadcast.hxx> +#include <svl/listener.hxx> SvtListenerIter* SvtListenerIter::pListenerIters = 0; diff --git a/svl/source/notify/makefile.mk b/svl/source/notify/makefile.mk deleted file mode 100644 index c2e6648907e5..000000000000 --- a/svl/source/notify/makefile.mk +++ /dev/null @@ -1,62 +0,0 @@ -#************************************************************************* -# -# 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. -# -#************************************************************************* - -PRJ=..$/.. - -PRJNAME=svl -TARGET=notify - -# --- Settings ----------------------------------------------------- - -.INCLUDE : settings.mk -.INCLUDE : $(PRJ)$/util$/svl.pmk - -# --- Files -------------------------------------------------------- - -SLOFILES = \ - $(SLO)$/smplhint.obj \ - $(SLO)$/hint.obj \ - $(SLO)$/lstner.obj \ - $(SLO)$/isethint.obj \ - $(SLO)$/brdcst.obj \ - $(SLO)$/listener.obj \ - $(SLO)$/listenerbase.obj \ - $(SLO)$/listeneriter.obj \ - $(SLO)$/broadcast.obj - -HXX1TARGET= notify -HXX1EXT= hxx -HXX1FILES= $(INC)$/hint.hxx \ - $(INC)$/smplhint.hxx \ - $(INC)$/lstner.hxx \ - $(INC)$/brdcst.hxx -HXX1EXCL= -E:*include* - -# --- Targets ------------------------------------------------------- - -.INCLUDE : target.mk - diff --git a/svl/source/numbers/makefile.mk b/svl/source/numbers/makefile.mk deleted file mode 100644 index 87a367566a8b..000000000000 --- a/svl/source/numbers/makefile.mk +++ /dev/null @@ -1,74 +0,0 @@ -#************************************************************************* -# -# 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. -# -#************************************************************************* - -PRJ=..$/.. - -PRJNAME=svl -TARGET=numbers -LIBTARGET=NO - -PROJECTPCH= -PROJECTPCHSOURCE= - -# --- Settings ----------------------------------------------------- - -.INCLUDE : settings.mk -.INCLUDE : $(PRJ)$/util$/svl.pmk - -# --- Files -------------------------------------------------------- - -EXCEPTIONSFILES= \ - $(SLO)$/numuno.obj \ - $(SLO)$/numfmuno.obj \ - $(SLO)$/supservs.obj \ - $(SLO)$/zforlist.obj - -SLOFILES = \ - $(EXCEPTIONSFILES) \ - $(SLO)$/zforfind.obj \ - $(SLO)$/zformat.obj \ - $(SLO)$/zforscan.obj \ - $(SLO)$/numhead.obj - -LIB1TARGET= $(SLB)$/$(TARGET).uno.lib -LIB1OBJFILES= \ - $(SLO)$/numfmuno.obj \ - $(SLO)$/supservs.obj - -LIB2TARGET= $(SLB)$/$(TARGET).lib -LIB2OBJFILES= \ - $(SLO)$/zforfind.obj \ - $(SLO)$/zforlist.obj \ - $(SLO)$/zformat.obj \ - $(SLO)$/zforscan.obj \ - $(SLO)$/numuno.obj \ - $(SLO)$/numhead.obj - -# --- Targets ------------------------------------------------------- - -.INCLUDE : target.mk - diff --git a/svl/source/numbers/numfmuno.cxx b/svl/source/numbers/numfmuno.cxx index be5622fdf225..a0af8caef8ae 100644 --- a/svl/source/numbers/numfmuno.cxx +++ b/svl/source/numbers/numfmuno.cxx @@ -40,7 +40,7 @@ #include <com/sun/star/beans/PropertyAttribute.hpp> #include "numfmuno.hxx" -#include "numuno.hxx" +#include <svl/numuno.hxx> #include <svl/zforlist.hxx> #include <svl/zformat.hxx> #include <svl/itemprop.hxx> diff --git a/svl/source/numbers/numuno.cxx b/svl/source/numbers/numuno.cxx index a6208657406e..94f535c48b02 100644 --- a/svl/source/numbers/numuno.cxx +++ b/svl/source/numbers/numuno.cxx @@ -38,7 +38,7 @@ #include <osl/mutex.hxx> #include <rtl/uuid.h> -#include "numuno.hxx" +#include <svl/numuno.hxx> #include "numfmuno.hxx" #include <svl/zforlist.hxx> diff --git a/svl/source/numbers/supservs.cxx b/svl/source/numbers/supservs.cxx index 90d41977e974..93e6051a21ce 100644 --- a/svl/source/numbers/supservs.cxx +++ b/svl/source/numbers/supservs.cxx @@ -34,8 +34,8 @@ #include <tools/debug.hxx> #include <vos/mutex.hxx> #include <tools/stream.hxx> -#include <strmadpt.hxx> -#include "instrm.hxx" +#include <svl/strmadpt.hxx> +#include <svl/instrm.hxx> using namespace ::com::sun::star::uno; using namespace ::com::sun::star::lang; diff --git a/svl/source/numbers/supservs.hxx b/svl/source/numbers/supservs.hxx index 45f6b3a8e285..85c5456beb01 100644 --- a/svl/source/numbers/supservs.hxx +++ b/svl/source/numbers/supservs.hxx @@ -28,7 +28,7 @@ #ifndef _SVTOOLS_NUMBERS_SUPPLIERSERVICE_HXX_ #define _SVTOOLS_NUMBERS_SUPPLIERSERVICE_HXX_ -#include "numuno.hxx" +#include <svl/numuno.hxx> #include <svl/zforlist.hxx> #include <com/sun/star/lang/XInitialization.hpp> #include <com/sun/star/lang/XServiceInfo.hpp> diff --git a/svl/source/numbers/zformat.cxx b/svl/source/numbers/zformat.cxx index b601bcd89f2a..3345a19513bd 100644 --- a/svl/source/numbers/zformat.cxx +++ b/svl/source/numbers/zformat.cxx @@ -47,13 +47,13 @@ #define _ZFORMAT_CXX #include <svl/zformat.hxx> -#include "zforscan.hxx" +#include <zforscan.hxx> #include "zforfind.hxx" #include <svl/zforlist.hxx> #include "numhead.hxx" #include <unotools/digitgroupingiterator.hxx> -#include "nfsymbol.hxx" +#include <svl/nfsymbol.hxx> #include <cmath> diff --git a/svl/source/numbers/zforscan.cxx b/svl/source/numbers/zforscan.cxx index ece26cff43b1..000649a6de80 100644 --- a/svl/source/numbers/zforscan.cxx +++ b/svl/source/numbers/zforscan.cxx @@ -45,7 +45,7 @@ #define _ZFORSCAN_CXX #include "zforscan.hxx" #undef _ZFORSCAN_CXX -#include "nfsymbol.hxx" +#include <svl/nfsymbol.hxx> using namespace svt; const sal_Unicode cNonBreakingSpace = 0xA0; diff --git a/svl/source/numbers/zforscan.hxx b/svl/source/numbers/zforscan.hxx index 0e82021acb3c..9b04921cb7f4 100644 --- a/svl/source/numbers/zforscan.hxx +++ b/svl/source/numbers/zforscan.hxx @@ -32,7 +32,7 @@ #include <i18npool/lang.h> #include <tools/color.hxx> #include <svl/nfkeytab.hxx> -#include "nfsymbol.hxx" +#include <svl/nfsymbol.hxx> class SvNumberFormatter; struct ImpSvNumberformatInfo; diff --git a/svl/source/passwordcontainer/makefile.mk b/svl/source/passwordcontainer/makefile.mk deleted file mode 100644 index 626a6ffc5830..000000000000 --- a/svl/source/passwordcontainer/makefile.mk +++ /dev/null @@ -1,70 +0,0 @@ -#************************************************************************* -# -# 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. -# -#************************************************************************* - -PRJ=..$/.. -PRJNAME=svl -TARGET=passwordcontainer.uno -LIBTARGET=NO -ENABLE_EXCEPTIONS=TRUE - -# --- Settings ---------------------------------- - -.INCLUDE : settings.mk -DLLPRE= - -# --- Files ------------------------------------- - -SLOFILES= \ - $(SLO)$/passwordcontainer.obj\ - $(SLO)$/syscreds.obj - -SHL1TARGET= $(TARGET) -SHL1IMPLIB= i$(TARGET) -SHL1OBJS= $(SLOFILES) -SHL1STDLIBS=\ - $(UNOTOOLSLIB) \ - $(UCBHELPERLIB) \ - $(CPPUHELPERLIB) \ - $(CPPULIB) \ - $(SALLIB) - -SHL1VERSIONMAP=$(SOLARENV)/src/component.map -SHL1DEF= $(MISC)$/$(SHL1TARGET).def -DEF1NAME= $(SHL1TARGET) - -# --- Targets ---------------------------------- - -.INCLUDE : target.mk - - -ALLTAR : $(MISC)/passwordcontainer.component - -$(MISC)/passwordcontainer.component .ERRREMOVE : \ - $(SOLARENV)/bin/createcomponent.xslt passwordcontainer.component - $(XSLTPROC) --nonet --stringparam uri \ - '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \ - $(SOLARENV)/bin/createcomponent.xslt passwordcontainer.component diff --git a/svl/source/svdde/ddeml1.cxx b/svl/source/svdde/ddeml1.cxx deleted file mode 100644 index 421fe6fd214d..000000000000 --- a/svl/source/svdde/ddeml1.cxx +++ /dev/null @@ -1,2658 +0,0 @@ -/************************************************************************* - * - * 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 sal_Bool ImpDdeMgr::MyWinDdePostMsg( HWND hWndTo, HWND hWndFrom, - sal_uInt16 nMsg, PDDESTRUCT pData, sal_uIntPtr nFlags ) -{ - sal_Bool bSuccess = WinDdePostMsg( hWndTo,hWndFrom,nMsg,pData,nFlags); - if( !bSuccess ) - { - WRITELOG("WinDdePostMsg:Failed!") - if ( !(nFlags & DDEPM_NOFREE) ) - { - MyDosFreeMem( pData,"MyWinDdePostMsg" ); - } - } - return bSuccess; -} - - -// ********************************************************************* -// ImpDdeMgr -// ********************************************************************* - -sal_uInt16 ImpDdeMgr::nLastErrInstance = 0; - -// -// Conversation-WndProc -// Steuert Transaktionen eines Conversationhandles -// -MRESULT EXPENTRY ConvWndProc(HWND hWnd,sal_uIntPtr 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,sal_uIntPtr 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( sal_uInt16 nTransactionType, - sal_uInt16 nClipboardFormat, HCONV hConversationHandle, HSZ hsz1, - HSZ hsz2, HDDEDATA hData, sal_uIntPtr nData1, sal_uIntPtr 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 = sal_True; - bInSyncTrans = sal_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 ); -} - - -sal_Bool ImpDdeMgr::IsSameInstance( HWND hWnd ) -{ - TID tid; PID pid; - WinQueryWindowProcess( hWnd, &pid, &tid ); - return (sal_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 ); - sal_uInt16 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( sal_uInt16 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 = sal_True; // default setting DDEML - UnregisterDDEMLApp(); -} - -void ImpDdeMgr::RegisterDDEMLApp() -{ - HWND* pPtr = pAppTable; - HWND hCur; - sal_uInt16 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; - sal_uInt16 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; -} - -sal_uInt16 ImpDdeMgr::DdeGetLastError() -{ - sal_uInt16 nErr; - if ( !pData ) - nErr = DMLERR_DLL_NOT_INITIALIZED; - else if ( nLastErrInstance ) - nErr = nLastErrInstance; - else - nErr = pData->nLastErr; - - nLastErrInstance = 0; - pData->nLastErr = 0; - return nErr; -} - - - -sal_uInt16 ImpDdeMgr::DdeInitialize( PFNCALLBACK pCallbackProc, sal_uIntPtr 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; - - sal_uIntPtr 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 = sal_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 += (sal_uInt16)hConvList; - if( (sal_uInt16)hConvList >= pData->nMaxConvCount ||pConv->hWndThis==0 ) - { - nLastErrInstance = DMLERR_INVALIDPARAMETER; - return 0; - } - GetLastServer(pData, hConvList, hLastConvInList); - nPrevConv = (sal_uInt16)hLastConvInList; - } - else - hCurListId = (HCONVLIST)WinCreateWindow( HWND_OBJECT, WC_FRAME, - CONVLISTNAME, 0,0,0,0,0, HWND_DESKTOP, HWND_BOTTOM, 0,0,0); - - bListConnect = sal_True; - DdeConnectImp( hszService, hszTopic, pCC ); -#if 0 && defined(OV_DEBUG) - WRITELOG("DdeConnectList:ConnectionList:") - HCONV hDebug = 0; - do - { - hDebug = DdeQueryNextServer( hCurListId, hDebug); - String aStr( (sal_uIntPtr)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 ) -{ - sal_uIntPtr nLen1 = 0, nLen2 = 0; - HATOMTBL hAtomTable = WinQuerySystemAtomTable(); - - if( hszService ) - nLen1 = WinQueryAtomLength( hAtomTable, hszService ); - if( hszTopic ) - nLen2 = WinQueryAtomLength( hAtomTable, hszTopic ); - nLen1++; nLen2++; - - DDEINIT* pBuf = 0; - - sal_uIntPtr 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 += (sal_uInt16)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 -sal_Bool ImpDdeMgr::CheckConvListId( HCONVLIST hConvListId ) -{ - HAB hAB = WinQueryAnchorBlock( (HWND)hConvListId ); - if( hAB ) - return WinIsWindow( hAB, (HWND)hConvListId ); - return sal_False; - /* - HAB hAB = WinQueryAnchorBlock( (HWND)hConvListId ); - if( hAB ) - { - char aBuf[ 16 ]; - WinQueryWindowText( (HWND)hConvListId, sizeof(aBuf), aBuf ); - if( strcmp(aBuf, CONVLISTNAME ) == 0 ) - return sal_True; - } - return sal_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 -sal_Bool ImpDdeMgr::DdeDisconnect( HCONV hConv ) -{ - WRITELOG("DdeDisconnect:Start") - ////WRITESTATUS("DdeDisconnect:Start") - - ImpDdeMgrData* pData = ImpDdeMgr::AccessMgrData(); - if ( !pData ) - { - ImpDdeMgr::nLastErrInstance = DMLERR_DLL_NOT_INITIALIZED; - return sal_False; - } - ImpHCONV* pConv = GetConvTable(pData) + (sal_uInt16)hConv; - - if( (sal_uInt16)hConv >= pData->nMaxConvCount || pConv->hWndThis==0 ) - { - nLastErrInstance = DMLERR_NO_CONV_ESTABLISHED; - return sal_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 sal_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, sal_False ); // alle Formate & NICHT loeschen - pThis->SendUnadvises( hConvPartner, 0, sal_False ); // alle Formate & NICHT loeschen - - pConv->nStatus |= ST_TERMINATED; - - HAB hAB = WinQueryAnchorBlock( pConv->hWndThis ); - // um die MessageQueue inne Gaenge zu halten - sal_uIntPtr 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; - sal_Bool bContinue = sal_True; - while( bContinue ) - { - if( WinGetMsg( hAB, &aQueueMsg, 0, 0, 0 )) - { - WinDispatchMsg( hAB, &aQueueMsg ); - if( (!WinIsWindow( hAB, hWndPartner)) || - (pConv->nStatus & ST_TERMACKREC) ) - { - bContinue = sal_False; - if( pConv->nStatus & ST_TERMACKREC ) - { - WRITELOG("DdeDisconnect: TermAck received") - } - else - { - WRITELOG("DdeDisconnect: Partner died") - } - } - } - else - bContinue = sal_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 sal_True; -} - -// static -sal_Bool ImpDdeMgr::DdeDisconnectList( HCONVLIST hConvList ) -{ - if( !CheckConvListId( hConvList ) ) - { - ImpDdeMgr::nLastErrInstance = DMLERR_INVALIDPARAMETER; - return sal_False; - } - - ImpDdeMgrData* pData = ImpDdeMgr::AccessMgrData(); - if ( !pData ) - { - ImpDdeMgr::nLastErrInstance = DMLERR_DLL_NOT_INITIALIZED; - return sal_False; - } - HCONV hConv = 0; - GetFirstServer( pData, hConvList, hConv ); - while( hConv ) - { - DdeDisconnect( hConv ); - GetFirstServer( pData, hConvList, hConv ); - } - WinDestroyWindow( (HWND)hConvList ); - return sal_True; -} - - - -// static -HCONV ImpDdeMgr::DdeReconnect(HCONV hConv) -{ - ImpDdeMgrData* pData = ImpDdeMgr::AccessMgrData(); - if ( !pData ) - { - ImpDdeMgr::nLastErrInstance = DMLERR_DLL_NOT_INITIALIZED; - return 0; - } - return 0; -} - -// static -sal_uInt16 ImpDdeMgr::DdeQueryConvInfo(HCONV hConv, sal_uIntPtr 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 += (sal_uIntPtr)hConv; - if( hConv >= pData->nMaxConvCount || pConv->hWndThis == 0 ) - { - ImpDdeMgr::nLastErrInstance = DMLERR_NO_CONV_ESTABLISHED; - return 0; - } - - sal_uInt16 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 -sal_Bool ImpDdeMgr::DdeSetUserHandle(HCONV hConv, sal_uIntPtr nTransId, sal_uIntPtr hUser) -{ - ImpDdeMgrData* pData = ImpDdeMgr::AccessMgrData(); - if ( !pData ) - { - ImpDdeMgr::nLastErrInstance = DMLERR_DLL_NOT_INITIALIZED; - return sal_False; - } - Transaction* pTrans = GetTransTable( pData ); - pTrans += nTransId; - if( !nTransId || !hConv || nTransId >= pData->nMaxTransCount || - pTrans->hConvOwner != hConv ) - { - ImpDdeMgr::nLastErrInstance = DMLERR_INVALIDPARAMETER; - return sal_False; - } - if( !pTrans->hConvOwner) - { - ImpDdeMgr::nLastErrInstance = DMLERR_UNFOUND_QUEUE_ID; - return sal_False; - } - pTrans->nUser = hUser; - return sal_True; -} - -sal_Bool ImpDdeMgr::DdeAbandonTransaction( HCONV hConv, sal_uIntPtr nTransId ) -{ - ////WRITELOG("DdeAbandonTransaction:Start") - if( !pData ) - { - nLastErrInstance = DMLERR_DLL_NOT_INITIALIZED; - return sal_False; - } - ImpHCONV* pConv = pConvTable; - pConv += (sal_uInt16)hConv; - if( nTransId < 1 || nTransId >= pData->nMaxTransCount || - hConv < 1 || hConv >= pData->nMaxConvCount || !pConv->hWndThis) - { - nLastErrInstance = DMLERR_INVALIDPARAMETER; - return sal_False; - } - if( !hConv ) - { - DBG_ASSERT(0,"DdeAbandonTransaction:NULL-hConv not supported"); - nLastErrInstance = DMLERR_INVALIDPARAMETER; - return sal_False; - } - Transaction* pTrans = pTransTable; - pTrans += (sal_uInt16)nTransId; - if( pTrans->hConvOwner != hConv ) - { - nLastErrInstance = DMLERR_UNFOUND_QUEUE_ID; - return sal_False; - } - - if( bInSyncTrans && nTransId == nSyncTransId ) - { - bSyncAbandonTrans = sal_True; - return sal_True; - } - sal_uInt16 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 sal_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 sal_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 -sal_Bool ImpDdeMgr::DdePostAdvise( HSZ hszTopic, HSZ hszItem) -{ - ////WRITELOG("DdePostAdvise:Start") - ////WRITESTATUS("DdePostAdvise:Start") - -#if 0 && defined( OV_DEBUG ) - String aDebStr("DdePostAdvise:Item "); - aDebStr += (sal_uIntPtr)hszItem; - WRITELOG((char*)(const char*)aDebStr) -#endif - - Transaction* pTrans = pTransTable; - pTrans++; - sal_uInt16 nCurTrans = 1; - sal_uInt16 nUsedTransactions = pData->nCurTransCount; - while( nUsedTransactions && nCurTrans < pData->nMaxTransCount ) - { - HCONV hOwner = pTrans->hConvOwner; - if( hOwner ) - { - nUsedTransactions--; - sal_uInt16 nTempType = pTrans->nType; - nTempType &= (~XTYPF_MASK); - if( nTempType == (XTYP_ADVREQ & (~XTYPF_NOBLOCK) ) ) - { - ImpHCONV* pConv = pConvTable; - pConv += (sal_uInt16)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 += (sal_uInt16)hOwner; - } - HWND hWndClient = pConv->hWndPartner; - HWND hWndServer = pConv->hWndThis; -#if 0 && defined( OV_DEBUG ) - String aDebStr("DdePostAdvise: Server:"); - aDebStr += (sal_uIntPtr)hWndServer; - aDebStr += " Client:"; - aDebStr += (sal_uIntPtr)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") - sal_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 sal_True; -} - -sal_Bool ImpDdeMgr::DdeEnableCallback( HCONV hConv, sal_uInt16 wCmd) -{ - return sal_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( sal_uIntPtr 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; - sal_uInt16 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 ); - - sal_uInt16 nStrLen = (sal_uInt16)DdeQueryString( hszService, 0, 0, 0); - char* pBuf = new char[ nStrLen + 1 ]; - DdeQueryString(hszService, pBuf, nStrLen, 850 /* CodePage*/ ); - pBuf[ nStrLen ] = 0; - String aStr( (sal_uIntPtr)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, sal_Bool bRegistered ) -{ - DBG_ASSERT(pService,"DDE:No Service"); - if( !pService ) - return; - MPARAM aMp1 = (MPARAM)(pService->hBaseServName); - MPARAM aMp2 = (MPARAM)(pService->hInstServName); - sal_uIntPtr nMsg; - if( bRegistered ) - nMsg = WM_DDEML_REGISTER; - else - nMsg = WM_DDEML_UNREGISTER; - - HWND* pPtr = pAppTable; - for( sal_uInt16 nPos = 0; nPos < pData->nMaxAppCount; nPos++, pPtr++ ) - { - HWND hWndCurWin = *pPtr; - if ( hWndCurWin && hWndCurWin != hWndServer ) - WinSendMsg( hWndCurWin, nMsg, aMp1, aMp2 ); - } -} - -HDDEDATA ImpDdeMgr::DdeNameService( HSZ hszService, sal_uInt16 afCmd ) -{ - HDDEDATA hRet = (HDDEDATA)1; - - if( afCmd & DNS_FILTERON ) - bServFilterOn = sal_True; - else if( afCmd & DNS_FILTEROFF ) - bServFilterOn = sal_False; - ImpService* pService = GetService( hszService ); - sal_Bool bRegister = (sal_Bool)(afCmd & DNS_REGISTER); - if( bRegister ) - { - if( !pService ) - { - pService = PutService( hszService ); - BroadcastService( pService, sal_True ); - } - } - else - { - if( pService ) - { - BroadcastService( pService, sal_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, sal_uIntPtr cbData, - HCONV hConv, HSZ hszItem, sal_uInt16 nFormat, sal_uInt16 nType, - sal_uIntPtr nTimeout, sal_uIntPtr* 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; - } - - sal_Bool bIsDdeHandle = (sal_Bool)(pDdeData && cbData==0xffffffff); - sal_Bool bAppOwnsHandle = (sal_Bool)( bIsDdeHandle && - (((DDESTRUCT*)pDdeData)->fsStatus & IMP_HDATAAPPOWNED) ); - - sal_Bool bNoData = (sal_Bool)(nType & XTYPF_NODATA)!=0; - sal_Bool bAckReq = (sal_Bool)(nType & XTYPF_ACKREQ)!=0; - sal_uInt16 nTypeFlags = nType & XTYPF_MASK; - nType &= (~XTYPF_MASK); - - sal_Bool bSync = (sal_Bool)( nTimeout != TIMEOUT_ASYNC ) != 0; - if( nType == XTYP_ADVSTART ) - bSync = sal_True; - - // Mapping transaction -> OS/2-Message - sal_uInt16 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 || (sal_uInt16)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 += (sal_uInt16)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; - - sal_Bool bReqOnAdvLoop = sal_False; - sal_uIntPtr nTransId = GetTransaction( pData, hConv, hszItem, nFormat ); - if( nTransId ) - { - // WRITELOG("DdeClientTransaction:Transaction found") - pTrans = GetTransTable( pData ); - pTrans += (sal_uInt16)nTransId; - sal_uInt16 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)sal_True; - - case XTYP_REQUEST: - // WRITELOG("DdeClientTransaction:Using adv trans for req") - // nConvst wird unten auf XST_WAITING_REQDATA gesetzt - bReqOnAdvLoop = sal_True; - break; - - default: - WRITELOG("DdeClientTransaction:Invalid parameter") - ImpDdeMgr::nLastErrInstance = DMLERR_INVALIDPARAMETER; - if( bIsDdeHandle && !bAppOwnsHandle ) - DdeFreeDataHandle( (HDDEDATA)pDdeData ); - return (HDDEDATA)sal_False; - } - } - } - else - { - // WRITELOG("DdeClientTransaction:Creating transaction") - nTransId = CreateTransaction(pData, hConv, hszItem, nFormat, nType); - } - - pTrans = GetTransTable( pData ); - pTrans += (sal_uInt16)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 = sal_True; - pThis->nSyncTransId = nTransId; - pThis->bSyncAbandonTrans = sal_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 sal_False; - } - HAB hAB = WinQueryAnchorBlock( hWndClient ); - sal_uIntPtr nDummyTimer = WinStartTimer( hAB, 0, 0, 50 ); - sal_uIntPtr nTimeoutId = TID_USERMAX - nTransId; - WinStartTimer( hAB, hWndClient, nTimeoutId, nTimeout ); - QMSG aQueueMsg; - sal_Bool bLoop = sal_True; - while( bLoop ) - { - if( pThis->nSyncResponseMsg ) - bLoop = sal_False; - else - { - if( WinGetMsg(hAB,&aQueueMsg,0,0,0 )) - { - WinDispatchMsg( hAB, &aQueueMsg ); - } - else - bLoop = sal_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 = sal_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") - sal_Bool bPositive = (sal_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 - pTrans->nConvst = XST_WAITING_ADVDATA; - } - break; - - default: - WRITELOG("DdeClientTransaction:Unexpected msg") - MyDosFreeMem( pDDEInData,"DdeClientTransaction" ); - pDDEInData = 0; - } - pThis->bSyncAbandonTrans = sal_False; - pThis->bInSyncTrans = sal_False; - if( pThis->bSyncAbandonTrans && bReqOnAdvLoop ) - pThis->DdeAbandonTransaction( hConv, nTransId ); - } - else - { - // WRITELOG("DdeClientTransaction:Starting async. trans.") - pDDEInData = (HDDEDATA)MyWinDdePostMsg( hWndServer, hWndClient, nMsg, - pOutDDEData, DDEPM_RETRY); - if( !pDDEInData ) - { - 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; - } - } - else - { - // WRITELOG("DdeClientTransaction:Async trans. success") - if( pResult ) - *pResult = nTransId; - } - } -#if 0 && defined( OV_DEBUG ) - if( nType == XTYP_REQUEST ) - { - WRITELOG("End XTYP_REQUEST"); - WinMessageBox(HWND_DESKTOP,HWND_DESKTOP, - "End XTYP_REQUEST","DdeClientTransaction", - HWND_DESKTOP,MB_OK); - } -#endif - //WRITELOG("DdeClientTransaction:End") - //WRITESTATUS("DdeClientTransaction:End") - return pDDEInData; -} - -MRESULT ImpDdeMgr::DdeRegister( ImpWndProcParams* pParams ) -{ - MRESULT nRet = (MRESULT)0; - if ( !(nTransactFilter & CBF_SKIP_REGISTRATIONS) ) - { - HSZ hSBaseName = (HSZ)pParams->nPar1; - HSZ hIBaseName = (HSZ)pParams->nPar2; - nRet=(MRESULT)Callback(XTYP_REGISTER,0,0,hSBaseName,hIBaseName,0,0,0); - } - return nRet; -} - -MRESULT ImpDdeMgr::DdeUnregister( ImpWndProcParams* pParams ) -{ - MRESULT nRet = (MRESULT)0; - if ( !(nTransactFilter & CBF_SKIP_UNREGISTRATIONS) ) - { - HSZ hSBaseName = (HSZ)pParams->nPar1; - HSZ hIBaseName = (HSZ)pParams->nPar2; - nRet=(MRESULT)Callback(XTYP_UNREGISTER,0,0,hSBaseName,hIBaseName,0,0,0); - } - return nRet; -} - -MRESULT ImpDdeMgr::DdeTimeout( ImpWndProcParams* pParams ) -{ - ////WRITELOG("DdeTimeout:Received") - if( nSyncResponseMsg ) - { - ////WRITELOG("DdeTimeout:Trans already processed->ignoring timeout") - return (MRESULT)1; - } - sal_uIntPtr nTimerId = (sal_uIntPtr)pParams->nPar1; - sal_uIntPtr nTransId = TID_USERMAX - nTimerId; - Transaction* pTrans = pTransTable; - pTrans += (sal_uInt16)nTransId; - if( nTransId < 1 || nTransId >= pData->nMaxTransCount || - pTrans->hConvOwner == 0 ) - { - DBG_ASSERT(0,"DdeTimeout:Invalid TransactionId"); - return (MRESULT)1; - } - if( bInSyncTrans && nTransId == nSyncTransId ) - { - sal_uInt16 nTempType = pTrans->nType; - nTempType &= (~XTYPF_MASK); - // advise-loops koennen nur innerhalb synchroner - // requests timeouts bekommen. die transaktion wird - // in diesem fall nicht geloescht. - if( nTempType != (XTYP_ADVREQ & (~XTYPF_NOBLOCK) )) - { - ////WRITELOG("DdeTimeout:Freeing transaction") - FreeTransaction( pData, nTransId ); - } - nSyncResponseMsg = WM_TIMER; -#if 0 && defined( OV_DEBUG ) - String aMsg("DdeTimeout:Transaction="); - aMsg += nTransId; - WRITELOG((char*)(const char*)aMsg) -#endif - } - else - { - ////WRITELOG("DdeTimeout:Async transaction timed out") - pTrans->nConvst = XST_TIMEOUT; - } - return (MRESULT)1; -} - - - -MRESULT ImpDdeMgr::DdeTerminate( ImpWndProcParams* pParams ) -{ - WRITELOG("DdeTerminate:Received") - HWND hWndThis = pParams->hWndReceiver; - HWND hWndPartner = (HWND)(pParams->nPar1); - - HCONV hConv = GetConvHandle( pData, hWndThis, hWndPartner ); -#if 0 && defined( OV_DEBUG ) - String strDebug("DdeTerminate:ConvHandle="); - strDebug += (sal_uInt16)hConv; - WRITELOG((char*)(const char*)strDebug) -#endif - ImpHCONV* pConv = pConvTable + (sal_uInt16)hConv; - if( hConv ) - { - // warten wir auf ein DDE_TERMINATE Acknowledge ? - if( pConv->nStatus & ST_TERMINATED ) - { - ////WRITELOG("DdeTerminate:TERMINATE-Ack received") - pConv->nStatus |= ST_TERMACKREC; - return (MRESULT)0; // DdeDisconnect raeumt jetzt auf - } - - // sind wir Server?, wenn ja: die App benachrichtigen, - // dass die Advise loops gestoppt wurden und die - // Transaktionen loeschen - - // OV 26.07.96: Die das TERMINATE empfangende App muss - // die Transaction-Tabelle abraeumen, egal ob Server oder Client!! - // Es muessen alle Trans geloescht werden, die als Owner den - // Client oder den Server haben! - // if( !(pConv->nStatus & ST_CLIENT ) ) - SendUnadvises( hConv, 0, sal_False ); // alle Formate & nicht loeschen - SendUnadvises( pConv->hConvPartner, 0, sal_False ); - - // wir werden von draussen gekillt - if ( !(nTransactFilter & CBF_SKIP_DISCONNECTS) ) - { - Callback( XTYP_DISCONNECT, 0, hConv, 0, 0, 0, - 0, (sal_uIntPtr)IsSameInstance(hWndPartner)); - } - - // kann unsere Partner-App DDEML ? - if( !(pConv->hConvPartner) ) - { - // nein, deshalb Transaktionstabelle selbst loeschen - ////WRITELOG("DdeTerminate:Freeing transactions") - FreeTransactions( pData, hConv ); - } - } - else - nLastErrInstance = DMLERR_NO_CONV_ESTABLISHED; - -#if 0 && defined(OV_DEBUG) - if( !WinIsWindow(0,hWndPartner)) - { - WRITELOG("DdeTerminate:hWndPartner not valid") - } - if(!WinIsWindow(0,hWndThis)) - { - WRITELOG("DdeTerminate:hWndThis not valid") - } -#endif - - if( hConv ) - { - // hWndThis nicht loeschen, da wir den Handle noch fuer - // das Acknowledge brauchen - ////WRITELOG("DdeTerminate:Freeing conversation") - FreeConvHandle( pData, hConv, sal_False ); - } - - ////WRITELOG("DdeTerminate:Acknowledging DDE_TERMINATE") - -#ifdef OV_DEBUG - DBG_ASSERT(WinIsWindow( 0, hWndThis ),"hWndThis not valid"); -#endif - - if( !WinDdePostMsg( hWndPartner, hWndThis, WM_DDE_TERMINATE, 0, DDEPM_RETRY )) - { - ////WRITELOG("DdeTerminate:Acknowledging DDE_TERMINATE failed") - } - // jetzt hWndThis loeschen - DestroyConversationWnd( hWndThis ); - - return (MRESULT)0; -} - - -/* - Zuordnung des Conversationhandles: - - Verbindungsaufbau: - Client: DdeInitiate( HWNDClient ) - Server: Post( WM_DDE_INITIATEACK( HWNDServer )) - Client: CreateConvHandle( HWNDClient, HWNDServer ) - - Datenaustausch: - Server: Post(WM_DDE_ACK( HWNDSender )) - Client: GetConvHandle( HWNDClient, HWNDSender ) -*/ - -MRESULT ImpDdeMgr::ConvWndProc( HWND hWnd,sal_uIntPtr nMsg,MPARAM nPar1,MPARAM nPar2 ) -{ - ImpWndProcParams aParams; - - MRESULT nRet = (MRESULT)0; - aParams.hWndReceiver= hWnd; - aParams.nPar1 = nPar1; - aParams.nPar2 = nPar2; - - switch( nMsg ) - { - -#ifdef DBG_UTIL - case WM_DDE_INITIATE : - DBG_ASSERT(0,"dde:unexpected msg"); - nRet = (MRESULT)sal_True; - break; -#endif - - case WM_DDE_INITIATEACK : nRet = DdeInitiateAck(&aParams); break; - case WM_DDE_ACK : nRet = DdeAck( &aParams ); break; - case WM_DDE_ADVISE : nRet = DdeAdvise( &aParams ); break; - case WM_DDE_DATA : nRet = DdeData( &aParams ); break; - case WM_DDE_EXECUTE : nRet = DdeExecute( &aParams ); break; - case WM_DDE_POKE : nRet = DdePoke( &aParams ); break; - case WM_DDE_REQUEST : nRet = DdeRequest( &aParams ); break; - case WM_DDE_TERMINATE : nRet = DdeTerminate( &aParams ); break; - case WM_DDE_UNADVISE : nRet = DdeUnadvise( &aParams ); break; - case WM_TIMER : nRet = DdeTimeout( &aParams ); break; - } - return nRet; -} - -MRESULT ImpDdeMgr::SrvWndProc( HWND hWnd,sal_uIntPtr nMsg,MPARAM nPar1,MPARAM nPar2 ) -{ - MRESULT nRet = (MRESULT)0; - - ImpWndProcParams aParams; - aParams.hWndReceiver= hWnd; - aParams.nPar1 = nPar1; - aParams.nPar2 = nPar2; - - switch( nMsg ) - { -#ifdef DBG_UTIL - case WM_DDE_ACK : - case WM_DDE_ADVISE : - case WM_DDE_EXECUTE : - case WM_DDE_POKE : - case WM_DDE_REQUEST : - case WM_DDE_UNADVISE : - case WM_DDE_DATA : - case WM_DDE_INITIATEACK : - DBG_ASSERT(0,"dde:unexpected msg"); - nRet = (MRESULT)sal_True; - break; -#endif - - case WM_DDE_TERMINATE : - break; // DDE_INITIATE wurde im DDE_INITIATEACK terminiert - - // ein Client will was von uns - case WM_DDE_INITIATE : - nRet = DdeInitiate( &aParams ); - break; - - // eine ddeml-faehige App. hat einen Service (typ. AppName) [de]reg. - case WM_DDEML_REGISTER : - nRet = DdeRegister( &aParams ); - break; - - case WM_DDEML_UNREGISTER : - nRet = DdeUnregister( &aParams ); - break; - }; - return nRet; -} - - -MRESULT ImpDdeMgr::DdeAck( ImpWndProcParams* pParams ) -{ - //WRITELOG("DdeAck:Start") - HSZ hszItem; - DDESTRUCT* pInDDEData = (DDESTRUCT*)(pParams->nPar2); - if( pInDDEData ) - { - sal_Bool bPositive = (sal_Bool)(pInDDEData->fsStatus & DDE_FACK ) != 0; - sal_Bool bBusy = bPositive ? sal_False : (sal_Bool)(pInDDEData->fsStatus & DDE_FBUSY ) != 0; - sal_Bool bNotProcessed = (sal_Bool)(pInDDEData->fsStatus & DDE_NOTPROCESSED ) != 0; -#if 0 && defined( OV_DEBUG ) - String aDebStr("DdeAck:Received "); - if( bPositive ) - aDebStr += "(positive)"; - else - aDebStr += "(negative)"; - if( bBusy ) - aDebStr += "(busy)"; - if( bNotProcessed ) - aDebStr += "(not processed)"; - WRITELOG((char*)(const char*)aDebStr) -#endif - // ein DDE_ACK niemals bestaetigen (um endlosschleifen zu vermeiden) - pInDDEData->fsStatus &= (~DDE_FACKREQ); - } - else - { - //WRITELOG("DdeAck:Received (no data!)") - return (MRESULT)0; - } - - HCONV hConv = CheckIncoming(pParams, 0, hszItem); -#ifdef OV_DEBUG - if( !hConv ) - { - WRITELOG("DdeAck:HCONV not found") - } -#endif - sal_uIntPtr nTransId=GetTransaction(pData,hConv,hszItem,pInDDEData->usFormat); - if( !nTransId ) - { - WRITELOG("DdeAck:Transaction not found") - MyDosFreeMem( pInDDEData,"DdeAck" ); - return (MRESULT)0; - } - - sal_Bool bThisIsSync = (sal_Bool)( bInSyncTrans && nTransId == nSyncTransId ); -#if 0 && defined( OV_DEBUG ) - if( bThisIsSync) - WRITELOG("DdeAck: sync transaction") - else - WRITELOG("DdeAck: async transaction") -#endif - // pruefen, ob die Transaktion abgeschlossen ist. - Transaction* pTrans = pTransTable; - pTrans += (sal_uInt16)nTransId; - ImpHCONV* pConv = pConvTable; - pConv += (sal_uInt16)hConv; - - if( pTrans->nConvst == XST_UNADVSENT ) - { - //WRITELOG("DdeAck:Unadvise-Ack received") - pTrans->nConvst = XST_UNADVACKRCVD; - MyDosFreeMem( pInDDEData,"DdeAck" ); - DdeFreeStringHandle( hszItem ); - return (MRESULT)0; - } - if( pTrans->nConvst == XST_ADVDATASENT ) - { - //WRITELOG("DdeAck:AdvData-Ack received") - pTrans->nConvst = XST_ADVDATAACKRCVD; - MyDosFreeMem( pInDDEData,"DdeAck" ); - DdeFreeStringHandle( hszItem ); - return (MRESULT)0; - } - - sal_uInt16 nType = pTrans->nType; - nType &= (~XTYPF_MASK); - // beginn einer advise-loop oder request auf advise-loop ? - // wenn ja: transaktion nicht loeschen - sal_Bool bFinished = (sal_Bool)(nType != XTYP_ADVSTART && - nType != (XTYP_ADVREQ & (~XTYPF_NOBLOCK)) ); - if( bFinished ) - { - if( !bThisIsSync ) - { - ////WRITELOG("DdeAck:Transaction completed") - Callback( XTYP_XACT_COMPLETE, pInDDEData->usFormat, hConv, - pConv->hszTopic, hszItem, (HDDEDATA)0, nTransId, 0 ); - } - ////WRITELOG("DdeAck:Freeing transaction") - FreeTransaction( pData, nTransId ); - } - - if( bThisIsSync ) - { - hSyncResponseData = pInDDEData; - nSyncResponseMsg = WM_DDE_ACK; - } - else - { - MyDosFreeMem( pInDDEData,"DdeAck" ); - } - - DdeFreeStringHandle( hszItem ); - - return (MRESULT)0; -} - - -sal_uInt16 ImpDdeMgr::SendUnadvises(HCONV hConvServer,sal_uInt16 nFormat,sal_Bool bFree) -{ - sal_uInt16 nTransFound = 0; - sal_Bool bCallApp = (sal_Bool)(!(nTransactFilter & CBF_FAIL_ADVISES)); -#if 0 && defined( OV_DEBUG ) - String aStr("Unadvising transactions for HCONV="); - aStr += (sal_uIntPtr)hConvServer; - aStr += " CallApp:"; aStr += (sal_uInt16)bCallApp; - WRITELOG((char*)aStr.GetStr()) -#endif - - - // wenn wir weder loeschen noch die App benachrichtigen sollen, - // koennen wir gleich wieder returnen - if( !hConvServer || ( !bFree && !bCallApp ) ) - return 0; - - ImpHCONV* pConvSrv = pConvTable; - pConvSrv += (sal_uInt16)hConvServer; - HSZ hszTopic = pConvSrv->hszTopic; - - Transaction* pTrans = pTransTable; - pTrans++; - sal_uInt16 nCurTransId = 1; - sal_uInt16 nCurTransactions = pData->nCurTransCount; - while( nCurTransactions && nCurTransId < pData->nMaxTransCount ) - { - if( pTrans->hConvOwner ) - nCurTransactions--; - if( pTrans->hConvOwner == hConvServer && - (pTrans->nType & XTYP_ADVREQ) ) - { - if( !nFormat || (nFormat == pTrans->nFormat) ) - { - nTransFound++; - if( bCallApp ) - { - //WRITELOG("SendUnadvises:Notifying App") - Callback( XTYP_ADVSTOP, pTrans->nFormat, hConvServer, - hszTopic, pTrans->hszItem, 0,0,0 ); - } - if( bFree ) - FreeTransaction( pData, (sal_uIntPtr)nCurTransId ); - } - } - nCurTransId++; - pTrans++; - } - return nTransFound; -} - - - -HCONV ImpDdeMgr::CheckIncoming( ImpWndProcParams* pParams, sal_uIntPtr nTransMask, - HSZ& rhszItem ) -{ -// ////WRITELOG("CheckIncoming") - rhszItem = 0; - DDESTRUCT* pInDDEData = (DDESTRUCT*)(pParams->nPar2); - if( !pInDDEData ) - { - // ////WRITELOG("CheckIncoming:PDDESTRUCT==0") - return (HCONV)0; - } - - HWND hWndThis = pParams->hWndReceiver; - HWND hWndClient = (HWND)pParams->nPar1; - - sal_Bool bReject = (sal_Bool)(nTransactFilter & nTransMask); - HCONV hConv; - if( !bReject ) - hConv = GetConvHandle( pData, hWndThis, hWndClient ); - if ( bReject || !hConv ) - return (HCONV)0; - - rhszItem = DdeCreateStringHandle( - ((char*)(pInDDEData)+pInDDEData->offszItemName), 850 ); - - // ////WRITELOG("CheckIncoming:OK"); - return hConv; -} - - -MRESULT ImpDdeMgr::DdeAdvise( ImpWndProcParams* pParams ) -{ - ////WRITELOG("DdeAdvise:Received") - HSZ hszItem; - HCONV hConv = CheckIncoming(pParams, CBF_FAIL_ADVISES, hszItem); - DDESTRUCT* pInDDEData = (DDESTRUCT*)(pParams->nPar2); - HWND hWndThis = pParams->hWndReceiver; - HWND hWndClient = (HWND)pParams->nPar1; - if( !hConv ) - { - ////WRITELOG("DdeAdvise:Conversation not found") - pInDDEData->fsStatus &= (~DDE_FACK); - MyWinDdePostMsg(hWndClient,hWndThis,WM_DDE_ACK,pInDDEData,DDEPM_RETRY); - DdeFreeStringHandle( hszItem ); - return (MRESULT)0; - } - - Transaction* pTrans = pTransTable; - ImpHCONV* pConv = pConvTable; - pConv += (sal_uInt16)hConv; - - // existiert schon ein Link auf Topic/Item/Format-Vektor ? - - sal_uIntPtr nTransId=GetTransaction(pData,hConv,hszItem,pInDDEData->usFormat); - if( nTransId ) - { - ////WRITELOG("DdeAdvise:Transaction already exists") - pTrans += (sal_uInt16)nTransId; - // ist es eine AdviseLoop ? - sal_uInt16 nTempType = pTrans->nType; - nTempType &= (~XTYPF_MASK); - if( nTempType == XTYP_ADVREQ ) - { - // Flags der laufenden Advise-Loop aktualisieren - ////WRITELOG("DdeAdvise:Adjusting Advise-Params") - pTrans->nType = XTYP_ADVREQ; - if( pInDDEData->fsStatus & DDE_FNODATA ) - pTrans->nType |= XTYPF_NODATA; - if( pInDDEData->fsStatus & DDE_FACKREQ ) - pTrans->nType |= XTYPF_ACKREQ; - pInDDEData->fsStatus |= DDE_FACK; - MyWinDdePostMsg(hWndClient,hWndThis,WM_DDE_ACK,pInDDEData,DDEPM_RETRY); - DdeFreeStringHandle( hszItem ); - return (MRESULT)0; - } - else if( nTempType != XTYP_ADVSTART ) - { - ////WRITELOG("DdeAdvise:Not a advise transaction") - pInDDEData->fsStatus &= (~DDE_FACK); - MyWinDdePostMsg(hWndClient,hWndThis,WM_DDE_ACK,pInDDEData,DDEPM_RETRY); - DdeFreeStringHandle( hszItem ); - return (MRESULT)0; - } - } - - if( !nTransId ) - { - ////WRITELOG("DdeAdvise:Creating Transaction") - ////WRITESTATUS("DdeAdvise:Creating Transaction") - nTransId = CreateTransaction( pData, hConv, hszItem, - pInDDEData->usFormat, XTYP_ADVREQ ); - ////WRITESTATUS("DdeAdvise:Created Transaction") - } - if( nTransId ) - { - pTrans = pTransTable; - pTrans += (sal_uInt16)nTransId; - if( pInDDEData->fsStatus & DDE_FNODATA ) - pTrans->nType |= XTYPF_NODATA; - if( pInDDEData->fsStatus & DDE_FACKREQ ) - pTrans->nType |= XTYPF_ACKREQ; - } - else - { - ////WRITELOG("DdeAdvise:Cannot create Transaction") - pInDDEData->fsStatus &= (~DDE_FACK); - MyWinDdePostMsg(hWndClient,hWndThis,WM_DDE_ACK,pInDDEData,DDEPM_RETRY); - DdeFreeStringHandle( hszItem ); - return (MRESULT)0; - } - - ////WRITELOG("DdeAdvise:Calling Server") - - if ( Callback( XTYP_ADVSTART, pInDDEData->usFormat, - hConv, pConv->hszTopic, hszItem, (HDDEDATA)0, 0, 0 ) ) - { - // - // ServerApp erlaubt AdviseLoop - // - ////WRITELOG("DdeAdvise:Advise loop established") - pInDDEData->fsStatus |= DDE_FACK; - MyWinDdePostMsg(hWndClient,hWndThis,WM_DDE_ACK,pInDDEData,DDEPM_RETRY); - } - else - { - ////WRITELOG("DdeAdvise:Advise loop not established") - FreeTransaction( pData, nTransId ); - pInDDEData->fsStatus &= (~DDE_FACK); // DDE_FNOTPROCESSED; - MyWinDdePostMsg(hWndClient,hWndThis,WM_DDE_ACK,pInDDEData,DDEPM_RETRY); - } - ////WRITESTATUS("DdeAdvise:End") - ////WRITELOG("DdeAdvise:End") - DdeFreeStringHandle( hszItem ); - return (MRESULT)0; -} - -MRESULT ImpDdeMgr::DdeData( ImpWndProcParams* pParams ) -{ - WRITELOG("DdeData:Received") - HSZ hszItem; - HCONV hConv = CheckIncoming(pParams, 0, hszItem); - HWND hWndThis = pParams->hWndReceiver; - HWND hWndClient = (HWND)pParams->nPar1; - DDESTRUCT* pInDDEData = (DDESTRUCT*)(pParams->nPar2); -#if 0 && defined( OV_DEBUG ) - { - String aStr("DdeData Address:"); - aStr += (sal_uIntPtr)pInDDEData; - WRITELOG((char*)aStr.GetStr()) - } -#endif - - sal_Bool bSendAck; - if( pInDDEData && (pInDDEData->fsStatus & DDE_FACKREQ )) - { - WRITELOG("DdeData: Ackn requested") - bSendAck = sal_True; - } - else - { - WRITELOG("DdeData: Ackn not requested") - bSendAck = sal_False; - } - - sal_uIntPtr nTransId = GetTransaction(pData,hConv,hszItem,pInDDEData->usFormat); - if( !nTransId ) - { - WRITELOG("DdeData:Transaction not found") - WRITEDATA(pInDDEData) - if( bSendAck ) - { - WRITELOG("DdeData: Posting Ackn") - pInDDEData->fsStatus &= (~DDE_FACK); // NOTPROCESSED; - MyWinDdePostMsg(hWndClient,hWndThis,WM_DDE_ACK,pInDDEData,DDEPM_RETRY); - } - else - { - MyDosFreeMem( pInDDEData,"DdeData" ); - } - return (MRESULT)0; - } - -#if 0 && defined( OV_DEBUG ) - if( pInDDEData ) - { - WRITEDATA(pInDDEData) - } -#endif - - sal_Bool bThisIsSync = (sal_Bool)( bInSyncTrans && nTransId == nSyncTransId ); - - // pruefen, ob die Transaktion abgeschlossen ist. - Transaction* pTrans = pTransTable; - pTrans += (sal_uInt16)nTransId; - - if( pTrans->nConvst == XST_WAITING_ACK ) - { - // dieser Fall kann eintreten, wenn ein Server innerhalb - // einer WM_DDE_ADVISE-Msg. oder bevor beim Client das - // Ack eintrifft, Advise-Daten sendet. - WRITELOG("DdeData:Ignoring unexpected data") - if( bSendAck ) - { - WRITELOG("DdeData: Posting Ackn") - pInDDEData->fsStatus &= (~DDE_FACK); // NOTPROCESSED; - MyWinDdePostMsg(hWndClient,hWndThis,WM_DDE_ACK,pInDDEData,DDEPM_RETRY); - } - else - { - MyDosFreeMem( pInDDEData,"DdeData" ); - } - return (MRESULT)0; - } - - ImpHCONV* pConv = pConvTable; - pConv += (sal_uInt16)hConv; - - sal_uInt16 nType = pTrans->nType; - nType &= (~XTYPF_MASK); - sal_Bool bNotAdviseLoop = (sal_Bool)(nType != (XTYP_ADVREQ & (~XTYPF_NOBLOCK))); - if( !bThisIsSync ) - { - // WRITELOG("DdeData:Is async transaction") - if( bNotAdviseLoop ) - { - // WRITELOG("DdeData:Transaction completed -> calling client") - Callback( XTYP_XACT_COMPLETE, pInDDEData->usFormat, hConv, - pConv->hszTopic, hszItem, pInDDEData, nTransId, 0 ); - // WRITELOG("DdeData:Freeing transaction") - FreeTransaction( pData, nTransId ); - } - else - { - WRITELOG("DdeData:Advise-Loop -> calling client") - HDDEDATA pToSend = pInDDEData; - if( pTrans->nType & XTYPF_NODATA ) - { - pToSend = 0; - // WRITELOG("DdeData:Is warm link") - } - Callback( XTYP_ADVDATA, pInDDEData->usFormat, hConv, - pConv->hszTopic, hszItem, pToSend, nTransId, 0 ); - } - if( bSendAck ) - { - WRITELOG("DdeData: Posting Ackn") - pInDDEData->fsStatus = DDE_FACK; - MyWinDdePostMsg(hWndClient,hWndThis,WM_DDE_ACK,pInDDEData,DDEPM_RETRY); - } - else - MyDosFreeMem( pInDDEData,"DdeData" ); - } - else // synchrone Transaktion (Datenhandle nicht freigeben!) - { - // WRITELOG("DdeData:Is sync transaction") - hSyncResponseData = pInDDEData; - nSyncResponseMsg = WM_DDE_DATA; - if( bSendAck ) - { - pInDDEData->fsStatus |= DDE_FACK; - WRITELOG("DdeData: Posting Ackn") - MyWinDdePostMsg(hWndClient,hWndThis,WM_DDE_ACK,pInDDEData, - DDEPM_RETRY | DDEPM_NOFREE ); - } - } - - DdeFreeStringHandle( hszItem ); - // WRITELOG("DdeData:End") - return (MRESULT)0; -} - -MRESULT ImpDdeMgr::DdeExecute( ImpWndProcParams* pParams ) -{ - ////WRITELOG("DdeExecute:Received") - DDESTRUCT* pInDDEData = (DDESTRUCT*)(pParams->nPar2); - HSZ hszItem; - HCONV hConv = CheckIncoming(pParams, 0, hszItem); - sal_Bool bSuccess = sal_False; - ImpHCONV* pConv = pConvTable; - pConv += (sal_uInt16)hConv; - if ( hConv && !(nTransactFilter & CBF_FAIL_EXECUTES) && pInDDEData ) - { - if ( Callback( XTYP_EXECUTE, pInDDEData->usFormat, hConv, - pConv->hszTopic, hszItem, pInDDEData, 0, 0 ) - == (DDESTRUCT*)DDE_FACK ) - bSuccess = sal_True; - } - else - { - ////WRITELOG("DdeExecute:Not processed") - } - if( pInDDEData ) - { - if( bSuccess ) - pInDDEData->fsStatus |= DDE_FACK; - else - pInDDEData->fsStatus &= (~DDE_FACK); - MyWinDdePostMsg( pConv->hWndPartner, pConv->hWndThis, WM_DDE_ACK, - pInDDEData, DDEPM_RETRY ); - } - DdeFreeStringHandle( hszItem ); - return (MRESULT)0; -} - -HCONV ImpDdeMgr::ConnectWithClient( HWND hWndClient, - HSZ hszPartner, HSZ hszService, HSZ hszTopic, sal_Bool bSameInst, - DDEINIT* pDDEData, CONVCONTEXT* pCC ) -{ - ////WRITELOG("ConnectWithClient:Start") - HWND hWndSrv = CreateConversationWnd(); - IncConversationWndRefCount( hWndSrv ); - HCONV hConv = CreateConvHandle( pData, pidThis, hWndSrv, hWndClient, - hszPartner, hszService, hszTopic ); - if(!hConv ) - return 0; - sal_Bool bFreeDdeData = sal_False; - if( !pDDEData ) - { - bFreeDdeData = sal_True; - pDDEData = CreateDDEInitData( hWndClient,hszService,hszTopic, pCC ); - PID pid; TID tid; - WinQueryWindowProcess( hWndClient, &pid, &tid ); - DosGiveSharedMem( pDDEData, pid, PAG_READ | PAG_WRITE); - } - HAB hAB = WinQueryAnchorBlock( hWndSrv ); - WinGetLastError( hAB ); // fehlercode zuruecksetzen - WinSendMsg(hWndClient,WM_DDE_INITIATEACK,(MPARAM)hWndSrv,(MPARAM)pDDEData); - if( WinGetLastError( hAB ) ) - { - // ////WRITELOG("DdeConnectWithClient:Client died") - if( bFreeDdeData ) - { - MyDosFreeMem( pDDEData,"ConnectWithClient" ); - } - FreeConvHandle( pData, hConv ); - return (HCONV)0; - } - - if( !(nTransactFilter & CBF_SKIP_CONNECT_CONFIRMS) ) - { - Callback( XTYP_CONNECT_CONFIRM, 0, hConv, hszTopic, hszService, - 0, 0, (sal_uIntPtr)bSameInst ); - } - - if( bFreeDdeData ) - { - MyDosFreeMem( pDDEData,"ConnectWithClient" ); - } - // HCONV der PartnerApp suchen & bei uns eintragen - ImpHCONV* pConv = pConvTable; - pConv += (sal_uInt16)hConv; - pConv->hConvPartner = GetConvHandle( pData, hWndClient, hWndSrv ); -#if 0 && defined(OV_DEBUG) - if( !pConv->hConvPartner ) - { - WRITELOG("DdeConnectWithClient:Partner not found") - } -#endif - pConv->nStatus = ST_CONNECTED; - //WRITESTATUS("Server:Connected with client") - //WRITELOG("ConnectWithClient:End") - return hConv; -} - -MRESULT ImpDdeMgr::DdeInitiate( ImpWndProcParams* pParams ) -{ - ////WRITELOG("DdeInitiate:Received") - HWND hWndClient = (HWND)(pParams->nPar1); -// sal_Bool bSameInst = IsSameInstance( hWndClient ); - sal_Bool bSameInst = (sal_Bool)(hWndClient==hWndServer); - DDEINIT* pDDEData = (DDEINIT*)pParams->nPar2; - - if ( ( nTransactFilter & (CBF_FAIL_CONNECTIONS | APPCMD_CLIENTONLY)) || - (( nTransactFilter & CBF_FAIL_SELFCONNECTIONS) && bSameInst ) - ) - { - MyDosFreeMem( pDDEData,"DdeInitiate" ); - return (MRESULT)sal_False; // narda - } - - HSZ hszService = (HSZ)0; - if( *(pDDEData->pszAppName) != '\0' ) - { - hszService = DdeCreateStringHandle( pDDEData->pszAppName, 850 ); - ////WRITELOG(pDDEData->pszAppName); - } - HSZ hszTopic = (HSZ)0; - if( *(pDDEData->pszTopic) != '\0' ) - { - hszTopic = DdeCreateStringHandle( pDDEData->pszTopic, 850 ); - ////WRITELOG(pDDEData->pszTopic); - } - HSZ hszPartner = GetAppName( hWndClient ); - - // nur weitermachen, wenn Service registriert oder - // Service-Name-Filtering ausgeschaltet. - if( !bServFilterOn || GetService(hszService) ) - { - // XTYP_CONNECT-Transaktionen erfolgen nur mit - // Services & Topics ungleich 0! - if( hszService && hszTopic ) - { - if( IsConvHandleAvailable(pData) && Callback( XTYP_CONNECT, - 0, 0, hszTopic,hszService, 0, 0, (sal_uIntPtr)bSameInst)) - { - // App erlaubt Verbindung mit Client - ConnectWithClient( hWndClient, hszPartner, - hszService, hszTopic, bSameInst, pDDEData ); - } - } - else - { - // ** Wildcard-Connect ** - ////WRITELOG("DdeInitiate:Wildconnect") - // vom Server eine Liste aller Service/Topic-Paare anfordern - CONVCONTEXT* pCC=(CONVCONTEXT*)(pDDEData+pDDEData->offConvContext); - DDESTRUCT* hList = Callback( XTYP_WILDCONNECT, 0, (HCONV)0, - hszTopic,hszService, (HDDEDATA)0, (sal_uIntPtr)pCC, (sal_uIntPtr)bSameInst ); - if( hList ) - { - HSZPAIR* pPairs = (HSZPAIR*)((char*)hList+hList->offabData); - while( pPairs->hszSvc ) - { - ////WRITELOG("DdeInitiate:Wildconnect.Connecting") - ConnectWithClient( hWndClient, hszPartner, - pPairs->hszSvc, pPairs->hszTopic, bSameInst, 0, pCC); - // Stringhandles gehoeren der App! (nicht free-en) - pPairs++; - } - DdeFreeDataHandle( hList ); - } - } - } -#if 0 && defined(OV_DEBUG) - else - { - WRITELOG("DdeInitiate:Service filtered") - } -#endif - DdeFreeStringHandle( hszTopic ); - DdeFreeStringHandle( hszService ); - DdeFreeStringHandle( hszPartner ); - MyDosFreeMem( pDDEData,"DdeInitiate" ); - ////WRITELOG("DdeInitiate:End") - return (MRESULT)sal_True; -} - -MRESULT ImpDdeMgr::DdeInitiateAck( ImpWndProcParams* pParams ) -{ - ////WRITELOG("DdeInitiateAck:Received") - DDEINIT* pDDEData = (DDEINIT*)(pParams->nPar2); - - if( !bListConnect && hCurConv ) - { - ////WRITELOG("DdeInitiateAck:Already connected") - MyDosFreeMem( pDDEData,"DdeInitiateAck" ); - WinPostMsg( hWndServer, WM_DDE_TERMINATE, (MPARAM)hWndServer, 0 ); - return (MRESULT)sal_False; - } - - HWND hWndThis = pParams->hWndReceiver; - // Referenz-Count unseres Client-Windows inkrementieren - IncConversationWndRefCount( hWndThis ); - - HWND hWndSrv = (HWND)(pParams->nPar1); - HSZ hszService = DdeCreateStringHandle( pDDEData->pszAppName, 850 ); - HSZ hszTopic = DdeCreateStringHandle( pDDEData->pszTopic, 850 ); - HSZ hszPartnerApp = GetAppName( hWndSrv ); - - hCurConv = CreateConvHandle( pData, pidThis, hWndThis, hWndSrv, - hszPartnerApp, hszService, hszTopic, 0 ); - - ImpHCONV* pConv = pConvTable; - pConv += (sal_uInt16)hCurConv; - - // HCONV der PartnerApp suchen & bei uns eintragen - pConv->hConvPartner = GetConvHandle( pData, hWndSrv, hWndThis ); - // nicht asserten, da ja non-ddeml-Partner moeglich - // DBG_ASSERT(pConv->hConvPartner,"DDE:Partner not found"); - pConv->nStatus = ST_CONNECTED | ST_CLIENT; - - if( bListConnect ) - { - ////WRITELOG("DdeInitiateAck:ListConnect/Connecting hConvs") - // Status setzen & verketten - pConv->hConvList = hCurListId; - pConv->nPrevHCONV = nPrevConv; - pConv->nStatus |= ST_INLIST; - if( nPrevConv ) - { - pConv = pConvTable; - pConv += nPrevConv; - pConv->nNextHCONV = (sal_uInt16)hCurConv; - } - nPrevConv = (sal_uInt16)hCurConv; - } - - DdeFreeStringHandle( hszService ); - DdeFreeStringHandle( hszTopic ); - DdeFreeStringHandle( hszPartnerApp ); - MyDosFreeMem( pDDEData,"DdeInitiateAck" ); - ////WRITESTATUS("After DdeInitiateAck") - ////WRITELOG("DdeInitiateAck:End") - return (MRESULT)sal_True; -} - -MRESULT ImpDdeMgr::DdePoke( ImpWndProcParams* pParams ) -{ - ////WRITELOG("DdePoke:Received") - HSZ hszItem = 0; - DDESTRUCT* pInDDEData = (DDESTRUCT*)(pParams->nPar2); - HCONV hConv = CheckIncoming( pParams, CBF_FAIL_REQUESTS, hszItem ); - sal_Bool bSuccess =sal_False; - ImpHCONV* pConv = pConvTable; - pConv += (sal_uInt16)hConv; - if ( hConv && !(nTransactFilter & CBF_FAIL_POKES) && pInDDEData ) - { - if( Callback( XTYP_POKE, pInDDEData->usFormat, hConv, - pConv->hszTopic, hszItem, pInDDEData, 0, 0 ) - == (DDESTRUCT*)DDE_FACK ) - bSuccess = sal_True; - } -#if 0 && defined( OV_DEBUG ) - else - { - WRITELOG("DdePoke:Not processed") - } -#endif - if( pInDDEData ) - { - if( bSuccess ) - pInDDEData->fsStatus |= DDE_FACK; - else - pInDDEData->fsStatus &= (~DDE_FACK); - - MyWinDdePostMsg( pConv->hWndPartner, pConv->hWndThis, WM_DDE_ACK, - pInDDEData, DDEPM_RETRY ); - } - DdeFreeStringHandle( hszItem ); - return (MRESULT)0; -} - -MRESULT ImpDdeMgr::DdeRequest( ImpWndProcParams* pParams ) -{ - ////WRITELOG("DdeRequest:Received") - HSZ hszItem = 0; - DDESTRUCT* pInDDEData = (DDESTRUCT*)(pParams->nPar2); - if( pInDDEData ) - // ist fuer Requests nicht definiert - pInDDEData->fsStatus = 0; - HCONV hConv = CheckIncoming( pParams, CBF_FAIL_REQUESTS, hszItem ); - HWND hWndThis = pParams->hWndReceiver; - HWND hWndClient = (HWND)pParams->nPar1; - if( hConv ) - { - ImpHCONV* pConv = pConvTable; - pConv += (sal_uInt16)hConv; - - DDESTRUCT* pOutDDEData = Callback( XTYP_REQUEST, pInDDEData->usFormat, - hConv, pConv->hszTopic, hszItem, (HDDEDATA)0, 0, 0 ); - - if ( !pOutDDEData ) - { - ////WRITELOG("DdeRequest:Not processed") - pInDDEData->fsStatus &= (~DDE_FACK); - MyWinDdePostMsg(hWndClient,hWndThis,WM_DDE_ACK,pInDDEData,DDEPM_RETRY); - } - else - { - ////WRITELOG("DdeRequest:Success") - MyDosFreeMem( pInDDEData,"DdeRequest" ); - pOutDDEData->fsStatus |= DDE_FRESPONSE; - MyWinDdePostMsg(hWndClient,hWndThis,WM_DDE_DATA,pOutDDEData,DDEPM_RETRY); - } - } - else - { - pInDDEData->fsStatus &= (~DDE_FACK); - MyWinDdePostMsg(hWndClient,hWndThis,WM_DDE_ACK,pInDDEData,DDEPM_RETRY); - } - - DdeFreeStringHandle( hszItem ); - ////WRITELOG("DdeRequest:End") - return (MRESULT)0; -} - - -MRESULT ImpDdeMgr::DdeUnadvise( ImpWndProcParams* pParams ) -{ - ////WRITELOG("DdeUnadvise:Received") - - HSZ hszItem; - HCONV hConv = CheckIncoming( pParams, 0, hszItem ); - DDESTRUCT* pInDDEData = (DDESTRUCT*)(pParams->nPar2); - HWND hWndThis = pParams->hWndReceiver; - HWND hWndClient = (HWND)pParams->nPar1; - sal_uInt16 nClosedTransactions = 0; - if( hConv ) - { - sal_uInt16 nFormat = pInDDEData->usFormat; - // alle Transaktionen des HCONVs loeschen ? - if( !hszItem ) - { - // App benachrichtigen & Transaktionen loeschen - nClosedTransactions = SendUnadvises( hConv, nFormat, sal_True ); - } - else - { - sal_uIntPtr nTransId = GetTransaction(pData, hConv, hszItem, nFormat); - if( nTransId ) - { - ////WRITELOG("DdeUnadvise:Transaction found") - Transaction* pTrans = pTransTable; - pTrans += (sal_uInt16)nTransId; - ImpHCONV* pConv = pConvTable; - pConv += (sal_uInt16)hConv; - nClosedTransactions = 1; - if( !(nTransactFilter & CBF_FAIL_ADVISES) ) - Callback( XTYP_ADVSTOP, nFormat, hConv, - pConv->hszTopic, hszItem, 0, 0, 0 ); - if( !pConv->hConvPartner ) - FreeTransaction( pData, nTransId ); - } -#if defined(OV_DEBUG) - else - { - WRITELOG("DdeUnadvise:Transaction not found") - } -#endif - } - } -#if defined(OV_DEBUG) - else - { - WRITELOG("DdeUnadvise:Conversation not found") - } -#endif - - if( !nClosedTransactions ) - pInDDEData->fsStatus &= (~DDE_FACK); - else - pInDDEData->fsStatus |= DDE_FACK; - - MyWinDdePostMsg(hWndClient,hWndThis,WM_DDE_ACK,pInDDEData,DDEPM_RETRY); - DdeFreeStringHandle( hszItem ); - return (MRESULT)0; -} - -sal_Bool ImpDdeMgr::WaitTransState( Transaction* pTrans, sal_uIntPtr nTransId, - sal_uInt16 nNewState, sal_uIntPtr nTimeout ) -{ - ////WRITELOG("WaitTransState:Start") - ImpHCONV* pConv = pConvTable; - pConv += pTrans->hConvOwner; - HAB hAB = WinQueryAnchorBlock( pConv->hWndThis ); - sal_uIntPtr nTimerId = WinStartTimer( hAB, 0, 0, 50 ); - QMSG aQueueMsg; - -// while( WinGetMsg( hAB, &aQueueMsg, 0, 0, 0 ) && -// WinIsWindow( hAB, pConv->hWndPartner) && -// pTrans->nConvst != nNewState ) -// { -// WinDispatchMsg( hAB, &aQueueMsg ); -// } - - sal_Bool bContinue = sal_True; - while( bContinue ) - { - if( WinGetMsg( hAB, &aQueueMsg, 0, 0, 0 )) - { - WinDispatchMsg( hAB, &aQueueMsg ); - if( (!WinIsWindow( hAB, pConv->hWndPartner)) || - (pTrans->nConvst == nNewState) ) - { - bContinue = sal_False; - } - } - else - bContinue = sal_False; - } - - WinStopTimer( hAB, 0, nTimerId ); - ////WRITELOG("WaitTransState:End") - return sal_True; -} - - - - diff --git a/svl/source/svdde/ddeml2.cxx b/svl/source/svdde/ddeml2.cxx deleted file mode 100644 index 6bcb4f7fcf27..000000000000 --- a/svl/source/svdde/ddeml2.cxx +++ /dev/null @@ -1,1011 +0,0 @@ -/************************************************************************* - * - * 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" - -#define INCL_DOS -#include <stdlib.h> - -#include "ddemlimp.hxx" -#define LOGFILE -#define STATUSFILE -#define DDEDATAFILE -#include "ddemldeb.hxx" - -#if defined (OS2) && defined (__BORLANDC__) -#pragma option -w-par -#endif - - -// ************************************************************************ -// Hilfsfunktionen Speicherverwaltung -// ************************************************************************ - -// -// AllocAtomName -// - -PSZ ImpDdeMgr::AllocAtomName( ATOM hString, sal_uIntPtr& rBufLen ) -{ - HATOMTBL hAtomTable = WinQuerySystemAtomTable(); - sal_uIntPtr nLen = WinQueryAtomLength( hAtomTable, hString ); - nLen++; - PSZ pBuf = 0; - if ( !MyDosAllocMem( (PPVOID)&pBuf, nLen, PAG_READ|PAG_WRITE|PAG_COMMIT | OBJ_ANY,"Atom" ) ) - { - WinQueryAtomName( hAtomTable, hString, pBuf, nLen ); - rBufLen = nLen; - } - return pBuf; -} - - -// -// MakeDDEObject -// - -PDDESTRUCT ImpDdeMgr::MakeDDEObject( HWND hwnd, ATOM hItemName, - sal_uInt16 fsStatus, sal_uInt16 usFormat, PVOID pabData, sal_uIntPtr usDataLen ) -{ - PDDESTRUCT pddes = 0; - sal_uIntPtr usItemLen; - PULONG pulSharedObj; - //WRITELOG("MakeDDEObject: Start") - - PSZ pItemName = 0; - if( hItemName != NULL ) - pItemName = AllocAtomName( hItemName, usItemLen ); - else - usItemLen = 1; - - sal_uIntPtr nTotalSize = sizeof(DDESTRUCT) + usItemLen + usDataLen; - - if( !(MyDosAllocSharedMem((PPVOID)&pulSharedObj, NULL, - nTotalSize, - PAG_COMMIT | PAG_READ | PAG_WRITE | OBJ_GETTABLE | OBJ_GIVEABLE | OBJ_ANY, - "MakeDDEObject"))) - { - pddes = (PDDESTRUCT) pulSharedObj; - // siehe "Glenn Puchtel, DDE for OS/2" p.60 - pddes->cbData = (sal_uIntPtr)usDataLen; - pddes->fsStatus = fsStatus; - pddes->usFormat = usFormat; - pddes->offszItemName = sizeof( DDESTRUCT ); - if( (usDataLen) && (pabData != NULL ) ) - pddes->offabData = sizeof(DDESTRUCT) + usItemLen; - else - pddes->offabData = 0; - - if( pItemName != NULL ) - memcpy(DDES_PSZITEMNAME(pddes), pItemName, usItemLen ); - else - *(DDES_PSZITEMNAME(pddes)) = '\0'; - - if( pabData != NULL ) - memcpy( DDES_PABDATA(pddes), pabData, usDataLen ); - } - - if ( pItemName ) - { - MyDosFreeMem( pItemName,"MakeDDEObject" ); - } - return pddes; -} - -// -// AllocNamedSharedMem -// - -APIRET ImpDdeMgr::AllocNamedSharedMem( PPVOID ppBaseAddress, PSZ pName, - sal_uIntPtr nElementSize, sal_uIntPtr nElementCount ) -{ - sal_uIntPtr nObjSize = (sal_uIntPtr)(nElementSize * nElementCount ); - nObjSize += sizeof( sal_uIntPtr ); // fuer ElementCount am Anfang des Blocks - - *ppBaseAddress = 0; - APIRET nRet = MyDosAllocSharedMem( ppBaseAddress, pName, nObjSize, - PAG_READ | PAG_WRITE | PAG_COMMIT | OBJ_ANY, - "AllocNamedSharedMem" ); - if ( !nRet ) - { - memset( *ppBaseAddress, 0, nObjSize ); - sal_uIntPtr* pULONG = (sal_uIntPtr*)*ppBaseAddress; - *pULONG = nObjSize; - } - return nRet; -} - -void ImpDdeMgr::CreateServerWnd() -{ - hWndServer = WinCreateWindow( HWND_DESKTOP, WC_FRAME, "DDEServer", 0, - 0,0,0,0, HWND_DESKTOP, HWND_BOTTOM, 0, 0, 0 ); - WinSetWindowULong( hWndServer, 0, (sal_uIntPtr)this ); - WinSubclassWindow( hWndServer, ::ServerWndProc ); - TID tidDummy; - WinQueryWindowProcess( hWndServer, &pidThis, &tidDummy ); -} - -void ImpDdeMgr::DestroyServerWnd() -{ - WinDestroyWindow( hWndServer ); - hWndServer = NULLHANDLE; -} - -HWND ImpDdeMgr::CreateConversationWnd() -{ - HWND hWnd = WinCreateWindow( HWND_OBJECT, WC_FRAME, "DDEConvWnd", 0, - 0,0,0,0, HWND_DESKTOP, HWND_BOTTOM, 0, 0, 0 ); - if ( hWnd ) - { - ImpConvWndData* pWndData = new ImpConvWndData; - pWndData->pThis = this; - pWndData->nRefCount = 0; - WinSetWindowULong( hWnd, 0, (sal_uIntPtr)pWndData ); - WinSubclassWindow( hWnd, ::ConvWndProc ); -#if 0 && defined( OV_DEBUG ) - String aStr("ConvWnd created:"); - aStr += (sal_uIntPtr)hWnd; - WRITELOG((char*)aStr.GetStr()) -#endif - } - else - nLastErrInstance = DMLERR_SYS_ERROR; - - return hWnd; -} - -// static -void ImpDdeMgr::DestroyConversationWnd( HWND hWnd ) -{ - ImpConvWndData* pObj = (ImpConvWndData*)WinQueryWindowULong( hWnd, 0 ); - if( pObj ) - { - pObj->nRefCount--; - if( pObj->nRefCount == 0 - // auch Windows mit Refcount vonm loeschen, da dieser in initial - // auf 0 gesetzt wird - || pObj->nRefCount == (sal_uInt16)-1 ) - { - delete pObj; - WinDestroyWindow( hWnd ); -#if 0 && defined( OV_DEBUG ) - String aStr("ConvWnd destroyed:"); - aStr += (sal_uIntPtr)hWnd; - WRITELOG((char*)aStr.GetStr()) -#endif - } - else - { -#if 0 && defined( OV_DEBUG ) - String aStr("ConvWnd not destroyed (Refcount="); - aStr += pObj->nRefCount; - aStr += ") "; aStr += (sal_uIntPtr)hWnd; - WRITELOG((char*)aStr.GetStr()) -#endif - } - } -#if defined( OV_DEBUG ) - else - { - WRITELOG("DestroyCnvWnd:Already destroyed/No win data/Partner died") - } -#endif -} - -// static -sal_uInt16 ImpDdeMgr::GetConversationWndRefCount( HWND hWnd ) -{ - ImpConvWndData* pObj = (ImpConvWndData*)WinQueryWindowULong( hWnd, 0 ); - DBG_ASSERT(pObj,"Dde:ConvWnd has no data"); - if( pObj ) - return pObj->nRefCount; - return 0; -} - -// static -sal_uInt16 ImpDdeMgr::IncConversationWndRefCount( HWND hWnd ) -{ -#if 0 && defined( OV_DEBUG ) - String aStr("IncConversationWndRefCount "); - aStr += (sal_uIntPtr)hWnd; - WRITELOG((char*)aStr.GetStr()) -#endif - ImpConvWndData* pObj = (ImpConvWndData*)WinQueryWindowULong( hWnd, 0 ); - DBG_ASSERT(pObj,"Dde:ConvWnd has no data"); - if( pObj ) - { - pObj->nRefCount++; - return pObj->nRefCount; - } - return 0; -} - -ImpDdeMgrData* ImpDdeMgr::InitAll() -{ - ImpDdeMgrData* pBase = 0; - // nur dann neu anlegen, wenn die Tabelle nicht existiert - APIRET nRet=DosGetNamedSharedMem((PPVOID)&pBase,DDEMLDATA,PAG_READ| PAG_WRITE); - if ( nRet ) - { - if ( nRet == 2 ) // ERROR_FILE_NOT_FOUND ) - { - // DDECONVERSATIONCOUNT=4096 - sal_uInt16 nConvTransCount = 128; - PSZ pResult; - nRet = DosScanEnv( "SOMAXDDECONN", (const char**)&pResult ); - if( !nRet ) - { - int nTemp = 0; - nTemp = atoi( pResult ); - nTemp++; // der nullte Eintrag wird nicht benutzt - if( nTemp > 128 ) - nConvTransCount = (sal_uInt16)nTemp; - } - sal_uIntPtr nSize = sizeof(ImpDdeMgrData); - nSize += sizeof(ImpHCONV) * nConvTransCount; - nSize += sizeof(Transaction) * nConvTransCount; - nSize += sizeof(HWND) * DDEMLAPPCOUNT; - - nRet = ImpDdeMgr::AllocNamedSharedMem( (PPVOID)&pBase, - DDEMLDATA, nSize, 1 ); - if ( !nRet ) - { - pBase->nTotalSize = nSize; - sal_uIntPtr nAppTable = (sal_uIntPtr)&(pBase->aAppTable); - sal_uIntPtr nCharBase = (sal_uIntPtr)pBase; - pBase->nOffsAppTable = nAppTable - nCharBase; - pBase->nOffsConvTable = pBase->nOffsAppTable; - pBase->nOffsConvTable += sizeof(HWND) * DDEMLAPPCOUNT; - pBase->nOffsTransTable = pBase->nOffsConvTable; - pBase->nOffsTransTable += sizeof(ImpHCONV) * nConvTransCount; - - pBase->nMaxAppCount = DDEMLAPPCOUNT; - pBase->nMaxConvCount = nConvTransCount; - pBase->nMaxTransCount = nConvTransCount; - } - } - } - - if( pBase ) - { - pConvTable = ImpDdeMgr::GetConvTable( pBase ); - pTransTable = ImpDdeMgr::GetTransTable( pBase ); - pAppTable = ImpDdeMgr::GetAppTable( pBase ); - } - - memset( &aDefaultContext, 0, sizeof(CONVCONTEXT) ); - aDefaultContext.cb = sizeof(CONVCONTEXT); - aDefaultContext.idCountry = 49; // ?? - aDefaultContext.usCodepage = 850; // ?? - - return pBase; -} - -// static -HCONV ImpDdeMgr::CreateConvHandle( ImpDdeMgrData* pData, - PID pidOwner, - HWND hWndMe, HWND hWndPartner, - HSZ hszPartner, HSZ hszServiceReq, HSZ hszTopic, - HCONV hPrevHCONV ) -{ - DBG_ASSERT(pData,"DDE:Invalid data"); - if( !pData ) - return (HCONV)0; - - ImpHCONV* pPtr = ImpDdeMgr::GetConvTable( pData ); - sal_uInt16 nCount = pData->nMaxConvCount; - pPtr++; - nCount--; // ersten Handle (NULLHANDLE) ueberspringen - sal_uInt16 nIdx = 1; - DBG_ASSERT(pPtr,"No ConvTable"); - if( !pPtr ) - return (HCONV)0; - - while( nCount && pPtr->hWndThis != (HWND)NULL ) - { - nCount--; - pPtr++; - nIdx++; - } - if( !nCount ) - return (HCONV)0; - - DdeKeepStringHandle( hszPartner ); - DdeKeepStringHandle( hszServiceReq ); - DdeKeepStringHandle( hszTopic ); - pPtr->hszPartner = hszPartner; - pPtr->hszServiceReq = hszServiceReq; - pPtr->hszTopic = hszTopic; - - pPtr->hWndThis = hWndMe; - pPtr->hWndPartner = hWndPartner; - pPtr->pidOwner = pidOwner; - pPtr->hConvPartner = (HCONV)0; - pPtr->nPrevHCONV = (sal_uInt16)hPrevHCONV; - pPtr->nNextHCONV = 0; - pPtr->nStatus = ST_CONNECTED; - - pData->nCurConvCount++; - - return (HCONV)nIdx; -} - -// static -void ImpDdeMgr::FreeConvHandle( ImpDdeMgrData* pBase, HCONV hConv, - sal_Bool bDestroyHWndThis ) -{ - DBG_ASSERT(pBase,"DDE:No data"); -#if 0 && defined( OV_DEBUG ) - String aStr("FreeConvHandle: Start "); - aStr += (sal_uIntPtr)hConv; - aStr += " Destroy: "; aStr += (sal_uInt16)bDestroyHWndThis; - WRITELOG((char*)aStr.GetStr()); - WRITESTATUS("FreeConvHandle: Start"); -#endif - if( !pBase ) - { - WRITELOG("FreeConvHandle: FAIL"); - return; - } - DBG_ASSERT(hConv&&hConv<pBase->nMaxConvCount,"DDE:Invalid Conv-Handle"); - if( hConv && hConv < pBase->nMaxConvCount ) - { - ImpHCONV* pTable = ImpDdeMgr::GetConvTable( pBase ); - ImpHCONV* pPtr = pTable + (sal_uInt16)hConv; - if( pPtr->nStatus & ST_INLIST ) - { - // Verkettung umsetzen - sal_uInt16 nPrev = pPtr->nPrevHCONV; - sal_uInt16 nNext = pPtr->nNextHCONV; - if( nPrev ) - { - pPtr = pTable + nPrev; - pPtr->nNextHCONV = nNext; - } - if( nNext ) - { - pPtr = pTable + nNext; - pPtr->nPrevHCONV = nPrev; - } - pPtr = pTable + (sal_uInt16)hConv; - } - - DdeFreeStringHandle( pPtr->hszPartner ); - DdeFreeStringHandle( pPtr->hszServiceReq ); - DdeFreeStringHandle( pPtr->hszTopic ); - if( bDestroyHWndThis ) - DestroyConversationWnd( pPtr->hWndThis ); - memset( pPtr, 0, sizeof(ImpHCONV) ); - DBG_ASSERT(pBase->nCurConvCount,"Dde:Invalid Trans. count"); - pBase->nCurConvCount--; - } -#if defined(OV_DEBUG) - else - { - WRITELOG("FreeConvHandle: FAIL"); - } -#endif - //WRITELOG("FreeConvHandle: END"); - //WRITESTATUS("FreeConvHandle: End"); -} - -// static -HCONV ImpDdeMgr::IsConvHandleAvailable( ImpDdeMgrData* pBase ) -{ - DBG_ASSERT(pBase,"DDE:No data"); - if( !pBase ) - return 0; - - ImpHCONV* pPtr = ImpDdeMgr::GetConvTable( pBase ); - sal_uInt16 nCurPos = pBase->nMaxConvCount - 1; - pPtr += nCurPos; // von hinten aufrollen - while( nCurPos >= 1 ) - { - if( pPtr->hWndThis == 0 ) - return sal_True; - pPtr--; - nCurPos--; - } - return sal_False; -} - -// static -HCONV ImpDdeMgr::GetConvHandle( ImpDdeMgrData* pBase, HWND hWndThis, - HWND hWndPartner ) -{ - DBG_ASSERT(pBase,"DDE:No data"); - if( !pBase ) - return 0; - ImpHCONV* pPtr = ImpDdeMgr::GetConvTable( pBase ); - sal_uInt16 nCurPos = 1; - pPtr++; // ersten Handle ueberspringen - sal_uInt16 nCurConvCount = pBase->nCurConvCount; - while( nCurConvCount && nCurPos < pBase->nMaxConvCount ) - { - if( pPtr->hWndThis ) - { - if(pPtr->hWndThis == hWndThis && pPtr->hWndPartner == hWndPartner) - return (HCONV)nCurPos; - nCurConvCount--; - if( !nCurConvCount ) - return (HCONV)0; - } - nCurPos++; - pPtr++; - } - return (HCONV)0; -} - - - -// static -sal_uIntPtr ImpDdeMgr::CreateTransaction( ImpDdeMgrData* pBase, HCONV hOwner, - HSZ hszItem, sal_uInt16 nFormat, sal_uInt16 nTransactionType ) -{ - DBG_ASSERT(pBase,"DDE:No Data"); - DBG_ASSERT(hOwner!=0,"DDE:No Owner"); - - if( pBase && hOwner ) - { - Transaction* pPtr = ImpDdeMgr::GetTransTable( pBase ); - DBG_ASSERT(pPtr->hConvOwner==0,"DDE:Data corrupted"); - sal_uInt16 nId = 1; - pPtr++; - while( nId < pBase->nMaxTransCount ) - { - if( pPtr->hConvOwner == (HCONV)0 ) - { - pPtr->hConvOwner = hOwner; - DdeKeepStringHandle( hszItem ); - pPtr->hszItem = hszItem; - pPtr->nType = nTransactionType; - pPtr->nConvst = XST_CONNECTED; - pPtr->nFormat = nFormat; - pBase->nCurTransCount++; - return (sal_uIntPtr)nId; - } - nId++; - pPtr++; - } - } - return 0; -} - -// static -void ImpDdeMgr::FreeTransaction( ImpDdeMgrData* pBase, sal_uIntPtr nTransId ) -{ - DBG_ASSERT(pBase,"DDE:No Data"); - if( !pBase ) - return; - - DBG_ASSERT(nTransId<pBase->nMaxTransCount,"DDE:Invalid TransactionId"); - if( nTransId >= pBase->nMaxTransCount ) - return; - - Transaction* pPtr = ImpDdeMgr::GetTransTable( pBase ); - pPtr += nTransId; - DBG_ASSERT(pPtr->hConvOwner!=0,"DDE:TransId has no owner"); - if( pPtr->hConvOwner ) - { - //WRITELOG("Freeing transaction"); - DdeFreeStringHandle( pPtr->hszItem ); - memset( pPtr, 0, sizeof(Transaction) ); - DBG_ASSERT(pBase->nCurTransCount,"Dde:Invalid Trans. count"); - pBase->nCurTransCount--; - } -} - -// static -sal_uIntPtr ImpDdeMgr::GetTransaction( ImpDdeMgrData* pBase, - HCONV hOwner, HSZ hszItem, sal_uInt16 nFormat ) -{ - DBG_ASSERT(pBase,"DDE:No Data"); - if( !pBase || !hOwner ) - return 0; - - Transaction* pTrans = ImpDdeMgr::GetTransTable( pBase ); - DBG_ASSERT(pTrans,"DDE:No TransactionTable"); - if( !pTrans ) - return 0; - pTrans++; // NULLHANDLE ueberspringen - - ImpHCONV* pConv = ImpDdeMgr::GetConvTable( pBase ); - pConv += (sal_uInt16)hOwner; - HCONV hConvPartner = pConv->hConvPartner; - - sal_uInt16 nCurTransCount = pBase->nCurTransCount; - for( sal_uInt16 nTrans=1; nTrans< pBase->nMaxTransCount; nTrans++, pTrans++ ) - { - if( pTrans->hConvOwner ) - { - if(( pTrans->hConvOwner == hOwner || - pTrans->hConvOwner == hConvPartner) && - pTrans->nFormat == nFormat && - pTrans->hszItem == hszItem ) - { - // gefunden! - return (sal_uIntPtr)nTrans; - } - nCurTransCount--; - if( !nCurTransCount ) - return 0; - } - } - return 0; // narda -} - -// static -HSZ ImpDdeMgr::DdeCreateStringHandle( PSZ pszString, int iCodePage) -{ - if( !pszString || *pszString == '\0' ) - return (HSZ)0; - // Atom-Table beachtet Gross/Kleinschreibung, DDEML aber nicht - - // OV 12.4.96: Services,Topics,Items case-sensitiv!!! - // (Grosskundenanforderung (Reuter-DDE)) - //strlwr( pszString ); - //*pszString = (char)toupper(*pszString); - - HATOMTBL hAtomTable = WinQuerySystemAtomTable(); - ATOM aAtom = WinAddAtom( hAtomTable, pszString ); - return (HSZ)aAtom; -} - -// static -sal_uIntPtr ImpDdeMgr::DdeQueryString( HSZ hszStr, PSZ pszStr, sal_uIntPtr cchMax, int iCodePage) -{ - HATOMTBL hAtomTable = WinQuerySystemAtomTable(); - if ( !pszStr ) - return WinQueryAtomLength( hAtomTable, (ATOM)hszStr); - else - { - *pszStr = 0; - return WinQueryAtomName( hAtomTable, (ATOM)hszStr, pszStr, cchMax ); - } -} - -// static -sal_Bool ImpDdeMgr::DdeFreeStringHandle( HSZ hsz ) -{ - if( !hsz ) - return sal_False; - ATOM aResult = WinDeleteAtom( WinQuerySystemAtomTable(),(ATOM)hsz ); - return (sal_Bool)(aResult==0); -} - -// static -sal_Bool ImpDdeMgr::DdeKeepStringHandle( HSZ hsz ) -{ - if( !hsz ) - return sal_True; - HATOMTBL hAtomTable = WinQuerySystemAtomTable(); -#ifdef DBG_UTIL - sal_uIntPtr nUsageCount=WinQueryAtomUsage(hAtomTable,(ATOM)hsz); -#endif - sal_uIntPtr nAtom = 0xFFFF0000; - sal_uIntPtr nPar = (sal_uIntPtr)hsz; - nAtom |= nPar; - ATOM aAtom = WinAddAtom( hAtomTable, (PSZ)nAtom ); -#ifdef DBG_UTIL - if ( aAtom ) - DBG_ASSERT(WinQueryAtomUsage(hAtomTable,(ATOM)hsz)==nUsageCount+1,"Keep failed"); -#endif - return (sal_Bool)(aAtom!=0); -} - - -// static -int ImpDdeMgr::DdeCmpStringHandles(HSZ hsz1, HSZ hsz2) -{ - if ( hsz1 == hsz2 ) - return 0; - if ( hsz1 < hsz2 ) - return -1; - return 1; -} - -HDDEDATA ImpDdeMgr::DdeCreateDataHandle( void* pSrc, sal_uIntPtr cb, - sal_uIntPtr cbOff, HSZ hszItem, sal_uInt16 wFmt, sal_uInt16 afCmd) -{ - char* pData = (char*)pSrc; - pData += cbOff; - sal_uInt16 nStatus; - if( afCmd & HDATA_APPOWNED ) - nStatus = IMP_HDATAAPPOWNED; - else - nStatus = 0; - PDDESTRUCT hData=MakeDDEObject(0,(ATOM)hszItem,nStatus,wFmt,pData,cb); -// WRITEDATA(hData) - if ( !hData ) - ImpDdeMgr::nLastErrInstance = DMLERR_INVALIDPARAMETER; - return (HDDEDATA)hData; -} - -// static -sal_uInt8* ImpDdeMgr::DdeAccessData(HDDEDATA hData, sal_uIntPtr* pcbDataSize) -{ - sal_uInt8* pRet = 0; - *pcbDataSize = 0; - if ( hData ) - { - pRet = (sal_uInt8*)hData; - pRet += hData->offabData; - sal_uIntPtr nLen = hData->cbData; - // nLen -= hData->offabData; - *pcbDataSize = nLen; - } - else - ImpDdeMgr::nLastErrInstance = DMLERR_INVALIDPARAMETER; - return pRet; -} - -// static -sal_Bool ImpDdeMgr::DdeUnaccessData(HDDEDATA hData) -{ - return sal_True; // nothing to do for us -} - -// static -sal_Bool ImpDdeMgr::DdeFreeDataHandle(HDDEDATA hData) -{ - DdeUnaccessData( hData ); - MyDosFreeMem( (PSZ)hData, "DdeFreeDataHandle" ); - return sal_True; -} - -// static -HDDEDATA ImpDdeMgr::DdeAddData(HDDEDATA hData,void* pSrc,sal_uIntPtr cb,sal_uIntPtr cbOff) -{ - return (HDDEDATA)0; -} - -// static -sal_uIntPtr ImpDdeMgr::DdeGetData(HDDEDATA hData,void* pDst,sal_uIntPtr cbMax,sal_uIntPtr cbOff) -{ - return 0; -} - -sal_Bool ImpDdeMgr::DisconnectAll() -{ - //WRITESTATUS("Before DisconnectAll()") - sal_uInt16 nCurConvCount = pData->nCurConvCount; - if( !nCurConvCount ) - return sal_True; - - sal_Bool bRet = sal_True; - ImpHCONV* pPtr = pConvTable; - pPtr++; - - for( sal_uInt16 nPos=1; nPos < pData->nMaxConvCount; nPos++, pPtr++ ) - { - if( pPtr->hWndThis ) - { - if( !DdeDisconnect( (HCONV)nPos ) ) - bRet = sal_False; - nCurConvCount--; - if( !nCurConvCount ) - break; - } - } - //WRITESTATUS("After DisconnectAll()") - return bRet; -} - -// static -void ImpDdeMgr::FreeTransactions( ImpDdeMgrData* pData,HWND hWndThis, - HWND hWndPartner ) -{ - sal_uInt16 nCurTransCount = pData->nCurTransCount; - if( !nCurTransCount ) - return; - - Transaction* pTrans = GetTransTable( pData ); - ImpHCONV* pConvTable = GetConvTable( pData ); - pTrans++; - for( sal_uInt16 nPos=1; nPos < pData->nMaxTransCount; nPos++, pTrans++ ) - { - if( pTrans->hConvOwner ) - { - ImpHCONV* pConv = pConvTable + (sal_uInt16)(pTrans->hConvOwner); - if((pConv->hWndThis==hWndThis&& pConv->hWndPartner==hWndPartner)|| - (pConv->hWndThis==hWndPartner && pConv->hWndPartner==hWndThis)) - { - FreeTransaction( pData, (sal_uIntPtr)nPos ); - } - nCurTransCount--; - if( !nCurTransCount ) - return; - } - } -} - -// static -void ImpDdeMgr::FreeTransactions( ImpDdeMgrData* pData, HCONV hConvOwner ) -{ - sal_uInt16 nCurTransCount = pData->nCurTransCount; - if( !nCurTransCount ) - return; - - Transaction* pTrans = GetTransTable( pData ); -// ImpHCONV* pConvTable = GetConvTable( pData ); - pTrans++; - for( sal_uInt16 nPos=1; nPos < pData->nMaxTransCount; nPos++, pTrans++ ) - { - if( pTrans->hConvOwner == hConvOwner ) - { - FreeTransaction( pData, (sal_uIntPtr)nPos ); - nCurTransCount--; - if( !nCurTransCount ) - return; - } - } -} - -// static -void ImpDdeMgr::FreeConversations( ImpDdeMgrData* pData, HWND hWndThis, - HWND hWndPartner ) -{ - sal_uInt16 nCurCount = pData->nCurConvCount; - if( !nCurCount ) - return; - - ImpHCONV* pPtr = GetConvTable( pData ); - pPtr++; - for( sal_uInt16 nPos=1; nPos < pData->nMaxConvCount; nPos++, pPtr++ ) - { - if( pPtr->hWndThis ) - { - if( hWndThis && pPtr->hWndPartner==hWndPartner ) - FreeConvHandle( pData, (HCONV)nPos ); - nCurCount--; - if( !nCurCount ) - return; - } - } -} - - -sal_Bool ImpDdeMgr::OwnsConversationHandles() -{ - //WRITESTATUS("OwnsConversationHandles()"); -#if 0 && defined( OV_DEBUG ) - String aStr("OwnsConversationHandles Server:"); - aStr += (sal_uIntPtr)hWndServer; - WRITELOG((char*)aStr.GetStr()) -#endif - ImpHCONV* pPtr = GetConvTable( pData ); - for( sal_uInt16 nCur = 1; nCur < pData->nMaxConvCount; nCur++, pPtr++ ) - { - if( pPtr->hWndThis && pPtr->pidOwner == pidThis ) - { - //WRITELOG("OwnsConversationHandles: sal_True"); - return sal_True; - } - } - // WRITELOG("OwnsConversationHandles: sal_False"); - return sal_False; -} - - - -// ********************************************************************* -// ********************************************************************* -// ********************************************************************* - -sal_uInt16 DdeInitialize(sal_uIntPtr* pidInst, PFNCALLBACK pfnCallback, - sal_uIntPtr afCmd, sal_uIntPtr ulRes) -{ - if( (*pidInst)!=0 ) - { - // Reinitialize wird noch nicht unterstuetzt - DBG_ASSERT(0,"DDEML:Reinitialize not supported"); - return DMLERR_INVALIDPARAMETER; - } - - ImpDdeMgr* pMgr = new ImpDdeMgr; - *pidInst = (sal_uIntPtr)pMgr; - return pMgr->DdeInitialize( pfnCallback, afCmd ); -} - -sal_Bool DdeUninitialize(sal_uIntPtr idInst) -{ - if( !idInst ) - return sal_False; - ImpDdeMgr* pMgr = (ImpDdeMgr*)idInst; - // nur loeschen, wenn wir nicht mehr benutzt werden! - if( !pMgr->OwnsConversationHandles() ) - { - WRITELOG("DdeUninitialize: sal_True"); - delete pMgr; - return sal_True; - } - WRITELOG("DdeUninitialize: sal_False"); - return sal_False; -} - - -HCONVLIST DdeConnectList(sal_uIntPtr idInst, HSZ hszService, HSZ hszTopic, - HCONVLIST hConvList, CONVCONTEXT* pCC) -{ - if( !idInst ) - return 0; - return ((ImpDdeMgr*)idInst)->DdeConnectList(hszService,hszTopic, - hConvList, pCC ); -} - -HCONV DdeQueryNextServer(HCONVLIST hConvList, HCONV hConvPrev) -{ - return ImpDdeMgr::DdeQueryNextServer( hConvList, hConvPrev ); -} - -sal_Bool DdeDisconnectList(HCONVLIST hConvList) -{ - return ImpDdeMgr::DdeDisconnectList( hConvList ); -} - -HCONV DdeConnect(sal_uIntPtr idInst, HSZ hszService, HSZ hszTopic, - CONVCONTEXT* pCC) -{ - if( !idInst ) - return 0; - return ((ImpDdeMgr*)idInst)->DdeConnect( hszService, hszTopic, pCC ); -} - -sal_Bool DdeDisconnect(HCONV hConv) -{ - return ImpDdeMgr::DdeDisconnect( hConv ); -} - -HCONV DdeReconnect(HCONV hConv) -{ - return ImpDdeMgr::DdeReconnect( hConv ); -} - - -sal_uInt16 DdeQueryConvInfo(HCONV hConv, sal_uIntPtr idTransact, CONVINFO* pCI ) -{ - return ImpDdeMgr::DdeQueryConvInfo( hConv, idTransact, pCI ); -} - -sal_Bool DdeSetUserHandle(HCONV hConv, sal_uIntPtr id, sal_uIntPtr hUser) -{ - return ImpDdeMgr::DdeSetUserHandle( hConv, id, hUser ); -} - -sal_Bool DdeAbandonTransaction(sal_uIntPtr idInst, HCONV hConv, sal_uIntPtr idTransaction) -{ - if( !idInst ) - return sal_False; - return ((ImpDdeMgr*)idInst)->DdeAbandonTransaction(hConv,idTransaction); -} - -sal_Bool DdePostAdvise(sal_uIntPtr idInst, HSZ hszTopic, HSZ hszItem) -{ - if( !idInst ) - return sal_False; - return ((ImpDdeMgr*)idInst)->DdePostAdvise( hszTopic, hszItem ); -} - -sal_Bool DdeEnableCallback(sal_uIntPtr idInst, HCONV hConv, sal_uInt16 wCmd) -{ - if( !idInst ) - return sal_False; - return ((ImpDdeMgr*)idInst)->DdeEnableCallback( hConv, wCmd ); -} - -HDDEDATA DdeClientTransaction(void* pData, sal_uIntPtr cbData, - HCONV hConv, HSZ hszItem, sal_uInt16 wFmt, sal_uInt16 wType, - sal_uIntPtr dwTimeout, sal_uIntPtr* pdwResult) -{ - return ImpDdeMgr::DdeClientTransaction( pData, cbData, - hConv, hszItem, wFmt, wType, dwTimeout, pdwResult ); -} - -HDDEDATA DdeCreateDataHandle(sal_uIntPtr idInst, void* pSrc, sal_uIntPtr cb, - sal_uIntPtr cbOff, HSZ hszItem, sal_uInt16 wFmt, sal_uInt16 afCmd) -{ - if( !idInst ) - return 0; - return ((ImpDdeMgr*)idInst)->DdeCreateDataHandle( pSrc, cb, - cbOff, hszItem, wFmt, afCmd ); -} - -HDDEDATA DdeAddData(HDDEDATA hData, void* pSrc, sal_uIntPtr cb, sal_uIntPtr cbOff) -{ - return ImpDdeMgr::DdeAddData( hData, pSrc, cb, cbOff ); -} - -sal_uIntPtr DdeGetData(HDDEDATA hData, void* pDst, sal_uIntPtr cbMax, sal_uIntPtr cbOff) -{ - return ImpDdeMgr::DdeGetData( hData, pDst, cbMax, cbOff ); -} - -sal_uInt8* DdeAccessData(HDDEDATA hData, sal_uIntPtr* pcbDataSize) -{ - return ImpDdeMgr::DdeAccessData( hData, pcbDataSize ); -} - -sal_Bool DdeUnaccessData(HDDEDATA hData) -{ - return ImpDdeMgr::DdeUnaccessData( hData ); -} - -sal_Bool DdeFreeDataHandle(HDDEDATA hData) -{ - return ImpDdeMgr::DdeFreeDataHandle( hData ); -} - -sal_uInt16 DdeGetLastError(sal_uIntPtr idInst) -{ - if( !idInst ) - return DMLERR_DLL_NOT_INITIALIZED; - return ((ImpDdeMgr*)idInst)->DdeGetLastError(); -} - -HSZ DdeCreateStringHandle(sal_uIntPtr idInst, PSZ pszString,int iCodePage ) -{ - if( !idInst ) - return 0; - return ((ImpDdeMgr*)idInst)->DdeCreateStringHandle(pszString,iCodePage); -} - -sal_uIntPtr DdeQueryString( sal_uIntPtr idInst, HSZ hsz, PSZ pBuf, - sal_uIntPtr cchMax, int iCodePage ) -{ - if( !idInst ) - return 0; - return ((ImpDdeMgr*)idInst)->DdeQueryString( hsz,pBuf,cchMax,iCodePage); -} - -sal_Bool DdeFreeStringHandle( sal_uIntPtr idInst, HSZ hsz) -{ - if( !idInst ) - return sal_False; - return ((ImpDdeMgr*)idInst)->DdeFreeStringHandle( hsz ); -} - -sal_Bool DdeKeepStringHandle( sal_uIntPtr idInst, HSZ hsz ) -{ - if( !idInst ) - return sal_False; - return ((ImpDdeMgr*)idInst)->DdeKeepStringHandle( hsz ); -} - -int DdeCmpStringHandles(HSZ hsz1, HSZ hsz2) -{ - return ImpDdeMgr::DdeCmpStringHandles( hsz1, hsz2 ); -} - -HDDEDATA DdeNameService( sal_uIntPtr idInst, HSZ hsz1, HSZ hszRes, sal_uInt16 afCmd ) -{ - if( !idInst ) - return 0; - return ((ImpDdeMgr*)idInst)->DdeNameService( hsz1, afCmd ); -} - - diff --git a/svl/source/svdde/ddemldeb.cxx b/svl/source/svdde/ddemldeb.cxx deleted file mode 100644 index 84b9ca555546..000000000000 --- a/svl/source/svdde/ddemldeb.cxx +++ /dev/null @@ -1,280 +0,0 @@ -/************************************************************************* - * - * 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" - -#include "ddemlimp.hxx" - -#ifdef OV_DEBUG -#include <svgen.hxx> -#endif - -#if defined(OV_DEBUG) - -void ImpAddHSZ( HSZ hszString, String& rStr ) -{ - char aBuf[ 128 ]; - ImpDdeMgr::DdeQueryString( hszString,aBuf,sizeof(aBuf),850); - rStr += " (\""; rStr += aBuf; rStr += "\","; - HATOMTBL hAtomTable = WinQuerySystemAtomTable(); - sal_uIntPtr nRefCount = 0; - if( hszString ) - nRefCount = WinQueryAtomUsage(hAtomTable, (ATOM)hszString ); - rStr += nRefCount; rStr += ')'; -} - - -void ImpWriteDdeStatus(char* aFilename, char* pAppContext) -{ - char aBuf[ 128 ]; - sal_uInt16 nCtr; - HWND* pAppPtr; - ImpHCONV* pConvPtr; - Transaction* pTransPtr; - - ImpDdeMgrData* pData = ImpDdeMgr::AccessMgrData(); - if( !pData ) - return; - SvFileStream aStrm(aFilename, STREAM_READWRITE ); - String aLine; - aStrm.Seek( STREAM_SEEK_TO_END ); - aStrm << endl; - aStrm.WriteLine("********************** DDEML-Log ***********************"); - aStrm << endl; - if( pAppContext ) - { - aLine = Application::GetAppName(); - aLine += ':'; - aLine += "App-Context:"; aLine += pAppContext; - aStrm.WriteLine( aLine ); aStrm << endl; - } - aStrm.WriteLine("----------------- ImpDdeMgrData -------------------"); - aStrm << endl; - aLine= "TotalSize :"; aLine+= pData->nTotalSize; aStrm.WriteLine(aLine); - aLine= "nOffsAppTable :"; aLine+= pData->nOffsAppTable; aStrm.WriteLine(aLine); - aLine= "nOffsConvTable :"; aLine+= pData->nOffsConvTable; aStrm.WriteLine(aLine); - aLine= "nOffsTransTable:"; aLine+= pData->nOffsTransTable; aStrm.WriteLine(aLine); - aLine= "nMaxAppCount :"; aLine+= pData->nMaxAppCount; aStrm.WriteLine(aLine); - aLine= "nMaxConvCount :"; aLine+= pData->nMaxConvCount; aStrm.WriteLine(aLine); - aLine= "nMaxTransCount :"; aLine+= pData->nMaxTransCount; aStrm.WriteLine(aLine); - aLine= "nLastErr :"; aLine+= pData->nLastErr; aStrm.WriteLine(aLine); - aLine= "nCurConvCount :"; aLine+= pData->nCurConvCount; aStrm.WriteLine(aLine); - aLine= "nCurTransCount :"; aLine+= pData->nCurTransCount; aStrm.WriteLine(aLine); - aStrm << endl; - aStrm.WriteLine("---------- Registered DDEML-Applications -----------"); - aStrm << endl; - pAppPtr = ImpDdeMgr::GetAppTable( pData ); - for( nCtr = 0; nCtr < pData->nMaxAppCount; nCtr++, pAppPtr++ ) - { - if( *pAppPtr ) - { - aLine = "App."; aLine += nCtr; aLine += " HWND:"; - aLine += (sal_uIntPtr)*pAppPtr; aStrm.WriteLine(aLine); - } - } - - aStrm << endl; - aStrm.WriteLine("-------------- Conversation handles ----------------"); - aStrm << endl; - - sal_uInt16 nCurCount = pData->nCurConvCount; - - if( nCurCount ) - { - pConvPtr = ImpDdeMgr::GetConvTable( pData ); - for( nCtr = 0; nCtr < pData->nMaxConvCount; nCtr++, pConvPtr++ ) - { - if( pConvPtr->hWndThis ) - { - aLine = "HCONV:"; aLine += nCtr; - aLine += " HCONVpartner: "; aLine += (sal_uInt16)pConvPtr->hConvPartner; - if( !pConvPtr->hConvPartner ) aLine += "(Non-DDEML-App)"; - aLine += " hszPartner: "; aLine += (sal_uInt16)pConvPtr->hszPartner; - ImpAddHSZ( pConvPtr->hszPartner, aLine ); - aStrm.WriteLine( aLine ); - - aLine = "hszService: "; aLine += (sal_uInt16)pConvPtr->hszServiceReq; - ImpAddHSZ( pConvPtr->hszServiceReq, aLine ); - aLine += " hszTopic: "; aLine += (sal_uInt16)pConvPtr->hszTopic; - ImpAddHSZ( pConvPtr->hszTopic, aLine ); - aStrm.WriteLine( aLine ); - - aLine= "Status: "; aLine+= pConvPtr->nStatus; - if( pConvPtr->nStatus & ST_CLIENT ) aLine += " (Client)"; - if( pConvPtr->nStatus & ST_INLIST ) aLine += " (Inlist)"; - aStrm.WriteLine(aLine); - - aLine = "pidOwner: "; aLine += (sal_uIntPtr)pConvPtr->pidOwner; - aStrm.WriteLine( aLine ); - aLine = "hWndThis: "; aLine += (sal_uIntPtr)pConvPtr->hWndThis; - aStrm.WriteLine( aLine ); - aLine = "hWndPartner: "; aLine += (sal_uIntPtr)pConvPtr->hWndPartner; - aStrm.WriteLine( aLine ); - - aLine = "hConvList: "; aLine += (sal_uIntPtr)pConvPtr->hConvList; - aLine += " Prev: "; aLine += pConvPtr->nPrevHCONV; - aLine += " Next: "; aLine += pConvPtr->nNextHCONV; - aStrm.WriteLine( aLine ); - aStrm.WriteLine("----------------------------------------------------"); - - nCurCount--; - if( !nCurCount ) - break; - } - } - } - - aStrm.WriteLine("----------------- Transaction Ids ------------------"); - - nCurCount = pData->nCurTransCount; - if( nCurCount ) - { - pTransPtr = ImpDdeMgr::GetTransTable( pData ); - for( nCtr = 0; nCtr < pData->nMaxTransCount; nCtr++, pTransPtr++ ) - { - - if( pTransPtr->hConvOwner ) - { - aLine = "TransactionId:"; aLine += nCtr; - aLine += " hConvOwner: "; aLine += (sal_uInt16)pTransPtr->hConvOwner; - aStrm.WriteLine( aLine ); - aLine = "Item: "; aLine += (sal_uInt16)pTransPtr->hszItem; - ImpAddHSZ( pTransPtr->hszItem, aLine ); - aLine += " Format: "; aLine += pTransPtr->nFormat; - aStrm.WriteLine( aLine ); - aLine = "TransactionType: "; aLine += pTransPtr->nType; - aLine += " Convst: "; aLine += pTransPtr->nConvst; - aLine += " LastErr: "; aLine += pTransPtr->nLastError; - aLine += " Userhandle: "; aLine += pTransPtr->nUser; - aStrm.WriteLine( aLine ); - aStrm.WriteLine("--------------------------------------------------"); - - nCurCount--; - if( !nCurCount ) - break; - } - } - } - aStrm << endl; - aStrm.WriteLine("******************* End of DDEML-Log *******************"); -} - -void ImpWriteDdeData(char* aFilename, DDESTRUCT* pData) -{ - char aBuf[ 128 ]; - sal_uInt16 nCtr; - SvFileStream aStrm(aFilename, STREAM_READWRITE ); - aStrm.Seek( STREAM_SEEK_TO_END ); - String aLine; - aStrm << endl; - aLine = "cbData:"; aLine += pData->cbData; aStrm.WriteLine( aLine ); - aLine = "fsStatus:"; aLine += pData->fsStatus; aStrm.WriteLine( aLine ); - aLine = "usFormat:"; aLine += pData->usFormat; aStrm.WriteLine( aLine ); - aLine = "ItemName:"; aLine += (char*)((char*)pData+pData->offszItemName); - aStrm.WriteLine( aLine ); - aLine = "offabData:"; aLine += pData->offabData; aStrm.WriteLine(aLine); - char* pBuf = (char*)pData+pData->offabData; - sal_uInt16 nLen = pData->cbData; // - pData->offabData; - while( nLen ) - { - aStrm << *pBuf; - nLen--; - pBuf++; - } - aStrm << endl; -} - -void ImpWriteLogFile(char* pFilename, char* pStr) -{ - SvFileStream aStrm(pFilename, STREAM_READWRITE ); - aStrm.Seek( STREAM_SEEK_TO_END ); - String aStr( Application::GetAppName() ); - aStr += ':'; aStr += pStr; - aStrm.WriteLine( (char*)aStr.GetStr() ); -} - -#else - -void ImpWriteDdeStatus(char*, char* ) {} -void ImpWriteDdeData(char*, DDESTRUCT*) {} -void ImpWriteLogFile(char*, char*) {} - -#endif - -APIRET MyDosAllocSharedMem(void** ppBaseAddress, char* pszName, unsigned long ulObjectSize, - unsigned long ulFlags, char* pContextStr ) -{ - APIRET nRet = DosAllocSharedMem(ppBaseAddress,pszName,ulObjectSize,ulFlags ); -#if 0 && defined(OV_DEBUG) && defined(LOGFILE) - String aStr("DosAllocSharedMem:"); - aStr += pContextStr; - aStr += ": "; - aStr += ulObjectSize; - aStr += " ("; - aStr += (sal_uIntPtr)*((char**)ppBaseAddress); - aStr += ')'; - ImpWriteLogFile("\\ddeml.mem", (char*)aStr.GetStr() ); -#endif - return nRet; -} - -APIRET MyDosAllocMem(void** ppBaseAddress, unsigned long ulObjectSize, - unsigned long ulFlags, char* pContextStr ) -{ - APIRET nRet = DosAllocMem(ppBaseAddress, ulObjectSize,ulFlags ); -#if 0 && defined(OV_DEBUG) && defined(LOGFILE) - String aStr("DosAllocMem:"); - aStr += pContextStr; - aStr += ": "; - aStr += ulObjectSize; - aStr += " ("; - aStr += (sal_uIntPtr)*((char**)ppBaseAddress); - aStr += ')'; - ImpWriteLogFile("\\ddeml.mem", (char*)aStr.GetStr() ); -#endif - return nRet; -} - - -APIRET MyDosFreeMem( void* pBaseAddress, char* pContextStr ) -{ - APIRET nRet = DosFreeMem( pBaseAddress ); -#if 0 && defined(OV_DEBUG) && defined(LOGFILE) - String aStr("DosFreeMem:"); - aStr += pContextStr; - aStr += ": "; - aStr += (sal_uIntPtr)pBaseAddress; - ImpWriteLogFile("\\ddeml.mem", (char*)aStr.GetStr()); -#endif - return nRet; -} - - - - - diff --git a/svl/source/svdde/ddemldeb.hxx b/svl/source/svdde/ddemldeb.hxx deleted file mode 100644 index 8654bbd3ca65..000000000000 --- a/svl/source/svdde/ddemldeb.hxx +++ /dev/null @@ -1,66 +0,0 @@ -/************************************************************************* - * - * 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. - * - ************************************************************************/ - -#if defined(OV_DEBUG) - -void ImpWriteLogFile(char*,char*); -void ImpAddHSZ( HSZ, String& ); -void ImpWriteDdeStatus(char*, char* ); -void ImpWriteDdeData(char*, DDESTRUCT*); - -#ifdef LOGFILE -#define WRITELOG(aString) ImpWriteLogFile("\\ddeml.log",aString); -#else -#define WRITELOG(bla) -#endif -#ifdef STATUSFILE -#define WRITESTATUS(aContext) ImpWriteDdeStatus("\\ddeml.sts",aContext); -#else -#define WRITESTATUS(bla) -#endif -#ifdef DDEDATAFILE -#define WRITEDATA(data) ImpWriteDdeData("\\ddeml.dat",data); -#else -#define WRITEDATA(bla) -#endif - -#else - -#define WRITELOG(bla) -#define WRITESTATUS(bla) -#define WRITEDATA(bla) - -#endif - -APIRET MyDosAllocSharedMem(void** ppBaseAddress, char* pszName, unsigned long ulObjectSize, - unsigned long ulFlags, char* pContextStr ); - -APIRET MyDosAllocMem(void** ppBaseAddress, unsigned long ulObjectSize, - unsigned long ulFlags, char* pContextStr ); - -APIRET MyDosFreeMem( void* pBaseAddress, char* pContextStr ); - diff --git a/svl/source/svdde/ddemlimp.hxx b/svl/source/svdde/ddemlimp.hxx deleted file mode 100644 index a145bc489f0f..000000000000 --- a/svl/source/svdde/ddemlimp.hxx +++ /dev/null @@ -1,433 +0,0 @@ -/************************************************************************* - * - * 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. - * - ************************************************************************/ - -#ifndef _DDEMLIMP_HXX -#define _DDEMLIMP_HXX - - -#include <string.h> -#include <ctype.h> -#include "ddemlos2.h" - -#define DDEMLSERVICETABLE_INISIZE 8 - -// Bezeichner der systemglobalen DDEML-Tabelle -#define DDEMLDATA "\\SHAREMEM\\OV_DDEML.DAT" - -// vorlaeufig konstante Tabellengroessen -#define CONVTABLECOUNT 2048 /* max count conversations */ -#define TRANSTABLECOUNT 2048 /* transactions */ -#define DDEMLAPPCOUNT 16 /* max count simultaniously running */ - /* ddeml (StarDivision) applications */ - -#define ST_TERMACKREC 0x8000 /* wird im Conversationhandle gesetzt, */ - /* wenn die Partner-App DDE_TERMINATE */ - /* bestaetigt hat */ - -#define XST_TIMEOUT 17 /* Trans. hat Timeout ueberschritten */ -#define XST_WAITING_ACK 18 /* Trans. wartet auf Acknowledge */ -#define XST_WAITING_ADVDATA 19 /* Trans. wartet auf Advise-Daten */ -#define XST_WAITING_REQDATA 20 /* Trans. wartet auf angeforderte Daten */ - - -/* User-Flags DDESTRUCT */ -#define IMP_HDATAAPPOWNED 0x8000 - -#define CONVLISTNAME "DdeConvListId" - -#define XTYPF_MASK (XTYPF_NOBLOCK | XTYPF_NODATA | XTYPF_ACKREQ) - -// -// DDEML-Messages; werden nur an registrierte DDEML-Apps gesendet -// - -// Msg: WM_DDEML_REGISTER -// Empfaenger: wird allen DDEML-Applikationen nach Registrierung -// eines neuen Services gesendet -// Params: nPar1: hszBaseServName -// nPar2: hszInstServName -#define WM_DDEML_REGISTER WM_USER+1 - -// Msg: WM_DDEML_UNREGISTER -// Empfaenger: wird allen DDEML-Applikationen nach Deregistrierung -// eines Services gesendet -// Params: nPar1: hszBaseServName -// nPar2: hszInstServName -#define WM_DDEML_UNREGISTER WM_USER+2 - -// -// -// - -struct ImpHCONV -{ - HCONV hConvPartner; - HSZ hszPartner; // Name of partner application - HSZ hszServiceReq; // Service name - HSZ hszTopic; // Topic name - sal_uInt16 nStatus; // ST_* of conversation - HCONVLIST hConvList; // ConvListId , wenn in ConvList - CONVCONTEXT aConvContext; // Conversation context - - // private - HWND hWndThis; // 0 == Handle not used - HWND hWndPartner; - PID pidOwner; // PID des DdeManagers, der - // den Conv-Handle erzeugt hat. - sal_uInt16 nPrevHCONV; // 0 == no previous hConv or not in list - sal_uInt16 nNextHCONV; // 0 == no next hconv or not in list -}; - -struct Transaction -{ - HSZ hszItem; // Item name - sal_uInt16 nFormat; // Data format - sal_uInt16 nType; // Transaction type (XTYP_*) - // XTYP_ADVREQ [|XTYPF_NODATA] == Advise-Loop - // [|XTYPF_ACKREQ] - // XTYP_EXECUTE == laufendes Execute - // XTYP_REQUEST - // XTYP_POKE - // XTYP_ADVSTOP - // XTYP_ADVSTART - sal_uInt16 nConvst; // Conversation state (XST_*) - // 0 == idle - // XST_REQSENT (fuer XTYP_ADVREQ) - // XST_TIMEOUT (fuer alle Typen!) - // XST_WAITING (alle ausser XTYP_ADVREQ) - sal_uInt16 nLastError; // last err in transaction - sal_uIntPtr nUser; // Userhandle - // private - HCONV hConvOwner; // 0 == Transaction not used -}; - - -struct ImpWndProcParams -{ - HWND hWndReceiver; - MPARAM nPar1; - MPARAM nPar2; -}; - -struct ImpService -{ - HSZ hBaseServName; // Basis-Name des Service - HSZ hInstServName; // Basis-Name + DDEML-Server-HWND der App -}; - -class ImpDdeMgr; - -// Daten eines Conversation-Windows -struct ImpConvWndData -{ - ImpDdeMgr* pThis; - sal_uInt16 nRefCount; // Zahl Conversations auf diesem Window -}; - - -// systemglobale Daten der Library (liegen in named shared memory) -struct ImpDdeMgrData -{ - sal_uIntPtr nTotalSize; - sal_uIntPtr nOffsAppTable; - sal_uIntPtr nOffsConvTable; - sal_uIntPtr nOffsTransTable; - sal_uInt16 nMaxAppCount; - sal_uInt16 nMaxConvCount; - sal_uInt16 nMaxTransCount; - sal_uInt16 nLastErr; - sal_uInt16 nReserved; - sal_uInt16 nCurTransCount; - sal_uInt16 nCurConvCount; - HWND aAppTable[ 1 ]; // fuer Broadcast-Messages - ImpHCONV aConvTable[ 1 ]; - Transaction aTransTable[ 1 ]; -}; - - - -class ImpDdeMgr -{ - friend MRESULT EXPENTRY ConvWndProc(HWND hWnd,sal_uIntPtr nMsg,MPARAM nPar1,MPARAM nPar2); - friend MRESULT EXPENTRY ServerWndProc(HWND hWnd,sal_uIntPtr nMsg,MPARAM nPar1,MPARAM nPar2); - friend void ImpWriteDdeStatus(char*,char*); - friend void ImpAddHSZ( HSZ, String& ); - - static PSZ AllocAtomName( ATOM hString, sal_uIntPtr& rBufLen ); - static PDDESTRUCT MakeDDEObject( HWND hwnd, ATOM hItemName, - sal_uInt16 fsStatus, sal_uInt16 usFormat, PVOID pabData, sal_uIntPtr usDataLen ); - static APIRET AllocNamedSharedMem( PPVOID ppBaseAddress, PSZ pName, - sal_uIntPtr nElementSize, sal_uIntPtr nElementCount ); - - HWND hWndServer; - PID pidThis; - PFNCALLBACK pCallback; - sal_uIntPtr nTransactFilter; - CONVCONTEXT aDefaultContext; - ImpDdeMgrData* pData; - ImpService* pServices; - sal_uInt16 nServiceCount; - - ImpHCONV* pConvTable; // liegt in pData (nicht deleten!) - Transaction* pTransTable; // liegt in pData (nicht deleten!) - HWND* pAppTable; // liegt in pData (nicht deleten!) - - static ImpHCONV* GetConvTable( ImpDdeMgrData* ); - static Transaction* GetTransTable( ImpDdeMgrData* ); - static HWND* GetAppTable( ImpDdeMgrData* ); - - - static HWND NextFrameWin( HENUM hEnum ); - void CreateServerWnd(); - void DestroyServerWnd(); - HWND CreateConversationWnd(); - // Fktn. duerfen nur fuer HCONVs aufgerufen werden, die - // in der eigenen Applikation erzeugt wurden - static void DestroyConversationWnd( HWND hWndConv ); - static sal_uInt16 GetConversationWndRefCount( HWND hWndConv ); - static sal_uInt16 IncConversationWndRefCount( HWND hWndConv ); - - MRESULT SrvWndProc(HWND hWnd,sal_uIntPtr nMsg,MPARAM nPar1,MPARAM nPar2); - MRESULT ConvWndProc(HWND hWnd,sal_uIntPtr nMsg,MPARAM nPar1,MPARAM nPar2); - void RegisterDDEMLApp(); - void UnregisterDDEMLApp(); - void CleanUp(); - ImpDdeMgrData* InitAll(); - static sal_Bool MyWinDdePostMsg( HWND, HWND, sal_uInt16, PDDESTRUCT, sal_uIntPtr ); - void MyInitiateDde( HWND hWndServer, HWND hWndClient, - HSZ hszService, HSZ hszTopic, CONVCONTEXT* pCC ); - DDEINIT* CreateDDEInitData( HWND hWndDest, HSZ hszService, - HSZ hszTopic, CONVCONTEXT* pCC ); - // wenn pDDEData==0, muss pCC gesetzt sein - HCONV ConnectWithClient( HWND hWndClient, HSZ hszPartner, - HSZ hszService, HSZ hszTopic, sal_Bool bSameInst, - DDEINIT* pDDEData, CONVCONTEXT* pCC = 0); - - HCONV CheckIncoming( ImpWndProcParams*, sal_uIntPtr nTransMask, - HSZ& rhszItem ); - // fuer Serverbetrieb. Ruft Callback-Fkt fuer alle offenen Advises - // auf, deren Owner der uebergebene HCONV ist. - // bFreeTransactions==sal_True: loescht die Transaktionen - // gibt Anzahl der getrennten Transaktionen zurueck - sal_uInt16 SendUnadvises( HCONV hConv, - sal_uInt16 nFormat, // 0==alle - sal_Bool bFreeTransactions ); - - sal_Bool WaitTransState( - Transaction* pTrans, sal_uIntPtr nTransId, - sal_uInt16 nNewState, - sal_uIntPtr nTimeout ); - - // DDEML ruft Callback mit XTYP_CONNECT-Transaction nur auf, - // wenn die App den angeforderten Service registriert hat - // Standardeinstellung: sal_True - sal_Bool bServFilterOn; - - // Fehlercode muss noch systemglobal werden (Atom o. ae.) - static sal_uInt16 nLastErrInstance; // wenn 0, dann gilt globaler Fehlercode - - static ImpDdeMgrData* AccessMgrData(); - - static HCONV CreateConvHandle( ImpDdeMgrData* pBase, - PID pidOwner, - HWND hWndThis, HWND hWndPartner, - HSZ hszPartner, HSZ hszServiceReq, HSZ hszTopic, - HCONV hPrevHCONV = 0 ); - - static HCONV IsConvHandleAvailable( ImpDdeMgrData* pBase ); - static HCONV GetConvHandle( ImpDdeMgrData* pBase, - HWND hWndThis, HWND hWndPartner ); - static void FreeConvHandle( ImpDdeMgrData*, HCONV, - sal_Bool bDestroyHWndThis = sal_True ); - - static sal_uIntPtr CreateTransaction( ImpDdeMgrData* pBase, - HCONV hOwner, HSZ hszItem, sal_uInt16 nFormat, - sal_uInt16 nTransactionType ); - static sal_uIntPtr GetTransaction( ImpDdeMgrData* pBase, - HCONV hOwner, HSZ hszItem, sal_uInt16 nFormat ); - - static void FreeTransaction( ImpDdeMgrData*, sal_uIntPtr nTransId ); - - sal_Bool DisconnectAll(); - // Transaktionen muessen _vor_ den Konversationen geloescht werden! - static void FreeTransactions( ImpDdeMgrData*, HWND hWndThis, - HWND hWndPartner ); - static void FreeTransactions( ImpDdeMgrData*, HCONV hConvOwner ); - - static void FreeConversations( ImpDdeMgrData*,HWND hWndThis, - HWND hWndPartner ); - - ImpService* GetService( HSZ hszService ); - ImpService* PutService( HSZ hszService ); - void BroadcastService( ImpService*, sal_Bool bRegistered ); - - // rh: Startposition(!) & gefundener Handle - static ImpHCONV* GetFirstServer( ImpDdeMgrData*, HCONVLIST, HCONV& rh); - static ImpHCONV* GetLastServer( ImpDdeMgrData*, HCONVLIST, HCONV& ); - static sal_Bool CheckConvListId( HCONVLIST hConvListId ); - - sal_Bool IsSameInstance( HWND hWnd ); - HSZ GetAppName( HWND hWnd ); - - - // Transactions - MRESULT DdeAck( ImpWndProcParams* pParams ); - MRESULT DdeAdvise( ImpWndProcParams* pParams ); - MRESULT DdeData( ImpWndProcParams* pParams ); - MRESULT DdeExecute( ImpWndProcParams* pParams ); - MRESULT DdeInitiate( ImpWndProcParams* pParams ); - MRESULT DdeInitiateAck( ImpWndProcParams* pParams ); - MRESULT DdePoke( ImpWndProcParams* pParams ); - MRESULT DdeRequest( ImpWndProcParams* pParams ); - MRESULT DdeTerminate( ImpWndProcParams* pParams ); - MRESULT DdeUnadvise( ImpWndProcParams* pParams ); - MRESULT DdeRegister( ImpWndProcParams* pParams ); - MRESULT DdeUnregister( ImpWndProcParams* pParams ); - MRESULT DdeTimeout( ImpWndProcParams* pParams ); - - HDDEDATA Callback( - sal_uInt16 nTransactionType, - sal_uInt16 nClipboardFormat, - HCONV hConversationHandle, - HSZ hsz1, - HSZ hsz2, - HDDEDATA hData, - sal_uIntPtr nData1, - sal_uIntPtr nData2 ); - - HCONV DdeConnectImp( HSZ hszService,HSZ hszTopic,CONVCONTEXT* pCC); - - // connection data - HCONV hCurConv; // wird im DdeInitiateAck gesetzt - HCONVLIST hCurListId; // fuer DdeConnectList - sal_uInt16 nPrevConv; // .... "" .... - sal_Bool bListConnect; - - // synchr. transaction data - sal_Bool bInSyncTrans; - sal_uIntPtr nSyncTransId; - HDDEDATA hSyncResponseData; - sal_uIntPtr nSyncResponseMsg; // WM_DDE_ACK, WM_DDE_DATA, WM_TIMER - // sal_True==nach Ende der synchronen Transaktion eine evtl. benutzte - // asynchrone Transaktion beenden (typisch synchroner Request auf - // Advise-Loop) - sal_Bool bSyncAbandonTrans; - -public: - ImpDdeMgr(); - ~ImpDdeMgr(); - - sal_uInt16 DdeInitialize( PFNCALLBACK pCallbackProc, sal_uIntPtr nTransactionFilter ); - sal_uInt16 DdeGetLastError(); - - HCONV DdeConnect( HSZ hszService, HSZ hszTopic, CONVCONTEXT* ); - HCONVLIST DdeConnectList( HSZ hszService, HSZ hszTopic, - HCONVLIST hConvList, CONVCONTEXT* ); - static sal_Bool DdeDisconnect( HCONV hConv ); - static sal_Bool DdeDisconnectList( HCONVLIST hConvList ); - static HCONV DdeReconnect(HCONV hConv); - static HCONV DdeQueryNextServer(HCONVLIST hConvList, HCONV hConvPrev); - static sal_uInt16 DdeQueryConvInfo(HCONV hConv, sal_uIntPtr idTrans,CONVINFO* pCI); - static sal_Bool DdeSetUserHandle(HCONV hConv, sal_uIntPtr id, sal_uIntPtr hUser); - sal_Bool DdeAbandonTransaction( HCONV hConv, sal_uIntPtr idTransaction); - - sal_Bool DdePostAdvise( HSZ hszTopic, HSZ hszItem); - sal_Bool DdeEnableCallback( HCONV hConv, sal_uInt16 wCmd); - - HDDEDATA DdeNameService( HSZ hszService, sal_uInt16 afCmd); - - static HDDEDATA DdeClientTransaction(void* pData, sal_uIntPtr cbData, - HCONV hConv, HSZ hszItem, sal_uInt16 wFmt, sal_uInt16 wType, - sal_uIntPtr dwTimeout, sal_uIntPtr* pdwResult); - - // Data handles - - HDDEDATA DdeCreateDataHandle( void* pSrc, sal_uIntPtr cb, sal_uIntPtr cbOff, - HSZ hszItem, sal_uInt16 wFmt, sal_uInt16 afCmd); - static sal_uInt8* DdeAccessData(HDDEDATA hData, sal_uIntPtr* pcbDataSize); - static sal_Bool DdeUnaccessData(HDDEDATA hData); - static sal_Bool DdeFreeDataHandle(HDDEDATA hData); - static HDDEDATA DdeAddData(HDDEDATA hData,void* pSrc,sal_uIntPtr cb,sal_uIntPtr cbOff); - static sal_uIntPtr DdeGetData(HDDEDATA hData,void* pDst,sal_uIntPtr cbMax,sal_uIntPtr cbOff); - - // String handles - - static HSZ DdeCreateStringHandle( PSZ pStr, int iCodePage); - static sal_uIntPtr DdeQueryString(HSZ hsz,PSZ pStr,sal_uIntPtr cchMax,int iCPage); - static sal_Bool DdeFreeStringHandle( HSZ hsz ); - static sal_Bool DdeKeepStringHandle( HSZ hsz ); - static int DdeCmpStringHandles(HSZ hsz1, HSZ hsz2); - - // mit dieser Funktion kann geprueft werden, ob eine - // Applikation schon eine DDEML-Instanz angelegt hat. - // Die aktuelle Impl. unterstuetzt nur eine DDEML-Instanz - // pro Applikation (wg. synchroner Transaktionen) - static ImpDdeMgr* GetImpDdeMgrInstance( HWND hWnd ); - - // gibt sal_True zurueck, wenn mind. ein lebender HCONV - // von diesem DdeMgr erzeugt wurde - sal_Bool OwnsConversationHandles(); -}; - -// static -inline ImpHCONV* ImpDdeMgr::GetConvTable( ImpDdeMgrData* pData ) -{ - ImpHCONV* pRet; - if( pData ) - pRet = (ImpHCONV*)((sal_uIntPtr)(pData) + pData->nOffsConvTable); - else - pRet = 0; - return pRet; -} - -// static -inline Transaction* ImpDdeMgr::GetTransTable( ImpDdeMgrData* pData ) -{ - Transaction* pRet; - if( pData ) - pRet = (Transaction*)((sal_uIntPtr)(pData) + pData->nOffsTransTable); - else - pRet = 0; - return pRet; -} - -// static -inline HWND* ImpDdeMgr::GetAppTable( ImpDdeMgrData* pData ) -{ - HWND* pRet; - if( pData ) - pRet = (HWND*)((sal_uIntPtr)(pData) + pData->nOffsAppTable); - else - pRet = 0; - return pRet; -} - - - - -#endif - diff --git a/svl/source/svdde/ddemlos2.h b/svl/source/svdde/ddemlos2.h deleted file mode 100644 index 0d8fec8cef8b..000000000000 --- a/svl/source/svdde/ddemlos2.h +++ /dev/null @@ -1,374 +0,0 @@ -/************************************************************************* - * - * 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. - * - ************************************************************************/ -#ifndef _DDEML_H -#define _DDEML_H - -#define INCL_OS2 -#define INCL_WIN - -#include <tools/svpm.h> -#include <tools/solar.h> -#include <tools/debug.hxx> -#include <tools/stream.hxx> - -typedef LHANDLE HSTR; - -#ifndef CALLBACK -#define CALLBACK -#endif - - -typedef sal_uIntPtr HCONVLIST; -typedef sal_uIntPtr HCONV; -typedef ATOM HSZ; -typedef DDESTRUCT* HDDEDATA; - -struct CONVINFO -{ - sal_uInt16 nSize; // sizeof(CONVINFO) - sal_uIntPtr nUser; // Userhandle - HCONV hConvPartner; // - HSZ hszPartner; // Name der Partnerapp - HSZ hszServiceReq; // Name des angeforderten Services - HSZ hszTopic; // -- " -- Topics - HSZ hszItem; // -- " -- Items - sal_uInt16 nFormat; // Datenformat der akt. Transaktion - sal_uInt16 nType; // Typ der akt. Transaktion (XTYP_*) - sal_uInt16 nStatus; // ST_* der Konversation - sal_uInt16 nConvst; // XST_* der akt. Transaktion - sal_uInt16 nLastError; // letzter Fehler der Transaktion - HCONVLIST hConvList; // ConvListId , wenn in ConvList - CONVCONTEXT aConvCtxt; // conversation context -}; - -/* the following structure is for use with XTYP_WILDCONNECT processing. */ - -struct HSZPAIR -{ - HSZ hszSvc; - HSZ hszTopic; -}; -typedef HSZPAIR *PHSZPAIR; - -/***** conversation states (usState) *****/ - -#define XST_NULL 0 /* quiescent states */ -#define XST_INCOMPLETE 1 -#define XST_CONNECTED 2 -#define XST_INIT1 3 /* mid-initiation states */ -#define XST_INIT2 4 -#define XST_REQSENT 5 /* active conversation states */ -#define XST_DATARCVD 6 -#define XST_POKESENT 7 -#define XST_POKEACKRCVD 8 -#define XST_EXECSENT 9 -#define XST_EXECACKRCVD 10 -#define XST_ADVSENT 11 -#define XST_UNADVSENT 12 -#define XST_ADVACKRCVD 13 -#define XST_UNADVACKRCVD 14 -#define XST_ADVDATASENT 15 -#define XST_ADVDATAACKRCVD 16 - -/* used in LOWORD(dwData1) of XTYP_ADVREQ callbacks... */ -#define CADV_LATEACK 0xFFFF - -/***** conversation status bits (fsStatus) *****/ - -#define ST_CONNECTED 0x0001 -#define ST_ADVISE 0x0002 -#define ST_ISLOCAL 0x0004 -#define ST_BLOCKED 0x0008 -#define ST_CLIENT 0x0010 -#define ST_TERMINATED 0x0020 -#define ST_INLIST 0x0040 -#define ST_BLOCKNEXT 0x0080 -#define ST_ISSELF 0x0100 - - -/* DDE constants for wStatus field */ - -//#define DDE_FACK 0x8000 -//#define DDE_FBUSY 0x4000 -//#define DDE_FDEFERUPD 0x4000 -//#define DDE_FACKREQ 0x8000 -//#define DDE_FRELEASE 0x2000 -//#define DDE_FREQUESTED 0x1000 -//#define DDE_FACKRESERVED 0x3ff0 -//#define DDE_FADVRESERVED 0x3fff -//#define DDE_FDATRESERVED 0x4fff -//#define DDE_FPOKRESERVED 0xdfff -//#define DDE_FAPPSTATUS 0x00ff -#define DDE_FNOTPROCESSED 0x0000 - -/***** message filter hook types *****/ - -#define MSGF_DDEMGR 0x8001 - -/***** codepage constants ****/ - -#define CP_WINANSI 1004 /* default codepage for windows & old DDE convs. */ - -/***** transaction types *****/ - -#define XTYPF_NOBLOCK 0x0002 /* CBR_BLOCK will not work */ -#define XTYPF_NODATA 0x0004 /* DDE_FDEFERUPD */ -#define XTYPF_ACKREQ 0x0008 /* DDE_FACKREQ */ - -#define XCLASS_MASK 0xFC00 -#define XCLASS_BOOL 0x1000 -#define XCLASS_DATA 0x2000 -#define XCLASS_FLAGS 0x4000 -#define XCLASS_NOTIFICATION 0x8000 - -#define XTYP_ERROR (0x0000 | XCLASS_NOTIFICATION | XTYPF_NOBLOCK ) -#define XTYP_ADVDATA (0x0010 | XCLASS_FLAGS ) -#define XTYP_ADVREQ (0x0020 | XCLASS_DATA | XTYPF_NOBLOCK ) -#define XTYP_ADVSTART (0x0030 | XCLASS_BOOL ) -#define XTYP_ADVSTOP (0x0040 | XCLASS_NOTIFICATION) -#define XTYP_EXECUTE (0x0050 | XCLASS_FLAGS ) -#define XTYP_CONNECT (0x0060 | XCLASS_BOOL | XTYPF_NOBLOCK) -#define XTYP_CONNECT_CONFIRM (0x0070 | XCLASS_NOTIFICATION | XTYPF_NOBLOCK) -#define XTYP_XACT_COMPLETE (0x0080 | XCLASS_NOTIFICATION ) -#define XTYP_POKE (0x0090 | XCLASS_FLAGS ) -#define XTYP_REGISTER (0x00A0 | XCLASS_NOTIFICATION | XTYPF_NOBLOCK) -#define XTYP_REQUEST (0x00B0 | XCLASS_DATA ) -#define XTYP_DISCONNECT (0x00C0 | XCLASS_NOTIFICATION | XTYPF_NOBLOCK) -#define XTYP_UNREGISTER (0x00D0 | XCLASS_NOTIFICATION | XTYPF_NOBLOCK) -#define XTYP_WILDCONNECT (0x00E0 | XCLASS_DATA | XTYPF_NOBLOCK) - -#define XTYP_MASK 0x00F0 -#define XTYP_SHIFT 4 /* shift to turn XTYP_ into an index */ - -/***** Timeout constants *****/ - -#define TIMEOUT_ASYNC -1L - -/***** Transaction ID constants *****/ - -#define QID_SYNC -1L - -/****** public strings used in DDE ******/ - -#define SZDDESYS_TOPIC "System" -#define SZDDESYS_ITEM_TOPICS "Topics" -#define SZDDESYS_ITEM_SYSITEMS "SysItems" -#define SZDDESYS_ITEM_RTNMSG "ReturnMessage" -#define SZDDESYS_ITEM_STATUS "Status" -#define SZDDESYS_ITEM_FORMATS "Formats" -#define SZDDESYS_ITEM_HELP "Help" -#define SZDDE_ITEM_ITEMLIST "TopicItemList" - - -/****** API entry points ******/ - -typedef HDDEDATA CALLBACK FNCALLBACK(sal_uInt16 wType, sal_uInt16 wFmt, HCONV hConv, - HSZ hsz1, HSZ hsz2, HDDEDATA hData, sal_uIntPtr dwData1, sal_uIntPtr dwData2); -typedef FNCALLBACK* PFNCALLBACK; - -#define CBR_BLOCK 0xffffffffL - -/* DLL registration functions */ - -sal_uInt16 DdeInitialize(sal_uIntPtr* pidInst, PFNCALLBACK pfnCallback, - sal_uIntPtr afCmd, sal_uIntPtr ulRes); - -/* - * Callback filter flags for use with standard apps. - */ - -#define CBF_FAIL_SELFCONNECTIONS 0x00001000 -#define CBF_FAIL_CONNECTIONS 0x00002000 -#define CBF_FAIL_ADVISES 0x00004000 -#define CBF_FAIL_EXECUTES 0x00008000 -#define CBF_FAIL_POKES 0x00010000 -#define CBF_FAIL_REQUESTS 0x00020000 -#define CBF_FAIL_ALLSVRXACTIONS 0x0003f000 - -#define CBF_SKIP_CONNECT_CONFIRMS 0x00040000 -#define CBF_SKIP_REGISTRATIONS 0x00080000 -#define CBF_SKIP_UNREGISTRATIONS 0x00100000 -#define CBF_SKIP_DISCONNECTS 0x00200000 -#define CBF_SKIP_ALLNOTIFICATIONS 0x003c0000 - -/* - * Application command flags - */ -#define APPCMD_CLIENTONLY 0x00000010L -#define APPCMD_FILTERINITS 0x00000020L -#define APPCMD_MASK 0x00000FF0L - -/* - * Application classification flags - */ -#define APPCLASS_STANDARD 0x00000000L -#define APPCLASS_MASK 0x0000000FL - - -sal_Bool DdeUninitialize(sal_uIntPtr idInst); - -/* conversation enumeration functions */ - -HCONVLIST DdeConnectList(sal_uIntPtr idInst, HSZ hszService, HSZ hszTopic, - HCONVLIST hConvList, CONVCONTEXT* pCC); -HCONV DdeQueryNextServer(HCONVLIST hConvList, HCONV hConvPrev); -sal_Bool DdeDisconnectList(HCONVLIST hConvList); - -/* conversation control functions */ - -HCONV DdeConnect(sal_uIntPtr idInst, HSZ hszService, HSZ hszTopic, - CONVCONTEXT* pCC); -sal_Bool DdeDisconnect(HCONV hConv); -HCONV DdeReconnect(HCONV hConv); - -sal_uInt16 DdeQueryConvInfo(HCONV hConv, sal_uIntPtr idTransaction, CONVINFO* pConvInfo); -sal_Bool DdeSetUserHandle(HCONV hConv, sal_uIntPtr id, sal_uIntPtr hUser); - -sal_Bool DdeAbandonTransaction(sal_uIntPtr idInst, HCONV hConv, sal_uIntPtr idTransaction); - - -/* app server interface functions */ - -sal_Bool DdePostAdvise(sal_uIntPtr idInst, HSZ hszTopic, HSZ hszItem); -sal_Bool DdeEnableCallback(sal_uIntPtr idInst, HCONV hConv, sal_uInt16 wCmd); - -#define EC_ENABLEALL 0 -#define EC_ENABLEONE ST_BLOCKNEXT -#define EC_DISABLE ST_BLOCKED -#define EC_QUERYWAITING 2 - -HDDEDATA DdeNameService(sal_uIntPtr idInst, HSZ hsz1, HSZ hsz2, sal_uInt16 afCmd); - -#define DNS_REGISTER 0x0001 -#define DNS_UNREGISTER 0x0002 -#define DNS_FILTERON 0x0004 -#define DNS_FILTEROFF 0x0008 - -/* app client interface functions */ - -HDDEDATA DdeClientTransaction(void* pData, sal_uIntPtr cbData, - HCONV hConv, HSZ hszItem, sal_uInt16 wFmt, sal_uInt16 wType, - sal_uIntPtr dwTimeout, sal_uIntPtr* pdwResult); - -/* data transfer functions */ - -HDDEDATA DdeCreateDataHandle(sal_uIntPtr idInst, void* pSrc, sal_uIntPtr cb, - sal_uIntPtr cbOff, HSZ hszItem, sal_uInt16 wFmt, sal_uInt16 afCmd); -// HDDEDATA DdeAddData(HDDEDATA hData, void* pSrc, sal_uIntPtr cb, sal_uIntPtr cbOff); -sal_uIntPtr DdeGetData(HDDEDATA hData, void* pDst, sal_uIntPtr cbMax, sal_uIntPtr cbOff); -sal_uInt8* DdeAccessData(HDDEDATA hData, sal_uIntPtr* pcbDataSize); -sal_Bool DdeUnaccessData(HDDEDATA hData); -sal_Bool DdeFreeDataHandle(HDDEDATA hData); - -#define HDATA_APPOWNED 0x0001 - -sal_uInt16 DdeGetLastError(sal_uIntPtr idInst); - -#define DMLERR_NO_ERROR 0 /* must be 0 */ - -#define DMLERR_FIRST 0x4000 - -#define DMLERR_ADVACKTIMEOUT 0x4000 -#define DMLERR_BUSY 0x4001 -#define DMLERR_DATAACKTIMEOUT 0x4002 -#define DMLERR_DLL_NOT_INITIALIZED 0x4003 -#define DMLERR_DLL_USAGE 0x4004 -#define DMLERR_EXECACKTIMEOUT 0x4005 -#define DMLERR_INVALIDPARAMETER 0x4006 -#define DMLERR_LOW_MEMORY 0x4007 -#define DMLERR_MEMORY_ERROR 0x4008 -#define DMLERR_NOTPROCESSED 0x4009 -#define DMLERR_NO_CONV_ESTABLISHED 0x400a -#define DMLERR_POKEACKTIMEOUT 0x400b -#define DMLERR_POSTMSG_FAILED 0x400c -#define DMLERR_REENTRANCY 0x400d -#define DMLERR_SERVER_DIED 0x400e -#define DMLERR_SYS_ERROR 0x400f -#define DMLERR_UNADVACKTIMEOUT 0x4010 -#define DMLERR_UNFOUND_QUEUE_ID 0x4011 - -#define DMLERR_LAST 0x4011 - -HSZ DdeCreateStringHandle(sal_uIntPtr idInst, PSZ pStr, int iCodePage); -sal_uIntPtr DdeQueryString(sal_uIntPtr idInst, HSZ hsz, PSZ pStr, sal_uIntPtr cchMax, - int iCodePage); -sal_Bool DdeFreeStringHandle(sal_uIntPtr idInst, HSZ hsz); -sal_Bool DdeKeepStringHandle(sal_uIntPtr idInst, HSZ hsz); -int DdeCmpStringHandles(HSZ hsz1, HSZ hsz2); - - - -/* von OS/2 nicht unterstuetzte Win3.1 Clipboard-Formate */ - -#define CF_NOTSUPPORTED_BASE 0xff00 - -#ifndef CF_DIB -#define CF_DIB CF_NOTSUPPORTED_BASE+1 -#endif - -#ifndef CF_DIF -#define CF_DIF CF_NOTSUPPORTED_BASE+2 -#endif - -#ifndef CF_DSPMETAFILEPICT -#define CF_DSPMETAFILEPICT CF_NOTSUPPORTED_BASE+3 -#endif - -#ifndef CF_METAFILEPICT -#define CF_METAFILEPICT CF_NOTSUPPORTED_BASE+4 -#endif - -#ifndef CF_OEMTEXT -#define CF_OEMTEXT CF_NOTSUPPORTED_BASE+5 -#endif - -#ifndef CF_OWNERDISPLAY -#define CF_OWNERDISPLAY CF_NOTSUPPORTED_BASE+6 -#endif - -#ifndef CF_PENDATA -#define CF_PENDATA CF_NOTSUPPORTED_BASE+7 -#endif - -#ifndef CF_RIFF -#define CF_RIFF CF_NOTSUPPORTED_BASE+8 -#endif - -#ifndef CF_SYLK -#define CF_SYLK CF_NOTSUPPORTED_BASE+9 -#endif - -#ifndef CF_TIFF -#define CF_TIFF CF_NOTSUPPORTED_BASE+10 -#endif - -#ifndef CF_WAVE -#define CF_WAVE CF_NOTSUPPORTED_BASE+11 -#endif - - -#endif /* _DDEML_HXX */ diff --git a/svl/source/svdde/makefile.mk b/svl/source/svdde/makefile.mk deleted file mode 100644 index d7f0a790486b..000000000000 --- a/svl/source/svdde/makefile.mk +++ /dev/null @@ -1,60 +0,0 @@ -#************************************************************************* -# -# 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. -# -#************************************************************************* - - -.IF "$(GUIBASE)"=="WIN" - -PRJ=..$/.. - -PRJNAME=svl -TARGET=svdde - -# --- Settings ----------------------------------------------------- - -.INCLUDE : settings.mk -.INCLUDE : $(PRJ)$/util$/svl.pmk - -# --- Files -------------------------------------------------------- - - -SLOFILES= $(SLO)$/ddecli.obj \ - $(SLO)$/ddesvr.obj \ - $(SLO)$/ddedata.obj \ - $(SLO)$/ddestrg.obj \ - $(SLO)$/ddewrap.obj \ - $(SLO)$/ddeinf.obj - -# --- Targets ------------------------------------------------------- - -.INCLUDE : target.mk - -.ELSE -dummy: - @echo GUI == "$(GUI)" - nothing to do - -.ENDIF - diff --git a/svl/source/svsql/converter.cxx b/svl/source/svsql/converter.cxx index 7b684110a196..2f6fa9f8c389 100644 --- a/svl/source/svsql/converter.cxx +++ b/svl/source/svsql/converter.cxx @@ -27,7 +27,7 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_svl.hxx" -#include "converter.hxx" +#include <svl/converter.hxx> sal_Int32 SvDbaseConverter::ConvertPrecisionToDbase(sal_Int32 _nLen, sal_Int32 _nScale) { diff --git a/svl/source/svsql/makefile.mk b/svl/source/svsql/makefile.mk deleted file mode 100644 index e837d022fb1e..000000000000 --- a/svl/source/svsql/makefile.mk +++ /dev/null @@ -1,46 +0,0 @@ -#************************************************************************* -# -# 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. -# -#************************************************************************* - -PRJ=..$/.. - -PRJNAME=svl -TARGET=svsql - -# --- Settings ----------------------------------------------------- - -.INCLUDE : settings.mk -.INCLUDE : $(PRJ)$/util$/svl.pmk - -# --- Files -------------------------------------------------------- - -SLOFILES = \ - $(SLO)$/converter.obj - -# --- Targets ------------------------------------------------------- - -.INCLUDE : target.mk - diff --git a/svl/source/undo/makefile.mk b/svl/source/undo/makefile.mk deleted file mode 100644 index 8a615d97a03b..000000000000 --- a/svl/source/undo/makefile.mk +++ /dev/null @@ -1,47 +0,0 @@ -#************************************************************************* -# -# 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. -# -#************************************************************************* - -PRJ=..$/.. - -PRJNAME=svl -TARGET=undo -ENABLE_EXCEPTIONS=TRUE - -# --- Settings ----------------------------------------------------- - -.INCLUDE : settings.mk -.INCLUDE : $(PRJ)$/util$/svl.pmk - -# --- Files -------------------------------------------------------- - -SLOFILES = \ - $(SLO)$/undo.obj - -# --- Tagets ------------------------------------------------------- - -.INCLUDE : target.mk - diff --git a/svl/source/uno/makefile.mk b/svl/source/uno/makefile.mk deleted file mode 100644 index 3414871305d5..000000000000 --- a/svl/source/uno/makefile.mk +++ /dev/null @@ -1,47 +0,0 @@ -#************************************************************************* -# -# 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. -# -#************************************************************************* - -PRJ=..$/.. - -PRJNAME=svl -TARGET=unoiface -ENABLE_EXCEPTIONS=TRUE - -# --- Settings ----------------------------------------------------- - -.INCLUDE : settings.mk -.INCLUDE : $(PRJ)$/util$/svl.pmk - -# --- Files -------------------------------------------------------- - -SLOFILES= \ - $(SLO)$/registerservices.obj\ - $(SLO)$/pathservice.obj - -# --- Targets ------------------------------------------------------ - -.INCLUDE : target.mk |