office-gobmx/sw/CppunitTest_sw_odfexport2.mk
László Németh 9574a62add tdf#132599 cui offapi sw xmloff: implement hyphenate-keep
Both parts of a hyphenated word shall lie within a single
page with ODF paragraph setting fo:hyphenation-keep="page".
The implementation follows the default page layout of
MSO 2016 and newer by shifting the bottom hyphenated line
to the next page (and to the next column, see last note).

Note: this is a MSO DOCX interoperability feature, used
also in DTP software, XSL and CSS.

* Add checkbox/combobox to Text Flow in paragraph dialog
* Store property in paragraph model (com::sun::style::ParagraphProperties::ParaHyphenationKeep)
* Add ODF import/export
* Add ODF unit tests

New constants of com::sun::text::ParagraphHyphenationKeepType,
containing ODF AUTO and PAGE (borrowed from XSL), and for the
planned extension ParaHyphenationKeepType of ParagraphProperties:

– COLUMN (standard XSL value, defined in
  https://www.w3.org/TR/2001/REC-xsl-20011015/slice7.html#hyphenation-keep)

– SPREAD and ALWAYS (CSS 4 values of hyphenate-limit-last,
  equivalent of hyphenation-keep, defined in
  https://www.w3.org/TR/css-text-4/#hyphenate-line-limits).

Note: the implementation truncates only a single hyphenated
line, like MSO does: the pages can end in hyphenated
lines (i.e. in the case of consecutive hyphenated lines),
but less often, than before.

Clean-up hyphenation dialog by collecting "Don't hyphenate"
options at the end of the hyphenation settings, and negating them
(similar to MSO and DTP), adding also the new option
"Hyphenate across column and page":

[x] Hyphenate words in CAPS
[x] Hyphenate last word
[x] Hyphenate across column and page

Note: ODF fo:hyphenation-keep has got only "auto" and
"page" attributes, while XSL defines also "column".
Because of the interoperability with MSO and DTP,
fo:hyphenation-keep="page" is interpreted as
XSL "column", avoiding hyphenation at the end
of column, not only at the end of page.

Change-Id: I5c6b7adc0671a5a790568e7bf1d33256e607f85f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164158
Tested-by: László Németh <nemeth@numbertext.org>
Reviewed-by: László Németh <nemeth@numbertext.org>
2024-03-04 23:39:51 +01:00

78 lines
2 KiB
Makefile

# -*- 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_odfexport2))
$(eval $(call gb_CppunitTest_use_common_precompiled_header,sw_odfexport2))
$(eval $(call gb_CppunitTest_add_exception_objects,sw_odfexport2, \
sw/qa/extras/odfexport/odfexport2 \
))
$(eval $(call gb_CppunitTest_use_libraries,sw_odfexport2, \
comphelper \
cppu \
cppuhelper \
editeng \
sal \
sfx \
subsequenttest \
svl \
sw \
swqahelper \
test \
tl \
unotest \
utl \
vcl \
))
$(eval $(call gb_CppunitTest_use_externals,sw_odfexport2,\
boost_headers \
libxml2 \
))
$(eval $(call gb_CppunitTest_set_include,sw_odfexport2,\
-I$(SRCDIR)/sw/inc \
-I$(SRCDIR)/sw/source/core/inc \
-I$(SRCDIR)/sw/qa/inc \
$$(INCLUDE) \
))
$(eval $(call gb_CppunitTest_use_api,sw_odfexport2,\
udkapi \
offapi \
oovbaapi \
))
$(eval $(call gb_CppunitTest_use_ure,sw_odfexport2))
$(eval $(call gb_CppunitTest_use_vcl,sw_odfexport2))
$(eval $(call gb_CppunitTest_use_rdb,sw_odfexport2,services))
$(eval $(call gb_CppunitTest_use_custom_headers,sw_odfexport2,\
officecfg/registry \
))
$(eval $(call gb_CppunitTest_use_configuration,sw_odfexport2))
$(eval $(call gb_CppunitTest_use_uiconfigs,sw_odfexport2, \
modules/swriter \
svx \
))
$(eval $(call gb_CppunitTest_use_more_fonts,sw_odfexport2))
$(eval $(call gb_CppunitTest_add_arguments,sw_odfexport2, \
-env:arg-env=$(gb_Helper_LIBRARY_PATH_VAR)"$$$${$(gb_Helper_LIBRARY_PATH_VAR)+=$$$$$(gb_Helper_LIBRARY_PATH_VAR)}" \
))
# vim: set noet sw=4 ts=4: