Repository.mk | 4 - dtrans/Library_dnd.mk | 60 ----------------------- dtrans/Library_dtrans.mk | 37 -------------- dtrans/Library_ftransl.mk | 52 -------------------- dtrans/Library_sysdtrans.mk | 57 ---------------------- dtrans/Module_dtrans.mk | 10 --- dtrans/README | 4 + dtrans/StaticLibrary_dtobj.mk | 44 ----------------- dtrans/source/generic/dtrans.component | 30 ----------- dtrans/source/win32/clipb/APNDataObject.hxx | 72 ---------------------------- dtrans/util/dnd.component | 30 ----------- dtrans/util/ftransl.component | 26 ---------- dtrans/util/sysdtrans.component | 26 ---------- postprocess/Rdb_services.mk | 4 - starmath/CppunitTest_starmath_qa_cppunit.mk | 8 --- vcl/Library_vcl.mk | 26 ++++++++++ vcl/vcl.windows.component | 24 +++++++++ vcl/win/dtrans/APNDataObject.hxx | 5 + vcl/win/dtrans/DOTransferable.cxx | 2 vcl/win/dtrans/DataFmtTransl.cxx | 2 vcl/win/dtrans/DtObjFactory.cxx | 3 - vcl/win/dtrans/Fetc.cxx | 2 vcl/win/dtrans/FetcList.cxx | 2 vcl/win/dtrans/MtaOleClipb.cxx | 56 ++++++++++++--------- vcl/win/dtrans/TxtCnvtHlp.cxx | 3 - vcl/win/dtrans/WinClipbImpl.cxx | 8 +-- vcl/win/dtrans/XNotifyingDataObject.cxx | 4 - vcl/win/dtrans/XTDataObject.cxx | 2 vcl/win/dtrans/clipboardmanager.cxx | 2 vcl/win/dtrans/ftransl.cxx | 2 vcl/win/dtrans/generic_clipboard.cxx | 2 vcl/win/dtrans/source.cxx | 3 - vcl/win/dtrans/target.cxx | 2 vcl/workben/win/dnd/dndTest.cxx | 29 +++++------ vcl/workben/win/dtrans/XTDo.cxx | 1 35 files changed, 124 insertions(+), 520 deletions(-)
New commits: commit 9e288fb05f96b897e748e8e938b42fde5637b06e Author: Jan-Marek Glogowski <[email protected]> AuthorDate: Tue Sep 22 13:23:00 2020 +0200 Commit: Michael Stahl <[email protected]> CommitDate: Wed Feb 12 13:00:21 2025 +0100 WIN move dtrans code into vcl/win/dtrans There is nothing abstract about either the clipboard or data transfer code in that directory and it's just used on Windows. All other backends implement this code in VCL, so this moves almost all code, except for the common MimeContentTypeFactory, into the vcl Windows backend / vclplug_win. This also drops four DLLs: sysdtrans, dnd, dtrans and ftransl. Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103209 Tested-by: Jenkins Reviewed-by: Jan-Marek Glogowski <[email protected]> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143174 Tested-by: Balazs Varga <[email protected]> Reviewed-by: Balazs Varga <[email protected]> (cherry picked from commit 06d0b2b32ad2e5aff718a87c2acc59021139c9b5) Conflicts: dtrans/Library_sysdtrans.mk dtrans/source/win32/clipb/APNDataObject.hxx solenv/clang-format/blacklist vcl/Library_vclplug_win.mk vcl/win/dtrans/DTransHelper.hxx vcl/vclplug_win.component Change-Id: I7018f50768bf221447b40487cc1f8a8586da33c4 diff --git a/Repository.mk b/Repository.mk index f5466d00b8ea..16ba641731f4 100644 --- a/Repository.mk +++ b/Repository.mk @@ -610,7 +610,6 @@ $(eval $(call gb_Helper_register_libraries_for_install,PLAINLIBS_OOO,ooo, \ sdbc2 \ sofficeapp \ srtrs1 \ - $(if $(filter $(OS),WNT),sysdtrans) \ textconv_dict \ ucb1 \ ucbhelper \ @@ -630,10 +629,7 @@ $(eval $(call gb_Helper_register_libraries_for_install,PLAINLIBS_OOO,ooo, \ macabdrv1 \ ) \ $(if $(filter WNT,$(OS)), \ - dnd \ - dtrans \ fps \ - ftransl \ inprocserv \ UAccCOM \ winaccessibility \ diff --git a/dtrans/Library_dnd.mk b/dtrans/Library_dnd.mk deleted file mode 100644 index 930b552827e1..000000000000 --- a/dtrans/Library_dnd.mk +++ /dev/null @@ -1,60 +0,0 @@ -# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- -# -# This file is part of the LibreOffice project. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at http://mozilla.org/MPL/2.0/. -# -# This file incorporates work covered by the following license notice: -# -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed -# with this work for additional information regarding copyright -# ownership. The ASF licenses this file to you under the Apache -# License, Version 2.0 (the "License"); you may not use this file -# except in compliance with the License. You may obtain a copy of -# the License at http://www.apache.org/licenses/LICENSE-2.0 . -# - -$(eval $(call gb_Library_Library,dnd)) - -$(eval $(call gb_Library_set_componentfile,dnd,dtrans/util/dnd)) - -$(eval $(call gb_Library_use_externals,dnd, \ - boost_headers \ -)) - -$(eval $(call gb_Library_use_sdk_api,dnd)) - -$(eval $(call gb_Library_use_libraries,dnd,\ - comphelper \ - cppu \ - cppuhelper \ - sal \ -)) - -$(eval $(call gb_Library_use_system_win32_libs,dnd,\ - advapi32 \ - gdi32 \ - ole32 \ - oleaut32 \ - shell32 \ - uuid \ -)) - -$(eval $(call gb_Library_use_static_libraries,dnd,\ - dtobj \ -)) - -$(eval $(call gb_Library_add_exception_objects,dnd,\ - dtrans/source/win32/dnd/globals \ - dtrans/source/win32/dnd/idroptarget \ - dtrans/source/win32/dnd/sourcecontext \ - dtrans/source/win32/dnd/source \ - dtrans/source/win32/dnd/target \ - dtrans/source/win32/dnd/targetdragcontext \ - dtrans/source/win32/dnd/targetdropcontext \ -)) - -# vim: set noet sw=4 ts=4: diff --git a/dtrans/Library_dtrans.mk b/dtrans/Library_dtrans.mk deleted file mode 100644 index e70d7215436b..000000000000 --- a/dtrans/Library_dtrans.mk +++ /dev/null @@ -1,37 +0,0 @@ -# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- -# -# This file is part of the LibreOffice project. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at http://mozilla.org/MPL/2.0/. -# -# This file incorporates work covered by the following license notice: -# -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed -# with this work for additional information regarding copyright -# ownership. The ASF licenses this file to you under the Apache -# License, Version 2.0 (the "License"); you may not use this file -# except in compliance with the License. You may obtain a copy of -# the License at http://www.apache.org/licenses/LICENSE-2.0 . -# - -$(eval $(call gb_Library_Library,dtrans)) - -$(eval $(call gb_Library_set_componentfile,dtrans,dtrans/source/generic/dtrans)) - -$(eval $(call gb_Library_use_sdk_api,dtrans)) - -$(eval $(call gb_Library_use_libraries,dtrans,\ - cppu \ - cppuhelper \ - sal \ -)) - -$(eval $(call gb_Library_add_exception_objects,dtrans,\ - dtrans/source/generic/clipboardmanager \ - dtrans/source/generic/generic_clipboard \ -)) - -# vim: set noet sw=4 ts=4: diff --git a/dtrans/Library_ftransl.mk b/dtrans/Library_ftransl.mk deleted file mode 100644 index f418af318d3f..000000000000 --- a/dtrans/Library_ftransl.mk +++ /dev/null @@ -1,52 +0,0 @@ -# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- -# -# This file is part of the LibreOffice project. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at http://mozilla.org/MPL/2.0/. -# -# This file incorporates work covered by the following license notice: -# -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed -# with this work for additional information regarding copyright -# ownership. The ASF licenses this file to you under the Apache -# License, Version 2.0 (the "License"); you may not use this file -# except in compliance with the License. You may obtain a copy of -# the License at http://www.apache.org/licenses/LICENSE-2.0 . -# - -$(eval $(call gb_Library_Library,ftransl)) - -$(eval $(call gb_Library_set_componentfile,ftransl,dtrans/util/ftransl)) - -$(eval $(call gb_Library_use_sdk_api,ftransl)) - -$(eval $(call gb_Library_use_libraries,ftransl,\ - comphelper \ - cppu \ - cppuhelper \ - sal \ -)) - -$(eval $(call gb_Library_use_system_win32_libs,ftransl,\ - advapi32 \ - gdi32 \ - ole32 \ -)) - -$(eval $(call gb_Library_use_static_libraries,ftransl,\ - dtobj \ -)) - -$(eval $(call gb_Library_add_exception_objects,ftransl,\ - dtrans/source/win32/ftransl/ftransl \ -)) - -$(eval $(call gb_Library_set_include,ftransl,\ - -I$(SRCDIR)/dtrans/source/inc \ - $$(INCLUDE) \ -)) - -# vim: set noet sw=4 ts=4: diff --git a/dtrans/Library_sysdtrans.mk b/dtrans/Library_sysdtrans.mk deleted file mode 100644 index 2c9a4a6f221f..000000000000 --- a/dtrans/Library_sysdtrans.mk +++ /dev/null @@ -1,57 +0,0 @@ -# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- -# -# This file is part of the LibreOffice project. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at http://mozilla.org/MPL/2.0/. -# -# This file incorporates work covered by the following license notice: -# -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed -# with this work for additional information regarding copyright -# ownership. The ASF licenses this file to you under the Apache -# License, Version 2.0 (the "License"); you may not use this file -# except in compliance with the License. You may obtain a copy of -# the License at http://www.apache.org/licenses/LICENSE-2.0 . -# - -$(eval $(call gb_Library_Library,sysdtrans)) - -$(eval $(call gb_Library_set_componentfile,sysdtrans,dtrans/util/sysdtrans)) - -$(eval $(call gb_Library_use_sdk_api,sysdtrans)) - -$(eval $(call gb_Library_add_defs,sysdtrans,\ - -D_UNICODE \ - -DUNICODE \ -)) - -$(eval $(call gb_Library_use_libraries,sysdtrans,\ - comphelper \ - cppu \ - cppuhelper \ - sal \ -)) - -$(eval $(call gb_Library_use_system_win32_libs,sysdtrans,\ - advapi32 \ - gdi32 \ - ole32 \ - oleaut32 \ - shell32 \ - uuid \ -)) - -$(eval $(call gb_Library_use_static_libraries,sysdtrans,\ - dtobj \ -)) - -$(eval $(call gb_Library_add_exception_objects,sysdtrans,\ - dtrans/source/win32/clipb/WinClipbImpl \ - dtrans/source/win32/clipb/WinClipboard \ - dtrans/source/win32/clipb/MtaOleClipb \ -)) - -# vim: set noet sw=4 ts=4: diff --git a/dtrans/Module_dtrans.mk b/dtrans/Module_dtrans.mk index 2ddc6f48a925..f583c41e88bb 100644 --- a/dtrans/Module_dtrans.mk +++ b/dtrans/Module_dtrans.mk @@ -23,14 +23,4 @@ $(eval $(call gb_Module_add_targets,dtrans,\ Library_mcnttype \ )) -ifeq ($(OS),WNT) -$(eval $(call gb_Module_add_targets,dtrans,\ - Library_dnd \ - Library_dtrans \ - Library_ftransl \ - Library_sysdtrans \ - StaticLibrary_dtobj \ -)) -endif - # vim: set noet sw=4 ts=4: diff --git a/dtrans/README b/dtrans/README index 23555bce65aa..73aca8b6e496 100644 --- a/dtrans/README +++ b/dtrans/README @@ -1 +1,3 @@ -Clipboard abstraction - data transfer. +Used to be a module for data transfer, but just contained Windows code. +Now it just contains the MimeContentTypeFactory, which probably should move to +vcl too, since it's just used there. diff --git a/dtrans/StaticLibrary_dtobj.mk b/dtrans/StaticLibrary_dtobj.mk deleted file mode 100644 index 04ed1c53249f..000000000000 --- a/dtrans/StaticLibrary_dtobj.mk +++ /dev/null @@ -1,44 +0,0 @@ -# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- -# -# This file is part of the LibreOffice project. -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at http://mozilla.org/MPL/2.0/. -# -# This file incorporates work covered by the following license notice: -# -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed -# with this work for additional information regarding copyright -# ownership. The ASF licenses this file to you under the Apache -# License, Version 2.0 (the "License"); you may not use this file -# except in compliance with the License. You may obtain a copy of -# the License at http://www.apache.org/licenses/LICENSE-2.0 . -# - -$(eval $(call gb_StaticLibrary_StaticLibrary,dtobj)) - -$(eval $(call gb_StaticLibrary_use_sdk_api,dtobj)) - -$(eval $(call gb_StaticLibrary_add_exception_objects,dtobj,\ - dtrans/source/win32/dtobj/APNDataObject \ - dtrans/source/win32/dtobj/DataFmtTransl \ - dtrans/source/win32/dtobj/DOTransferable \ - dtrans/source/win32/dtobj/DtObjFactory \ - dtrans/source/win32/dtobj/DTransHelper \ - dtrans/source/win32/dtobj/Fetc \ - dtrans/source/win32/dtobj/FetcList \ - dtrans/source/win32/dtobj/FmtFilter \ - dtrans/source/win32/dtobj/TxtCnvtHlp \ - dtrans/source/win32/dtobj/XNotifyingDataObject \ - dtrans/source/win32/dtobj/XTDataObject \ - dtrans/source/win32/misc/ImplHelper \ -)) - -$(eval $(call gb_StaticLibrary_set_include,dtobj,\ - -I$(SRCDIR)/dtrans/source/inc \ - $$(INCLUDE) \ -)) - -# vim: set noet sw=4 ts=4: diff --git a/dtrans/source/generic/dtrans.component b/dtrans/source/generic/dtrans.component deleted file mode 100644 index 1bfb643be4d0..000000000000 --- a/dtrans/source/generic/dtrans.component +++ /dev/null @@ -1,30 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - --> - -<component loader="com.sun.star.loader.SharedLibrary" environment="@CPPU_ENV@" - xmlns="http://openoffice.org/2010/uno-components"> - <implementation name="com.sun.star.comp.datatransfer.ClipboardManager" - constructor="dtrans_ClipboardManager_get_implementation"> - <service name="com.sun.star.datatransfer.clipboard.ClipboardManager"/> - </implementation> - <implementation name="com.sun.star.comp.datatransfer.clipboard.GenericClipboard" - constructor="dtrans_GenericClipboard_get_implementation"> - <service name="com.sun.star.datatransfer.clipboard.GenericClipboard"/> - </implementation> -</component> diff --git a/dtrans/source/win32/clipb/APNDataObject.hxx b/dtrans/source/win32/clipb/APNDataObject.hxx deleted file mode 100644 index fbfbdb4ca45d..000000000000 --- a/dtrans/source/win32/clipb/APNDataObject.hxx +++ /dev/null @@ -1,72 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#ifndef INCLUDED_DTRANS_SOURCE_WIN32_CLIPB_APNDATAOBJECT_HXX -#define INCLUDED_DTRANS_SOURCE_WIN32_CLIPB_APNDATAOBJECT_HXX - -/* - an APartment Neutral dataobject wrapper; this wrapper of a IDataObject - pointer can be used from any apartment without RPC_E_WRONG_THREAD - which normally occurs if an apartment tries to use an interface - pointer of another apartment; we use containment to hold the original - DataObject -*/ -class CAPNDataObject : public IDataObject -{ -public: - CAPNDataObject( IDataObjectPtr rIDataObject ); - ~CAPNDataObject( ); - - //IUnknown interface methods - - STDMETHODIMP QueryInterface(REFIID iid, LPVOID* ppvObject); - STDMETHODIMP_( ULONG ) AddRef( ); - STDMETHODIMP_( ULONG ) Release( ); - - // IDataObject interface methods - - STDMETHODIMP GetData( LPFORMATETC pFormatetc, LPSTGMEDIUM pmedium ); - STDMETHODIMP GetDataHere( LPFORMATETC pFormatetc, LPSTGMEDIUM pmedium ); - STDMETHODIMP QueryGetData( LPFORMATETC pFormatetc ); - STDMETHODIMP GetCanonicalFormatEtc( LPFORMATETC pFormatectIn, LPFORMATETC pFormatetcOut ); - STDMETHODIMP SetData( LPFORMATETC pFormatetc, LPSTGMEDIUM pmedium, BOOL fRelease ); - STDMETHODIMP EnumFormatEtc( DWORD dwDirection, IEnumFORMATETC** ppenumFormatetc ); - STDMETHODIMP DAdvise( LPFORMATETC pFormatetc, DWORD advf, LPADVISESINK pAdvSink, DWORD* pdwConnection ); - STDMETHODIMP DUnadvise( DWORD dwConnection ); - STDMETHODIMP EnumDAdvise( LPENUMSTATDATA* ppenumAdvise ); - - operator IDataObject*( ); - -private: - HRESULT MarshalIDataObjectIntoCurrentApartment( IDataObject** ppIDataObj ); - -private: - IDataObjectPtr m_rIDataObjectOrg; - HGLOBAL m_hGlobal; - LONG m_nRefCnt; - -// prevent copy and assignment -private: - CAPNDataObject( const CAPNDataObject& theOther ); - CAPNDataObject& operator=( const CAPNDataObject& theOther ); -}; - -#endif - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dtrans/util/dnd.component b/dtrans/util/dnd.component deleted file mode 100644 index 8a3f5feebbb2..000000000000 --- a/dtrans/util/dnd.component +++ /dev/null @@ -1,30 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - --> - -<component loader="com.sun.star.loader.SharedLibrary" environment="@CPPU_ENV@" - xmlns="http://openoffice.org/2010/uno-components"> - <implementation name="com.sun.star.comp.datatransfer.dnd.OleDragSource_V1" - constructor="dtrans_DragSource_get_implementation"> - <service name="com.sun.star.datatransfer.dnd.OleDragSource"/> - </implementation> - <implementation name="com.sun.star.comp.datatransfer.dnd.OleDropTarget_V1" - constructor="dtrans_DropTarget_get_implementation"> - <service name="com.sun.star.datatransfer.dnd.OleDropTarget"/> - </implementation> -</component> diff --git a/dtrans/util/ftransl.component b/dtrans/util/ftransl.component deleted file mode 100644 index e97a897f7437..000000000000 --- a/dtrans/util/ftransl.component +++ /dev/null @@ -1,26 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - --> - -<component loader="com.sun.star.loader.SharedLibrary" environment="@CPPU_ENV@" - xmlns="http://openoffice.org/2010/uno-components"> - <implementation name="com.sun.star.datatransfer.DataFormatTranslator" - constructor="dtrans_CDataFormatTranslatorUNO_get_implementation"> - <service name="com.sun.star.datatransfer.DataFormatTranslator"/> - </implementation> -</component> diff --git a/dtrans/util/sysdtrans.component b/dtrans/util/sysdtrans.component deleted file mode 100644 index 263b1417258e..000000000000 --- a/dtrans/util/sysdtrans.component +++ /dev/null @@ -1,26 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - --> - -<component loader="com.sun.star.loader.SharedLibrary" environment="@CPPU_ENV@" - xmlns="http://openoffice.org/2010/uno-components"> - <implementation name="com.sun.star.datatransfer.clipboard.ClipboardW32" - constructor="dtrans_CWinClipboard_get_implementation"> - <service name="com.sun.star.datatransfer.clipboard.SystemClipboard"/> - </implementation> -</component> diff --git a/postprocess/Rdb_services.mk b/postprocess/Rdb_services.mk index ce8649ed7f7e..71aa15142588 100644 --- a/postprocess/Rdb_services.mk +++ b/postprocess/Rdb_services.mk @@ -136,10 +136,6 @@ $(eval $(call gb_Rdb_add_components,services,\ ) \ $(if $(filter WNT,$(OS)), \ avmedia/source/win/avmediawin \ - dtrans/source/generic/dtrans \ - dtrans/util/dnd \ - dtrans/util/ftransl \ - dtrans/util/sysdtrans \ fpicker/source/win32/fps \ shell/source/backends/wininetbe/wininetbe1 \ shell/source/win32/simplemail/smplmail \ diff --git a/starmath/CppunitTest_starmath_qa_cppunit.mk b/starmath/CppunitTest_starmath_qa_cppunit.mk index 19beb8c3eebd..d314a5994374 100644 --- a/starmath/CppunitTest_starmath_qa_cppunit.mk +++ b/starmath/CppunitTest_starmath_qa_cppunit.mk @@ -71,15 +71,9 @@ $(eval $(call gb_CppunitTest_use_components,starmath_qa_cppunit,\ ucb/source/core/ucb1 \ ucb/source/ucp/file/ucpfile1 \ unotools/util/utl \ + vcl/vcl.common \ )) -ifeq ($(strip $(OS)),WNT) -$(eval $(call gb_CppunitTest_use_components,starmath_qa_cppunit,\ - dtrans/util/ftransl \ - dtrans/util/sysdtrans \ -)) -endif - $(eval $(call gb_CppunitTest_use_configuration,starmath_qa_cppunit)) # vim: set noet sw=4 ts=4: diff --git a/vcl/Library_vcl.mk b/vcl/Library_vcl.mk index af4b5f897e64..7769396ee035 100644 --- a/vcl/Library_vcl.mk +++ b/vcl/Library_vcl.mk @@ -686,6 +686,31 @@ $(eval $(call gb_Library_add_exception_objects,vcl,\ vcl/win/app/salinfo \ vcl/win/app/salinst \ vcl/win/app/salshl \ + vcl/win/dtrans/APNDataObject \ + vcl/win/dtrans/clipboardmanager \ + vcl/win/dtrans/DataFmtTransl \ + vcl/win/dtrans/DOTransferable \ + vcl/win/dtrans/DtObjFactory \ + vcl/win/dtrans/DTransHelper \ + vcl/win/dtrans/Fetc \ + vcl/win/dtrans/FetcList \ + vcl/win/dtrans/FmtFilter \ + vcl/win/dtrans/ftransl \ + vcl/win/dtrans/generic_clipboard \ + vcl/win/dtrans/globals \ + vcl/win/dtrans/idroptarget \ + vcl/win/dtrans/ImplHelper \ + vcl/win/dtrans/MtaOleClipb \ + vcl/win/dtrans/source \ + vcl/win/dtrans/sourcecontext \ + vcl/win/dtrans/target \ + vcl/win/dtrans/targetdragcontext \ + vcl/win/dtrans/targetdropcontext \ + vcl/win/dtrans/TxtCnvtHlp \ + vcl/win/dtrans/WinClipbImpl \ + vcl/win/dtrans/WinClipboard \ + vcl/win/dtrans/XNotifyingDataObject \ + vcl/win/dtrans/XTDataObject \ vcl/win/app/saltimer \ vcl/win/gdi/gdiimpl \ vcl/win/gdi/salbmp \ @@ -711,6 +736,7 @@ $(eval $(call gb_Library_use_system_win32_libs,vcl,\ imm32 \ mpr \ ole32 \ + oleaut32 \ shell32 \ usp10 \ uuid \ diff --git a/vcl/vcl.windows.component b/vcl/vcl.windows.component index 2d5b8bb51386..c664cfeaa90a 100644 --- a/vcl/vcl.windows.component +++ b/vcl/vcl.windows.component @@ -19,6 +19,30 @@ <component loader="com.sun.star.loader.SharedLibrary" environment="@CPPU_ENV@" prefix="vcl" xmlns="http://openoffice.org/2010/uno-components"> + <implementation name="com.sun.star.datatransfer.DataFormatTranslator" + constructor="dtrans_CDataFormatTranslatorUNO_get_implementation"> + <service name="com.sun.star.datatransfer.DataFormatTranslator"/> + </implementation> + <implementation name="com.sun.star.comp.datatransfer.dnd.OleDragSource_V1" + constructor="dtrans_DragSource_get_implementation"> + <service name="com.sun.star.datatransfer.dnd.OleDragSource"/> + </implementation> + <implementation name="com.sun.star.comp.datatransfer.dnd.OleDropTarget_V1" + constructor="dtrans_DropTarget_get_implementation"> + <service name="com.sun.star.datatransfer.dnd.OleDropTarget"/> + </implementation> + <implementation name="com.sun.star.comp.datatransfer.ClipboardManager" + constructor="dtrans_ClipboardManager_get_implementation"> + <service name="com.sun.star.datatransfer.clipboard.ClipboardManager"/> + </implementation> + <implementation name="com.sun.star.comp.datatransfer.clipboard.GenericClipboard" + constructor="dtrans_GenericClipboard_get_implementation"> + <service name="com.sun.star.datatransfer.clipboard.GenericClipboard"/> + </implementation> + <implementation name="com.sun.star.datatransfer.clipboard.ClipboardW32" + constructor="dtrans_CWinClipboard_get_implementation"> + <service name="com.sun.star.datatransfer.clipboard.SystemClipboard"/> + </implementation> <implementation name="com.sun.star.frame.VCLSessionManagerClient"> <service name="com.sun.star.frame.SessionManagerClient"/> </implementation> diff --git a/dtrans/source/win32/dtobj/APNDataObject.cxx b/vcl/win/dtrans/APNDataObject.cxx similarity index 100% rename from dtrans/source/win32/dtobj/APNDataObject.cxx rename to vcl/win/dtrans/APNDataObject.cxx diff --git a/dtrans/source/win32/dtobj/APNDataObject.hxx b/vcl/win/dtrans/APNDataObject.hxx similarity index 97% rename from dtrans/source/win32/dtobj/APNDataObject.hxx rename to vcl/win/dtrans/APNDataObject.hxx index 534bead593b3..cfa5dd4b3748 100644 --- a/dtrans/source/win32/dtobj/APNDataObject.hxx +++ b/vcl/win/dtrans/APNDataObject.hxx @@ -20,6 +20,11 @@ #ifndef INCLUDED_DTRANS_SOURCE_WIN32_DTOBJ_APNDATAOBJECT_HXX #define INCLUDED_DTRANS_SOURCE_WIN32_DTOBJ_APNDATAOBJECT_HXX +#if !defined WIN32_LEAN_AND_MEAN +# define WIN32_LEAN_AND_MEAN +#endif +#include <objidl.h> + #include <systools/win32/comtools.hxx> /* diff --git a/dtrans/source/win32/dtobj/DOTransferable.cxx b/vcl/win/dtrans/DOTransferable.cxx similarity index 99% rename from dtrans/source/win32/dtobj/DOTransferable.cxx rename to vcl/win/dtrans/DOTransferable.cxx index 22b2c3a8968e..5a317166d869 100644 --- a/dtrans/source/win32/dtobj/DOTransferable.cxx +++ b/vcl/win/dtrans/DOTransferable.cxx @@ -22,8 +22,8 @@ #include <osl/diagnose.h> #include "DOTransferable.hxx" -#include "../misc/ImplHelper.hxx" -#include <WinClip.hxx> +#include "ImplHelper.hxx" +#include "WinClip.hxx" #include "DTransHelper.hxx" #include "TxtCnvtHlp.hxx" #include "MimeAttrib.hxx" diff --git a/dtrans/source/win32/dtobj/DOTransferable.hxx b/vcl/win/dtrans/DOTransferable.hxx similarity index 100% rename from dtrans/source/win32/dtobj/DOTransferable.hxx rename to vcl/win/dtrans/DOTransferable.hxx diff --git a/dtrans/source/win32/dtobj/DTransHelper.cxx b/vcl/win/dtrans/DTransHelper.cxx similarity index 100% rename from dtrans/source/win32/dtobj/DTransHelper.cxx rename to vcl/win/dtrans/DTransHelper.cxx diff --git a/dtrans/source/win32/dtobj/DTransHelper.hxx b/vcl/win/dtrans/DTransHelper.hxx similarity index 99% rename from dtrans/source/win32/dtobj/DTransHelper.hxx rename to vcl/win/dtrans/DTransHelper.hxx index 4f4e0cdeb216..2143c571f047 100644 --- a/dtrans/source/win32/dtobj/DTransHelper.hxx +++ b/vcl/win/dtrans/DTransHelper.hxx @@ -27,7 +27,7 @@ #if defined _MSC_VER #pragma warning(pop) #endif -#include <WinClip.hxx> +#include "WinClip.hxx" #define AUTO_INIT TRUE diff --git a/dtrans/source/win32/dtobj/DataFmtTransl.cxx b/vcl/win/dtrans/DataFmtTransl.cxx similarity index 99% rename from dtrans/source/win32/dtobj/DataFmtTransl.cxx rename to vcl/win/dtrans/DataFmtTransl.cxx index 1ae6f1d9eba2..1ca2e2338590 100644 --- a/dtrans/source/win32/dtobj/DataFmtTransl.cxx +++ b/vcl/win/dtrans/DataFmtTransl.cxx @@ -21,8 +21,8 @@ #include <rtl/string.hxx> #include <osl/diagnose.h> #include <rtl/tencinfo.h> -#include "../misc/ImplHelper.hxx" -#include <WinClip.hxx> +#include "ImplHelper.hxx" +#include "WinClip.hxx" #include "MimeAttrib.hxx" #include "DTransHelper.hxx" #include <rtl/string.h> diff --git a/dtrans/source/win32/dtobj/DataFmtTransl.hxx b/vcl/win/dtrans/DataFmtTransl.hxx similarity index 100% rename from dtrans/source/win32/dtobj/DataFmtTransl.hxx rename to vcl/win/dtrans/DataFmtTransl.hxx diff --git a/dtrans/source/win32/dtobj/DtObjFactory.cxx b/vcl/win/dtrans/DtObjFactory.cxx similarity index 97% rename from dtrans/source/win32/dtobj/DtObjFactory.cxx rename to vcl/win/dtrans/DtObjFactory.cxx index ee77267304b6..779e025d8ea0 100644 --- a/dtrans/source/win32/dtobj/DtObjFactory.cxx +++ b/vcl/win/dtrans/DtObjFactory.cxx @@ -17,8 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include "../../inc/DtObjFactory.hxx" - +#include "DtObjFactory.hxx" #include "XTDataObject.hxx" using namespace com::sun::star::uno; diff --git a/dtrans/source/inc/DtObjFactory.hxx b/vcl/win/dtrans/DtObjFactory.hxx similarity index 100% rename from dtrans/source/inc/DtObjFactory.hxx rename to vcl/win/dtrans/DtObjFactory.hxx diff --git a/dtrans/source/win32/dtobj/Fetc.cxx b/vcl/win/dtrans/Fetc.cxx similarity index 99% rename from dtrans/source/win32/dtobj/Fetc.cxx rename to vcl/win/dtrans/Fetc.cxx index 048b9228de5d..9bcb2f609ff6 100644 --- a/dtrans/source/win32/dtobj/Fetc.cxx +++ b/vcl/win/dtrans/Fetc.cxx @@ -19,7 +19,7 @@ #include <osl/diagnose.h> #include "Fetc.hxx" -#include "../misc/ImplHelper.hxx" +#include "ImplHelper.hxx" CFormatEtc::CFormatEtc( ) { diff --git a/dtrans/source/win32/dtobj/Fetc.hxx b/vcl/win/dtrans/Fetc.hxx similarity index 100% rename from dtrans/source/win32/dtobj/Fetc.hxx rename to vcl/win/dtrans/Fetc.hxx diff --git a/dtrans/source/win32/dtobj/FetcList.cxx b/vcl/win/dtrans/FetcList.cxx similarity index 99% rename from dtrans/source/win32/dtobj/FetcList.cxx rename to vcl/win/dtrans/FetcList.cxx index c98e5ecb6950..c097e171be5e 100644 --- a/dtrans/source/win32/dtobj/FetcList.cxx +++ b/vcl/win/dtrans/FetcList.cxx @@ -25,8 +25,8 @@ #include <com/sun/star/datatransfer/XMimeContentType.hpp> #include "DataFmtTransl.hxx" -#include "../misc/ImplHelper.hxx" -#include <WinClip.hxx> +#include "ImplHelper.hxx" +#include "WinClip.hxx" #include <algorithm> diff --git a/dtrans/source/win32/dtobj/FetcList.hxx b/vcl/win/dtrans/FetcList.hxx similarity index 100% rename from dtrans/source/win32/dtobj/FetcList.hxx rename to vcl/win/dtrans/FetcList.hxx diff --git a/dtrans/source/win32/dtobj/FmtFilter.cxx b/vcl/win/dtrans/FmtFilter.cxx similarity index 100% rename from dtrans/source/win32/dtobj/FmtFilter.cxx rename to vcl/win/dtrans/FmtFilter.cxx diff --git a/dtrans/source/win32/dtobj/FmtFilter.hxx b/vcl/win/dtrans/FmtFilter.hxx similarity index 100% rename from dtrans/source/win32/dtobj/FmtFilter.hxx rename to vcl/win/dtrans/FmtFilter.hxx diff --git a/dtrans/source/win32/misc/ImplHelper.cxx b/vcl/win/dtrans/ImplHelper.cxx similarity index 100% rename from dtrans/source/win32/misc/ImplHelper.cxx rename to vcl/win/dtrans/ImplHelper.cxx diff --git a/dtrans/source/win32/misc/ImplHelper.hxx b/vcl/win/dtrans/ImplHelper.hxx similarity index 100% rename from dtrans/source/win32/misc/ImplHelper.hxx rename to vcl/win/dtrans/ImplHelper.hxx diff --git a/dtrans/source/win32/dtobj/MimeAttrib.hxx b/vcl/win/dtrans/MimeAttrib.hxx similarity index 100% rename from dtrans/source/win32/dtobj/MimeAttrib.hxx rename to vcl/win/dtrans/MimeAttrib.hxx diff --git a/dtrans/source/win32/clipb/MtaOleClipb.cxx b/vcl/win/dtrans/MtaOleClipb.cxx similarity index 98% rename from dtrans/source/win32/clipb/MtaOleClipb.cxx rename to vcl/win/dtrans/MtaOleClipb.cxx index 246e49ee409f..ab2358048379 100644 --- a/dtrans/source/win32/clipb/MtaOleClipb.cxx +++ b/vcl/win/dtrans/MtaOleClipb.cxx @@ -43,6 +43,10 @@ #include <sal/log.hxx> #include "MtaOleClipb.hxx" + +#include <svsys.h> +#include <win/saldata.hxx> + #include <osl/thread.h> #include <wchar.h> @@ -57,8 +61,7 @@ using osl::ClearableMutexGuard; namespace /* private */ { - wchar_t CLIPSRV_DLL_NAME[] = L"sysdtrans.dll"; - wchar_t g_szWndClsName[] = L"MtaOleReqWnd###"; + const wchar_t g_szWndClsName[] = L"MtaOleReqWnd###"; // messages constants @@ -675,8 +678,8 @@ void CMtaOleClipboard::createMtaOleReqWnd( ) { WNDCLASSEXW wcex; - HINSTANCE hInst = GetModuleHandleW( CLIPSRV_DLL_NAME ); - OSL_ENSURE( nullptr != hInst, "The name of the clipboard service dll must have changed" ); + SalData* pSalData = GetSalData(); + OSL_ASSERT(nullptr != pSalData->mhInst); ZeroMemory( &wcex, sizeof(wcex) ); @@ -685,7 +688,7 @@ void CMtaOleClipboard::createMtaOleReqWnd( ) wcex.lpfnWndProc = static_cast< WNDPROC >( CMtaOleClipboard::mtaOleReqWndProc ); wcex.cbClsExtra = 0; wcex.cbWndExtra = 0; - wcex.hInstance = hInst; + wcex.hInstance = pSalData->mhInst; wcex.hIcon = nullptr; wcex.hCursor = nullptr; wcex.hbrBackground = nullptr; @@ -697,7 +700,7 @@ void CMtaOleClipboard::createMtaOleReqWnd( ) if ( 0 != m_MtaOleReqWndClassAtom ) m_hwndMtaOleReqWnd = CreateWindowW( - g_szWndClsName, nullptr, 0, 0, 0, 0, 0, nullptr, nullptr, hInst, nullptr ); + g_szWndClsName, nullptr, 0, 0, 0, 0, 0, nullptr, nullptr, pSalData->mhInst, nullptr ); } unsigned int CMtaOleClipboard::run( ) diff --git a/dtrans/source/win32/clipb/MtaOleClipb.hxx b/vcl/win/dtrans/MtaOleClipb.hxx similarity index 100% rename from dtrans/source/win32/clipb/MtaOleClipb.hxx rename to vcl/win/dtrans/MtaOleClipb.hxx diff --git a/dtrans/source/win32/dtobj/TxtCnvtHlp.cxx b/vcl/win/dtrans/TxtCnvtHlp.cxx similarity index 99% rename from dtrans/source/win32/dtobj/TxtCnvtHlp.cxx rename to vcl/win/dtrans/TxtCnvtHlp.cxx index 529a0b49969f..fea5cd7dded7 100644 --- a/dtrans/source/win32/dtobj/TxtCnvtHlp.cxx +++ b/vcl/win/dtrans/TxtCnvtHlp.cxx @@ -18,9 +18,10 @@ */ #include <osl/diagnose.h> + #include "TxtCnvtHlp.hxx" #include "DTransHelper.hxx" -#include "../misc/ImplHelper.hxx" +#include "ImplHelper.hxx" using namespace ::com::sun::star::datatransfer; using namespace ::com::sun::star::uno; diff --git a/dtrans/source/win32/dtobj/TxtCnvtHlp.hxx b/vcl/win/dtrans/TxtCnvtHlp.hxx similarity index 100% rename from dtrans/source/win32/dtobj/TxtCnvtHlp.hxx rename to vcl/win/dtrans/TxtCnvtHlp.hxx diff --git a/dtrans/source/inc/WinClip.hxx b/vcl/win/dtrans/WinClip.hxx similarity index 100% rename from dtrans/source/inc/WinClip.hxx rename to vcl/win/dtrans/WinClip.hxx diff --git a/dtrans/source/win32/clipb/WinClipbImpl.cxx b/vcl/win/dtrans/WinClipbImpl.cxx similarity index 97% rename from dtrans/source/win32/clipb/WinClipbImpl.cxx rename to vcl/win/dtrans/WinClipbImpl.cxx index 548a7ff4c5aa..90d001a77277 100644 --- a/dtrans/source/win32/clipb/WinClipbImpl.cxx +++ b/vcl/win/dtrans/WinClipbImpl.cxx @@ -21,12 +21,12 @@ #include "WinClipbImpl.hxx" #include <systools/win32/comtools.hxx> -#include "../../inc/DtObjFactory.hxx" -#include "../dtobj/APNDataObject.hxx" -#include "../dtobj/DOTransferable.hxx" +#include "DtObjFactory.hxx" +#include "APNDataObject.hxx" +#include "DOTransferable.hxx" #include "WinClipboard.hxx" #include <com/sun/star/datatransfer/clipboard/RenderingCapabilities.hpp> -#include "../dtobj/XNotifyingDataObject.hxx" +#include "XNotifyingDataObject.hxx" #if defined _MSC_VER #pragma warning(push,1) diff --git a/dtrans/source/win32/clipb/WinClipbImpl.hxx b/vcl/win/dtrans/WinClipbImpl.hxx similarity index 100% rename from dtrans/source/win32/clipb/WinClipbImpl.hxx rename to vcl/win/dtrans/WinClipbImpl.hxx diff --git a/dtrans/source/win32/clipb/WinClipboard.cxx b/vcl/win/dtrans/WinClipboard.cxx similarity index 100% rename from dtrans/source/win32/clipb/WinClipboard.cxx rename to vcl/win/dtrans/WinClipboard.cxx diff --git a/dtrans/source/win32/clipb/WinClipboard.hxx b/vcl/win/dtrans/WinClipboard.hxx similarity index 100% rename from dtrans/source/win32/clipb/WinClipboard.hxx rename to vcl/win/dtrans/WinClipboard.hxx diff --git a/dtrans/source/win32/dtobj/XNotifyingDataObject.cxx b/vcl/win/dtrans/XNotifyingDataObject.cxx similarity index 98% rename from dtrans/source/win32/dtobj/XNotifyingDataObject.cxx rename to vcl/win/dtrans/XNotifyingDataObject.cxx index 3b495b4d2dd4..7df06f95c0d1 100644 --- a/dtrans/source/win32/dtobj/XNotifyingDataObject.cxx +++ b/vcl/win/dtrans/XNotifyingDataObject.cxx @@ -19,8 +19,8 @@ #include <osl/diagnose.h> #include "XNotifyingDataObject.hxx" -#include "../clipb/WinClipbImpl.hxx" -#include "../clipb/WinClipboard.hxx" +#include "WinClipbImpl.hxx" +#include "WinClipboard.hxx" using namespace com::sun::star::datatransfer; using namespace com::sun::star::datatransfer::clipboard; diff --git a/dtrans/source/win32/dtobj/XNotifyingDataObject.hxx b/vcl/win/dtrans/XNotifyingDataObject.hxx similarity index 100% rename from dtrans/source/win32/dtobj/XNotifyingDataObject.hxx rename to vcl/win/dtrans/XNotifyingDataObject.hxx diff --git a/dtrans/source/win32/dtobj/XTDataObject.cxx b/vcl/win/dtrans/XTDataObject.cxx similarity index 99% rename from dtrans/source/win32/dtobj/XTDataObject.cxx rename to vcl/win/dtrans/XTDataObject.cxx index ed89eaf6dec4..1cf8de842cf4 100644 --- a/dtrans/source/win32/dtobj/XTDataObject.cxx +++ b/vcl/win/dtrans/XTDataObject.cxx @@ -21,7 +21,7 @@ #include "XTDataObject.hxx" #include <com/sun/star/datatransfer/DataFlavor.hpp> -#include "../misc/ImplHelper.hxx" +#include "ImplHelper.hxx" #include "DTransHelper.hxx" #include "TxtCnvtHlp.hxx" #include <com/sun/star/datatransfer/UnsupportedFlavorException.hpp> diff --git a/dtrans/source/win32/dtobj/XTDataObject.hxx b/vcl/win/dtrans/XTDataObject.hxx similarity index 100% rename from dtrans/source/win32/dtobj/XTDataObject.hxx rename to vcl/win/dtrans/XTDataObject.hxx diff --git a/dtrans/source/generic/clipboardmanager.cxx b/vcl/win/dtrans/clipboardmanager.cxx similarity index 100% rename from dtrans/source/generic/clipboardmanager.cxx rename to vcl/win/dtrans/clipboardmanager.cxx diff --git a/dtrans/source/generic/clipboardmanager.hxx b/vcl/win/dtrans/clipboardmanager.hxx similarity index 100% rename from dtrans/source/generic/clipboardmanager.hxx rename to vcl/win/dtrans/clipboardmanager.hxx diff --git a/dtrans/source/win32/ftransl/ftransl.cxx b/vcl/win/dtrans/ftransl.cxx similarity index 99% rename from dtrans/source/win32/ftransl/ftransl.cxx rename to vcl/win/dtrans/ftransl.cxx index d659156fb4e3..0f134849be2c 100644 --- a/dtrans/source/win32/ftransl/ftransl.cxx +++ b/vcl/win/dtrans/ftransl.cxx @@ -27,7 +27,7 @@ #include <com/sun/star/uno/XComponentContext.hpp> #include <cppuhelper/supportsservice.hxx> #include <rtl/ref.hxx> -#include "../misc/ImplHelper.hxx" +#include "ImplHelper.hxx" #if defined _MSC_VER #pragma warning(push,1) diff --git a/dtrans/source/win32/ftransl/ftransl.hxx b/vcl/win/dtrans/ftransl.hxx similarity index 99% rename from dtrans/source/win32/ftransl/ftransl.hxx rename to vcl/win/dtrans/ftransl.hxx index 2592c015eb9a..6859e0d53774 100644 --- a/dtrans/source/win32/ftransl/ftransl.hxx +++ b/vcl/win/dtrans/ftransl.hxx @@ -27,7 +27,7 @@ #include <com/sun/star/datatransfer/XDataFormatTranslator.hpp> #include <com/sun/star/datatransfer/XMimeContentTypeFactory.hpp> #include <com/sun/star/uno/XComponentContext.hpp> -#include <WinClip.hxx> +#include "WinClip.hxx" #include <vector> diff --git a/dtrans/source/generic/generic_clipboard.cxx b/vcl/win/dtrans/generic_clipboard.cxx similarity index 100% rename from dtrans/source/generic/generic_clipboard.cxx rename to vcl/win/dtrans/generic_clipboard.cxx diff --git a/dtrans/source/generic/generic_clipboard.hxx b/vcl/win/dtrans/generic_clipboard.hxx similarity index 100% rename from dtrans/source/generic/generic_clipboard.hxx rename to vcl/win/dtrans/generic_clipboard.hxx diff --git a/dtrans/source/win32/dnd/globals.cxx b/vcl/win/dtrans/globals.cxx similarity index 100% rename from dtrans/source/win32/dnd/globals.cxx rename to vcl/win/dtrans/globals.cxx diff --git a/dtrans/source/win32/dnd/globals.hxx b/vcl/win/dtrans/globals.hxx similarity index 100% rename from dtrans/source/win32/dnd/globals.hxx rename to vcl/win/dtrans/globals.hxx diff --git a/dtrans/source/win32/dnd/idroptarget.cxx b/vcl/win/dtrans/idroptarget.cxx similarity index 100% rename from dtrans/source/win32/dnd/idroptarget.cxx rename to vcl/win/dtrans/idroptarget.cxx diff --git a/dtrans/source/win32/dnd/idroptarget.hxx b/vcl/win/dtrans/idroptarget.hxx similarity index 100% rename from dtrans/source/win32/dnd/idroptarget.hxx rename to vcl/win/dtrans/idroptarget.hxx diff --git a/dtrans/source/win32/dnd/source.cxx b/vcl/win/dtrans/source.cxx similarity index 99% rename from dtrans/source/win32/dnd/source.cxx rename to vcl/win/dtrans/source.cxx index 8a3eb8175343..d91090b1e910 100644 --- a/dtrans/source/win32/dnd/source.cxx +++ b/vcl/win/dtrans/source.cxx @@ -30,7 +30,8 @@ #include "source.hxx" #include "globals.hxx" #include "sourcecontext.hxx" -#include "../../inc/DtObjFactory.hxx" +#include "DtObjFactory.hxx" + #include <rtl/ustring.h> #include <osl/thread.h> #include <winuser.h> diff --git a/dtrans/source/win32/dnd/source.hxx b/vcl/win/dtrans/source.hxx similarity index 100% rename from dtrans/source/win32/dnd/source.hxx rename to vcl/win/dtrans/source.hxx diff --git a/dtrans/source/win32/dnd/sourcecontext.cxx b/vcl/win/dtrans/sourcecontext.cxx similarity index 100% rename from dtrans/source/win32/dnd/sourcecontext.cxx rename to vcl/win/dtrans/sourcecontext.cxx diff --git a/dtrans/source/win32/dnd/sourcecontext.hxx b/vcl/win/dtrans/sourcecontext.hxx similarity index 100% rename from dtrans/source/win32/dnd/sourcecontext.hxx rename to vcl/win/dtrans/sourcecontext.hxx diff --git a/dtrans/source/win32/dnd/target.cxx b/vcl/win/dtrans/target.cxx similarity index 99% rename from dtrans/source/win32/dnd/target.cxx rename to vcl/win/dtrans/target.cxx index 7c532322da5c..b6b00d84efb3 100644 --- a/dtrans/source/win32/dnd/target.cxx +++ b/vcl/win/dtrans/target.cxx @@ -31,7 +31,7 @@ #include <rtl/ustring.h> #include <osl/thread.h> -#include "../dtobj/DOTransferable.hxx" +#include "DOTransferable.hxx" using namespace cppu; using namespace osl; diff --git a/dtrans/source/win32/dnd/target.hxx b/vcl/win/dtrans/target.hxx similarity index 100% rename from dtrans/source/win32/dnd/target.hxx rename to vcl/win/dtrans/target.hxx diff --git a/dtrans/source/win32/dnd/targetdragcontext.cxx b/vcl/win/dtrans/targetdragcontext.cxx similarity index 100% rename from dtrans/source/win32/dnd/targetdragcontext.cxx rename to vcl/win/dtrans/targetdragcontext.cxx diff --git a/dtrans/source/win32/dnd/targetdragcontext.hxx b/vcl/win/dtrans/targetdragcontext.hxx similarity index 100% rename from dtrans/source/win32/dnd/targetdragcontext.hxx rename to vcl/win/dtrans/targetdragcontext.hxx diff --git a/dtrans/source/win32/dnd/targetdropcontext.cxx b/vcl/win/dtrans/targetdropcontext.cxx similarity index 100% rename from dtrans/source/win32/dnd/targetdropcontext.cxx rename to vcl/win/dtrans/targetdropcontext.cxx diff --git a/dtrans/source/win32/dnd/targetdropcontext.hxx b/vcl/win/dtrans/targetdropcontext.hxx similarity index 100% rename from dtrans/source/win32/dnd/targetdropcontext.hxx rename to vcl/win/dtrans/targetdropcontext.hxx diff --git a/dtrans/source/test/makefile.mk b/vcl/workben/dtrans/makefile.mk similarity index 100% rename from dtrans/source/test/makefile.mk rename to vcl/workben/dtrans/makefile.mk diff --git a/dtrans/source/test/test_dtrans.cxx b/vcl/workben/dtrans/test_dtrans.cxx similarity index 100% rename from dtrans/source/test/test_dtrans.cxx rename to vcl/workben/dtrans/test_dtrans.cxx diff --git a/dtrans/test/win32/dnd/atlwindow.cxx b/vcl/workben/win/dnd/atlwindow.cxx similarity index 100% rename from dtrans/test/win32/dnd/atlwindow.cxx rename to vcl/workben/win/dnd/atlwindow.cxx diff --git a/dtrans/test/win32/dnd/atlwindow.hxx b/vcl/workben/win/dnd/atlwindow.hxx similarity index 100% rename from dtrans/test/win32/dnd/atlwindow.hxx rename to vcl/workben/win/dnd/atlwindow.hxx diff --git a/dtrans/test/win32/dnd/dndTest.cxx b/vcl/workben/win/dnd/dndTest.cxx similarity index 100% rename from dtrans/test/win32/dnd/dndTest.cxx rename to vcl/workben/win/dnd/dndTest.cxx diff --git a/dtrans/test/win32/dnd/makefile.mk b/vcl/workben/win/dnd/makefile.mk similarity index 100% rename from dtrans/test/win32/dnd/makefile.mk rename to vcl/workben/win/dnd/makefile.mk diff --git a/dtrans/test/win32/dnd/sourcelistener.cxx b/vcl/workben/win/dnd/sourcelistener.cxx similarity index 100% rename from dtrans/test/win32/dnd/sourcelistener.cxx rename to vcl/workben/win/dnd/sourcelistener.cxx diff --git a/dtrans/test/win32/dnd/sourcelistener.hxx b/vcl/workben/win/dnd/sourcelistener.hxx similarity index 100% rename from dtrans/test/win32/dnd/sourcelistener.hxx rename to vcl/workben/win/dnd/sourcelistener.hxx diff --git a/dtrans/test/win32/dnd/targetlistener.cxx b/vcl/workben/win/dnd/targetlistener.cxx similarity index 100% rename from dtrans/test/win32/dnd/targetlistener.cxx rename to vcl/workben/win/dnd/targetlistener.cxx diff --git a/dtrans/test/win32/dnd/targetlistener.hxx b/vcl/workben/win/dnd/targetlistener.hxx similarity index 100% rename from dtrans/test/win32/dnd/targetlistener.hxx rename to vcl/workben/win/dnd/targetlistener.hxx diff --git a/dtrans/test/win32/dnd/transferable.cxx b/vcl/workben/win/dnd/transferable.cxx similarity index 100% rename from dtrans/test/win32/dnd/transferable.cxx rename to vcl/workben/win/dnd/transferable.cxx diff --git a/dtrans/test/win32/dnd/transferable.hxx b/vcl/workben/win/dnd/transferable.hxx similarity index 100% rename from dtrans/test/win32/dnd/transferable.hxx rename to vcl/workben/win/dnd/transferable.hxx diff --git a/dtrans/source/win32/workbench/XTDo.cxx b/vcl/workben/win/dtrans/XTDo.cxx similarity index 100% rename from dtrans/source/win32/workbench/XTDo.cxx rename to vcl/workben/win/dtrans/XTDo.cxx diff --git a/dtrans/source/win32/workbench/XTDo.hxx b/vcl/workben/win/dtrans/XTDo.hxx similarity index 100% rename from dtrans/source/win32/workbench/XTDo.hxx rename to vcl/workben/win/dtrans/XTDo.hxx diff --git a/dtrans/source/win32/workbench/makefile.mk b/vcl/workben/win/dtrans/makefile.mk similarity index 100% rename from dtrans/source/win32/workbench/makefile.mk rename to vcl/workben/win/dtrans/makefile.mk diff --git a/dtrans/source/win32/workbench/test_wincb.cxx b/vcl/workben/win/dtrans/test_wincb.cxx similarity index 100% rename from dtrans/source/win32/workbench/test_wincb.cxx rename to vcl/workben/win/dtrans/test_wincb.cxx diff --git a/dtrans/source/win32/workbench/testmarshal.cxx b/vcl/workben/win/dtrans/testmarshal.cxx similarity index 100% rename from dtrans/source/win32/workbench/testmarshal.cxx rename to vcl/workben/win/dtrans/testmarshal.cxx commit 51d9cc4d8aba67731ffa04a013b947349eb3a888 Author: Stephan Bergmann <[email protected]> AuthorDate: Fri Oct 27 19:27:21 2017 +0200 Commit: Michael Stahl <[email protected]> CommitDate: Wed Feb 12 12:17:14 2025 +0100 loplugin:includeform: dtrans (Windows) (cherry picked from commit 9851245f1e5978c566acbc4db69ba650b455b1b4) Conflicts: dtrans/source/generic/dtrans.cxx Change-Id: I8da9250a64d1be4fe410028676320f5bb38d0176 diff --git a/dtrans/source/generic/clipboardmanager.cxx b/dtrans/source/generic/clipboardmanager.cxx index 957d1d94281c..8cea07171f78 100644 --- a/dtrans/source/generic/clipboardmanager.cxx +++ b/dtrans/source/generic/clipboardmanager.cxx @@ -17,7 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include <clipboardmanager.hxx> +#include "clipboardmanager.hxx" #include <com/sun/star/container/ElementExistException.hpp> #include <com/sun/star/container/NoSuchElementException.hpp> #include <com/sun/star/lang/DisposedException.hpp> diff --git a/dtrans/source/generic/generic_clipboard.cxx b/dtrans/source/generic/generic_clipboard.cxx index 9766d23892b4..dfc5759750f9 100644 --- a/dtrans/source/generic/generic_clipboard.cxx +++ b/dtrans/source/generic/generic_clipboard.cxx @@ -17,7 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include <generic_clipboard.hxx> +#include "generic_clipboard.hxx" #include <com/sun/star/lang/DisposedException.hpp> #include <com/sun/star/datatransfer/clipboard/RenderingCapabilities.hpp> #include <com/sun/star/uno/XComponentContext.hpp> diff --git a/dtrans/source/win32/dtobj/DOTransferable.cxx b/dtrans/source/win32/dtobj/DOTransferable.cxx index ceca4996a7db..22b2c3a8968e 100644 --- a/dtrans/source/win32/dtobj/DOTransferable.cxx +++ b/dtrans/source/win32/dtobj/DOTransferable.cxx @@ -23,7 +23,7 @@ #include "DOTransferable.hxx" #include "../misc/ImplHelper.hxx" -#include "WinClip.hxx" +#include <WinClip.hxx> #include "DTransHelper.hxx" #include "TxtCnvtHlp.hxx" #include "MimeAttrib.hxx" diff --git a/dtrans/source/win32/dtobj/DTransHelper.hxx b/dtrans/source/win32/dtobj/DTransHelper.hxx index 2143c571f047..4f4e0cdeb216 100644 --- a/dtrans/source/win32/dtobj/DTransHelper.hxx +++ b/dtrans/source/win32/dtobj/DTransHelper.hxx @@ -27,7 +27,7 @@ #if defined _MSC_VER #pragma warning(pop) #endif -#include "WinClip.hxx" +#include <WinClip.hxx> #define AUTO_INIT TRUE diff --git a/dtrans/source/win32/dtobj/DataFmtTransl.cxx b/dtrans/source/win32/dtobj/DataFmtTransl.cxx index a498e9d4471e..1ae6f1d9eba2 100644 --- a/dtrans/source/win32/dtobj/DataFmtTransl.cxx +++ b/dtrans/source/win32/dtobj/DataFmtTransl.cxx @@ -22,7 +22,7 @@ #include <osl/diagnose.h> #include <rtl/tencinfo.h> #include "../misc/ImplHelper.hxx" -#include "WinClip.hxx" +#include <WinClip.hxx> #include "MimeAttrib.hxx" #include "DTransHelper.hxx" #include <rtl/string.h> diff --git a/dtrans/source/win32/dtobj/FetcList.cxx b/dtrans/source/win32/dtobj/FetcList.cxx index c5744730323a..c98e5ecb6950 100644 --- a/dtrans/source/win32/dtobj/FetcList.cxx +++ b/dtrans/source/win32/dtobj/FetcList.cxx @@ -26,7 +26,7 @@ #include "DataFmtTransl.hxx" #include "../misc/ImplHelper.hxx" -#include "WinClip.hxx" +#include <WinClip.hxx> #include <algorithm> diff --git a/dtrans/source/win32/ftransl/ftransl.hxx b/dtrans/source/win32/ftransl/ftransl.hxx index 6859e0d53774..2592c015eb9a 100644 --- a/dtrans/source/win32/ftransl/ftransl.hxx +++ b/dtrans/source/win32/ftransl/ftransl.hxx @@ -27,7 +27,7 @@ #include <com/sun/star/datatransfer/XDataFormatTranslator.hpp> #include <com/sun/star/datatransfer/XMimeContentTypeFactory.hpp> #include <com/sun/star/uno/XComponentContext.hpp> -#include "WinClip.hxx" +#include <WinClip.hxx> #include <vector> commit 47177b5f49d4280be515d10adc969661a1792b70 Author: Mike Kaganski <[email protected]> AuthorDate: Wed Sep 20 20:20:44 2017 +0300 Commit: Michael Stahl <[email protected]> CommitDate: Wed Feb 12 11:41:32 2025 +0100 Windows: avoid dependence on UNICODE define; prefer W functions [only backport changes in dtrans module] Reviewed-on: https://gerrit.libreoffice.org/42560 Tested-by: Jenkins <[email protected]> Reviewed-by: Mike Kaganski <[email protected]> (cherry picked from commit eef4c133e9649ebd690918bd7b83c2d5dc0dfcff) Change-Id: I95b90128e93f0d88ed73601bcc5a7ca9279d4cf1 diff --git a/dtrans/source/win32/clipb/MtaOleClipb.cxx b/dtrans/source/win32/clipb/MtaOleClipb.cxx index 6c8ec203295f..246e49ee409f 100644 --- a/dtrans/source/win32/clipb/MtaOleClipb.cxx +++ b/dtrans/source/win32/clipb/MtaOleClipb.cxx @@ -35,7 +35,10 @@ // characters in the debug information #endif -//#define UNICODE +#if !defined WINVER +#define WINVER 0x0400 +#endif + #include <osl/diagnose.h> #include <sal/log.hxx> @@ -54,8 +57,8 @@ using osl::ClearableMutexGuard; namespace /* private */ { - char CLIPSRV_DLL_NAME[] = "sysdtrans.dll"; - char g_szWndClsName[] = "MtaOleReqWnd###"; + wchar_t CLIPSRV_DLL_NAME[] = L"sysdtrans.dll"; + wchar_t g_szWndClsName[] = L"MtaOleReqWnd###"; // messages constants @@ -86,7 +89,7 @@ namespace /* private */ // ctor Win32Condition() { - m_hEvent = CreateEvent( + m_hEvent = CreateEventW( nullptr, /* no security */ true, /* manual reset */ false, /* initial state not signaled */ @@ -119,7 +122,7 @@ namespace /* private */ queue that's what we want, messages from the PostMessage queue stay untouched */ MSG msg; - PeekMessage(&msg, nullptr, 0, 0, PM_NOREMOVE); + PeekMessageW(&msg, nullptr, 0, 0, PM_NOREMOVE); break; } @@ -248,7 +251,7 @@ CMtaOleClipboard::CMtaOleClipboard( ) : m_ClipboardChangedEventCount( 0 ) { // signals that the thread was successfully setup - m_hEvtThrdReady = CreateEventA( nullptr, MANUAL_RESET, INIT_NONSIGNALED, nullptr ); + m_hEvtThrdReady = CreateEventW( nullptr, MANUAL_RESET, INIT_NONSIGNALED, nullptr ); OSL_ASSERT( nullptr != m_hEvtThrdReady ); @@ -260,10 +263,10 @@ CMtaOleClipboard::CMtaOleClipboard( ) : // setup the clipboard changed notifier thread - m_hClipboardChangedNotifierEvents[0] = CreateEventA( nullptr, MANUAL_RESET, INIT_NONSIGNALED, nullptr ); + m_hClipboardChangedNotifierEvents[0] = CreateEventW( nullptr, MANUAL_RESET, INIT_NONSIGNALED, nullptr ); OSL_ASSERT( nullptr != m_hClipboardChangedNotifierEvents[0] ); - m_hClipboardChangedNotifierEvents[1] = CreateEventA( nullptr, MANUAL_RESET, INIT_NONSIGNALED, nullptr ); + m_hClipboardChangedNotifierEvents[1] = CreateEventW( nullptr, MANUAL_RESET, INIT_NONSIGNALED, nullptr ); OSL_ASSERT( nullptr != m_hClipboardChangedNotifierEvents[1] ); unsigned uThreadId; @@ -316,7 +319,7 @@ CMtaOleClipboard::~CMtaOleClipboard( ) CloseHandle( m_hEvtThrdReady ); if ( m_MtaOleReqWndClassAtom ) - UnregisterClassA( g_szWndClsName, nullptr ); + UnregisterClassW( g_szWndClsName, nullptr ); OSL_ENSURE( ( nullptr == m_pfncClipViewerCallback ) && !IsWindow( m_hwndNextClipViewer ), @@ -519,7 +522,7 @@ LRESULT CMtaOleClipboard::onChangeCBChain( HWND hWndRemove, HWND hWndNext ) { // forward the message to the next one DWORD_PTR dwpResult; - SendMessageTimeoutA( + SendMessageTimeoutW( m_hwndNextClipViewer, WM_CHANGECBCHAIN, reinterpret_cast<WPARAM>(hWndRemove), @@ -552,7 +555,7 @@ LRESULT CMtaOleClipboard::onDrawClipboard( ) if ( IsWindow( m_hwndNextClipViewer ) ) { DWORD_PTR dwpResult; - SendMessageTimeoutA( + SendMessageTimeoutW( m_hwndNextClipViewer, WM_DRAWCLIPBOARD, static_cast< WPARAM >( 0 ), @@ -570,7 +573,7 @@ LRESULT CMtaOleClipboard::onDrawClipboard( ) LRESULT CMtaOleClipboard::sendMessage( UINT msg, WPARAM wParam, LPARAM lParam ) { - return ::SendMessageA( m_hwndMtaOleReqWnd, msg, wParam, lParam ); + return ::SendMessageW( m_hwndMtaOleReqWnd, msg, wParam, lParam ); } // PostMessage so we don't need to supply the HWND if we send @@ -578,7 +581,7 @@ LRESULT CMtaOleClipboard::sendMessage( UINT msg, WPARAM wParam, LPARAM lParam ) bool CMtaOleClipboard::postMessage( UINT msg, WPARAM wParam, LPARAM lParam ) { - BOOL const ret = PostMessageA(m_hwndMtaOleReqWnd, msg, wParam, lParam); + BOOL const ret = PostMessageW(m_hwndMtaOleReqWnd, msg, wParam, lParam); SAL_WARN_IF(0 == ret, "dtrans", "ERROR: PostMessage() failed!"); return ret; } @@ -661,7 +664,7 @@ LRESULT CALLBACK CMtaOleClipboard::mtaOleReqWndProc( HWND hWnd, UINT uMsg, WPARA break; default: - lResult = DefWindowProcA( hWnd, uMsg, wParam, lParam ); + lResult = DefWindowProcW( hWnd, uMsg, wParam, lParam ); break; } @@ -670,14 +673,14 @@ LRESULT CALLBACK CMtaOleClipboard::mtaOleReqWndProc( HWND hWnd, UINT uMsg, WPARA void CMtaOleClipboard::createMtaOleReqWnd( ) { - WNDCLASSEXA wcex; + WNDCLASSEXW wcex; - HINSTANCE hInst = GetModuleHandleA( CLIPSRV_DLL_NAME ); + HINSTANCE hInst = GetModuleHandleW( CLIPSRV_DLL_NAME ); OSL_ENSURE( nullptr != hInst, "The name of the clipboard service dll must have changed" ); - ZeroMemory( &wcex, sizeof( WNDCLASSEXA ) ); + ZeroMemory( &wcex, sizeof(wcex) ); - wcex.cbSize = sizeof(WNDCLASSEXA); + wcex.cbSize = sizeof(wcex); wcex.style = 0; wcex.lpfnWndProc = static_cast< WNDPROC >( CMtaOleClipboard::mtaOleReqWndProc ); wcex.cbClsExtra = 0; @@ -690,10 +693,10 @@ void CMtaOleClipboard::createMtaOleReqWnd( ) wcex.lpszClassName = g_szWndClsName; wcex.hIconSm = nullptr; - m_MtaOleReqWndClassAtom = RegisterClassExA( &wcex ); + m_MtaOleReqWndClassAtom = RegisterClassExW( &wcex ); if ( 0 != m_MtaOleReqWndClassAtom ) - m_hwndMtaOleReqWnd = CreateWindowA( + m_hwndMtaOleReqWnd = CreateWindowW( g_szWndClsName, nullptr, 0, 0, 0, 0, 0, nullptr, nullptr, hInst, nullptr ); } @@ -713,8 +716,8 @@ unsigned int CMtaOleClipboard::run( ) // pumping messages MSG msg; - while( GetMessageA( &msg, nullptr, 0, 0 ) ) - DispatchMessageA( &msg ); + while( GetMessageW( &msg, nullptr, 0, 0 ) ) + DispatchMessageW( &msg ); nRet = 0; } diff --git a/dtrans/source/win32/workbench/XTDo.cxx b/dtrans/source/win32/workbench/XTDo.cxx index 2aecc0c5bf22..f8da707d92e3 100644 --- a/dtrans/source/win32/workbench/XTDo.cxx +++ b/dtrans/source/win32/workbench/XTDo.cxx @@ -32,7 +32,6 @@ #pragma warning(pop) #endif #include <memory> -#include <tchar.h> using namespace ::std; diff --git a/dtrans/test/win32/dnd/dndTest.cxx b/dtrans/test/win32/dnd/dndTest.cxx index aae5851c1cab..803b9e1a51d0 100644 --- a/dtrans/test/win32/dnd/dndTest.cxx +++ b/dtrans/test/win32/dnd/dndTest.cxx @@ -22,7 +22,6 @@ #endif #include <windows.h> #include <comdef.h> -#include <tchar.h> #include <atlbase.h> CComModule _Module; #include <atlcom.h> @@ -61,11 +60,11 @@ int main( int argc, char *argv[ ], char *envp[ ] ) HRESULT hr; if( FAILED( hr=CoInitialize(NULL ))) { - _tprintf(_T("CoInitialize failed ")); + printf("CoInitialize failed "); return -1; } - _Module.Init( ObjectMap, GetModuleHandle( NULL)); + _Module.Init( ObjectMap, GetModuleHandleA( NULL)); if( FAILED(hr=doTest())) { @@ -84,7 +83,7 @@ HRESULT doTest() // create the MTA thread that is used to realize MTA calls to the services // We create the thread and wait until the thread has created its message queue - HANDLE evt= CreateEvent(NULL, FALSE, FALSE, NULL); + HANDLE evt= CreateEventA(NULL, FALSE, FALSE, NULL); DWORD threadIdMTA=0; HANDLE hMTAThread= CreateThread( NULL, 0, MTAFunc, &evt, 0, &threadIdMTA); WaitForSingleObject( evt, INFINITE); @@ -92,27 +91,27 @@ HRESULT doTest() HRESULT hr= S_OK; RECT pos1={0,0,300,200}; - AWindow win(_T("DnD starting in Ole STA"), threadIdMTA, pos1); + AWindow win("DnD starting in Ole STA", threadIdMTA, pos1); RECT pos2={ 0, 205, 300, 405}; - AWindow win2( _T("DnD starting in MTA"), threadIdMTA, pos2, true); + AWindow win2("DnD starting in MTA", threadIdMTA, pos2, true); // win3 and win4 call initialize from an MTA but they are created in an STA RECT pos3={300,0,600,200}; - AWindow win3(_T("DnD starting in OLE STA"), threadIdMTA, pos3, false, true); + AWindow win3("DnD starting in OLE STA", threadIdMTA, pos3, false, true); RECT pos4={ 300, 205, 600, 405}; - AWindow win24( _T("DnD starting in Ole MTA"), threadIdMTA, pos4, true, true); + AWindow win24("DnD starting in Ole MTA", threadIdMTA, pos4, true, true); MSG msg; - while( GetMessage(&msg, (HWND)NULL, 0, 0) ) + while( GetMessageA(&msg, (HWND)NULL, 0, 0) ) { TranslateMessage( &msg); - DispatchMessage( &msg); + DispatchMessageA( &msg); } // Shut down the MTA thread - PostThreadMessage( threadIdMTA, WM_QUIT, 0, 0); + PostThreadMessageA( threadIdMTA, WM_QUIT, 0, 0); WaitForSingleObject(hMTAThread, INFINITE); CloseHandle(hMTAThread); @@ -126,13 +125,13 @@ DWORD WINAPI MTAFunc( void* threadData) ATLASSERT( FAILED(hr) ); MSG msg; // force the creation of a message queue - PeekMessage(&msg, NULL, WM_USER, WM_USER, PM_NOREMOVE); + PeekMessageA(&msg, NULL, WM_USER, WM_USER, PM_NOREMOVE); SetEvent( *(HANDLE*)threadData ); RECT pos={0, 406, 300, 605}; - AWindow win(_T("DnD, full MTA"), GetCurrentThreadId(), pos, false, true); + AWindow win("DnD, full MTA", GetCurrentThreadId(), pos, false, true); - while( GetMessage(&msg, (HWND)NULL, 0, 0) ) + while( GetMessageA(&msg, (HWND)NULL, 0, 0) ) { switch( msg.message) { @@ -170,7 +169,7 @@ DWORD WINAPI MTAFunc( void* threadData) } // end switch TranslateMessage( &msg); - DispatchMessage( &msg); + DispatchMessageA( &msg); } CoUninitialize();
