[Libreoffice-commits] core.git: Branch 'feature/qt5-win+mac' - 3764 commits - accessibility/inc accessibility/Library_acc.mk accessibility/source android/Bootstrap android/CustomTarget_lo_android.mk android/mobile-config.py android/source avmedia/inc avmedia/Library_avmediaQuickTime.mk avmedia/source basctl/inc basctl/Library_basctl.mk basctl/source basctl/uiconfig basegfx/Library_basegfx.mk basegfx/source basegfx/test basic/CppunitTest_basic_macros.mk basic/inc basic/qa basic/source binaryurp/source bin/check-elf-dynamic-objects bin/distro-install-file-lists bin/find-unneeded-includes bin/gbuild-to-ide bin/lo-all-static-libs bin/lo-xlate-lang bin/run bin/symbolstore.py bin/unpack-sources bin/update_pch bridges/inc bridges/Library_cpp_uno.mk bridges/source canvas/Executable_canvasdemo.mk canvas/Module_canvas.mk canvas/source canvas/workben chart2/inc chart2/IwyuFilter_chart2.yaml chart2/JunitTest_chart2_unoapi.mk chart2/Library_chartcontroller.mk chart2/Module_chart2.mk chart2/qa chart2/source ch art2/uiconfig cli_ure/source codemaker/source comphelper/JunitTest_comphelper_complex.mk comphelper/Library_comphelper.mk comphelper/qa comphelper/source compilerplugins/clang compilerplugins/LICENSE.TXT config_host/config_clang.h.in config_host/config_features.h.in config_host/config_fuzzers.h.in config_host/config_global.h.in config_host/config_gpgme.h.in config_host/config_kde4.h.in config_host/config_vclplug.h.in config_host.mk.in configmgr/JunitTest_configmgr_unoapi.mk configmgr/qa configmgr/source configure.ac connectivity/com connectivity/CppunitTest_connectivity_mysql_test.mk connectivity/inc connectivity/JunitTest_complex.mk connectivity/Library_mysqlc.mk connectivity/Module_connectivity.mk connectivity/qa connectivity/README connectivity/registry connectivity/source cppcanvas/Library_cppcanvas.mk cppcanvas/qa cppcanvas/source cppuhelper/qa cppuhelper/source cppu/qa cppu/source cpputools/source cui/inc cui/Library_cui.mk cui/qa cui/source cui/uiconfig dbaccess/CppunitTest_d baccess_hsqldb_test.mk dbaccess/CppunitTest_dbaccess_tdf119625.mk dbaccess/inc dbaccess/JunitTest_dbaccess_complex.mk dbaccess/JunitTest_dbaccess_unoapi.mk dbaccess/Library_dbu.mk dbaccess/Module_dbaccess.mk dbaccess/qa dbaccess/source dbaccess/uiconfig desktop/CppunitTest_desktop_lib.mk desktop/Executable_soffice_bin.mk desktop/Executable_soffice_com.mk desktop/Executable_soffice_exe.mk desktop/Executable_soffice.mk desktop/Executable_unopkg.mk desktop/inc desktop/Library_sofficeapp.mk desktop/Module_desktop.mk desktop/qa desktop/README desktop/source desktop/uiconfig desktop/win32 dictionaries distro-configs/Jenkins distro-configs/LibreOfficeCoverity.conf distro-configs/LibreOfficeFlatpak.conf distro-configs/LibreOfficeiOS.conf distro-configs/LibreOfficeLinux.conf distro-configs/LibreOfficeOpenBSD.conf download.lst drawinglayer/inc drawinglayer/qa drawinglayer/source dtrans/source editeng/CustomTarget_generated.mk editeng/inc editeng/qa editeng/source embeddedobj/Module_embeddedob j.mk embeddedobj/source embedserv/Module_embedserv.mk embedserv/source emfio/inc emfio/qa emfio/README emfio/source extensions/Executable_twain32shim.mk extensions/inc extensions/JunitTest_extensions_unoapi.mk extensions/Library_log.mk extensions/Library_scn.mk extensions/Library_so_activex_x64.mk extensions/Module_extensions.mk extensions/README extensions/source extensions/uiconfig external/boost external/cairo external/coinmp external/cppunit external/curl external/epm external/epoxy external/gpgmepp external/graphite external/harfbuzz external/hunspell external/hyphen external/icu external/lcms2 external/libcdr external/libcmis external/libebook external/libepubgen external/libetonyek external/libexttextcat external/libjpeg-turbo external/liblangtag external/libmwaw external/libnumbertext external/liborcus external/librevenge external/libwpd external/libwpg external/libwps external/libxml2 external/libxslt external/lpsolve external/Module_external.mk external/nss external/openss l external/pdfium external/poppler external/postgresql external/python3 external/redland external/rhino external/twain_dsm external/xmlsec extras/CustomTarget_autocorr.mk extras/Module_extras.mk extras/Package_autocorr.mk extras/Package_tplwizbitmap.mk extras/Persona_dark.mk extras/Persona_gray.mk extras/Persona_green.mk extras/Persona_pink.mk extras/Persona_sand.mk extras/Personas.mk extras/Persona_white.mk extras/source filter/Configuration_filter.mk filter/inc filter/JunitTest_filter_complex.mk filter/qa filter/source filter/uiconfig forms/inc forms/JunitTest_forms_complex.mk forms/JunitTest_forms_unoapi_1.mk forms/JunitTest_forms_unoapi_2.mk forms/JunitTest_forms_unoapi_3.mk forms/JunitTest_forms_unoapi_4.mk forms/source formula/inc formula/source formula/uiconfig fpicker/inc fpicker/README fpicker/source fpicker/uiconfig framework/inc framework/JunitTest_framework_complex.mk framework/JunitTest_framework_unoapi.mk framework/qa framework/source .git-hooks/pre-commit .gitignore . gitmodules helpcompiler/source helpcontent2 hwpfilter/source i18nlangtag/source i18npool/CustomTarget_breakiterator.mk i18npool/Executable_gendict.mk i18npool/inc i18npool/Library_localedata_others.mk i18npool/Module_i18npool.mk i18npool/source i18nutil/source icon-themes/breeze icon-themes/breeze_dark icon-themes/breeze_svg icon-themes/colibre icon-themes/colibre_svg icon-themes/elementary icon-themes/elementary_svg icon-themes/karasa_jaga icon-themes/sifr icon-themes/sifr_dark icon-themes/sifr_svg icon-themes/tango idlc/inc idlc/source idl/source include/android include/basegfx include/basic include/canvas include/codemaker include/com include/comphelper include/connectivity include/cppuhelper include/dbaccess include/desktop include/drawinglayer include/editeng include/filter include/formula include/fpicker include/framework include/i18nlangtag include/i18nutil include/IwyuFilter_include.yaml include/jvmaccess include/LibreOfficeKit include/o3tl include/oox include/opencl include /registry include/rtl include/sal include/salhelper include/sax include/sfx2 include/sot include/store include/svl include/svtools include/svx include/test include/toolkit include/tools include/unoidl include/unotest include/unotools include/vcl include/xmloff include/xmlscript instsetoo_native/CustomTarget_setup.mk instsetoo_native/inc_openoffice instsetoo_native/util io/qa ios/CustomTarget_iOS_link.mk ios/CustomTarget_iOS_setup.mk ios/Module_ios.mk io/source ios/README ios/source jurt/com jurt/JunitTest_java_remote.mk jurt/source jvmfwk/distributions jvmfwk/inc jvmfwk/plugins jvmfwk/source l10ntools/inc l10ntools/source librelogo/source libreofficekit/qa libreofficekit/source lingucomponent/source linguistic/JunitTest_linguistic_unoapi.mk linguistic/source lotuswordpro/inc lotuswordpro/source lo.xcent lo.xcent.in Makefile.in o3tl/CppunitTest_o3tl_tests.mk o3tl/qa odk/config odk/CustomTarget_javadoc.mk odk/docs odk/examples odk/index.html odk/index_online.html offapi/com offapi/typ e_reference offapi/UnoApi_offapi.mk officecfg/registry onlineupdate/source oovbaapi/ooo oox/inc oox/Library_oox.mk oox/source opencl/source osx/README package/inc package/qa package/source postprocess/CustomTarget_images.mk postprocess/CustomTarget_registry.mk postprocess/Rdb_services.mk pyuno/source qadevOOo/Jar_OOoRunner.mk qadevOOo/objdsc qadevOOo/tests readlicense_oo/docs readlicense_oo/license README.cross README.md registry/Module_registry.mk registry/source registry/tools reportbuilder/java reportdesign/inc reportdesign/JunitTest_reportdesign_complex.mk reportdesign/source reportdesign/uiconfig RepositoryExternal.mk RepositoryFixes.mk Repository.mk sal/cppunittester salhelper/IwyuFilter_salhelper.yaml salhelper/Module_salhelper.mk salhelper/qa salhelper/source salhelper/test sal/Library_sal.mk sal/osl sal/qa sal/rtl sal/textenc sax/qa sax/source scaddins/inc scaddins/source sccomp/inc sccomp/qa sccomp/source sc/CppunitTest_sc_cellfieldsobj.mk sc/CppunitTest_sc_cellformatsenum eration.mk sc/CppunitTest_sc_cellformatsobj.mk sc/CppunitTest_sc_cellsenumeration.mk sc/CppunitTest_sc_cellsobj.mk sc/CppunitTest_sc_chartobj.mk sc/CppunitTest_sc_ddelinkobj.mk sc/CppunitTest_sc_ddelinksobj.mk sc/CppunitTest_sc_drawpagesobj.mk sc/CppunitTest_sc_headerfieldsobj.mk sc/CppunitTest_sc_indexenumeration_cellannotationsenumeration.mk sc/CppunitTest_sc_indexenumeration_cellarealinksenumeration.mk sc/CppunitTest_sc_indexenumeration_databaserangesenumeration.mk sc/CppunitTest_sc_indexenumeration_datapilotfieldsenumeration.mk sc/CppunitTest_sc_indexenumeration_datapilotitemsenumeration.mk sc/CppunitTest_sc_indexenumeration_datapilottablesenumeration.mk sc/CppunitTest_sc_indexenumeration_ddelinksenumeration.mk sc/CppunitTest_sc_indexenumeration_functiondescriptionenumeration.mk sc/CppunitTest_sc_indexenumeration_labelrangesenumeration.mk sc/CppunitTest_sc_indexenumeration_namedrangesenumeration.mk sc/CppunitTest_sc_indexenumeration_scenariosenumeration.mk sc/CppunitTest_sc_inde xenumeration_sheetcellrangesenumeration.mk sc/CppunitTest_sc_indexenumeration_sheetlinksenumeration.mk sc/CppunitTest_sc_indexenumeration_spreadsheetsenumeration.mk sc/CppunitTest_sc_indexenumeration_spreadsheetviewpanesenumeration.mk sc/CppunitTest_sc_indexenumeration_subtotalfieldsenumeration.mk sc/CppunitTest_sc_indexenumeration_tableautoformatenumeration.mk sc/CppunitTest_sc_indexenumeration_tablechartsenumeration.mk sc/CppunitTest_sc_indexenumeration_tablecolumnsenumeration.mk sc/CppunitTest_sc_indexenumeration_tableconditionalentryenumeration.mk sc/CppunitTest_sc_indexenumeration_tablerowsenumeration.mk sc/CppunitTest_sc_indexenumeration_textfieldenumeration.mk sc/CppunitTest_sc_sheetlinksobj.mk sc/CppunitTest_sc_stylefamiliesobj.mk sc/CppunitTest_sc_styleloaderobj.mk sc/CppunitTest_sc_tableconditionalformat.mk sc/CppunitTest_sc_tableconditionalformatobj.mk sc/CppunitTest_sc_tablerowsobj.mk sc/CppunitTest_sc_uniquecellformatsenumeration.mk sc/CppunitTest_sc_uniquecellformatsob j.mk schema/libreoffice sc/inc sc/IwyuFilter_sc.yaml sc/JunitTest_sc_complex.mk sc/JunitTest_sc_unoapi_1.mk sc/JunitTest_sc_unoapi_2.mk sc/JunitTest_sc_unoapi_3.mk sc/JunitTest_sc_unoapi_4.mk sc/JunitTest_sc_unoapi_5.mk sc/JunitTest_sc_unoapi_6.mk sc/JunitTest_sc_unoapi_7.mk sc/Library_sc.mk sc/Module_sc.mk scp2/InstallScript_setup_osl.mk scp2/Module_scp2.mk scp2/source sc/qa scripting/examples scripting/java scripting/source sc/sdi sc/source sc/uiconfig sc/UIConfig_scalc.mk sc/UITest_calc_tests7.mk sc/UITest_chart.mk sc/UITest_hideShowSheet.mk sc/UITest_inputLine.mk sc/UITest_search_replace.mk sc/UITest_signatureLine.mk sc/UITest_sort.mk sdext/Library_PresentationMinimizer.mk sdext/source sd/inc sd/IwyuFilter_sd.yaml sd/JunitTest_sd_unoapi.mk sd/qa sd/sdi sd/source sd/uiconfig sd/UIConfig_sdraw.mk sd/UIConfig_simpress.mk setup_native/source sfx2/inc sfx2/JunitTest_sfx2_complex.mk sfx2/JunitTest_sfx2_unoapi.mk sfx2/Library_sfx.mk sfx2/qa sfx2/sdi sfx2/source sfx2/uiconfig shell/Libr ary_kde4be.mk shell/Module_shell.mk shell/qa shell/source slideshow/CppunitTest_slideshow.mk slideshow/Module_slideshow.mk slideshow/source slideshow/test smoketest/libtest.cxx solenv/bin solenv/clang-format solenv/CompilerTest_compilerplugins_clang.mk solenv/flatpak-manifest.in solenv/gbuild solenv/inc solenv/maven solenv/sanitizers solenv/vs soltools/cpp soltools/mkdepend sot/inc sot/JunitTest_sot_complex.mk sot/qa sot/source starmath/inc starmath/IwyuFilter_starmath.yaml starmath/JunitTest_starmath_unoapi.mk starmath/Library_smd.mk starmath/qa starmath/sdi starmath/source starmath/uiconfig starmath/util stoc/source stoc/test store/IwyuFilter_store.yaml store/source svgio/inc svgio/qa svgio/source svl/JunitTest_svl_complex.mk svl/qa svl/source svtools/inc svtools/JunitTest_svtools_unoapi.mk svtools/Library_svt.mk svtools/source svtools/uiconfig svx/CppunitTest_svx_unit.mk svx/inc svx/JunitTest_svx_unoapi.mk svx/Library_svxcore.mk svx/qa svx/sdi svx/source svx/uiconfig sw/CppunitTe st_sw_apitests.mk sw/CppunitTest_sw_mailmerge.mk sw/CppunitTest_sw_ooxmlexport13.mk sw/CppunitTest_sw_ooxmlexport_template.mk sw/CppunitTest_sw_ooxmlimport2.mk sw/CppunitTest_sw_rtfexport4.mk sw/CppunitTest_sw_rtfexport5.mk sw/CppunitTest_sw_unowriter.mk sw/CppunitTest_sw_ww8export2.mk sw/CppunitTest_sw_ww8export3.mk sw/CppunitTest_sw_ww8export.mk sw/CppunitTest_sw_ww8import.mk sw/CustomTarget_generated.mk swext/mediawiki sw/inc sw/IwyuFilter_sw.yaml sw/JunitTest_sw_complex.mk sw/JunitTest_sw_unoapi_1.mk sw/JunitTest_sw_unoapi_2.mk sw/JunitTest_sw_unoapi_3.mk sw/JunitTest_sw_unoapi_4.mk sw/Library_sw.mk sw/Module_sw.mk sw/ooxmlexport_setup.mk sw/PythonTest_sw_python.mk sw/qa sw/sdi sw/source sw/uiconfig sw/UIConfig_swriter.mk sw/UITest_chapterNumbering.mk sw/UITest_librelogo.mk sw/UITest_options.mk sw/UITest_writer_tests5.mk sysui/CustomTarget_share.mk sysui/desktop test/inc test/Library_subsequenttest.mk test/Library_test.mk test/source testtools/qa testtools/source toolkit/JunitTe st_toolkit_unoapi_1.mk toolkit/JunitTest_toolkit_unoapi_2.mk toolkit/JunitTest_toolkit_unoapi_3.mk toolkit/JunitTest_toolkit_unoapi_4.mk toolkit/Library_tk.mk toolkit/source tools/CppunitTest_tools_test.mk tools/qa tools/source translations ucbhelper/source ucb/JunitTest_ucb_complex.mk ucb/JunitTest_ucb_unoapi.mk ucb/Library_ucpcmis1.mk ucb/source udkapi/com uitest/calc_tests uitest/manual_tests uitest/test_main.py uitest/uitest UnoControls/inc UnoControls/source unodevtools/source unoidl/source unotools/JunitTest_unotools_complex.mk unotools/source unoxml/JunitTest_unordf_complex.mk unoxml/JunitTest_unoxml_complex.mk unoxml/source ure/source uui/inc uui/source uui/uiconfig vbahelper/source vcl/backendtest vcl/CppunitTest_vcl_lifecycle.mk vcl/CppunitTest_vcl_outdev.mk vcl/CustomTarget_kde4_moc.mk vcl/CustomTarget_kde5_moc.mk vcl/CustomTarget_qt5_macosx_rpath.mk vcl/Executable_mtpfuzzer.mk vcl/headless vcl/inc vcl/ios vcl/Library_vcl.mk vcl/Library_vclplug_gen.mk vcl/Library_vclplug_ gtk3_kde5.mk vcl/Library_vclplug_gtk3.mk vcl/Library_vclplug_kde4.mk vcl/Library_vclplug_kde5.mk vcl/Library_vclplug_osx.mk vcl/Library_vclplug_qt5.mk vcl/Module_vcl.mk vcl/opengl vcl/osx vcl/qa vcl/qt5 vcl/quartz vcl/README vcl/README.scheduler vcl/README.vars vcl/source vcl/StaticLibrary_vclmain.mk vcl/uiconfig vcl/UIConfig_vcl.mk vcl/unx vcl/win vcl/workben winaccessibility/inc winaccessibility/Module_winaccessibility.mk winaccessibility/source wizards/com wizards/source writerfilter/source writerperfect/inc writerperfect/qa writerperfect/source xmlhelp/source xmloff/inc xmloff/JunitTest_xmloff_unoapi.mk xmloff/qa xmloff/source xmlscript/source xmlsecurity/CppunitTest_xmlsecurity_signing.mk xmlsecurity/inc xmlsecurity/Library_xmlsecurity.mk xmlsecurity/Library_xsec_xmlsec.mk xmlsecurity/qa xmlsecurity/source xmlsecurity/uiconfig

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Fri Jan 25 22:53:48 UTC 2019


Rebased ref, commits from common ancestor:
commit f5f2e624db4710040d5b240a3b81ebb95bcdfe3c
Author:     Jan-Marek Glogowski <glogow at fbihome.de>
AuthorDate: Fri Jan 25 21:56:41 2019 +0100
Commit:     Jan-Marek Glogowski <glogow at fbihome.de>
CommitDate: Fri Jan 25 23:50:19 2019 +0100

    Just define the __clang_major___WORKAROUND_GUARD
    
    Change-Id: I84e969005ac2a96da449b5434ee5fdb37fc9b432

diff --git a/external/boost/UnpackedTarball_boost.mk b/external/boost/UnpackedTarball_boost.mk
index f20bd08d8c15..86f52ded439e 100644
--- a/external/boost/UnpackedTarball_boost.mk
+++ b/external/boost/UnpackedTarball_boost.mk
@@ -40,8 +40,6 @@ boost_patches += msvc2017.patch.0
 
 boost_patches += sse.patch.0
 
-boost_patches += Wundef.patch.0
-
 $(eval $(call gb_UnpackedTarball_UnpackedTarball,boost))
 
 $(eval $(call gb_UnpackedTarball_set_tarball,boost,$(BOOST_TARBALL)))
diff --git a/external/boost/Wundef.patch.0 b/external/boost/Wundef.patch.0
deleted file mode 100644
index aa2d383435d0..000000000000
--- a/external/boost/Wundef.patch.0
+++ /dev/null
@@ -1,11 +0,0 @@
---- boost/type_traits/detail/config.hpp
-+++ boost/type_traits/detail/config.hpp
-@@ -82,7 +82,7 @@
- // Can we implement accurate is_function/is_member_function_pointer (post C++03)?
- //
- #if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) && !BOOST_WORKAROUND(BOOST_GCC, < 40900)\
--      && !BOOST_WORKAROUND(BOOST_MSVC, < 1900) && !BOOST_WORKAROUND(__clang_major__, <= 4)
-+      && !BOOST_WORKAROUND(BOOST_MSVC, < 1900) && !(defined __clang_major__ && BOOST_WORKAROUND(__clang_major__, <= 4))
- #  define BOOST_TT_HAS_ASCCURATE_IS_FUNCTION
- #endif
- 
diff --git a/external/boost/boost_1_60_0.undef.warning.patch b/external/boost/boost_1_60_0.undef.warning.patch
index 79441d6cc1fc..0678afa9d5ce 100644
--- a/external/boost/boost_1_60_0.undef.warning.patch
+++ b/external/boost/boost_1_60_0.undef.warning.patch
@@ -1,6 +1,6 @@
 --- a/b/boost/boost/config/workaround.hpp
 +++ a/b/boost/boost/config/workaround.hpp
-@@ -237,6 +237,13 @@
+@@ -237,6 +237,19 @@
  #else
  #define BOOST_INTEL_WORKAROUND_GUARD 0
  #endif
@@ -11,6 +11,12 @@
 +#define BOOST_GCC_VERSION_WORKAROUND_GUARD 0
 +#endif
 +
++#ifndef __clang_major___WORKAROUND_GUARD
++#define __clang_major___WORKAROUND_GUARD 1
++#else
++#define __clang_major___WORKAROUND_GUARD 0
++#endif
++
  // Always define to zero, if it's used it'll be defined my MPL:
  #define BOOST_MPL_CFG_GCC_WORKAROUND_GUARD 0
  
commit f3608cf105a4b180e45a51a8fba2529ab1840c5a
Author:     Jan-Marek Glogowski <glogow at fbihome.de>
AuthorDate: Wed Nov 28 09:24:22 2018 +0100
Commit:     Jan-Marek Glogowski <glogow at fbihome.de>
CommitDate: Fri Jan 25 23:50:17 2019 +0100

    Revert OSX baseline bump
    
    Revert "Bump Xcode baseline to 9.3"
    This reverts commit b4f666f2e677b05cab8395fe7972b45b15f60c3f.
    
    Revert "Clang (and GCC) always has __cplusplus >= C++17 now"
    This reverts commit 3d79f0ff9eedec74a131796016add94f4a1be02d.
    
    This also includes some patches to fix some other stuff, mainly
    Apples broken std::regexp in libnumbertext and Boost 1.69.
    
    Change-Id: I040feeb382a0125ac8baa2900993ea0fd9f77d4d

diff --git a/configure.ac b/configure.ac
index 527e24a49c1f..ca7d7a0ff157 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2766,16 +2766,6 @@ if test $_os = Darwin -o $_os = iOS; then
     FRAMEWORKSHOME="$MACOSX_SDK_PATH/System/Library/Frameworks"
     MACOSX_DEPLOYMENT_TARGET="$with_macosx_version_min_required"
 
-    AC_MSG_CHECKING([whether Xcode is new enough])
-    my_xcode_ver1=$(xcrun xcodebuild -version | head -n 1)
-    my_xcode_ver2=${my_xcode_ver1#Xcode }
-    my_xcode_ver3=$(printf %s "$my_xcode_ver2" | $AWK -F. '{ print $1*100+($2<100?$2:99) }')
-    if test "$my_xcode_ver3" -ge 903; then
-        AC_MSG_RESULT([yes ($my_xcode_ver2)])
-    else
-        AC_MSG_ERROR(["$my_xcode_ver1" is too old or unrecognized, must be at least Xcode 9.3])
-    fi
-
     case "$with_macosx_version_min_required" in
     10.10)
         MAC_OS_X_VERSION_MIN_REQUIRED="101000"
diff --git a/external/boost/boost-android-unified.patch.1 b/external/boost/boost-android-unified.patch.1
index 46181b862f49..6412cdcf6ded 100644
--- a/external/boost/boost-android-unified.patch.1
+++ b/external/boost/boost-android-unified.patch.1
@@ -1,22 +1,26 @@
 --- a/boost/type_traits/detail/is_function_cxx_11.hpp
 +++ b/boost/type_traits/detail/is_function_cxx_11.hpp
-@@ -18,7 +18,7 @@
+@@ -18,7 +18,9 @@
     template <class T>
     struct is_function : public false_type {};
  
 -#if defined(__cpp_noexcept_function_type) && !defined(_MSC_VER)
-+#if defined(__cpp_noexcept_function_type) && !defined(_MSC_VER) && !(defined __ANDROID__ && defined __clang__ && __clang_major__ == 5 && __clang_minor__ == 0 && __clang_patchlevel__ == 300080)
++#if defined(__cpp_noexcept_function_type) && !defined(_MSC_VER) && \
++	!(defined __ANDROID__ && defined __clang__ && __clang_major__ == 5 && __clang_minor__ == 0 && __clang_patchlevel__ == 300080) && \
++	!(defined __apple_build_version__ && __apple_build_version__ <= 9000038)
  #define BOOST_TT_NOEXCEPT_PARAM , bool NE
  #define BOOST_TT_NOEXCEPT_DECL noexcept(NE)
  #else
 --- a/boost/type_traits/detail/is_member_function_pointer_cxx_11.hpp
 +++ b/boost/type_traits/detail/is_member_function_pointer_cxx_11.hpp
-@@ -31,7 +31,7 @@
+@@ -31,7 +31,9 @@
     template <class T>
     struct is_member_function_pointer<T const volatile> : public is_member_function_pointer<T> {};
  
 -#if defined(_MSVC_LANG) && (_MSVC_LANG >= 201703) 
-+#if (defined(_MSVC_LANG) && (_MSVC_LANG >= 201703)) || (defined __ANDROID__ && defined __clang__ && __clang_major__ == 5 && __clang_minor__ == 0 && __clang_patchlevel__ == 300080)
++#if (defined(_MSVC_LANG) && (_MSVC_LANG >= 201703)) || \
++	(defined __ANDROID__ && defined __clang__ && __clang_major__ == 5 && __clang_minor__ == 0 && __clang_patchlevel__ == 300080) || \
++	(defined __apple_build_version__ && __apple_build_version__ <= 9000038)
     // MSVC can't handle noexcept(b) as a deduced template parameter 
     // so we will have to write everything out :(
  #define BOOST_TT_NOEXCEPT_PARAM
diff --git a/external/libnumbertext/0002-regexp_match_not_null.diff b/external/libnumbertext/0002-regexp_match_not_null.diff
new file mode 100644
index 000000000000..30c4777ee75c
--- /dev/null
+++ b/external/libnumbertext/0002-regexp_match_not_null.diff
@@ -0,0 +1,12 @@
+diff -ur a/src/Soros.cxx b/src/Soros.cxx
+--- a/src/Soros.cxx	2018-10-09 10:33:20.000000000 +0200
++++ b/src/Soros.cxx	2018-11-15 16:49:08.000000000 +0100
+@@ -50,7 +50,7 @@
+     program = regex_replace(program, wregex(L"(^|[\n;])([^\n;#]*#[^\n]*\\[:[^\n:\\]]*:\\][^\n]*)"), L"$1#$2");
+     replace(filtered_lang, L"_", L"-");
+     program = regex_replace(program, wregex(L"(^|[\n;])#([^\n;#]*#[^\n]*\\[:" + filtered_lang + L":\\][^\n]*)"), L"$1$2");
+-    program = regex_replace(program, wregex(L"(#[^\n]*)?(\n|$)"), L";"); // remove comments
++    program = regex_replace(program, wregex(L"(#[^\n]*)?(\n|$)"), L";", std::regex_constants::match_not_null); // remove comments
+     // __numbertext__ sets the place of left zero deletion rule
+     if (program.find(L"__numbertext__") == std::wstring::npos)
+         program.insert(0, L"__numbertext__;");
diff --git a/external/libnumbertext/UnpackedTarball_libnumbertext.mk b/external/libnumbertext/UnpackedTarball_libnumbertext.mk
index 67b147393e31..52a1230e5b2c 100644
--- a/external/libnumbertext/UnpackedTarball_libnumbertext.mk
+++ b/external/libnumbertext/UnpackedTarball_libnumbertext.mk
@@ -19,6 +19,7 @@ $(eval $(call gb_UnpackedTarball_set_patchlevel,libnumbertext,1))
 #  <https://github.com/Numbertext/libnumbertext/pull/43>:
 $(eval $(call gb_UnpackedTarball_add_patches,libnumbertext, \
     external/libnumbertext/0001-Don-t-depend-on-en_US.UTF-8-locale.patch \
+    external/libnumbertext/0002-regexp_match_not_null.diff \
 ))
 
 # vim: set noet sw=4 ts=4:
diff --git a/unotools/source/i18n/resmgr.cxx b/unotools/source/i18n/resmgr.cxx
index 654d3c2fae19..a2a525860254 100644
--- a/unotools/source/i18n/resmgr.cxx
+++ b/unotools/source/i18n/resmgr.cxx
@@ -21,7 +21,7 @@
 // workdir/UnpackedTarball/boost/boost/locale/format.hpp using "std::auto_ptr<data> d;", but must
 // come very early here in case <memory> is already (indirectly) included earlier:
 #include <config_libcxx.h>
-#if HAVE_LIBCXX
+#if HAVE_LIBCXX && __cplusplus >= 201703L
 #define _LIBCPP_ENABLE_CXX17_REMOVED_AUTO_PTR
 #elif defined _MSC_VER
 #define _HAS_AUTO_PTR_ETC 1
commit 24c0e1a2c10f39b0f9d3dc895ab717d88acad9b0
Author:     Jan-Marek Glogowski <glogow at fbihome.de>
AuthorDate: Mon Sep 17 11:01:59 2018 +0200
Commit:     Jan-Marek Glogowski <glogow at fbihome.de>
CommitDate: Fri Jan 25 23:50:14 2019 +0100

    Qt5 use LO provided native file pickers
    
    This uses the native file pickers on Windows and MacOSX.
    
    Change-Id: Ic836d3ed8de0760c6c94c68d61f6eaa96f773000

diff --git a/vcl/Library_vclplug_qt5.mk b/vcl/Library_vclplug_qt5.mk
index 5c55118f57fa..4c604edfa450 100644
--- a/vcl/Library_vclplug_qt5.mk
+++ b/vcl/Library_vclplug_qt5.mk
@@ -89,7 +89,7 @@ $(eval $(call gb_Library_add_exception_objects,vclplug_qt5,\
     vcl/qt5/Qt5Clipboard \
     vcl/qt5/Qt5Data \
     vcl/qt5/Qt5DragAndDrop \
-    vcl/qt5/Qt5FilePicker \
+    $(if $(USING_X11),vcl/qt5/Qt5FilePicker) \
     vcl/qt5/Qt5Font \
     vcl/qt5/Qt5FontFace \
     vcl/qt5/Qt5Frame \
diff --git a/vcl/qt5/Qt5Instance.cxx b/vcl/qt5/Qt5Instance.cxx
index 1c4cad5d3a09..68fb5bf6c684 100644
--- a/vcl/qt5/Qt5Instance.cxx
+++ b/vcl/qt5/Qt5Instance.cxx
@@ -225,17 +225,27 @@ void Qt5Instance::ProcessEvent(SalUserEvent aEvent)
 }
 
 css::uno::Reference<css::ui::dialogs::XFilePicker2>
-Qt5Instance::createFilePicker(const css::uno::Reference<css::uno::XComponentContext>&)
+Qt5Instance::createFilePicker(const css::uno::Reference<css::uno::XComponentContext>& cntxt)
 {
+#if (defined _WIN32 || defined MACOSX)
+    return SalInstance::createFilePicker(cntxt);
+#else
+    (void)cntxt;
     return css::uno::Reference<css::ui::dialogs::XFilePicker2>(
         new Qt5FilePicker(QFileDialog::ExistingFile));
+#endif
 }
 
 css::uno::Reference<css::ui::dialogs::XFolderPicker2>
-Qt5Instance::createFolderPicker(const css::uno::Reference<css::uno::XComponentContext>&)
+Qt5Instance::createFolderPicker(const css::uno::Reference<css::uno::XComponentContext>& cntxt)
 {
+#if (defined _WIN32 || defined MACOSX)
+    return SalInstance::createFolderPicker(cntxt);
+#else
+    (void)cntxt;
     return css::uno::Reference<css::ui::dialogs::XFolderPicker2>(
         new Qt5FilePicker(QFileDialog::Directory));
+#endif
 }
 
 css::uno::Reference<css::uno::XInterface>
commit d2da9dd4ef3b56a0491022c3469957339c161123
Author:     Jan-Marek Glogowski <glogow at fbihome.de>
AuthorDate: Thu Sep 13 11:32:12 2018 +0200
Commit:     Jan-Marek Glogowski <glogow at fbihome.de>
CommitDate: Fri Jan 25 23:50:12 2019 +0100

    Qt5 build VCL plugin on MacOSX
    
    Change-Id: I6ddec483703c95faf69b7b146363376765d5d6f8

diff --git a/Repository.mk b/Repository.mk
index f97de31dd93a..ddb396717fbe 100644
--- a/Repository.mk
+++ b/Repository.mk
@@ -484,6 +484,7 @@ $(eval $(call gb_Helper_register_libraries_for_install,OOOLIBS,ooo, \
 			AppleRemote \
 		) \
 		fps_aqua \
+		$(if $(ENABLE_QT5),vclplug_qt5) \
 		vclplug_osx \
 		MacOSXSpell \
 	) \
diff --git a/configure.ac b/configure.ac
index 99687dec8119..527e24a49c1f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -671,6 +671,7 @@ darwin*) # macOS or iOS
             host=x86_64-apple-darwin
         fi
     else
+        test_qt5=yes
         _os=Darwin
         INSTROOTBASESUFFIX=/$PRODUCTNAME_WITHOUT_SPACES.app
         INSTROOTCONTENTSUFFIX=/Contents
@@ -10101,6 +10102,7 @@ else
     enable_gtk3=no
     case "$_os" in
     WINNT) R="win" ;;
+    Darwin) R="osx" ;;
     esac
 fi
 
@@ -10958,13 +10960,7 @@ if test \( "$test_kde5" = "yes" -a "$ENABLE_KDE5" = "TRUE" \) -o \
         \( "$test_qt5" = "yes" -a "$ENABLE_QT5" = "TRUE" \) -o \
         \( "$test_gtk3_kde5" = "yes" -a "$ENABLE_GTK3_KDE5" = "TRUE" \)
 then
-    qt5_incdirs="$QT5INC /usr/include/qt5 /usr/include $x_includes"
-    qt5_libdirs="$QT5LIB /usr/lib/qt5 /usr/lib $x_libraries"
-
-    if test -n "$supports_multilib"; then
-        qt5_libdirs="$qt5_libdirs /usr/lib64/qt5 /usr/lib64/qt /usr/lib64"
-    fi
-
+    qt5_fwk_search="QtCore QtGui QtWidgets QtNetwork"
     qt5_test_include="QtWidgets/qapplication.h"
     if test $_os == "WINNT"; then
         qt5_test_library="Qt5Widgets.lib"
@@ -10972,12 +10968,25 @@ then
         qt5_test_library="libQt5Widgets.so"
     fi
 
+    qt5_incdirs=""
+    qt5_libdirs=""
+    if test "$USING_X11" = TRUE; then
+        qt5_incdirs="$QT5INC /usr/include/qt5 /usr/include $x_includes"
+        qt5_libdirs="$QT5LIB /usr/lib/qt5 /usr/lib $x_libraries"
+        if test -n "$supports_multilib"; then
+            qt5_libdirs="$qt5_libdirs /usr/lib64/qt5 /usr/lib64/qt /usr/lib64"
+        fi
+    fi
+
     dnl Check for qmake5
     AC_PATH_PROGS( QMAKE5, [qmake-qt5 qmake], no, [$QT5DIR/bin:$PATH] )
     if test "$QMAKE5" = "no"; then
         AC_MSG_ERROR([Qmake not found.  Please specify the root of your Qt5 installation by exporting QT5DIR before running "configure".])
     else
-        qmake5_test_ver="`$QMAKE5 -v 2>&1 | $SED -n -e 's/^Using Qt version \(5\.[[0-9.]]\+\).*$/\1/p'`"
+        case "$host_os" in
+        darwin*) qmake5_test_ver="`$QMAKE5 -v 2>&1 | $SED -n -e 's/^Using Qt version \(5\.[[0-9.]]\{0,\}\).*$/\1/p'`" ;;
+        *) qmake5_test_ver="`$QMAKE5 -v 2>&1 | $SED -n -e 's/^Using Qt version \(5\.[[0-9.]]\+\).*$/\1/p'`" ;;
+        esac
         if test -z "$qmake5_test_ver"; then
             AC_MSG_ERROR([Wrong qmake for Qt5 found. Please specify the root of your Qt5 installation by exporting QT5DIR before running "configure".])
         fi
@@ -10990,49 +10999,87 @@ then
         fi
     fi
 
-    qt5_incdirs="`$QMAKE5 -query QT_INSTALL_HEADERS` $qt5_incdirs"
-    qt5_libdirs="`$QMAKE5 -query QT_INSTALL_LIBS` $qt5_libdirs"
-    if test $_os == "WINNT"; then
-        qt5_incdirs="`cygpath -m $qt5_incdirs`"
-        qt5_libdirs="`cygpath -m $qt5_libdirs`"
-    fi
+    qt5_cmake_incdir="`$QMAKE5 -query QT_INSTALL_HEADERS`"
+    qt5_cmake_libdir="`$QMAKE5 -query QT_INSTALL_LIBS`"
+    case "$_os" in
+    WINNT)
+        qt5_incdirs="`cygpath -m $qt5_cmake_incdir`"
+        qt5_libdirs="`cygpath -m $qt5_cmake_libdir`"
+        ;;
+    Darwin)
+        qt5_incdirs="$qt5_cmake_incdir"
+        qt5_libdirs="$qt5_cmake_libdir"
+        qt5_libdir="$qt5_cmake_libdir"
+        ;;
+    *)
+        qt5_incdirs="$qt5_cmake_incdir $qt5_incdirs"
+        qt5_libdirs="$qt5_cmake_libdir $qt5_libdirs"
+        ;;
+    esac
+    AC_MSG_NOTICE([Qt5 headers: ${qt5_cmake_incdir}])
+    AC_MSG_NOTICE([Qt5 libraries: ${qt5_cmake_libdir}])
 
-    AC_MSG_CHECKING([for Qt5 headers])
-    qt5_incdir="no"
-    for inc_dir in $qt5_incdirs; do
-        if test -r "$inc_dir/$qt5_test_include"; then
-            qt5_incdir="$inc_dir"
-            break
+    case "$_os" in
+    Darwin)
+        QT5_LIBS="-F ${qt5_libdirs}"
+        AC_MSG_CHECKING([for used Qt5 frameworks])
+        qt5_fwk_missing=""
+        for fwk in ${qt5_fwk_search}; do
+            if test ! -d "${qt5_libdirs}/${fwk}.framework"; then
+                qt5_fwk_missing="${qt5_fwk_missing} $fwk";
+            fi
+            QT5_LIBS="${QT5_LIBS} -framework $fwk"
+        done
+        if test -n "$qt5_fwk_missing"; then
+            AC_MSG_ERROR([Missing Qt5 frameworks in ${qt5_libdirs}:${qt5_fwk_missing}])
+        else
+            AC_MSG_RESULT([${qt5_fwk_search}])
         fi
-    done
-    AC_MSG_RESULT([$qt5_incdir])
-    if test "x$qt5_incdir" = "xno"; then
-        AC_MSG_ERROR([Qt5 headers not found.  Please specify the root of your Qt5 installation by exporting QT5DIR before running "configure".])
-    fi
+        ;;
+    *)
+        AC_MSG_CHECKING([for Qt5 headers])
+        qt5_incdir="no"
+        for inc_dir in $qt5_incdirs; do
+            if test -r "$inc_dir/$qt5_test_include"; then
+                qt5_incdir="$inc_dir"
+                break
+            fi
+        done
 
-    AC_MSG_CHECKING([for Qt5 libraries])
-    qt5_libdir="no"
-    for lib_dir in $qt5_libdirs; do
-        if test -r "$lib_dir/$qt5_test_library"; then
-            qt5_libdir="$lib_dir"
-            break
+        AC_MSG_RESULT([$qt5_incdir])
+        if test "x$qt5_incdir" = "xno"; then
+            AC_MSG_ERROR([Qt5 headers not found.  Please specify the root of your Qt5 installation by exporting QT5DIR before running "configure".])
+        fi
+
+        AC_MSG_CHECKING([for Qt5 libraries])
+        qt5_libdir="no"
+        for lib_dir in $qt5_libdirs; do
+            if test -r "$lib_dir/$qt5_test_library"; then
+                qt5_libdir="$lib_dir"
+                break
+            fi
+        done
+        AC_MSG_RESULT([$qt5_libdir])
+        if test "x$qt5_libdir" = "xno"; then
+            AC_MSG_ERROR([Qt5 libraries not found.  Please specify the root of your Qt5 installation by exporting QT5DIR before running "configure".])
         fi
-    done
-    AC_MSG_RESULT([$qt5_libdir])
-    if test "x$qt5_libdir" = "xno"; then
-        AC_MSG_ERROR([Qt5 libraries not found.  Please specify the root of your Qt5 installation by exporting QT5DIR before running "configure".])
-    fi
+
+        if test $_os == "WINNT"; then
+            QT5_LIBS="-LIBPATH:$qt5_libdir Qt5Core.lib Qt5Gui.lib Qt5Widgets.lib Qt5Network.lib"
+        else
+            QT5_LIBS="-L$qt5_libdir -lQt5Core -lQt5Gui -lQt5Widgets -lQt5Network"
+        fi
+
+        ;;
+    esac
 
     QT5_CFLAGS="-I$qt5_incdir -DQT_CLEAN_NAMESPACE -DQT_THREAD_SUPPORT"
-    QT5_CFLAGS=$(printf '%s' "$QT5_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
-    if test $_os == "WINNT"; then
-        QT5_LIBS="-LIBPATH:$qt5_libdir Qt5Core.lib Qt5Gui.lib Qt5Widgets.lib Qt5Network.lib"
-    else
-        QT5_LIBS="-L$qt5_libdir -lQt5Core -lQt5Gui -lQt5Widgets -lQt5Network"
+    if test "$_os" = "Darwin"; then
+        QT5_CFLAGS="$QT5_CFLAGS -F $qt5_cmake_libdir"
     fi
+    QT5_CFLAGS=$(printf '%s' "$QT5_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
 
     dnl Check for Meta Object Compiler
-
     AC_PATH_PROGS( MOC5, [moc-qt5 moc], no, [`dirname $qt5_libdir`/bin:$QT5DIR/bin:$PATH] )
     if test "$MOC5" = "no"; then
         AC_MSG_ERROR([Qt Meta Object Compiler not found.  Please specify
diff --git a/include/vcl/dllapi.h b/include/vcl/dllapi.h
index 805d1cb00908..668cbeb174c6 100644
--- a/include/vcl/dllapi.h
+++ b/include/vcl/dllapi.h
@@ -36,7 +36,7 @@
 #define UITEST_DLLPUBLIC SAL_DLLPUBLIC_IMPORT
 #endif
 
-#if (defined UNX  && ! defined MACOS) || defined _WIN32
+#if defined UNX || defined MACOS || defined _WIN32
 #define VCL_PLUGIN_PUBLIC VCL_DLLPUBLIC
 #else
 #define VCL_PLUGIN_PUBLIC SAL_DLLPRIVATE
diff --git a/vcl/Library_vclplug_osx.mk b/vcl/Library_vclplug_osx.mk
index 7b2e52f3b3d3..91396d425dec 100644
--- a/vcl/Library_vclplug_osx.mk
+++ b/vcl/Library_vclplug_osx.mk
@@ -71,6 +71,7 @@ $(eval $(call gb_Library_add_cxxflags,vclplug_osx,\
 
 $(eval $(call gb_Library_add_defs,vclplug_osx,\
     -DMACOSX_BUNDLE_IDENTIFIER=\"$(MACOSX_BUNDLE_IDENTIFIER)\" \
+    -DVCLPLUG_OSX_IMPLEMENTATION \
 ))
 
 $(eval $(call gb_Library_add_objcxxobjects,vclplug_osx,\
diff --git a/vcl/Library_vclplug_qt5.mk b/vcl/Library_vclplug_qt5.mk
index 0d3a522b1b62..5c55118f57fa 100644
--- a/vcl/Library_vclplug_qt5.mk
+++ b/vcl/Library_vclplug_qt5.mk
@@ -26,6 +26,7 @@ $(eval $(call gb_Library_set_include,vclplug_qt5,\
     -I$(SRCDIR)/vcl/inc \
     -I$(SRCDIR)/vcl/inc/qt5 \
 ))
+#	$(if $(filter MACOS,$(OS)), -F $(QT5_LIBS)) \
 
 $(eval $(call gb_Library_add_defs,vclplug_qt5,\
     -DVCLPLUG_QT5_IMPLEMENTATION \
@@ -67,6 +68,7 @@ $(eval $(call gb_Library_use_externals,vclplug_qt5,\
 $(eval $(call gb_Library_add_defs,vclplug_qt5,\
     $(QT5_CFLAGS) \
 ))
+
 $(eval $(call gb_Library_add_libs,vclplug_qt5,\
     $(QT5_LIBS) \
 ))
@@ -96,13 +98,11 @@ $(eval $(call gb_Library_add_exception_objects,vclplug_qt5,\
     vcl/qt5/Qt5Graphics_GDI \
     vcl/qt5/Qt5Graphics_Text \
     vcl/qt5/Qt5Instance \
-    vcl/qt5/Qt5Instance_Print \
     vcl/qt5/Qt5MainWindow \
     vcl/qt5/Qt5Menu \
     vcl/qt5/Qt5Object \
     vcl/qt5/Qt5OpenGLContext \
     vcl/qt5/Qt5Painter \
-    vcl/qt5/Qt5Printer \
     $(if $(USING_X11),vcl/qt5/Qt5System) \
     vcl/qt5/Qt5Timer \
     vcl/qt5/Qt5Tools \
@@ -111,6 +111,34 @@ $(eval $(call gb_Library_add_exception_objects,vclplug_qt5,\
     vcl/qt5/Qt5XAccessible \
 ))
 
+ifeq ($(OS),MACOSX)
+$(eval $(call gb_Library_use_system_darwin_frameworks,vclplug_qt5,\
+    ApplicationServices \
+    Cocoa \
+    Carbon \
+    CoreFoundation \
+    $(if $(filter X86_64,$(CPUNAME)),,QuickTime) \
+))
+
+$(eval $(call gb_Library_add_cxxflags,vclplug_qt5,\
+    $(gb_OBJCXXFLAGS) \
+))
+
+$(eval $(call gb_Library_use_libraries,vclplug_qt5,\
+    vclplug_osx \
+))
+
+$(eval $(call gb_Library_add_objcxxobjects,vclplug_qt5,\
+    vcl/qt5/Qt5Instance_Print \
+    vcl/qt5/Qt5Printer \
+))
+else
+$(eval $(call gb_Library_add_exception_objects,vclplug_qt5,\
+    vcl/qt5/Qt5Instance_Print \
+    vcl/qt5/Qt5Printer \
+))
+endif
+
 ifeq ($(OS),LINUX)
 $(eval $(call gb_Library_add_libs,vclplug_qt5,\
     -lm \
diff --git a/vcl/Module_vcl.mk b/vcl/Module_vcl.mk
index 7b4951e38160..3c8ae6cb7670 100644
--- a/vcl/Module_vcl.mk
+++ b/vcl/Module_vcl.mk
@@ -101,6 +101,12 @@ $(eval $(call gb_Module_add_targets,vcl,\
     Package_osxres \
     Library_vclplug_osx \
 ))
+ifneq ($(ENABLE_QT5),)
+$(eval $(call gb_Module_add_targets,vcl,\
+    CustomTarget_qt5_moc \
+    Library_vclplug_qt5 \
+))
+endif
 endif
 
 ifeq ($(OS),WNT)
diff --git a/vcl/inc/osx/salprn.h b/vcl/inc/osx/salprn.h
index 0c7ec1e9edfd..8fd210654eac 100644
--- a/vcl/inc/osx/salprn.h
+++ b/vcl/inc/osx/salprn.h
@@ -22,13 +22,14 @@
 
 #include <osx/osxvcltypes.h>
 
+#include <vclpluginapi.h>
 #include <salprn.hxx>
 
 #include <memory>
 
 class AquaSalGraphics;
 
-class AquaSalInfoPrinter : public SalInfoPrinter
+class VCLPLUG_OSX_PUBLIC AquaSalInfoPrinter : public SalInfoPrinter
 {
     /// Printer graphics
     AquaSalGraphics*        mpGraphics;
@@ -111,7 +112,7 @@ class AquaSalInfoPrinter : public SalInfoPrinter
 };
 
 
-class AquaSalPrinter : public SalPrinter
+class VCLPLUG_OSX_PUBLIC AquaSalPrinter : public SalPrinter
 {
     AquaSalInfoPrinter*         mpInfoPrinter;          // pointer to the compatible InfoPrinter
     public:
diff --git a/vcl/inc/qt5/Qt5Data.hxx b/vcl/inc/qt5/Qt5Data.hxx
index 9d64d566274f..27e0421ed4b3 100644
--- a/vcl/inc/qt5/Qt5Data.hxx
+++ b/vcl/inc/qt5/Qt5Data.hxx
@@ -29,10 +29,10 @@
 class QCursor;
 
 class VCLPLUG_QT5_PUBLIC Qt5Data
-#ifndef _WIN32
-    : public GenericUnixSalData
-#else
+#if (defined MACOSX || defined _WIN32)
     : public SalData
+#else
+    : public GenericUnixSalData
 #endif
 {
     o3tl::enumarray<PointerStyle, std::unique_ptr<QCursor>> m_aCursors;
@@ -40,7 +40,7 @@ class VCLPLUG_QT5_PUBLIC Qt5Data
 public:
     explicit Qt5Data(SalInstance* pInstance);
     virtual ~Qt5Data() override;
-#ifndef _WIN32
+#if !(defined MACOSX || defined _WIN32)
     virtual void ErrorTrapPush() override;
     virtual bool ErrorTrapPop(bool bIgnoreError = true) override;
 #endif
diff --git a/vcl/inc/qt5/Qt5Frame.hxx b/vcl/inc/qt5/Qt5Frame.hxx
index 1f9e6477cf48..7afcb7831414 100644
--- a/vcl/inc/qt5/Qt5Frame.hxx
+++ b/vcl/inc/qt5/Qt5Frame.hxx
@@ -24,7 +24,7 @@
 
 #include "Qt5Tools.hxx"
 
-#ifndef _WIN32
+#if !(defined MACOSX || defined _WIN32)
 #include <headless/svpgdi.hxx>
 #endif
 #include <vcl/svapp.hxx>
@@ -44,7 +44,7 @@ class QScreen;
 class QImage;
 class SvpSalGraphics;
 
-#ifdef _WIN32
+#if (defined MACOSX || defined _WIN32)
 typedef void (*damageHandler)(void* handle,
                               sal_Int32 nExtentsX, sal_Int32 nExtentsY,
                               sal_Int32 nExtentsWidth, sal_Int32 nExtentsHeight);
@@ -68,7 +68,7 @@ class VCLPLUG_QT5_PUBLIC Qt5Frame : public QObject, public SalFrame
     const bool m_bUseCairo;
     std::unique_ptr<QImage> m_pQImage;
     std::unique_ptr<Qt5Graphics> m_pQt5Graphics;
-#ifndef _WIN32
+#if !(defined MACOSX || defined _WIN32)
     UniqueCairoSurface m_pSurface;
     std::unique_ptr<SvpSalGraphics> m_pOurSvpGraphics;
     // in base class, this ptr is the same as m_pOurSvpGraphic
@@ -137,7 +137,7 @@ public:
     void Damage(sal_Int32 nExtentsX, sal_Int32 nExtentsY, sal_Int32 nExtentsWidth,
                 sal_Int32 nExtentsHeight) const;
 
-#ifndef _WIN32
+#if !(defined MACOSX || defined _WIN32)
     virtual void InitSvpSalGraphics(SvpSalGraphics* pSvpSalGraphics);
 #endif
     virtual SalGraphics* AcquireGraphics() override;
diff --git a/vcl/inc/qt5/Qt5Instance.hxx b/vcl/inc/qt5/Qt5Instance.hxx
index b5f52c041932..5e62da4ff40c 100644
--- a/vcl/inc/qt5/Qt5Instance.hxx
+++ b/vcl/inc/qt5/Qt5Instance.hxx
@@ -31,7 +31,7 @@ class QApplication;
 class SalYieldMutex;
 class SalFrame;
 
-#ifdef _WIN32
+#if (defined MACOSX || defined _WIN32)
 #include <salinst.hxx>
 #include <comphelper/solarmutex.hxx>
 #include <memory>
@@ -43,7 +43,7 @@ class SalFrame;
 // Qts moc doesn't like macros, so this is handled by an extra base class
 // It also keeps all the #ifdef handling local
 class VCLPLUG_QT5_PUBLIC Qt5MocInstance
-#ifdef _WIN32
+#if (defined MACOSX || defined _WIN32)
     : public SalInstance
 #else
     : public SalGenericInstance
@@ -51,7 +51,7 @@ class VCLPLUG_QT5_PUBLIC Qt5MocInstance
 {
 public:
     Qt5MocInstance()
-#ifdef _WIN32
+#if (defined MACOSX || defined _WIN32)
         : SalInstance(o3tl::make_unique<comphelper::SolarMutex>())
 #else
         : SalGenericInstance(o3tl::make_unique<SalYieldMutex>())
@@ -59,7 +59,7 @@ public:
     {
     }
 
-#ifndef _WIN32
+#if !(defined MACOSX || defined _WIN32)
     virtual GenPspGraphics* CreatePrintGraphics() override;
     virtual void PostPrintersChanged() override;
 #endif
diff --git a/vcl/inc/qt5/Qt5Printer.hxx b/vcl/inc/qt5/Qt5Printer.hxx
index 4fcae075fe3c..84a46a9be8f7 100644
--- a/vcl/inc/qt5/Qt5Printer.hxx
+++ b/vcl/inc/qt5/Qt5Printer.hxx
@@ -19,21 +19,26 @@
 
 #pragma once
 
-#ifndef _WIN32
-#include <unx/genprn.h>
-#else
+#ifdef _WIN32
 #include <WinDef.h>
 #include <win/salprn.h>
+#else
+#ifdef MACOSX
+#include <osx/salprn.h>
+#else
+#include <unx/genprn.h>
+#endif
 #endif
-
-class Point;
-class SalFrame;
 
 class Qt5Printer
-#ifndef _WIN32
-    : public PspSalPrinter
-#else
+#ifdef _WIN32
     : public WinSalPrinter
+#else
+#ifdef MACOSX
+    : public AquaSalPrinter
+#else
+    : public PspSalPrinter
+#endif
 #endif
 {
 public:
diff --git a/vcl/inc/qt5/Qt5System.hxx b/vcl/inc/qt5/Qt5System.hxx
index 6bd732956137..ef514227ed94 100644
--- a/vcl/inc/qt5/Qt5System.hxx
+++ b/vcl/inc/qt5/Qt5System.hxx
@@ -11,21 +11,29 @@
 
 #include <vcl/sysdata.hxx>
 
-#ifndef _WIN32
-#include <unx/gensys.h>
-#else
+#ifdef _WIN32
 #include <win/salsys.h>
+#else
+#ifdef MACOSX
+#include <osx/salsys.h>
+#else
+#include <unx/gensys.h>
+#endif
 #endif
 
 class Qt5System
-#ifndef _WIN32
-    : public SalGenericSystem
-#else
+#ifdef _WIN32
     : public WinSalSystem
+#else
+#ifdef MACOSX
+    : public AquaSalSystem
+#else
+    : public SalGenericSystem
+#endif
 #endif
 {
 public:
-#ifndef _WIN32
+#if !(defined MACOSX || defined _WIN32)
     virtual unsigned int GetDisplayScreenCount() override;
     virtual tools::Rectangle GetDisplayScreenPosSizePixel(unsigned int nScreen) override;
     virtual int ShowNativeDialog(const OUString& rTitle, const OUString& rMessage,
diff --git a/vcl/qt5/Qt5Data.cxx b/vcl/qt5/Qt5Data.cxx
index 1e2166a34c72..0475d0dbaecc 100644
--- a/vcl/qt5/Qt5Data.cxx
+++ b/vcl/qt5/Qt5Data.cxx
@@ -149,18 +149,18 @@
 #include <unx/x11_cursors/wsshow_curs.h>
 #include <unx/x11_cursors/wsshow_mask.h>
 
-#ifndef _WIN32
+#if !(defined MACOSX || defined _WIN32)
 #include <unx/glyphcache.hxx>
 #endif
 
 Qt5Data::Qt5Data(SalInstance* pInstance)
-#ifndef _WIN32
-    : GenericUnixSalData(SAL_DATA_QT5, pInstance)
-#else
+#if (defined MACOSX || defined _WIN32)
     : SalData()
+#else
+    : GenericUnixSalData(SAL_DATA_QT5, pInstance)
 #endif
 {
-#ifdef _WIN32
+#if (defined MACOSX || defined _WIN32)
     m_pInstance = pInstance;
     SetSalData(this);
 #endif
@@ -318,7 +318,7 @@ QCursor& Qt5Data::getCursor(PointerStyle ePointerStyle)
     return *m_aCursors[ePointerStyle];
 }
 
-#ifndef _WIN32
+#if !(defined _WIN32 || defined MACOSX)
 void Qt5Data::ErrorTrapPush() {}
 
 bool Qt5Data::ErrorTrapPop(bool /*bIgnoreError*/) { return false; }
diff --git a/vcl/qt5/Qt5Frame.cxx b/vcl/qt5/Qt5Frame.cxx
index 285eba74d079..53c1b5eab324 100644
--- a/vcl/qt5/Qt5Frame.cxx
+++ b/vcl/qt5/Qt5Frame.cxx
@@ -48,7 +48,7 @@
 
 #include <com/sun/star/datatransfer/dnd/DNDConstants.hpp>
 
-#ifndef _WIN32
+#if !(defined MACOSX || defined _WIN32)
 #include <cairo.h>
 #include <headless/svpgdi.hxx>
 #endif
@@ -63,7 +63,7 @@ static void SvpDamageHandler(void* handle, sal_Int32 nExtentsX, sal_Int32 nExten
 Qt5Frame::Qt5Frame(Qt5Frame* pParent, SalFrameStyleFlags nStyle, bool bUseCairo )
     : m_pTopLevel(nullptr)
     , m_bUseCairo(bUseCairo)
-#ifndef _WIN32
+#if !(defined MACOSX || defined _WIN32)
     , m_pSvpGraphics(nullptr)
 #endif
     , m_bNullRegion(true)
@@ -147,7 +147,7 @@ Qt5Frame::Qt5Frame(Qt5Frame* pParent, SalFrameStyleFlags nStyle, bool bUseCairo
         maGeometry.nRightDecoration = 0;
     }
 
-#ifndef _WIN32
+#if !(defined MACOSX || defined _WIN32)
     m_aSystemData.nSize = sizeof(SystemEnvData);
     m_aSystemData.aWindow = m_pQWidget->winId();
     m_aSystemData.aShellWindow = reinterpret_cast<sal_IntPtr>(this);
@@ -164,7 +164,7 @@ Qt5Frame::~Qt5Frame()
     else
         delete m_pQWidget;
 
-#ifndef _WIN32
+#if !(defined MACOSX || defined _WIN32)
     m_aSystemData.aShellWindow = 0;
 #endif
 }
@@ -188,7 +188,7 @@ void Qt5Frame::TriggerPaintEvent(QRect aRect)
     CallCallback(SalEvent::Paint, &aPaintEvt);
 }
 
-#ifndef _WIN32
+#if !(defined MACOSX || defined _WIN32)
 void Qt5Frame::InitSvpSalGraphics(SvpSalGraphics* pSvpSalGraphics)
 {
     int width = 640;
@@ -208,7 +208,7 @@ SalGraphics* Qt5Frame::AcquireGraphics()
 
     m_bGraphicsInUse = true;
 
-#ifndef _WIN32
+#if !(defined MACOSX || defined _WIN32)
     if (m_bUseCairo)
     {
         if (!m_pOurSvpGraphics.get())
@@ -235,7 +235,7 @@ SalGraphics* Qt5Frame::AcquireGraphics()
 void Qt5Frame::ReleaseGraphics(SalGraphics* pSalGraph)
 {
     (void)pSalGraph;
-#ifndef _WIN32
+#if !(defined MACOSX || defined _WIN32)
     if (m_bUseCairo)
         assert(pSalGraph == m_pOurSvpGraphics.get());
     else
diff --git a/vcl/qt5/Qt5Graphics_Text.cxx b/vcl/qt5/Qt5Graphics_Text.cxx
index 4028614c36f7..d27010020d3a 100644
--- a/vcl/qt5/Qt5Graphics_Text.cxx
+++ b/vcl/qt5/Qt5Graphics_Text.cxx
@@ -24,7 +24,7 @@
 
 #include <o3tl/make_unique.hxx>
 #include <vcl/fontcharmap.hxx>
-#ifndef _WIN32
+#if !(defined MACOSX || defined _WIN32)
 #include <unx/geninst.h>
 #include <unx/fontmanager.hxx>
 #include <unx/glyphcache.hxx>
@@ -93,7 +93,7 @@ bool Qt5Graphics::GetFontCapabilities(vcl::FontCapabilities& rFontCapabilities)
 
 void Qt5Graphics::GetDevFontList(PhysicalFontCollection* pPFC)
 {
-#ifndef _WIN32
+#if !(defined MACOSX || defined _WIN32)
     static const bool bUseFontconfig = (nullptr == getenv("SAL_VCL_QT5_NO_FONTCONFIG"));
 #endif
 
@@ -102,7 +102,7 @@ void Qt5Graphics::GetDevFontList(PhysicalFontCollection* pPFC)
         return;
 
     QFontDatabase aFDB;
-#ifndef _WIN32
+#if !(defined MACOSX || defined _WIN32)
     QStringList aFontFamilyList;
     if (bUseFontconfig)
         aFontFamilyList = aFDB.families();
diff --git a/vcl/qt5/Qt5Instance.cxx b/vcl/qt5/Qt5Instance.cxx
index 5d130dfd45be..1c4cad5d3a09 100644
--- a/vcl/qt5/Qt5Instance.cxx
+++ b/vcl/qt5/Qt5Instance.cxx
@@ -104,7 +104,7 @@ std::unique_ptr<SalVirtualDevice>
 Qt5Instance::CreateVirtualDevice(SalGraphics* pGraphics, long& nDX, long& nDY, DeviceFormat eFormat,
                                  const SystemGraphicsData* /* pData */)
 {
-#ifndef _WIN32
+#if !(defined MACOSX || defined _WIN32)
     if (m_bUseCairo)
     {
         SvpSalGraphics* pSvpSalGraphics = dynamic_cast<SvpSalGraphics*>(pGraphics);
@@ -149,7 +149,7 @@ SalSystem* Qt5Instance::CreateSalSystem() { return new Qt5System; }
 
 std::shared_ptr<SalBitmap> Qt5Instance::CreateSalBitmap()
 {
-#ifndef _WIN32
+#if !(defined MACOSX || defined _WIN32)
     if (m_bUseCairo)
         return std::make_shared<SvpSalBitmap>();
     else
@@ -322,7 +322,7 @@ VCLPLUG_QT5_PUBLIC SalInstance* create_SalInstance()
     for (int i = 0; i < nFakeArgc; i++)
         pFakeArgv[i] = pFakeArgvFreeable[i];
 
-#ifndef _WIN32
+#if !(defined MACOSX || defined _WIN32)
     char* session_manager = nullptr;
     if (getenv("SESSION_MANAGER") != nullptr)
     {
@@ -335,7 +335,7 @@ VCLPLUG_QT5_PUBLIC SalInstance* create_SalInstance()
     *pFakeArgc = nFakeArgc;
     pQApplication = new QApplication(*pFakeArgc, pFakeArgv);
 
-#ifndef _WIN32
+#if !(defined MACOSX || defined _WIN32)
     if (session_manager != nullptr)
     {
         // coverity[tainted_string] - trusted source for setenv
diff --git a/vcl/qt5/Qt5Instance_Print.cxx b/vcl/qt5/Qt5Instance_Print.cxx
index 0eb8a30cdce5..d2964f19db0f 100644
--- a/vcl/qt5/Qt5Instance_Print.cxx
+++ b/vcl/qt5/Qt5Instance_Print.cxx
@@ -20,7 +20,7 @@
 #include <Qt5Instance.hxx>
 #include <Qt5Printer.hxx>
 
-#ifndef _WIN32
+#if !(defined MACOSX || defined _WIN32)
 #include <vcl/svapp.hxx>
 #include <vcl/timer.hxx>
 
@@ -39,7 +39,7 @@ using namespace psp;
  *  static helpers
  */
 
-#ifndef _WIN32
+#if !(defined MACOSX || defined _WIN32)
 static OUString getPdfDir(const PrinterInfo& rInfo)
 {
     OUString aDir;
@@ -63,7 +63,7 @@ static OUString getPdfDir(const PrinterInfo& rInfo)
 SalInfoPrinter* Qt5Instance::CreateInfoPrinter(SalPrinterQueueInfo* pQueueInfo,
                                                ImplJobSetup* pJobSetup)
 {
-#ifndef _WIN32
+#if !(defined MACOSX || defined _WIN32)
     // create and initialize SalInfoPrinter
     PspSalInfoPrinter* pPrinter = new PspSalInfoPrinter;
     configurePspInfoPrinter(pPrinter, pQueueInfo, pJobSetup);
@@ -79,7 +79,7 @@ void Qt5Instance::DestroyInfoPrinter(SalInfoPrinter* pPrinter) { delete pPrinter
 
 std::unique_ptr<SalPrinter> Qt5Instance::CreatePrinter(SalInfoPrinter* pInfoPrinter)
 {
-#ifndef _WIN32
+#if !(defined MACOSX || defined _WIN32)
     // create and initialize SalPrinter
     Qt5Printer* pPrinter = new Qt5Printer(pInfoPrinter);
     pPrinter->m_aJobData = static_cast<PspSalInfoPrinter*>(pInfoPrinter)->m_aJobData;
@@ -93,7 +93,7 @@ std::unique_ptr<SalPrinter> Qt5Instance::CreatePrinter(SalInfoPrinter* pInfoPrin
 
 void Qt5Instance::GetPrinterQueueInfo(ImplPrnQueueList* pList)
 {
-#ifndef _WIN32
+#if !(defined MACOSX || defined _WIN32)
     PrinterInfoManager& rManager(PrinterInfoManager::get());
     static const char* pNoSyncDetection = getenv("SAL_DISABLE_SYNCHRONOUS_PRINTER_DETECTION");
     if (!pNoSyncDetection || !*pNoSyncDetection)
@@ -136,7 +136,7 @@ void Qt5Instance::GetPrinterQueueState(SalPrinterQueueInfo*) {}
 
 OUString Qt5Instance::GetDefaultPrinter()
 {
-#ifndef _WIN32
+#if !(defined MACOSX || defined _WIN32)
     PrinterInfoManager& rManager(PrinterInfoManager::get());
     return rManager.getDefaultPrinter();
 #else
@@ -144,7 +144,7 @@ OUString Qt5Instance::GetDefaultPrinter()
 #endif
 }
 
-#ifndef _WIN32
+#if !(defined MACOSX || defined _WIN32)
 void Qt5MocInstance::PostPrintersChanged() {}
 
 GenPspGraphics* Qt5MocInstance::CreatePrintGraphics() { return new GenPspGraphics(); }
diff --git a/vcl/qt5/Qt5Instance_Print.mm b/vcl/qt5/Qt5Instance_Print.mm
new file mode 100644
index 000000000000..b4004831fda8
--- /dev/null
+++ b/vcl/qt5/Qt5Instance_Print.mm
@@ -0,0 +1,20 @@
+/* -*- 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 .
+ */
+
+#include "Qt5Instance_Print.cxx"
diff --git a/vcl/qt5/Qt5Object.cxx b/vcl/qt5/Qt5Object.cxx
index df1a4e5504d7..5e8c5e8b86ff 100644
--- a/vcl/qt5/Qt5Object.cxx
+++ b/vcl/qt5/Qt5Object.cxx
@@ -38,7 +38,7 @@ Qt5Object::Qt5Object(Qt5Frame* pParent, bool bShow)
     if (bShow)
         m_pQWidget->show();
 
-#ifndef _WIN32
+#if !(defined MACOSX || defined _WIN32)
     m_aSystemData.nSize = sizeof(SystemEnvData);
     m_aSystemData.aWindow = pParent->GetQWidget()->winId();
     m_aSystemData.aShellWindow = reinterpret_cast<sal_IntPtr>(this);
diff --git a/vcl/qt5/Qt5Printer.cxx b/vcl/qt5/Qt5Printer.cxx
index 354045efb437..b32faf71a97d 100644
--- a/vcl/qt5/Qt5Printer.cxx
+++ b/vcl/qt5/Qt5Printer.cxx
@@ -25,11 +25,16 @@
 
 #include <Qt5Printer.hxx>
 
+#if defined _WIN32
 Qt5Printer::Qt5Printer(SalInfoPrinter* /* pInfoPrinter */)
-#ifndef _WIN32
-    : PspSalPrinter(pInfoPrinter)
-#else
     : WinSalPrinter()
+#else
+Qt5Printer::Qt5Printer(SalInfoPrinter* pInfoPrinter)
+#ifdef MACOSX
+    : AquaSalPrinter(static_cast<AquaSalInfoPrinter*>(pInfoPrinter))
+#else
+    : PspSalPrinter(pInfoPrinter)
+#endif
 #endif
 {
 }
diff --git a/vcl/qt5/Qt5Printer.mm b/vcl/qt5/Qt5Printer.mm
new file mode 100644
index 000000000000..6f2eed046866
--- /dev/null
+++ b/vcl/qt5/Qt5Printer.mm
@@ -0,0 +1,20 @@
+/* -*- 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 .
+ */
+
+#include "Qt5Printer.cxx"
diff --git a/vcl/qt5/Qt5Tools.cxx b/vcl/qt5/Qt5Tools.cxx
index b12a03539bbb..e14c6099d927 100644
--- a/vcl/qt5/Qt5Tools.cxx
+++ b/vcl/qt5/Qt5Tools.cxx
@@ -21,7 +21,7 @@
 
 #include <vcl/event.hxx>
 
-#ifndef _WIN32
+#if !(defined MACOSX || defined _WIN32)
 #include <cairo.h>
 
 void CairoDeleter::operator()(cairo_surface_t* pSurface) const { cairo_surface_destroy(pSurface); }
diff --git a/vcl/qt5/Qt5Widget.cxx b/vcl/qt5/Qt5Widget.cxx
index 4dad8b3bda20..1ff36d002d1b 100644
--- a/vcl/qt5/Qt5Widget.cxx
+++ b/vcl/qt5/Qt5Widget.cxx
@@ -42,7 +42,7 @@
 #include <vcl/commandevent.hxx>
 #include <vcl/event.hxx>
 
-#ifndef _WIN32
+#if !(defined MACOSX || defined _WIN32)
 #include <cairo.h>
 #include <headless/svpgdi.hxx>
 #endif
@@ -53,7 +53,7 @@ void Qt5Widget::paintEvent(QPaintEvent* pEvent)
     if (!m_pFrame->m_bNullRegion)
         p.setClipRegion(m_pFrame->m_aRegion);
 
-#ifndef _WIN32
+#if !(defined MACOSX || defined _WIN32)
     if (m_pFrame->m_bUseCairo)
     {
         cairo_surface_t* pSurface = m_pFrame->m_pSurface.get();
@@ -70,7 +70,7 @@ void Qt5Widget::paintEvent(QPaintEvent* pEvent)
 
 void Qt5Widget::resizeEvent(QResizeEvent* pEvent)
 {
-#ifndef _WIN32
+#if !(defined MACOSX || defined _WIN32)
     if (m_pFrame->m_bUseCairo)
     {
         int width = size().width();
commit 9f805c1bb028c9e193c2c9e4d2b2714af28dedb3
Author:     Jan-Marek Glogowski <glogow at fbihome.de>
AuthorDate: Wed Sep 12 10:30:05 2018 +0200
Commit:     Jan-Marek Glogowski <glogow at fbihome.de>
CommitDate: Fri Jan 25 23:50:10 2019 +0100

    Qt5 build VCL plugin on Windows
    
    Change-Id: I1bb673eb2c228d767caca6a9a860bd9d113d082f

diff --git a/Repository.mk b/Repository.mk
index 4ae85285c7d0..f97de31dd93a 100644
--- a/Repository.mk
+++ b/Repository.mk
@@ -475,6 +475,7 @@ $(eval $(call gb_Helper_register_libraries_for_install,OOOLIBS,ooo, \
 		ado \
 		oleautobridge \
 		smplmail \
+		$(if $(ENABLE_QT5),vclplug_qt5) \
 		vclplug_win \
 		wininetbe1 \
 	) \
diff --git a/config_host/config_vclplug.h.in b/config_host/config_vclplug.h.in
index 5bd9b4b98fe4..5a6875756b94 100644
--- a/config_host/config_vclplug.h.in
+++ b/config_host/config_vclplug.h.in
@@ -10,5 +10,6 @@ Settings about which X11 desktops have support enabled.
 #define ENABLE_GTK 0
 #define ENABLE_KDE5 0
 #define ENABLE_GTK3_KDE5 0
+#define ENABLE_QT5 0
 
 #endif
diff --git a/configure.ac b/configure.ac
index 16666c887612..99687dec8119 100644
--- a/configure.ac
+++ b/configure.ac
@@ -636,6 +636,7 @@ cygwin*|interix*)
     test_xrender=no
     test_freetype=no
     test_fontconfig=no
+    test_qt5=yes
     _os=WINNT
 
     DLLPOST=".dll"
@@ -4681,7 +4682,6 @@ if test "$USING_X11" != TRUE; then
     build_gstreamer_1_0=no
     build_gstreamer_0_10=no
     test_kde5=no
-    test_qt5=no
     test_gtk3_kde5=no
     enable_cairo_canvas=no
 fi
@@ -10094,10 +10094,16 @@ dnl ===================================================================
 dnl Test which vclplugs have to be built.
 dnl ===================================================================
 R=""
-if test "$USING_X11" != TRUE; then
+if test "$USING_X11" = TRUE; then
+    R="gen"
+else
     enable_gtk=no
     enable_gtk3=no
+    case "$_os" in
+    WINNT) R="win" ;;
+    esac
 fi
+
 GTK3_CFLAGS=""
 GTK3_LIBS=""
 ENABLE_GTK3=""
@@ -10108,7 +10114,7 @@ if test "x$enable_gtk3" = "xyes"; then
     : ${with_system_cairo:=yes}
     PKG_CHECK_MODULES(GTK3, gtk+-3.0 >= 3.18 gtk+-unix-print-3.0 gmodule-no-export-2.0 glib-2.0 >= 2.38 cairo, ENABLE_GTK3="TRUE", ENABLE_GTK3="")
     if test "x$ENABLE_GTK3" = "xTRUE"; then
-        R="gtk3"
+        R=" gtk3"
         dnl Avoid installed by unpackaged files for now.
         if test -z "$PKGFORMAT"; then
             GOBJECT_INTROSPECTION_CHECK(INTROSPECTION_REQUIRED_VERSION)
@@ -10960,7 +10966,11 @@ then
     fi
 
     qt5_test_include="QtWidgets/qapplication.h"
-    qt5_test_library="libQt5Widgets.so"
+    if test $_os == "WINNT"; then
+        qt5_test_library="Qt5Widgets.lib"
+    else
+        qt5_test_library="libQt5Widgets.so"
+    fi
 
     dnl Check for qmake5
     AC_PATH_PROGS( QMAKE5, [qmake-qt5 qmake], no, [$QT5DIR/bin:$PATH] )
@@ -10982,6 +10992,10 @@ then
 
     qt5_incdirs="`$QMAKE5 -query QT_INSTALL_HEADERS` $qt5_incdirs"
     qt5_libdirs="`$QMAKE5 -query QT_INSTALL_LIBS` $qt5_libdirs"
+    if test $_os == "WINNT"; then
+        qt5_incdirs="`cygpath -m $qt5_incdirs`"
+        qt5_libdirs="`cygpath -m $qt5_libdirs`"
+    fi
 
     AC_MSG_CHECKING([for Qt5 headers])
     qt5_incdir="no"
@@ -11011,7 +11025,11 @@ then
 
     QT5_CFLAGS="-I$qt5_incdir -DQT_CLEAN_NAMESPACE -DQT_THREAD_SUPPORT"
     QT5_CFLAGS=$(printf '%s' "$QT5_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
-    QT5_LIBS="-L$qt5_libdir -lQt5Core -lQt5Gui -lQt5Widgets -lQt5Network"
+    if test $_os == "WINNT"; then
+        QT5_LIBS="-LIBPATH:$qt5_libdir Qt5Core.lib Qt5Gui.lib Qt5Widgets.lib Qt5Network.lib"
+    else
+        QT5_LIBS="-L$qt5_libdir -lQt5Core -lQt5Gui -lQt5Widgets -lQt5Network"
+    fi
 
     dnl Check for Meta Object Compiler
 
diff --git a/vcl/CustomTarget_qt5_macosx_rpath.mk b/vcl/CustomTarget_qt5_macosx_rpath.mk
new file mode 100644
index 000000000000..49ffac57cb33
--- /dev/null
+++ b/vcl/CustomTarget_qt5_macosx_rpath.mk
@@ -0,0 +1,22 @@
+# -*- 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/.
+#
+
+$(eval $(call gb_CustomTarget_CustomTarget,vcl/qt5))
+
+#$(call gb_CustomTarget_get_target,vcl/qt5) : \
+#	$(call gb_LinkTarget_get_target,vclplug_qt5).rpath
+#	$(call gb_LinkTarget__get_workdir_linktargetname,vclplug_qt5)
+
+#$(call gb_CustomTarget_get_workdir,$(INSTROOT)/program/)/%.moc : \
+#		$(SRCDIR)/vcl/inc/qt5/%.hxx \
+#		| $(call gb_CustomTarget_get_workdir,vcl/qt5)/.dir
+#	$(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),$(true),RPATH,1)
+#	install_name_tool -add_rpath $(QT5_LIBDIR)
+
+# vim: set noet sw=4:
diff --git a/vcl/Library_vclplug_qt5.mk b/vcl/Library_vclplug_qt5.mk
index f7fbfd1cdbdb..0d3a522b1b62 100644
--- a/vcl/Library_vclplug_qt5.mk
+++ b/vcl/Library_vclplug_qt5.mk
@@ -35,6 +35,7 @@ $(eval $(call gb_Library_use_sdk_api,vclplug_qt5))
 
 $(eval $(call gb_Library_use_libraries,vclplug_qt5,\
     $(if $(USING_X11),vclplug_gen) \
+    $(if $(filter WNT,$(OS)),vclplug_win) \
     vcl \
     tl \
     utl \
@@ -54,7 +55,7 @@ $(eval $(call gb_Library_use_libraries,vclplug_qt5,\
 
 $(eval $(call gb_Library_use_externals,vclplug_qt5,\
     boost_headers \
-    cairo \
+    $(if $(USING_X11),cairo) \
     epoxy \
     graphite \
     harfbuzz \
@@ -102,7 +103,7 @@ $(eval $(call gb_Library_add_exception_objects,vclplug_qt5,\
     vcl/qt5/Qt5OpenGLContext \
     vcl/qt5/Qt5Painter \
     vcl/qt5/Qt5Printer \
-    vcl/qt5/Qt5System \
+    $(if $(USING_X11),vcl/qt5/Qt5System) \
     vcl/qt5/Qt5Timer \
     vcl/qt5/Qt5Tools \
     vcl/qt5/Qt5VirtualDevice \
@@ -112,9 +113,9 @@ $(eval $(call gb_Library_add_exception_objects,vclplug_qt5,\
 
 ifeq ($(OS),LINUX)
 $(eval $(call gb_Library_add_libs,vclplug_qt5,\
-	-lm \
-	-ldl \
-	-lpthread \
+    -lm \
+    -ldl \
+    -lpthread \
 ))
 endif
 
diff --git a/vcl/Module_vcl.mk b/vcl/Module_vcl.mk
index 95dd579c38de..7b4951e38160 100644
--- a/vcl/Module_vcl.mk
+++ b/vcl/Module_vcl.mk
@@ -108,6 +108,12 @@ $(eval $(call gb_Module_add_targets,vcl,\
     WinResTarget_vcl \
     Library_vclplug_win \
 ))
+ifneq ($(ENABLE_QT5),)
+$(eval $(call gb_Module_add_targets,vcl,\
+    CustomTarget_qt5_moc \
+    Library_vclplug_qt5 \
+))
+endif
 endif
 
 ifeq ($(OS),HAIKU)
diff --git a/vcl/inc/qt5/Qt5Bitmap.hxx b/vcl/inc/qt5/Qt5Bitmap.hxx
index ba2ea5a2f58a..3f1421a820a5 100644
--- a/vcl/inc/qt5/Qt5Bitmap.hxx
+++ b/vcl/inc/qt5/Qt5Bitmap.hxx
@@ -19,13 +19,14 @@
 
 #pragma once
 
+#include <vclpluginapi.h>
 #include <salbmp.hxx>
 
 #include <memory>
 
 class QImage;
 
-class VCL_DLLPUBLIC Qt5Bitmap : public SalBitmap
+class VCLPLUG_QT5_PUBLIC Qt5Bitmap : public SalBitmap
 {
     std::unique_ptr<QImage> m_pImage;
     BitmapPalette m_aPalette;
diff --git a/vcl/inc/qt5/Qt5Data.hxx b/vcl/inc/qt5/Qt5Data.hxx
index ef537d0c040f..9d64d566274f 100644
--- a/vcl/inc/qt5/Qt5Data.hxx
+++ b/vcl/inc/qt5/Qt5Data.hxx
@@ -28,17 +28,22 @@
 
 class QCursor;
 
-class VCLPLUG_QT5_PUBLIC Qt5Data : public GenericUnixSalData
+class VCLPLUG_QT5_PUBLIC Qt5Data
+#ifndef _WIN32
+    : public GenericUnixSalData
+#else
+    : public SalData
+#endif
 {
     o3tl::enumarray<PointerStyle, std::unique_ptr<QCursor>> m_aCursors;
 
 public:
     explicit Qt5Data(SalInstance* pInstance);
     virtual ~Qt5Data() override;
-
+#ifndef _WIN32
     virtual void ErrorTrapPush() override;
     virtual bool ErrorTrapPop(bool bIgnoreError = true) override;
-
+#endif
     QCursor& getCursor(PointerStyle ePointerStyle);
 
     static bool noNativeControls();
diff --git a/vcl/inc/qt5/Qt5Frame.hxx b/vcl/inc/qt5/Qt5Frame.hxx
index e88c1ead3d85..1f9e6477cf48 100644
--- a/vcl/inc/qt5/Qt5Frame.hxx
+++ b/vcl/inc/qt5/Qt5Frame.hxx
@@ -24,7 +24,9 @@
 
 #include "Qt5Tools.hxx"
 
+#ifndef _WIN32
 #include <headless/svpgdi.hxx>
+#endif
 #include <vcl/svapp.hxx>
 #include <vcl/sysdata.hxx>
 
@@ -42,6 +44,18 @@ class QScreen;
 class QImage;
 class SvpSalGraphics;
 
+#ifdef _WIN32
+typedef void (*damageHandler)(void* handle,
+                              sal_Int32 nExtentsX, sal_Int32 nExtentsY,
+                              sal_Int32 nExtentsWidth, sal_Int32 nExtentsHeight);
+
+struct VCL_DLLPUBLIC DamageHandler
+{
+    void *handle;
+    damageHandler damaged;
+};
+#endif
+
 class VCLPLUG_QT5_PUBLIC Qt5Frame : public QObject, public SalFrame
 {
     Q_OBJECT
@@ -54,12 +68,14 @@ class VCLPLUG_QT5_PUBLIC Qt5Frame : public QObject, public SalFrame
     const bool m_bUseCairo;
     std::unique_ptr<QImage> m_pQImage;
     std::unique_ptr<Qt5Graphics> m_pQt5Graphics;
+#ifndef _WIN32
     UniqueCairoSurface m_pSurface;
     std::unique_ptr<SvpSalGraphics> m_pOurSvpGraphics;
     // in base class, this ptr is the same as m_pOurSvpGraphic
     // in derived class, it can point to a derivative
     // of SvpSalGraphics (which the derived class then owns)
     SvpSalGraphics* m_pSvpGraphics;
+#endif
     DamageHandler m_aDamageHandler;
     QRegion m_aRegion;
     bool m_bNullRegion;
@@ -121,7 +137,9 @@ public:
     void Damage(sal_Int32 nExtentsX, sal_Int32 nExtentsY, sal_Int32 nExtentsWidth,
                 sal_Int32 nExtentsHeight) const;
 
+#ifndef _WIN32
     virtual void InitSvpSalGraphics(SvpSalGraphics* pSvpSalGraphics);
+#endif
     virtual SalGraphics* AcquireGraphics() override;
     virtual void ReleaseGraphics(SalGraphics* pGraphics) override;
 
diff --git a/vcl/inc/qt5/Qt5Graphics.hxx b/vcl/inc/qt5/Qt5Graphics.hxx
index b11f926f72bb..f44923d6b781 100644
--- a/vcl/inc/qt5/Qt5Graphics.hxx
+++ b/vcl/inc/qt5/Qt5Graphics.hxx
@@ -30,6 +30,10 @@
 #include "Qt5Data.hxx"
 #include "Qt5Graphics_Controls.hxx"
 
+#ifdef _WIN32
+#include <QtWidgets/QPushButton>
+#endif
+
 class PhysicalFontCollection;
 class QImage;
 class QPushButton;
diff --git a/vcl/inc/qt5/Qt5Instance.hxx b/vcl/inc/qt5/Qt5Instance.hxx
index 91682bd87950..b5f52c041932 100644
--- a/vcl/inc/qt5/Qt5Instance.hxx
+++ b/vcl/inc/qt5/Qt5Instance.hxx
@@ -20,10 +20,10 @@
 #pragma once
 
 #include <vclpluginapi.h>
-#include <unx/geninst.h>
 #include <salusereventlist.hxx>
 
 #include <osl/conditn.hxx>
+#include <o3tl/make_unique.hxx>
 
 #include <QtCore/QObject>
 
@@ -31,8 +31,42 @@ class QApplication;
 class SalYieldMutex;
 class SalFrame;
 
+#ifdef _WIN32
+#include <salinst.hxx>
+#include <comphelper/solarmutex.hxx>
+#include <memory>
+#include <unordered_map>
+#else
+#include <unx/geninst.h>
+#endif
+
+// Qts moc doesn't like macros, so this is handled by an extra base class
+// It also keeps all the #ifdef handling local
+class VCLPLUG_QT5_PUBLIC Qt5MocInstance
+#ifdef _WIN32
+    : public SalInstance
+#else
+    : public SalGenericInstance
+#endif
+{
+public:
+    Qt5MocInstance()
+#ifdef _WIN32
+        : SalInstance(o3tl::make_unique<comphelper::SolarMutex>())
+#else
+        : SalGenericInstance(o3tl::make_unique<SalYieldMutex>())
+#endif
+    {
+    }
+
+#ifndef _WIN32
+    virtual GenPspGraphics* CreatePrintGraphics() override;
+    virtual void PostPrintersChanged() override;
+#endif
+};
+
 class VCLPLUG_QT5_PUBLIC Qt5Instance : public QObject,
-                                       public SalGenericInstance,
+                                       public Qt5MocInstance,
                                        public SalUserEventList
 {
     Q_OBJECT
@@ -79,7 +113,6 @@ public:
     virtual void GetPrinterQueueInfo(ImplPrnQueueList* pList) override;
     virtual void GetPrinterQueueState(SalPrinterQueueInfo* pInfo) override;
     virtual OUString GetDefaultPrinter() override;
-    virtual void PostPrintersChanged() override;
 
     virtual std::unique_ptr<SalMenu> CreateMenu(bool, Menu*) override;
     virtual std::unique_ptr<SalMenuItem> CreateMenuItem(const SalItemParams&) override;
@@ -98,8 +131,6 @@ public:
     virtual void AddToRecentDocumentList(const OUString& rFileUrl, const OUString& rMimeType,
                                          const OUString& rDocumentService) override;
 
-    virtual GenPspGraphics* CreatePrintGraphics() override;
-
     virtual bool IsMainThread() const override;
 
     virtual void TriggerUserEventProcessing() override;
diff --git a/vcl/inc/qt5/Qt5Printer.hxx b/vcl/inc/qt5/Qt5Printer.hxx
index 81a38206e4f1..4fcae075fe3c 100644
--- a/vcl/inc/qt5/Qt5Printer.hxx
+++ b/vcl/inc/qt5/Qt5Printer.hxx
@@ -19,11 +19,22 @@
 
 #pragma once
 
+#ifndef _WIN32
 #include <unx/genprn.h>
+#else
+#include <WinDef.h>
+#include <win/salprn.h>
+#endif
 
+class Point;
 class SalFrame;
 
-class Qt5Printer : public PspSalPrinter
+class Qt5Printer
+#ifndef _WIN32
+    : public PspSalPrinter
+#else
+    : public WinSalPrinter
+#endif
 {
 public:
     Qt5Printer(SalInfoPrinter* pInfoPrinter);
diff --git a/vcl/inc/qt5/Qt5System.hxx b/vcl/inc/qt5/Qt5System.hxx
index 0d51bb29f358..6bd732956137 100644
--- a/vcl/inc/qt5/Qt5System.hxx
+++ b/vcl/inc/qt5/Qt5System.hxx
@@ -10,15 +10,27 @@
 #pragma once
 
 #include <vcl/sysdata.hxx>
+
+#ifndef _WIN32
 #include <unx/gensys.h>
+#else
+#include <win/salsys.h>
+#endif
 
-class Qt5System : public SalGenericSystem
+class Qt5System
+#ifndef _WIN32
+    : public SalGenericSystem
+#else
+    : public WinSalSystem
+#endif
 {
 public:
+#ifndef _WIN32
     virtual unsigned int GetDisplayScreenCount() override;
     virtual tools::Rectangle GetDisplayScreenPosSizePixel(unsigned int nScreen) override;
     virtual int ShowNativeDialog(const OUString& rTitle, const OUString& rMessage,
                                  const std::vector<OUString>& rButtons) override;
+#endif
 };
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/inc/qt5/Qt5Tools.hxx b/vcl/inc/qt5/Qt5Tools.hxx
index 57bf94793955..5fe9444e2960 100644
--- a/vcl/inc/qt5/Qt5Tools.hxx
+++ b/vcl/inc/qt5/Qt5Tools.hxx
@@ -94,7 +94,9 @@ inline QImage::Format getBitFormat(sal_uInt16 nBitCount)
             std::abort();
             break;
     }
+#ifndef _WIN32
     return QImage::Format_Invalid;
+#endif
 }
 
 inline sal_uInt16 getFormatBits(QImage::Format eFormat)
@@ -114,10 +116,13 @@ inline sal_uInt16 getFormatBits(QImage::Format eFormat)
             return 32;
         default:
             std::abort();
+#ifndef _WIN32
             return 0;
+#endif
     }
 }
 
+#ifndef _WIN32
 typedef struct _cairo_surface cairo_surface_t;
 struct CairoDeleter
 {
@@ -125,6 +130,7 @@ struct CairoDeleter
 };
 
 typedef std::unique_ptr<cairo_surface_t, CairoDeleter> UniqueCairoSurface;
+#endif
 
 sal_uInt16 GetKeyModCode(Qt::KeyboardModifiers eKeyModifiers);
 sal_uInt16 GetMouseModCode(Qt::MouseButtons eButtons);
diff --git a/vcl/inc/win/salprn.h b/vcl/inc/win/salprn.h
index c0c6e7fb7932..ef8737acc1f4 100644
--- a/vcl/inc/win/salprn.h
+++ b/vcl/inc/win/salprn.h
@@ -70,7 +70,7 @@ public:
 };
 
 
-class WinSalPrinter : public SalPrinter
+class SAL_DLLPUBLIC_EXPORT WinSalPrinter : public SalPrinter
 {
 public:
     WinSalGraphics*         mpGraphics;             // current Printer graphics
diff --git a/vcl/inc/win/salsys.h b/vcl/inc/win/salsys.h
index 03f627b5abb2..59f087136b79 100644
--- a/vcl/inc/win/salsys.h
+++ b/vcl/inc/win/salsys.h
@@ -25,7 +25,7 @@
 #include <vector>
 #include <map>
 
-class WinSalSystem : public SalSystem
+class SAL_DLLPUBLIC_EXPORT WinSalSystem : public SalSystem
 {
 public:
     struct DisplayMonitor
diff --git a/vcl/qt5/Qt5Data.cxx b/vcl/qt5/Qt5Data.cxx
index 1830dab0e523..1e2166a34c72 100644
--- a/vcl/qt5/Qt5Data.cxx
+++ b/vcl/qt5/Qt5Data.cxx
@@ -149,11 +149,21 @@
 #include <unx/x11_cursors/wsshow_curs.h>
 #include <unx/x11_cursors/wsshow_mask.h>
 
+#ifndef _WIN32
 #include <unx/glyphcache.hxx>
+#endif
 
 Qt5Data::Qt5Data(SalInstance* pInstance)
+#ifndef _WIN32
     : GenericUnixSalData(SAL_DATA_QT5, pInstance)
+#else
+    : SalData()
+#endif
 {
+#ifdef _WIN32
+    m_pInstance = pInstance;
+    SetSalData(this);
+#endif
     ImplSVData* pSVData = ImplGetSVData();
 
     // draw toolbars on separate lines
@@ -308,9 +318,11 @@ QCursor& Qt5Data::getCursor(PointerStyle ePointerStyle)
     return *m_aCursors[ePointerStyle];
 }
 
+#ifndef _WIN32
 void Qt5Data::ErrorTrapPush() {}
 
 bool Qt5Data::ErrorTrapPop(bool /*bIgnoreError*/) { return false; }
+#endif
 
 bool Qt5Data::noNativeControls()
 {
diff --git a/vcl/qt5/Qt5Frame.cxx b/vcl/qt5/Qt5Frame.cxx
index e3ced2dec236..285eba74d079 100644
--- a/vcl/qt5/Qt5Frame.cxx
+++ b/vcl/qt5/Qt5Frame.cxx
@@ -48,8 +48,10 @@
 
 #include <com/sun/star/datatransfer/dnd/DNDConstants.hpp>
 
+#ifndef _WIN32
 #include <cairo.h>
 #include <headless/svpgdi.hxx>
+#endif
 
 static void SvpDamageHandler(void* handle, sal_Int32 nExtentsX, sal_Int32 nExtentsY,
                              sal_Int32 nExtentsWidth, sal_Int32 nExtentsHeight)
@@ -58,10 +60,12 @@ static void SvpDamageHandler(void* handle, sal_Int32 nExtentsX, sal_Int32 nExten
     pThis->Damage(nExtentsX, nExtentsY, nExtentsWidth, nExtentsHeight);
 }
 
-Qt5Frame::Qt5Frame(Qt5Frame* pParent, SalFrameStyleFlags nStyle, bool bUseCairo)
+Qt5Frame::Qt5Frame(Qt5Frame* pParent, SalFrameStyleFlags nStyle, bool bUseCairo )
     : m_pTopLevel(nullptr)
     , m_bUseCairo(bUseCairo)
+#ifndef _WIN32
     , m_pSvpGraphics(nullptr)
+#endif
     , m_bNullRegion(true)
     , m_bGraphicsInUse(false)
     , m_ePointerStyle(PointerStyle::Arrow)
@@ -143,13 +147,12 @@ Qt5Frame::Qt5Frame(Qt5Frame* pParent, SalFrameStyleFlags nStyle, bool bUseCairo)
         maGeometry.nRightDecoration = 0;
     }
 
+#ifndef _WIN32
     m_aSystemData.nSize = sizeof(SystemEnvData);
     m_aSystemData.aWindow = m_pQWidget->winId();
     m_aSystemData.aShellWindow = reinterpret_cast<sal_IntPtr>(this);
-    //m_aSystemData.pSalFrame = this;
-    //m_aSystemData.pWidget = m_pQWidget;
-    //m_aSystemData.nScreen = m_nXScreen.getXScreen();
     m_aSystemData.pToolkit = "qt5";
+#endif
 }
 
 Qt5Frame::~Qt5Frame()
@@ -160,7 +163,10 @@ Qt5Frame::~Qt5Frame()
         delete m_pTopLevel;
     else
         delete m_pQWidget;
+
+#ifndef _WIN32
     m_aSystemData.aShellWindow = 0;
+#endif
 }
 
 void Qt5Frame::Damage(sal_Int32 nExtentsX, sal_Int32 nExtentsY, sal_Int32 nExtentsWidth,
@@ -182,6 +188,7 @@ void Qt5Frame::TriggerPaintEvent(QRect aRect)
     CallCallback(SalEvent::Paint, &aPaintEvt);
 }
 
+#ifndef _WIN32
 void Qt5Frame::InitSvpSalGraphics(SvpSalGraphics* pSvpSalGraphics)
 {
     int width = 640;
@@ -192,6 +199,7 @@ void Qt5Frame::InitSvpSalGraphics(SvpSalGraphics* pSvpSalGraphics)
     cairo_surface_set_user_data(m_pSurface.get(), SvpSalGraphics::getDamageKey(), &m_aDamageHandler,
                                 nullptr);
 }
+#endif
 
 SalGraphics* Qt5Frame::AcquireGraphics()
 {
@@ -200,6 +208,7 @@ SalGraphics* Qt5Frame::AcquireGraphics()
 
     m_bGraphicsInUse = true;
 
+#ifndef _WIN32
     if (m_bUseCairo)
     {
         if (!m_pOurSvpGraphics.get())
@@ -210,6 +219,7 @@ SalGraphics* Qt5Frame::AcquireGraphics()
         return m_pOurSvpGraphics.get();
     }
     else
+#endif
     {
         if (!m_pQt5Graphics.get())
         {
@@ -225,9 +235,11 @@ SalGraphics* Qt5Frame::AcquireGraphics()
 void Qt5Frame::ReleaseGraphics(SalGraphics* pSalGraph)
 {
     (void)pSalGraph;
+#ifndef _WIN32
     if (m_bUseCairo)
         assert(pSalGraph == m_pOurSvpGraphics.get());
     else
+#endif
         assert(pSalGraph == m_pQt5Graphics.get());
     m_bGraphicsInUse = false;
 }
diff --git a/vcl/qt5/Qt5Graphics.cxx b/vcl/qt5/Qt5Graphics.cxx
index fbf7ae05bf6b..05c514a0a927 100644
--- a/vcl/qt5/Qt5Graphics.cxx
+++ b/vcl/qt5/Qt5Graphics.cxx
@@ -28,6 +28,8 @@
 #include <QtWidgets/QPushButton>
 #include <QtWidgets/QWidget>
 
+#include <vcl/sysdata.hxx>
+
 Qt5Graphics::Qt5Graphics( Qt5Frame *pFrame, QImage *pQImage )
     : m_pFrame( pFrame )
     , m_pQImage( pQImage )
diff --git a/vcl/qt5/Qt5Graphics_Controls.cxx b/vcl/qt5/Qt5Graphics_Controls.cxx
index 8763752c0615..00b039b910a9 100644
--- a/vcl/qt5/Qt5Graphics_Controls.cxx
+++ b/vcl/qt5/Qt5Graphics_Controls.cxx
@@ -595,9 +595,7 @@ bool Qt5Graphics_Controls::drawNativeControl(ControlType type, ControlPart part,
     }
     else if (type == ControlType::Progress && part == ControlPart::Entire)
     {
-        SAL_WNODEPRECATED_DECLARATIONS_PUSH
-        QStyleOptionProgressBarV2 option;
-        SAL_WNODEPRECATED_DECLARATIONS_POP
+        QStyleOptionProgressBar option;
         option.minimum = 0;
         option.maximum = widgetRect.width();
         option.progress = value.getNumericVal();
@@ -801,6 +799,7 @@ bool Qt5Graphics_Controls::getNativeControlRegion(ControlType type, ControlPart
                     retVal = true;
                     break;
                 default:
+                    h = 0; w = 0;
                     break;
             }
             if (retVal)
diff --git a/vcl/qt5/Qt5Graphics_Text.cxx b/vcl/qt5/Qt5Graphics_Text.cxx
index 87bdb054655f..4028614c36f7 100644
--- a/vcl/qt5/Qt5Graphics_Text.cxx
+++ b/vcl/qt5/Qt5Graphics_Text.cxx
@@ -24,10 +24,12 @@
 
 #include <o3tl/make_unique.hxx>
 #include <vcl/fontcharmap.hxx>
+#ifndef _WIN32
 #include <unx/geninst.h>
 #include <unx/fontmanager.hxx>
 #include <unx/glyphcache.hxx>
 #include <unx/genpspgraphics.h>
+#endif
 
 #include <sallayout.hxx>
 #include <PhysicalFontCollection.hxx>
@@ -91,13 +93,16 @@ bool Qt5Graphics::GetFontCapabilities(vcl::FontCapabilities& rFontCapabilities)
 
 void Qt5Graphics::GetDevFontList(PhysicalFontCollection* pPFC)
 {
+#ifndef _WIN32
     static const bool bUseFontconfig = (nullptr == getenv("SAL_VCL_QT5_NO_FONTCONFIG"));
+#endif
 
     m_pFontCollection = pPFC;
     if (pPFC->Count())
         return;
 
     QFontDatabase aFDB;
+#ifndef _WIN32
     QStringList aFontFamilyList;
     if (bUseFontconfig)
         aFontFamilyList = aFDB.families();
@@ -136,6 +141,8 @@ void Qt5Graphics::GetDevFontList(PhysicalFontCollection* pPFC)
 
     if (bUseFontconfig)
         SalGenericInstance::RegisterFontSubstitutors(pPFC);
+    }
+#endif
 
     for (auto& family : aFDB.families())
         for (auto& style : aFDB.styles(family))
diff --git a/vcl/qt5/Qt5Instance.cxx b/vcl/qt5/Qt5Instance.cxx
index dceb97d89f6d..5d130dfd45be 100644
--- a/vcl/qt5/Qt5Instance.cxx
+++ b/vcl/qt5/Qt5Instance.cxx
@@ -50,7 +50,7 @@
 #include <headless/svpbmp.hxx>
 
 Qt5Instance::Qt5Instance(bool bUseCairo)
-    : SalGenericInstance(o3tl::make_unique<SalYieldMutex>())
+    : Qt5MocInstance()
     , m_postUserEventId(-1)
     , m_bUseCairo(bUseCairo)
 {
@@ -104,6 +104,7 @@ std::unique_ptr<SalVirtualDevice>
 Qt5Instance::CreateVirtualDevice(SalGraphics* pGraphics, long& nDX, long& nDY, DeviceFormat eFormat,
                                  const SystemGraphicsData* /* pData */)
 {
+#ifndef _WIN32
     if (m_bUseCairo)
     {
         SvpSalGraphics* pSvpSalGraphics = dynamic_cast<SvpSalGraphics*>(pGraphics);
@@ -114,6 +115,9 @@ Qt5Instance::CreateVirtualDevice(SalGraphics* pGraphics, long& nDX, long& nDY, D
         return pVD;
     }
     else
+#else
+    (void)pGraphics;
+#endif
     {
         std::unique_ptr<SalVirtualDevice> pVD(new Qt5VirtualDevice(eFormat, 1));
         pVD->SetSize(nDX, nDY);
@@ -145,9 +149,11 @@ SalSystem* Qt5Instance::CreateSalSystem() { return new Qt5System; }
 
 std::shared_ptr<SalBitmap> Qt5Instance::CreateSalBitmap()
 {
+#ifndef _WIN32
     if (m_bUseCairo)
         return std::make_shared<SvpSalBitmap>();
     else
+#endif
         return std::make_shared<Qt5Bitmap>();
 }
 
@@ -316,23 +322,27 @@ VCLPLUG_QT5_PUBLIC SalInstance* create_SalInstance()
     for (int i = 0; i < nFakeArgc; i++)
         pFakeArgv[i] = pFakeArgvFreeable[i];
 
+#ifndef _WIN32
     char* session_manager = nullptr;
     if (getenv("SESSION_MANAGER") != nullptr)
     {
         session_manager = strdup(getenv("SESSION_MANAGER"));
         unsetenv("SESSION_MANAGER");
     }
+#endif
 
     int* pFakeArgc = new int;
     *pFakeArgc = nFakeArgc;
     pQApplication = new QApplication(*pFakeArgc, pFakeArgv);
 
+#ifndef _WIN32
     if (session_manager != nullptr)
     {
         // coverity[tainted_string] - trusted source for setenv
         setenv("SESSION_MANAGER", session_manager, 1);
         free(session_manager);
     }
+#endif
 
     QApplication::setQuitOnLastWindowClosed(false);
 
diff --git a/vcl/qt5/Qt5Instance_Print.cxx b/vcl/qt5/Qt5Instance_Print.cxx
index 1a0410844976..0eb8a30cdce5 100644
--- a/vcl/qt5/Qt5Instance_Print.cxx
+++ b/vcl/qt5/Qt5Instance_Print.cxx
@@ -20,23 +20,26 @@
 #include <Qt5Instance.hxx>
 #include <Qt5Printer.hxx>
 
+#ifndef _WIN32
 #include <vcl/svapp.hxx>
 #include <vcl/timer.hxx>
-#include <printerinfomanager.hxx>
 
 #include <jobset.h>
 #include <print.h>
-#include <salptype.hxx>
 #include <saldatabasic.hxx>
 
+#include <salptype.hxx>
+#include <printerinfomanager.hxx>
 #include <unx/genpspgraphics.h>
 
 using namespace psp;
+#endif
 
 /*
  *  static helpers
  */
 
+#ifndef _WIN32
 static OUString getPdfDir(const PrinterInfo& rInfo)
 {
     OUString aDir;
@@ -55,30 +58,42 @@ static OUString getPdfDir(const PrinterInfo& rInfo)
     }
     return aDir;
 }
+#endif
 
 SalInfoPrinter* Qt5Instance::CreateInfoPrinter(SalPrinterQueueInfo* pQueueInfo,
                                                ImplJobSetup* pJobSetup)
 {
+#ifndef _WIN32
     // create and initialize SalInfoPrinter
     PspSalInfoPrinter* pPrinter = new PspSalInfoPrinter;
     configurePspInfoPrinter(pPrinter, pQueueInfo, pJobSetup);
 
     return pPrinter;
+#else
+    (void)pQueueInfo; (void)pJobSetup;
+    return nullptr;
+#endif
 }
 
 void Qt5Instance::DestroyInfoPrinter(SalInfoPrinter* pPrinter) { delete pPrinter; }
 
 std::unique_ptr<SalPrinter> Qt5Instance::CreatePrinter(SalInfoPrinter* pInfoPrinter)
 {
+#ifndef _WIN32
     // create and initialize SalPrinter
     Qt5Printer* pPrinter = new Qt5Printer(pInfoPrinter);
     pPrinter->m_aJobData = static_cast<PspSalInfoPrinter*>(pInfoPrinter)->m_aJobData;
 
     return std::unique_ptr<SalPrinter>(pPrinter);
+#else
+    (void)pInfoPrinter;
+    return std::unique_ptr<SalPrinter>();
+#endif
 }
 
 void Qt5Instance::GetPrinterQueueInfo(ImplPrnQueueList* pList)
 {
+#ifndef _WIN32
     PrinterInfoManager& rManager(PrinterInfoManager::get());
     static const char* pNoSyncDetection = getenv("SAL_DISABLE_SYNCHRONOUS_PRINTER_DETECTION");
     if (!pNoSyncDetection || !*pNoSyncDetection)
@@ -112,18 +127,27 @@ void Qt5Instance::GetPrinterQueueInfo(ImplPrnQueueList* pList)
 
         pList->Add(std::move(pInfo));
     }
+#else
+    (void)pList;
+#endif
 }
 
 void Qt5Instance::GetPrinterQueueState(SalPrinterQueueInfo*) {}
 
 OUString Qt5Instance::GetDefaultPrinter()
 {
+#ifndef _WIN32
     PrinterInfoManager& rManager(PrinterInfoManager::get());
     return rManager.getDefaultPrinter();
+#else
+    return OUString();
+#endif
 }
 
-void Qt5Instance::PostPrintersChanged() {}
+#ifndef _WIN32
+void Qt5MocInstance::PostPrintersChanged() {}
 
-GenPspGraphics* Qt5Instance::CreatePrintGraphics() { return new GenPspGraphics(); }
+GenPspGraphics* Qt5MocInstance::CreatePrintGraphics() { return new GenPspGraphics(); }
+#endif
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/qt5/Qt5Object.cxx b/vcl/qt5/Qt5Object.cxx
index e498283ef1ee..df1a4e5504d7 100644
--- a/vcl/qt5/Qt5Object.cxx
+++ b/vcl/qt5/Qt5Object.cxx
@@ -38,13 +38,12 @@ Qt5Object::Qt5Object(Qt5Frame* pParent, bool bShow)
     if (bShow)
         m_pQWidget->show();
 
+#ifndef _WIN32
     m_aSystemData.nSize = sizeof(SystemEnvData);
     m_aSystemData.aWindow = pParent->GetQWidget()->winId();
     m_aSystemData.aShellWindow = reinterpret_cast<sal_IntPtr>(this);
-    //m_aSystemData.pSalFrame = this;
-    //m_aSystemData.pWidget = m_pQWidget;
-    //m_aSystemData.nScreen = m_nXScreen.getXScreen();
     m_aSystemData.pToolkit = "qt5";
+#endif
 }
 
 void Qt5Object::ResetClipRegion()
diff --git a/vcl/qt5/Qt5Painter.cxx b/vcl/qt5/Qt5Painter.cxx
index 06eeb2895214..efaf04e9b570 100644
--- a/vcl/qt5/Qt5Painter.cxx
+++ b/vcl/qt5/Qt5Painter.cxx
@@ -20,6 +20,7 @@
 #include <Qt5Painter.hxx>
 
 #include <QtGui/QColor>
+#include <QtWidgets/QPushButton>
 
 Qt5Painter::Qt5Painter(Qt5Graphics& rGraphics, bool bPrepareBrush, sal_uInt8 nTransparency)
     : m_rGraphics(rGraphics)
diff --git a/vcl/qt5/Qt5Printer.cxx b/vcl/qt5/Qt5Printer.cxx
index 16a6a1115073..354045efb437 100644
--- a/vcl/qt5/Qt5Printer.cxx
+++ b/vcl/qt5/Qt5Printer.cxx
@@ -17,10 +17,20 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
+#include <svsys.h>
+#include <salptype.hxx>
+
+#include <rtl/ustring.hxx>
+#include <tools/gen.hxx>
+
 #include <Qt5Printer.hxx>
 
-Qt5Printer::Qt5Printer(SalInfoPrinter* pInfoPrinter)
+Qt5Printer::Qt5Printer(SalInfoPrinter* /* pInfoPrinter */)
+#ifndef _WIN32
     : PspSalPrinter(pInfoPrinter)
+#else
+    : WinSalPrinter()
+#endif
 {
 }
 
diff --git a/vcl/qt5/Qt5Tools.cxx b/vcl/qt5/Qt5Tools.cxx
index 54ac3f99e26f..b12a03539bbb 100644
--- a/vcl/qt5/Qt5Tools.cxx
+++ b/vcl/qt5/Qt5Tools.cxx
@@ -19,11 +19,13 @@
 
 #include <Qt5Tools.hxx>
 
-#include <cairo.h>
-
 #include <vcl/event.hxx>
 
+#ifndef _WIN32
+#include <cairo.h>
+
 void CairoDeleter::operator()(cairo_surface_t* pSurface) const { cairo_surface_destroy(pSurface); }
+#endif
 
 sal_uInt16 GetKeyModCode(Qt::KeyboardModifiers eKeyModifiers)
 {
diff --git a/vcl/qt5/Qt5Widget.cxx b/vcl/qt5/Qt5Widget.cxx
index 6d75cd60df73..4dad8b3bda20 100644
--- a/vcl/qt5/Qt5Widget.cxx
+++ b/vcl/qt5/Qt5Widget.cxx
@@ -39,17 +39,21 @@
 #include <QtWidgets/QToolTip>
 #include <QtWidgets/QWidget>
 
-#include <cairo.h>
-#include <headless/svpgdi.hxx>
 #include <vcl/commandevent.hxx>
 #include <vcl/event.hxx>
 
+#ifndef _WIN32
+#include <cairo.h>
+#include <headless/svpgdi.hxx>
+#endif
+
 void Qt5Widget::paintEvent(QPaintEvent* pEvent)
 {
     QPainter p(this);
     if (!m_pFrame->m_bNullRegion)
         p.setClipRegion(m_pFrame->m_aRegion);
 
+#ifndef _WIN32
     if (m_pFrame->m_bUseCairo)
     {
         cairo_surface_t* pSurface = m_pFrame->m_pSurface.get();
@@ -60,11 +64,13 @@ void Qt5Widget::paintEvent(QPaintEvent* pEvent)
         p.drawImage(pEvent->rect().topLeft(), aImage, pEvent->rect());
     }
     else
+#endif
         p.drawImage(pEvent->rect().topLeft(), *m_pFrame->m_pQImage, pEvent->rect());
 }
 
 void Qt5Widget::resizeEvent(QResizeEvent* pEvent)
 {
+#ifndef _WIN32
     if (m_pFrame->m_bUseCairo)
     {
         int width = size().width();
@@ -89,6 +95,7 @@ void Qt5Widget::resizeEvent(QResizeEvent* pEvent)
         }
     }
     else
+#endif
     {
         QImage* pImage = nullptr;
 
@@ -297,9 +304,11 @@ static sal_uInt16 GetKeyCode(int keyval)
             case Qt::Key_Insert:
                 nCode = KEY_INSERT;
                 break;
+#ifndef _WIN32
             case Qt::Key_Delete:
                 nCode = KEY_DELETE;
                 break;
+#endif
             case Qt::Key_Plus:
                 nCode = KEY_ADD;
                 break;
commit b0b089e8f7a6df793761bdec6ee9d98b1bf12a5a
Author:     Jan-Marek Glogowski <glogow at fbihome.de>
AuthorDate: Thu Jan 17 14:01:51 2019 +0000
Commit:     Jan-Marek Glogowski <glogow at fbihome.de>
CommitDate: Fri Jan 25 23:44:29 2019 +0100

    Qt5/KDE5 use logicalDotsPerInch to report DPI
    
    It looks like all other backend don't use the physical, but the
    logical DPI to report the resolution.
    So use the QScreens logical resolution when reporting the DPI
    values. Also use QScreen for KDE5, as the Svp defaults to 96.
    
    This might fix tdf#122131, but since I can't reproduce...
    
    Change-Id: Iefc75acf26f8664f2a9ad995edbdc749be2228cf
    Reviewed-on: https://gerrit.libreoffice.org/66525
    Tested-by: Jenkins
    Reviewed-by: Jan-Marek Glogowski <glogow at fbihome.de>

diff --git a/vcl/qt5/Qt5Graphics_GDI.cxx b/vcl/qt5/Qt5Graphics_GDI.cxx
index 156c487ad57d..90baba36d3f0 100644
--- a/vcl/qt5/Qt5Graphics_GDI.cxx
+++ b/vcl/qt5/Qt5Graphics_GDI.cxx
@@ -643,8 +643,8 @@ void Qt5Graphics::GetResolution(sal_Int32& rDPIX, sal_Int32& rDPIY)
         return;
 
     QScreen* pScreen = m_pFrame->GetQWidget()->window()->windowHandle()->screen();
-    rDPIX = pScreen->physicalDotsPerInchX();
-    rDPIY = pScreen->physicalDotsPerInchY();
+    rDPIX = pScreen->logicalDotsPerInchX();
+    rDPIY = pScreen->logicalDotsPerInchY();
 }
 
 sal_uInt16 Qt5Graphics::GetBitCount() const { return getFormatBits(m_pQImage->format()); }
diff --git a/vcl/unx/kde5/KDE5SalFrame.cxx b/vcl/unx/kde5/KDE5SalFrame.cxx
index 9c82f6ca53b1..ec4a7ff8f45c 100644
--- a/vcl/unx/kde5/KDE5SalFrame.cxx
+++ b/vcl/unx/kde5/KDE5SalFrame.cxx
@@ -208,7 +208,7 @@ SalGraphics* KDE5SalFrame::AcquireGraphics()
 
     if (!m_pKDE5Graphics.get())
     {
-        m_pKDE5Graphics.reset(new KDE5SalGraphics());
+        m_pKDE5Graphics.reset(new KDE5SalGraphics(this));
         Qt5Frame::InitSvpSalGraphics(m_pKDE5Graphics.get());
     }
 
diff --git a/vcl/unx/kde5/KDE5SalGraphics.cxx b/vcl/unx/kde5/KDE5SalGraphics.cxx
index 583edf6e8e6c..290127d0526e 100644
--- a/vcl/unx/kde5/KDE5SalGraphics.cxx
+++ b/vcl/unx/kde5/KDE5SalGraphics.cxx
@@ -21,7 +21,11 @@
 
 #include <salbmp.hxx>
 
+#include <QtGui/QScreen>
+#include <QtGui/QWindow>
+
 #include <Qt5Tools.hxx>
+#include <Qt5Frame.hxx>
 
 static void QImage2BitmapBuffer(QImage* pImg, BitmapBuffer* pBuf)
 {
@@ -35,8 +39,9 @@ static void QImage2BitmapBuffer(QImage* pImg, BitmapBuffer* pBuf)
     }
 }
 
-KDE5SalGraphics::KDE5SalGraphics()
+KDE5SalGraphics::KDE5SalGraphics(Qt5Frame* pFrame)
     : SvpSalGraphics()
+    , m_pFrame(pFrame)
 {
 }
 
@@ -59,4 +64,22 @@ bool KDE5SalGraphics::drawNativeControl(ControlType nType, ControlPart nPart,
     return bHandled;
 }
 
+void KDE5SalGraphics::GetResolution(sal_Int32& rDPIX, sal_Int32& rDPIY)
+{
+    char* pForceDpi;
+    if ((pForceDpi = getenv("SAL_FORCEDPI")))
+    {
+        OString sForceDPI(pForceDpi);
+        rDPIX = rDPIY = sForceDPI.toInt32();
+        return;
+    }
+
+    if (!m_pFrame || !m_pFrame->GetQWidget()->window()->windowHandle())
+        return;
+
+    QScreen* pScreen = m_pFrame->GetQWidget()->window()->windowHandle()->screen();
+    rDPIX = pScreen->logicalDotsPerInchX();
+    rDPIY = pScreen->logicalDotsPerInchY();
+}
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/unx/kde5/KDE5SalGraphics.hxx b/vcl/unx/kde5/KDE5SalGraphics.hxx
index d5b01542e877..109a0fa8ac29 100644
--- a/vcl/unx/kde5/KDE5SalGraphics.hxx
+++ b/vcl/unx/kde5/KDE5SalGraphics.hxx
@@ -29,13 +29,15 @@
 #include <QtGui/QImage>
 #include <QtWidgets/QPushButton>
 
+class Qt5Frame;
+
 /**
  * Handles native graphics requests and performs the needed drawing operations.
  */
 class KDE5SalGraphics : public SvpSalGraphics
 {
 public:
-    KDE5SalGraphics();
+    KDE5SalGraphics(Qt5Frame* pFrame);
     virtual bool IsNativeControlSupported(ControlType, ControlPart) override;
 
     virtual bool hitTestNativeControl(ControlType, ControlPart, const tools::Rectangle&,
@@ -48,8 +50,11 @@ public:
                                         ControlState, const ImplControlValue&, const OUString&,
                                         tools::Rectangle&, tools::Rectangle&) override;
 
+    virtual void GetResolution(sal_Int32& rDPIX, sal_Int32& rDPIY) override;
+
 private:
     Qt5Graphics_Controls m_aControl;
+    Qt5Frame* m_pFrame;
 };
 
 inline bool KDE5SalGraphics::IsNativeControlSupported(ControlType nType, ControlPart nPart)
commit ed4a2031a8b72d15dbe60ec9dd6fcaed07715be9
Author:     Muhammet Kara <muhammet.kara at collabora.com>
AuthorDate: Fri Jan 25 14:24:42 2019 +0300
Commit:     Muhammet Kara <muhammet.kara at collabora.com>
CommitDate: Fri Jan 25 22:44:44 2019 +0100

    Forge the freeform redaction tool
    
    out of the Freeform Line tool in Draw.
    
    * Replace .uno:LineToolbox with .uno:Freeline_Unfilled in Redaction toolbar
    
    * Add new parameters to .uno:Freeline_Unfilled
      - SfxUInt16Item Transparence, SfxStringItem Color,
        SfxUInt16Item Width, SfxBoolItem IsSticky
    
    * Handle the params in FuConstructBezierPolygon
    
    * Now the freeform line draw tool on the Redaction toolbar
      works with a default width of 5mm, color of COL_GRAY7,
      and a transparency of 50%; and it sticks when it is
      clicked/selected once until user deliberately deselects it
      by clicking on another tool or by clicking outside of the page.
    
    * Known problem: icon is not displayed on the toolbar after adding the params
    
    Change-Id: I6b09276ca82782dbf214aab8d2ba3b407fb0d81c
    Reviewed-on: https://gerrit.libreoffice.org/66916
    Tested-by: Jenkins
    Reviewed-by: Muhammet Kara <muhammet.kara at collabora.com>

diff --git a/sd/source/ui/func/fuconbez.cxx b/sd/source/ui/func/fuconbez.cxx
index ebc57cb87ebc..1acc46a41f9c 100644
--- a/sd/source/ui/func/fuconbez.cxx
+++ b/sd/source/ui/func/fuconbez.cxx
@@ -31,6 +31,9 @@
 
 #include <svx/svxids.hrc>
 #include <svx/svdpagv.hxx>
+#include <svx/xlnclit.hxx>
+#include <svx/xlntrit.hxx>
+#include <svx/xlnwtit.hxx>
 
 #include <app.hrc>
 #include <ViewShell.hxx>
@@ -50,7 +53,10 @@ using namespace ::com::sun::star::uno;
 
 namespace sd {
 
-
+/*//Extra attributes coming from parameters
+    sal_uInt16  mnTransparence;  // Default: 0
+    OUString    msColor;         // Default: ""
+    sal_uInt16  mnWidth;         // Default: 0*/
 FuConstructBezierPolygon::FuConstructBezierPolygon (
     ViewShell* pViewSh,
     ::sd::Window* pWin,
@@ -58,8 +64,29 @@ FuConstructBezierPolygon::FuConstructBezierPolygon (
     SdDrawDocument* pDoc,
     SfxRequest& rReq)
     : FuConstruct(pViewSh, pWin, pView, pDoc, rReq),
-      nEditMode(SID_BEZIER_MOVE)
+      nEditMode(SID_BEZIER_MOVE),
+      mnTransparence(0),
+      mnWidth(0)
+{
+}
+
+namespace{
+
+/// Checks to see if the request has a parameter of IsSticky:bool=true
+/// It means that the selected command/button will stay selected after use
+bool isSticky(SfxRequest& rReq)
 {
+    const SfxItemSet *pArgs = rReq.GetArgs ();
+    if (pArgs)
+    {
+        const SfxBoolItem* pIsSticky = rReq.GetArg<SfxBoolItem>(FN_PARAM_4);
+        if (pIsSticky && pIsSticky->GetValue())
+            return true;
+    }
+
+    return false;
+}
+
 }
 
 rtl::Reference<FuPoor> FuConstructBezierPolygon::Create( ViewShell* pViewSh, ::sd::Window* pWin, ::sd::View* pView, SdDrawDocument* pDoc, SfxRequest& rReq, bool bPermanent )
@@ -67,7 +94,7 @@ rtl::Reference<FuPoor> FuConstructBezierPolygon::Create( ViewShell* pViewSh, ::s
     FuConstructBezierPolygon* pFunc;
     rtl::Reference<FuPoor> xFunc( pFunc = new FuConstructBezierPolygon( pViewSh, pWin, pView, pDoc, rReq ) );
     xFunc->DoExecute(rReq);
-    pFunc->SetPermanent(bPermanent);
+    pFunc->SetPermanent(bPermanent || isSticky(rReq));
     return xFunc;
 }
 
@@ -76,11 +103,32 @@ void FuConstructBezierPolygon::DoExecute( SfxRequest& rReq )
     FuConstruct::DoExecute( rReq );
 
     const SfxItemSet* pArgs = rReq.GetArgs();
+
     if( pArgs )
     {
         const SfxPoolItem*  pPoolItem = nullptr;
         if( SfxItemState::SET == pArgs->GetItemState( SID_ADD_MOTION_PATH, true, &pPoolItem ) )
             maTargets = static_cast<const SfxUnoAnyItem*>( pPoolItem )->GetValue();
+
+        if (nSlotId == SID_DRAW_FREELINE_NOFILL)
+        {
+            const SfxUInt16Item* pTransparence  = rReq.GetArg<SfxUInt16Item>(FN_PARAM_1);
+            const SfxStringItem* pColor         = rReq.GetArg<SfxStringItem>(FN_PARAM_2);
+            const SfxUInt16Item* pWidth         = rReq.GetArg<SfxUInt16Item>(FN_PARAM_3);
+
+            if (pTransparence && pTransparence->GetValue() > 0)
+            {
+                mnTransparence = pTransparence->GetValue();
+            }
+            if (pColor && !pColor->GetValue().isEmpty())
+            {
+                msColor = pColor->GetValue();
+            }
+            if (pWidth && pWidth->GetValue() > 0)
+            {
+                mnWidth = pWidth->GetValue();
+            }
+        }
     }
 }
 
@@ -126,6 +174,7 @@ bool FuConstructBezierPolygon::MouseButtonDown(const MouseEvent& rMEvt)
         {
             SfxItemSet aAttr(mpDoc->GetPool());
             SetStyleSheet(aAttr, pObj);
+            SetAttributes(aAttr);
             pObj->SetMergedItemSet(aAttr);
         }
     }
@@ -285,6 +334,37 @@ void FuConstructBezierPolygon::SelectionHasChanged()
         *mpView);
 }
 
+namespace {
+/// Returns the color based on the color names listed in core/include/tools/color.hxx
+/// Feel free to extend with more color names from color.hxx
+Color strToColor(const OUString& sColor)
+{
+    Color aColor = COL_AUTO;
+
+    if (sColor == "COL_GRAY")
+        aColor = COL_GRAY;
+    else if (sColor == "COL_GRAY3")
+        aColor = COL_GRAY3;
+    else if (sColor == "COL_GRAY7")
+        aColor = COL_GRAY7;
+
+    return aColor;
+}
+}
+
+void FuConstructBezierPolygon::SetAttributes(SfxItemSet& rAttr)
+{
+    if (nSlotId == SID_DRAW_FREELINE_NOFILL)
+    {
+        if (mnTransparence > 0 && mnTransparence <= 100)
+            rAttr.Put(XLineTransparenceItem(mnTransparence));
+        if (!msColor.isEmpty())
+            rAttr.Put(XLineColorItem(OUString(), strToColor(msColor)));
+        if (mnWidth > 0)
+            rAttr.Put(XLineWidthItem(mnWidth));
+    }
+}
+
 /**
  * Set current bezier edit mode
  */
diff --git a/sd/source/ui/inc/fuconbez.hxx b/sd/source/ui/inc/fuconbez.hxx
index 15754c4b3c94..21b4a5ba6aa6 100644
--- a/sd/source/ui/inc/fuconbez.hxx
+++ b/sd/source/ui/inc/fuconbez.hxx
@@ -47,6 +47,11 @@ public:
     void    SetEditMode(sal_uInt16 nMode);
     sal_uInt16  GetEditMode() { return nEditMode; }
 
+    /**
+     * set attribute for the object to be created
+     */
+    void SetAttributes(SfxItemSet& rAttr);
+
     virtual SdrObjectUniquePtr CreateDefaultObject(const sal_uInt16 nID, const ::tools::Rectangle& rRectangle) override;
 
 private:
@@ -59,6 +64,11 @@ private:
 
     sal_uInt16    nEditMode;
     css::uno::Any maTargets;   // used for creating a path for custom animations
+
+    //Extra attributes coming from parameters
+    sal_uInt16  mnTransparence;  // Default: 0
+    OUString    msColor;         // Default: ""
+    sal_uInt16  mnWidth;         // Default: 0
 };
 
 } // end of namespace sd
diff --git a/sd/uiconfig/sdraw/toolbar/redactionbar.xml b/sd/uiconfig/sdraw/toolbar/redactionbar.xml
index b3b8deb053d0..1a5b45b31634 100644
--- a/sd/uiconfig/sdraw/toolbar/redactionbar.xml
+++ b/sd/uiconfig/sdraw/toolbar/redactionbar.xml
@@ -19,7 +19,7 @@
 -->
 <toolbar:toolbar xmlns:toolbar="http://openoffice.org/2001/toolbar" xmlns:xlink="http://www.w3.org/1999/xlink">
  <toolbar:toolbaritem xlink:href=".uno:Rect?FillTransparence:short=50&FillColor:string=COL_GRAY7&LineStyle:short=0&IsSticky:bool=true"/>
- <toolbar:toolbaritem xlink:href=".uno:LineToolbox"/>
+ <toolbar:toolbaritem xlink:href=".uno:Freeline_Unfilled?Transparence:short=50&Color:string=COL_GRAY7&Width:short=500&IsSticky:bool=true"/>
  <toolbar:toolbarseparator/>
  <toolbar:toolbaritem xlink:href=".uno:ExportDirectToPDF"/>
 </toolbar:toolbar>
diff --git a/svx/sdi/svx.sdi b/svx/sdi/svx.sdi
index 362e183e91d6..1577acf4a4c6 100644
--- a/svx/sdi/svx.sdi
+++ b/svx/sdi/svx.sdi
@@ -3472,7 +3472,8 @@ SfxBoolItem Freeline SID_DRAW_FREELINE
 
 
 SfxBoolItem Freeline_Unfilled SID_DRAW_FREELINE_NOFILL
-
+(SfxUInt16Item Transparence FN_PARAM_1, SfxStringItem Color FN_PARAM_2,
+ SfxUInt16Item Width FN_PARAM_3, SfxBoolItem IsSticky FN_PARAM_4)
 [
     AutoUpdate = TRUE,
     FastCall = FALSE,
commit b1d35c809aaa2ba6ac1f5fb12f5d251e8718aa7c
Author:     Michael Meeks <michael.meeks at collabora.com>
AuthorDate: Fri Jan 25 17:51:19 2019 +0000
Commit:     Michael Meeks <michael.meeks at collabora.com>
CommitDate: Fri Jan 25 22:21:35 2019 +0100

    lok: calm down CnP issues & simplify.
    
    Change-Id: I67669b9b3accbcf89bddf3b8dc8435edba89224b
    Reviewed-on: https://gerrit.libreoffice.org/66925
    Tested-by: Jenkins
    Reviewed-by: Michael Meeks <michael.meeks at collabora.com>

diff --git a/libreofficekit/qa/unit/tiledrendering.cxx b/libreofficekit/qa/unit/tiledrendering.cxx
index c0ded3e1a7e6..69f7c5dbe6f8 100644
--- a/libreofficekit/qa/unit/tiledrendering.cxx
+++ b/libreofficekit/qa/unit/tiledrendering.cxx
@@ -37,6 +37,35 @@ using namespace ::boost;
 using namespace ::lok;
 using namespace ::std;
 
+namespace {
+
+void processEventsToIdle()
+{
+    typedef void (ProcessEventsToIdleFn)(void);
+    static ProcessEventsToIdleFn *processFn = nullptr;
+    if (!processFn)
+    {
+        void *me = dlopen(nullptr, RTLD_NOW);
+        processFn = reinterpret_cast<ProcessEventsToIdleFn *>(dlsym(me, "unit_lok_process_events_to_idle"));
+    }
+
+    CPPUNIT_ASSERT(processFn);
+
+    (*processFn)();
+}
+
+void insertString(Document& rDocument, const std::string& s)
+{
+    for (const char c : s)
+    {
+        rDocument.postKeyEvent(LOK_KEYEVENT_KEYINPUT, c, 0);
+        rDocument.postKeyEvent(LOK_KEYEVENT_KEYUP, c, 0);
+        processEventsToIdle();
+    }
+}
+
+}
+
 OUString getFileURLFromSystemPath(OUString const & path)
 {
     OUString url;
@@ -57,6 +86,9 @@ public:
     const string m_sInstDir;
     const string m_sLOPath;
 
+    std::unique_ptr<Document> loadDocument( Office *pOffice, const string &pName,
+                                            const char *pFilterOptions = nullptr );
+
     TiledRenderingTest()
         : m_sSrcRoot( getenv( "SRC_ROOT" ) )
         , m_sInstDir( getenv( "INSTDIR" ) )
@@ -130,20 +162,26 @@ int getDocumentType( Office* pOffice, const string& rPath )
     return pDocument->getDocumentType();
 }
 
-void TiledRenderingTest::testDocumentTypes( Office* pOffice )
+std::unique_ptr<Document> TiledRenderingTest::loadDocument( Office *pOffice, const string &pName,
+                                                            const char *pFilterOptions )
 {
-    const string sTextDocPath = m_sSrcRoot + "/libreofficekit/qa/data/blank_text.odt";
-    const string sTextLockFile = m_sSrcRoot +"/libreofficekit/qa/data/.~lock.blank_text.odt#";
+    const string sDocPath = m_sSrcRoot + "/libreofficekit/qa/data/" + pName;
+    const string sLockFile = m_sSrcRoot +"/libreofficekit/qa/data/.~lock." + pName + "#";
 
-    // FIXME: same comment as below wrt lockfile removal.
-    remove( sTextLockFile.c_str() );
+    remove( sLockFile.c_str() );
+
+    return std::unique_ptr<Document>(pOffice->documentLoad( sDocPath.c_str(), pFilterOptions ));
+}
+
+void TiledRenderingTest::testDocumentTypes( Office* pOffice )
+{
+    std::unique_ptr<Document> pDocument(loadDocument(pOffice, "blank_text.odt"));
 
-    std::unique_ptr<Document> pDocument(pOffice->documentLoad( sTextDocPath.c_str()));
     CPPUNIT_ASSERT(pDocument.get());
     CPPUNIT_ASSERT_EQUAL(LOK_DOCTYPE_TEXT, static_cast<LibreOfficeKitDocumentType>(pDocument->getDocumentType()));
     // This crashed.
     pDocument->postUnoCommand(".uno:Bold");
-    Scheduler::ProcessEventsToIdle();
+    processEventsToIdle();
 
     const string sPresentationDocPath = m_sSrcRoot + "/libreofficekit/qa/data/blank_presentation.odp";
     const string sPresentationLockFile = m_sSrcRoot +"/libreofficekit/qa/data/.~lock.blank_presentation.odp#";
@@ -158,16 +196,7 @@ void TiledRenderingTest::testDocumentTypes( Office* pOffice )
 
 void TiledRenderingTest::testImpressSlideNames( Office* pOffice )
 {
-    const string sDocPath = m_sSrcRoot + "/libreofficekit/qa/data/impress_slidenames.odp";
-    const string sLockFile = m_sSrcRoot +"/libreofficekit/qa/data/.~lock.impress_slidenames.odp#";
-
-    // FIXME: this is a temporary hack: LOK will fail when trying to open a
-    // locked file, and since we're reusing the file for a different unit
-    // test it's entirely possible that an unwanted lock file will remain.
-    // Hence forcefully remove it here.
-    remove( sLockFile.c_str() );
-
-    std::unique_ptr< Document> pDocument( pOffice->documentLoad( sDocPath.c_str() ) );
+    std::unique_ptr<Document> pDocument(loadDocument(pOffice, "impress_slidenames.odp"));
 
     CPPUNIT_ASSERT_EQUAL(3, pDocument->getParts());
     CPPUNIT_ASSERT_EQUAL(std::string("TestText1"), std::string(pDocument->getPartName(0)));
@@ -179,13 +208,7 @@ void TiledRenderingTest::testImpressSlideNames( Office* pOffice )
 
 void TiledRenderingTest::testCalcSheetNames( Office* pOffice )
 {
-    const string sDocPath = m_sSrcRoot + "/libreofficekit/qa/data/calc_sheetnames.ods";
-    const string sLockFile = m_sSrcRoot +"/libreofficekit/qa/data/.~lock.calc_sheetnames.ods#";
-
-    // FIXME: LOK will fail when trying to open a locked file
-    remove( sLockFile.c_str() );
-
-    std::unique_ptr< Document> pDocument( pOffice->documentLoad( sDocPath.c_str() ) );
+    std::unique_ptr<Document> pDocument(loadDocument(pOffice, "calc_sheetnames.ods"));
 
     CPPUNIT_ASSERT_EQUAL(3, pDocument->getParts());
     CPPUNIT_ASSERT_EQUAL(std::string("TestText1"), std::string(pDocument->getPartName(0)));
@@ -195,13 +218,8 @@ void TiledRenderingTest::testCalcSheetNames( Office* pOffice )
 
 void TiledRenderingTest::testPaintPartTile(Office* pOffice)
 {
-    const string sTextDocPath = m_sSrcRoot + "/libreofficekit/qa/data/blank_text.odt";
-    const string sTextLockFile = m_sSrcRoot +"/libreofficekit/qa/data/.~lock.blank_text.odt#";
+    std::unique_ptr<Document> pDocument(loadDocument(pOffice, "blank_text.odt"));
 
-    // FIXME: same comment as below wrt lockfile removal.
-    remove(sTextLockFile.c_str());
-
-    std::unique_ptr<Document> pDocument(pOffice->documentLoad( sTextDocPath.c_str()));
     CPPUNIT_ASSERT(pDocument.get());
     CPPUNIT_ASSERT_EQUAL(LOK_DOCTYPE_TEXT, static_cast<LibreOfficeKitDocumentType>(pDocument->getDocumentType()));
 
@@ -223,45 +241,9 @@ void TiledRenderingTest::testPaintPartTile(Office* pOffice)
     pDocument->paintPartTile(aBuffer.data(), /*nPart=*/0, nCanvasWidth, nCanvasHeight, /*nTilePosX=*/0, /*nTilePosY=*/0, /*nTileWidth=*/3840, /*nTileHeight=*/3840);
 }
 
-namespace {
-
-void processEventsToIdle()
-{
-    typedef void (ProcessEventsToIdleFn)(void);
-    static ProcessEventsToIdleFn *processFn = nullptr;
-    if (!processFn)
-    {
-        void *me = dlopen(nullptr, RTLD_NOW);
-        processFn = reinterpret_cast<ProcessEventsToIdleFn *>(dlsym(me, "unit_lok_process_events_to_idle"));
-    }
-
-    CPPUNIT_ASSERT(processFn);
-
-    (*processFn)();
-}
-
-void insertString(Document& rDocument, const std::string& s)
-{
-    for (const char c : s)
-    {
-        rDocument.postKeyEvent(LOK_KEYEVENT_KEYINPUT, c, 0);
-        rDocument.postKeyEvent(LOK_KEYEVENT_KEYUP, c, 0);
-        processEventsToIdle();
-    }
-}
-
-}
-
 void TiledRenderingTest::testDocumentLoadLanguage(Office* pOffice)
 {
-    const string sDocPath = m_sSrcRoot + "/libreofficekit/qa/data/empty.ods";
-    const string sLockFile = m_sSrcRoot +"/libreofficekit/qa/data/.~lock.empty.ods#";
-
-    // FIXME: LOK will fail when trying to open a locked file
-    remove(sLockFile.c_str());
-
-    // first try with the en-US locale
-    std::unique_ptr<Document> pDocument(pOffice->documentLoad(sDocPath.c_str(), "Language=en-US"));
+    std::unique_ptr<Document> pDocument(loadDocument(pOffice, "blank_text.odt", "Language=en-US"));
 
     // assert that '.' is the decimal separator
     insertString(*pDocument, "1.5");
commit 175274a6bca20451ccd6b5574e118265449f7642
Author:     Michael Meeks <michael.meeks at collabora.com>
AuthorDate: Fri Jan 25 17:47:15 2019 +0000
Commit:     Michael Meeks <michael.meeks at collabora.com>
CommitDate: Fri Jan 25 22:21:23 2019 +0100

    lok: don't crash in simple LOK use-case with no callback.
    
    Change-Id: I7bceba10f002ad5751e3d810f9a9767ad2e875bc
    Reviewed-on: https://gerrit.libreoffice.org/66924
    Tested-by: Jenkins
    Reviewed-by: Michael Meeks <michael.meeks at collabora.com>

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index c10283321221..a2845e0cc3e8 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -1577,8 +1577,11 @@ static LibreOfficeKitDocument* lo_documentLoadWithOptions(LibreOfficeKit* pThis,
         }
 
         LibLODocument_Impl* pDocument = new LibLODocument_Impl(xComponent);
-        int nState = doc_getSignatureState(pDocument);
-        pLib->mpCallback(LOK_CALLBACK_SIGNATURE_STATUS, OString::number(nState).getStr(), pLib->mpCallbackData);
+        if (pLib->mpCallback)
+        {
+            int nState = doc_getSignatureState(pDocument);
+            pLib->mpCallback(LOK_CALLBACK_SIGNATURE_STATUS, OString::number(nState).getStr(), pLib->mpCallbackData);
+        }
         return pDocument;
     }
     catch (const uno::Exception& exception)
commit 7422d394812958a2014615b996df0378cc7d495f
Author:     Jens Carl <j.carl43 at gmx.de>
AuthorDate: Fri Jan 25 17:41:27 2019 +0000
Commit:     Jens Carl <j.carl43 at gmx.de>
CommitDate: Fri Jan 25 21:52:05 2019 +0100

    tdf#45904 Move XPropertySet Java tests to C++
    
    Move XPropertySet Java tests to C++ for ScSpreadsheetSettings.
    
    Change-Id: Id969a566fcb4e544c26a4097e0f49a01bc967ad7
    Reviewed-on: https://gerrit.libreoffice.org/66926
    Tested-by: Jenkins
    Reviewed-by: Jens Carl <j.carl43 at gmx.de>

diff --git a/framework/qa/complex/api_internal/api.lst b/framework/qa/complex/api_internal/api.lst
index 609e7d5c323d..434ae00edc0d 100644
--- a/framework/qa/complex/api_internal/api.lst
+++ b/framework/qa/complex/api_internal/api.lst
@@ -84,7 +84,6 @@ job96=sc.ScFilterDescriptorBase
 job98=sc.ScHeaderFieldObj
 job99=sc.ScHeaderFieldsObj
 job126=sc.ScSheetLinkObj
-job128=sc.ScSpreadsheetSettings
 job129=sc.ScSpreadsheetSettingsObj
 job131=sc.ScStyleFamilyObj
 job132=sc.ScStyleObj
diff --git a/qadevOOo/Jar_OOoRunner.mk b/qadevOOo/Jar_OOoRunner.mk
index 71887651aa48..3f9f58ac43d9 100644
--- a/qadevOOo/Jar_OOoRunner.mk
+++ b/qadevOOo/Jar_OOoRunner.mk
@@ -982,7 +982,6 @@ $(eval $(call gb_Jar_add_sourcefiles,OOoRunner,\
     qadevOOo/tests/java/mod/_sc/ScNamedRangesObj \
     qadevOOo/tests/java/mod/_sc/ScShapeObj \
     qadevOOo/tests/java/mod/_sc/ScSheetLinkObj \
-    qadevOOo/tests/java/mod/_sc/ScSpreadsheetSettings \
     qadevOOo/tests/java/mod/_sc/ScSpreadsheetSettingsObj \
     qadevOOo/tests/java/mod/_sc/ScStyleFamilyObj \
     qadevOOo/tests/java/mod/_sc/ScStyleObj \
diff --git a/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScSpreadsheetSettings.csv b/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScSpreadsheetSettings.csv
deleted file mode 100644
index 63db656f8011..000000000000
--- a/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScSpreadsheetSettings.csv
+++ /dev/null
@@ -1,7 +0,0 @@
-"ScSpreadsheetSettings";"com::sun::star::beans::XPropertySet";"getPropertySetInfo()"
-"ScSpreadsheetSettings";"com::sun::star::beans::XPropertySet";"setPropertyValue()"
-"ScSpreadsheetSettings";"com::sun::star::beans::XPropertySet";"getPropertyValue()"
-"ScSpreadsheetSettings";"com::sun::star::beans::XPropertySet";"addPropertyChangeListener()"
-"ScSpreadsheetSettings";"com::sun::star::beans::XPropertySet";"removePropertyChangeListener()"
-"ScSpreadsheetSettings";"com::sun::star::beans::XPropertySet";"addVetoableChangeListener()"
-"ScSpreadsheetSettings";"com::sun::star::beans::XPropertySet";"removeVetoableChangeListener()"
diff --git a/qadevOOo/tests/java/mod/_sc/ScSpreadsheetSettings.java b/qadevOOo/tests/java/mod/_sc/ScSpreadsheetSettings.java
deleted file mode 100644
index f98ad9f7f91b..000000000000
--- a/qadevOOo/tests/java/mod/_sc/ScSpreadsheetSettings.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * 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 .
- */
-
-package mod._sc;
-
-import java.io.PrintWriter;
-
-import lib.TestCase;
-import lib.TestEnvironment;
-import lib.TestParameters;
-
-import com.sun.star.uno.XInterface;
-
-/**
-* Test for object which is represented by service
-* <code>com.sun.star.sheet.GlobalSheetSettings</code>. <p>
-* Object implements the following interfaces :
-* <ul>
-*  <li> <code>com::sun::star::sheet::GlobalSheetSettings</code></li>
-*  <li> <code>com::sun::star::beans::XPropertySet</code></li>
-* </ul>
-* @see com.sun.star.sheet.GlobalSheetSettings
-* @see com.sun.star.beans.XPropertySet
-* @see ifc.sheet._GlobalSheetSettings
-* @see ifc.beans._XPropertySet
-*/
-public class ScSpreadsheetSettings extends TestCase {
-
-    /**
-    * Creating a TestEnvironment for the interfaces to be tested.
-    * Creates an instance of the service
-    * <code>com.sun.star.sheet.GlobalSheetSettings</code>.
-    */
-    @Override
-    public TestEnvironment createTestEnvironment(
-        TestParameters tParam, PrintWriter log) throws Exception {
-
-        XInterface oObj = null;
-
-        // creation of testobject here
-        // first we write what we are intend to do to log file
-        log.println( "creating a test environment" );
-
-        // create testobject here
-        oObj = (XInterface)tParam.getMSF().
-            createInstance("com.sun.star.sheet.GlobalSheetSettings");
-
-        TestEnvironment tEnv = new TestEnvironment(oObj);
-
-        return tEnv;
-    } // finish method getTestEnvironment
-
-}    // finish class ScSpreadsheetSettings
-
diff --git a/sc/qa/extras/scspreadsheetsettings.cxx b/sc/qa/extras/scspreadsheetsettings.cxx
index 4efd21102624..5835877e2dc0 100644
--- a/sc/qa/extras/scspreadsheetsettings.cxx
+++ b/sc/qa/extras/scspreadsheetsettings.cxx
@@ -8,6 +8,7 @@
  */
 
 #include <test/calc_unoapi_test.hxx>
+#include <test/beans/xpropertyset.hxx>
 #include <test/sheet/globalsheetsettings.hxx>
 
 #include <com/sun/star/lang/XComponent.hpp>
@@ -23,7 +24,9 @@ using namespace com::sun::star;
 
 namespace sc_apitest
 {
-class ScSpreadsheetSettings : public CalcUnoApiTest, public apitest::GlobalSheetSettings
+class ScSpreadsheetSettings : public CalcUnoApiTest,
+                              public apitest::GlobalSheetSettings,
+                              public apitest::XPropertySet
 {
 public:
     ScSpreadsheetSettings();
@@ -37,6 +40,13 @@ public:
     // GlobalSheetSettings
     CPPUNIT_TEST(testGlobalSheetSettingsProperties);
 
+    // XPropertySet
+    CPPUNIT_TEST(testGetPropertySetInfo);
+    CPPUNIT_TEST(testGetPropertyValue);
+    CPPUNIT_TEST(testSetPropertyValue);
+    CPPUNIT_TEST(testPropertyChangeListener);
+    CPPUNIT_TEST(testVetoableChangeListener);
+
     CPPUNIT_TEST_SUITE_END();
 
 private:
@@ -45,6 +55,7 @@ private:
 
 ScSpreadsheetSettings::ScSpreadsheetSettings()
     : CalcUnoApiTest("/sc/qa/extras/testdocuments")
+    , XPropertySet({ "LinkUpdateMode", "UsePrinterMetrics", "UserLists" })
 {
 }
 
@@ -70,7 +81,7 @@ void ScSpreadsheetSettings::tearDown()
 
 CPPUNIT_TEST_SUITE_REGISTRATION(ScSpreadsheetSettings);
 
-} // end namespace
+} // namespace sc_apitest
 
 CPPUNIT_PLUGIN_IMPLEMENT();
 
diff --git a/sc/qa/unoapi/sc_6.sce b/sc/qa/unoapi/sc_6.sce
index cb24d34d75c5..c842d055142c 100644
--- a/sc/qa/unoapi/sc_6.sce
+++ b/sc/qa/unoapi/sc_6.sce
@@ -19,6 +19,5 @@
 -o sc.ScNamedRangesObj
 # -o sc.ScShapeObj
 # -o sc.ScSheetLinkObj
--o sc.ScSpreadsheetSettings
 -o sc.ScSpreadsheetSettingsObj
 -o sc.ScStyleFamilyObj
diff --git a/test/source/beans/xpropertyset.cxx b/test/source/beans/xpropertyset.cxx
index b67c485a17a7..993b609ec4b4 100644

... etc. - the rest is truncated


More information about the Libreoffice-commits mailing list