From 8ad0c29f56e5069a3679560d404b603332dcf38a Mon Sep 17 00:00:00 2001 From: Miklos Vajna Date: Wed, 22 Apr 2020 16:25:51 +0200 Subject: sw: prefer ODF over RTF when pasting from Writer Regression from commit e9e6d4b058e13165f3dde1ca7822eec97dfe8aa7 (tdf#116685: Make the RICHTEXT take precedence over EMBED_SOURCE., 2019-09-26), the problem was that now we always prefer RTF over ODF when pasting into Writer. The commit made sense for Calc->Writer paste, but it causes formatting loss for Writer -> Writer paste. The exact use-case was copy&paste of numberings where the pasted content got paragraph indent as direct formatting, so shift-tab at the paragraph start changed only the bullet type, not the indentation -- but it's easy to imagine several other cases where a roundtrip via ODF provides better results than RTF. Fix the problem by leaving the above commit in place, but extending SwTransferable::Paste() so that it prefers ODF over RTF in case of a Writer->Writer paste (and leaves the non-Writer -> Writer paste behavior unchanged to avoid the unwanted OLE objects). Change-Id: Ida745bba65c5a210021cea0d267c02900fc6398a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92705 Reviewed-by: Miklos Vajna Tested-by: Jenkins --- sw/CppunitTest_sw_uibase_dochdl.mk | 73 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 sw/CppunitTest_sw_uibase_dochdl.mk (limited to 'sw/CppunitTest_sw_uibase_dochdl.mk') diff --git a/sw/CppunitTest_sw_uibase_dochdl.mk b/sw/CppunitTest_sw_uibase_dochdl.mk new file mode 100644 index 000000000000..14cf57687a8f --- /dev/null +++ b/sw/CppunitTest_sw_uibase_dochdl.mk @@ -0,0 +1,73 @@ +# -*- 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_CppunitTest_CppunitTest,sw_uibase_dochdl)) + +$(eval $(call gb_CppunitTest_use_common_precompiled_header,sw_uibase_dochdl)) + +$(eval $(call gb_CppunitTest_add_exception_objects,sw_uibase_dochdl, \ + sw/qa/uibase/dochdl/dochdl \ +)) + +$(eval $(call gb_CppunitTest_use_libraries,sw_uibase_dochdl, \ + comphelper \ + cppu \ + cppuhelper \ + editeng \ + sal \ + sfx \ + svl \ + svx \ + svxcore \ + sw \ + test \ + unotest \ + utl \ + vcl \ +)) + +$(eval $(call gb_CppunitTest_use_externals,sw_uibase_dochdl,\ + boost_headers \ + libxml2 \ +)) + +$(eval $(call gb_CppunitTest_set_include,sw_uibase_dochdl,\ + -I$(SRCDIR)/sw/inc \ + -I$(SRCDIR)/sw/source/core/inc \ + -I$(SRCDIR)/sw/source/uibase/inc \ + -I$(SRCDIR)/sw/qa/inc \ + $$(INCLUDE) \ +)) + +$(eval $(call gb_CppunitTest_use_api,sw_uibase_dochdl,\ + udkapi \ + offapi \ + oovbaapi \ +)) + +$(eval $(call gb_CppunitTest_use_ure,sw_uibase_dochdl)) +$(eval $(call gb_CppunitTest_use_vcl,sw_uibase_dochdl)) + +$(eval $(call gb_CppunitTest_use_rdb,sw_uibase_dochdl,services)) + +$(eval $(call gb_CppunitTest_use_custom_headers,sw_uibase_dochdl,\ + officecfg/registry \ +)) + +$(eval $(call gb_CppunitTest_use_configuration,sw_uibase_dochdl)) + +$(eval $(call gb_CppunitTest_use_uiconfigs,sw_uibase_dochdl, \ + modules/swriter \ +)) + +$(eval $(call gb_CppunitTest_use_more_fonts,sw_uibase_dochdl)) + +# vim: set noet sw=4 ts=4: -- cgit