sw/CppunitTest_sw_uibase_docvw.mk | 74 ++
sw/Module_sw.mk |1
sw/qa/uibase/docvw/docvw.cxx | 190 ++
sw/source/uibase/docvw/edtwin.cxx | 27 +
4 files changed, 292 insertions(+)
New commits:
commit e2a84cd740c0e58c08beb5c4169877a440cf53e1
Author: Miklos Vajna
AuthorDate: Tue Aug 2 16:55:26 2022 +0200
Commit: Miklos Vajna
CommitDate: Tue Aug 2 17:45:37 2022 +0200
sw: make shift-doubleclick on graphics open the graphic dialog
Double-clicking on images without modifier keys or with ctrl triggered
the graphic dialog. However, shift-doubleclick did not.
One drawback of this behavior is that extensions can catch the
.uno:GraphicDialog command for plain or ctrl double-click, but they
can't customize the behavior for shift double-click. Another problem was
that if you had a text selection and you shift-clicked (single click) on
an image, then no image selection was created. (While this works in
Word.)
Fix the problem by extending the code handling mouse button events in
Writer in case the button type is left, the only modifier is shift and
we get one or two clicks:
- if the position points to an object that should be selected, then
shift-click now selects that object
- if the user shift-double-clicks on an image, then we open the graphic
dialog
This improves consistency, as double-click with no/ctrl/shift modifiers
now all dispatch .uno:GraphicDialog. Do the double-click tweak only for
graphics, other shape types can be added in the future if needed.
Change-Id: I2edc70a399a9d2662b476a1bbc4c5f087ce8e59c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137696
Reviewed-by: Miklos Vajna
Tested-by: Jenkins
diff --git a/sw/CppunitTest_sw_uibase_docvw.mk
b/sw/CppunitTest_sw_uibase_docvw.mk
new file mode 100644
index ..2938c8e3a6dd
--- /dev/null
+++ b/sw/CppunitTest_sw_uibase_docvw.mk
@@ -0,0 +1,74 @@
+# -*- 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_docvw))
+
+$(eval $(call gb_CppunitTest_use_common_precompiled_header,sw_uibase_docvw))
+
+$(eval $(call gb_CppunitTest_add_exception_objects,sw_uibase_docvw, \
+sw/qa/uibase/docvw/docvw \
+))
+
+$(eval $(call gb_CppunitTest_use_libraries,sw_uibase_docvw, \
+comphelper \
+cppu \
+cppuhelper \
+editeng \
+sal \
+sfx \
+svl \
+svx \
+svxcore \
+sw \
+swqahelper \
+test \
+unotest \
+utl \
+vcl \
+))
+
+$(eval $(call gb_CppunitTest_use_externals,sw_uibase_docvw,\
+boost_headers \
+libxml2 \
+))
+
+$(eval $(call gb_CppunitTest_set_include,sw_uibase_docvw,\
+-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_docvw,\
+ udkapi \
+ offapi \
+ oovbaapi \
+))
+
+$(eval $(call gb_CppunitTest_use_ure,sw_uibase_docvw))
+$(eval $(call gb_CppunitTest_use_vcl,sw_uibase_docvw))
+
+$(eval $(call gb_CppunitTest_use_rdb,sw_uibase_docvw,services))
+
+$(eval $(call gb_CppunitTest_use_custom_headers,sw_uibase_docvw,\
+officecfg/registry \
+))
+
+$(eval $(call gb_CppunitTest_use_configuration,sw_uibase_docvw))
+
+$(eval $(call gb_CppunitTest_use_uiconfigs,sw_uibase_docvw, \
+modules/swriter \
+))
+
+$(eval $(call gb_CppunitTest_use_more_fonts,sw_uibase_docvw))
+
+# vim: set noet sw=4 ts=4:
diff --git a/sw/Module_sw.mk b/sw/Module_sw.mk
index 318f8581d7df..146b6c7bf138 100644
--- a/sw/Module_sw.mk
+++ b/sw/Module_sw.mk
@@ -128,6 +128,7 @@ $(eval $(call gb_Module_add_slowcheck_targets,sw,\
CppunitTest_sw_core_docnode \
CppunitTest_sw_uibase_shells \
CppunitTest_sw_uibase_dochdl \
+CppunitTest_sw_uibase_docvw \
CppunitTest_sw_uibase_frmdlg \
CppunitTest_sw_uibase_uno \
CppunitTest_sw_uibase_wrtsh \
diff --git a/sw/qa/uibase/docvw/docvw.cxx b/sw/qa/uibase/docvw/docvw.cxx
new file mode 100644
index ..3ec8027c8468
--- /dev/null
+++ b/sw/qa/uibase/docvw/docvw.cxx
@@ -0,0 +1,190 @@
+/* -*- 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