summaryrefslogtreecommitdiff
path: root/include/editeng
diff options
context:
space:
mode:
authorLászló Németh <nemeth@numbertext.org>2022-06-01 16:38:28 +0200
committerLászló Németh <nemeth@numbertext.org>2022-06-02 09:57:39 +0200
commit7a1d4b7d1db93ca1f541856a8d00d621d50e7bd6 (patch)
tree62c14075edae32b552caf8688623d11327bc17cc /include/editeng
parent6585fe3fc154c518d657202295a2c5214de55b56 (diff)
tdf#149420 sw offapi xmloff: add hyphenation zone
Add hyphenation zone support, i.e. allow the specified amount of extra space in lines instead of forcing hyphenation. It's for limiting hyphenation, used especially with not justified paragraph alignment. Note: this is an OOXML interoperability feature, used also in DTP software and CSS. * Add checkbox to Text Flow in paragraph dialog * Store property in paragraph model (com::sun::star::style::ParagraphProperties::ParaHyphenationZone) * Add ODF import/export * Add ODF unit test * Add layout test Note: extend SvxHyphenZoneItem::GetPresentation() with missing No CAPS and No last word hyphenation options. Note: fix OSL_ENSURE condition in SwTextFormatInfo::GetHyphValues(). Follow-up to commit 29359fc15c435cec17987fd6221ab6833d38746e "tdf#149324 sw offapi xmloff: add option to not hyphenate short words". Change-Id: Ib8eff6ea98a9aa5ca6cb9d17faa0bbb789687ce9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135247 Tested-by: Jenkins Reviewed-by: László Németh <nemeth@numbertext.org>
Diffstat (limited to 'include/editeng')
-rw-r--r--include/editeng/editrids.hrc5
-rw-r--r--include/editeng/hyphenzoneitem.hxx8
-rw-r--r--include/editeng/memberids.h1
3 files changed, 11 insertions, 3 deletions
diff --git a/include/editeng/editrids.hrc b/include/editeng/editrids.hrc
index 57342e7c1deb..31ac07a1d22b 100644
--- a/include/editeng/editrids.hrc
+++ b/include/editeng/editrids.hrc
@@ -230,7 +230,10 @@
#define RID_SVXITEMS_HYPHEN_MINLEAD NC_("RID_SVXITEMS_HYPHEN_MINLEAD", "%1 characters at end of line")
#define RID_SVXITEMS_HYPHEN_MINTRAIL NC_("RID_SVXITEMS_HYPHEN_MINTRAIL", "%1 characters at beginning of line")
#define RID_SVXITEMS_HYPHEN_MAX NC_("RID_SVXITEMS_HYPHEN_MAX", "%1 hyphens")
-#define RID_SVXITEMS_HYPHEN_MINWORDLEN NC_("RID_SVXITEMS_HYPHEN_MINWORDLEN", "Words with at least %1 characters")
+#define RID_SVXITEMS_HYPHEN_NO_CAPS_TRUE NC_("RID_SVXITEMS_HYPHEN_NO_CAPS_TRUE", "Not hyphenated CAPS")
+#define RID_SVXITEMS_HYPHEN_LAST_WORD_TRUE NC_("RID_SVXITEMS_HYPHEN_NO_CAPS_FALSE", "Not hyphenated last word")
+#define RID_SVXITEMS_HYPHEN_MINWORDLEN NC_("RID_SVXITEMS_HYPHEN_MINWORDLEN", "%1 characters in words")
+#define RID_SVXITEMS_HYPHEN_ZONE NC_("RID_SVXITEMS_HYPHEN_ZONE", "Hyphenation zone ")
#define RID_SVXITEMS_PAGEMODEL_COMPLETE NC_("RID_SVXITEMS_PAGEMODEL_COMPLETE", "Page Style: ")
#define RID_SVXITEMS_KERNING_COMPLETE NC_("RID_SVXITEMS_KERNING_COMPLETE", "Kerning ")
#define RID_SVXITEMS_KERNING_EXPANDED NC_("RID_SVXITEMS_KERNING_EXPANDED", "locked ")
diff --git a/include/editeng/hyphenzoneitem.hxx b/include/editeng/hyphenzoneitem.hxx
index b1ec7cba3a45..7104d2d7db58 100644
--- a/include/editeng/hyphenzoneitem.hxx
+++ b/include/editeng/hyphenzoneitem.hxx
@@ -38,8 +38,9 @@ class EDITENG_DLLPUBLIC SvxHyphenZoneItem final : public SfxPoolItem
bool bNoLastWordHyphenation : 1;
sal_uInt8 nMinLead;
sal_uInt8 nMinTrail;
- sal_uInt8 nMaxHyphens;
- sal_uInt8 nMinWordLength;
+ sal_uInt8 nMaxHyphens; // max. consecutive lines with hyphenation
+ sal_uInt8 nMinWordLength; // hyphenate only words with at least nMinWordLength characters
+ sal_uInt16 nTextHyphenZone; // don't force hyphenation at line end, allow this extra white space
public:
static SfxPoolItem* CreateDefault();
@@ -81,6 +82,9 @@ public:
sal_uInt8 &GetMinWordLength() { return nMinWordLength; }
sal_uInt8 GetMinWordLength() const { return nMinWordLength; }
+
+ sal_uInt16 &GetTextHyphenZone() { return nTextHyphenZone; }
+ sal_uInt16 GetTextHyphenZone() const { return nTextHyphenZone; }
};
#endif
diff --git a/include/editeng/memberids.h b/include/editeng/memberids.h
index 4ec470f31db7..9b89ebafaefb 100644
--- a/include/editeng/memberids.h
+++ b/include/editeng/memberids.h
@@ -49,6 +49,7 @@
#define MID_HYPHEN_NO_CAPS 4
#define MID_HYPHEN_NO_LAST_WORD 5
#define MID_HYPHEN_MIN_WORD_LENGTH 6
+#define MID_HYPHEN_ZONE 7
// SvxBoxInfoItem
#define MID_HORIZONTAL 1