diff --git a/cui/source/inc/paragrph.hxx b/cui/source/inc/paragrph.hxx index e8806dcdac7c..5dab4d9e12cd 100644 --- a/cui/source/inc/paragrph.hxx +++ b/cui/source/inc/paragrph.hxx @@ -246,6 +246,14 @@ private: std::unique_ptr m_xMinWordLength; std::unique_ptr m_xHyphenZoneLabel; SvxRelativeField m_aHyphenZone; + std::unique_ptr m_xParagraphEndZoneLabel; + SvxRelativeField m_aParagraphEndZone; + std::unique_ptr m_xColumnEndZoneLabel; + SvxRelativeField m_aColumnEndZone; + std::unique_ptr m_xPageEndZoneLabel; + SvxRelativeField m_aPageEndZone; + std::unique_ptr m_xSpreadEndZoneLabel; + SvxRelativeField m_aSpreadEndZone; // pagebreak std::unique_ptr m_xPageBreakBox; diff --git a/cui/source/tabpages/paragrph.cxx b/cui/source/tabpages/paragrph.cxx index b5c7bcd147fc..5db7ce43b474 100644 --- a/cui/source/tabpages/paragrph.cxx +++ b/cui/source/tabpages/paragrph.cxx @@ -1666,6 +1666,10 @@ bool SvxExtParagraphTabPage::FillItemSet( SfxItemSet* rOutSet ) m_xMaxHyphenEdit->get_value_changed_from_saved() || m_xMinWordLength->get_value_changed_from_saved() || m_aHyphenZone.get_value_changed_from_saved() || + m_aParagraphEndZone.get_value_changed_from_saved() || + m_aColumnEndZone.get_value_changed_from_saved() || + m_aPageEndZone.get_value_changed_from_saved() || + m_aSpreadEndZone.get_value_changed_from_saved() || m_xAcrossParagraphBox->get_state_changed_from_saved() || m_xAcrossColumnBox->get_state_changed_from_saved() || m_xAcrossPageBox->get_state_changed_from_saved() || @@ -1691,6 +1695,10 @@ bool SvxExtParagraphTabPage::FillItemSet( SfxItemSet* rOutSet ) DBG_ASSERT( pPool, "Where is the pool?" ); MapUnit eUnit = pPool->GetMetric( _nWhich ); aHyphen.GetTextHyphenZone() = static_cast(m_aHyphenZone.GetCoreValue(eUnit)); + aHyphen.GetTextHyphenZoneAlways() = static_cast(m_aParagraphEndZone.GetCoreValue(eUnit)); + aHyphen.GetTextHyphenZoneColumn() = static_cast(m_aColumnEndZone.GetCoreValue(eUnit)); + aHyphen.GetTextHyphenZonePage() = static_cast(m_aPageEndZone.GetCoreValue(eUnit)); + aHyphen.GetTextHyphenZoneSpread() = static_cast(m_aSpreadEndZone.GetCoreValue(eUnit)); aHyphen.SetHyphen( eHyphenState == TRISTATE_TRUE ); aHyphen.SetNoLastWordHyphenation(m_xHyphenNoLastWordBox->get_state() != TRISTATE_TRUE); const TriState eAcrossParagraphState = m_xAcrossParagraphBox->get_state(); @@ -1943,6 +1951,26 @@ void SvxExtParagraphTabPage::Reset( const SfxItemSet* rSet ) m_xMinWordLength->set_value(rHyphen.GetMinWordLength()); m_aHyphenZone.SetFieldUnit(eFUnit); m_aHyphenZone.SetMetricValue(rHyphen.GetTextHyphenZone(), MapUnit::MapTwip); + m_aParagraphEndZone.SetFieldUnit(eFUnit); + m_aParagraphEndZone.SetMetricValue(rHyphen.GetTextHyphenZoneAlways(), MapUnit::MapTwip); + // 0 means inheritance, mark this with empty box + if ( !rHyphen.GetTextHyphenZoneAlways() ) + m_aParagraphEndZone.set_text(OUString()); + m_aColumnEndZone.SetFieldUnit(eFUnit); + m_aColumnEndZone.SetMetricValue(rHyphen.GetTextHyphenZoneColumn(), MapUnit::MapTwip); + // 0 means inheritance, mark this with empty box + if ( !rHyphen.GetTextHyphenZoneColumn() ) + m_aColumnEndZone.set_text(OUString()); + m_aPageEndZone.SetFieldUnit(eFUnit); + m_aPageEndZone.SetMetricValue(rHyphen.GetTextHyphenZonePage(), MapUnit::MapTwip); + // 0 means inheritance, mark this with empty box + if ( !rHyphen.GetTextHyphenZonePage() ) + m_aPageEndZone.set_text(OUString()); + m_aSpreadEndZone.SetFieldUnit(eFUnit); + m_aSpreadEndZone.SetMetricValue(rHyphen.GetTextHyphenZoneSpread(), MapUnit::MapTwip); + // 0 means inheritance, mark this with empty box + if ( !rHyphen.GetTextHyphenZoneSpread() ) + m_aSpreadEndZone.set_text(OUString()); m_xAcrossParagraphBox->set_state(!rHyphen.IsKeep() || rHyphen.GetKeepType() < 4 ? TRISTATE_TRUE : TRISTATE_FALSE); m_xAcrossColumnBox->set_state(!rHyphen.IsKeep() || rHyphen.GetKeepType() < 3 ? TRISTATE_TRUE : TRISTATE_FALSE); m_xAcrossPageBox->set_state(!rHyphen.IsKeep() || rHyphen.GetKeepType() < 2 ? TRISTATE_TRUE : TRISTATE_FALSE); @@ -1976,11 +2004,32 @@ void SvxExtParagraphTabPage::Reset( const SfxItemSet* rSet ) m_xMinWordLength->set_sensitive(bEnable); m_xHyphenZoneLabel->set_sensitive(bEnable); m_aHyphenZone.set_sensitive(bEnable); + m_xParagraphEndZoneLabel->set_sensitive(bEnable); + m_aParagraphEndZone.set_sensitive(bEnable); + m_xColumnEndZoneLabel->set_sensitive(bEnable); + m_aColumnEndZone.set_sensitive(bEnable); + m_xPageEndZoneLabel->set_sensitive(bEnable); + m_aPageEndZone.set_sensitive(bEnable); + m_xSpreadEndZoneLabel->set_sensitive(bEnable); + m_aSpreadEndZone.set_sensitive(bEnable); m_xAcrossText->set_sensitive(bEnable); m_xAcrossParagraphBox->set_sensitive(bEnable); m_xAcrossColumnBox->set_sensitive(bEnable); m_xAcrossPageBox->set_sensitive(bEnable); m_xAcrossSpreadBox->set_sensitive(bEnable); + // gray out end zones, if hyphenation across is disabled + bool bAcross = bEnable && m_xAcrossParagraphBox->get_state() == TRISTATE_TRUE; + m_xParagraphEndZoneLabel->set_sensitive(bAcross); + m_aParagraphEndZone.set_sensitive(bAcross); + bAcross = bEnable && m_xAcrossColumnBox->get_state() == TRISTATE_TRUE; + m_xColumnEndZoneLabel->set_sensitive(bAcross); + m_aColumnEndZone.set_sensitive(bAcross); + bAcross = bEnable && m_xAcrossPageBox->get_state() == TRISTATE_TRUE; + m_xPageEndZoneLabel->set_sensitive(bAcross); + m_aPageEndZone.set_sensitive(bAcross); + bAcross = bEnable && m_xAcrossSpreadBox->get_state() == TRISTATE_TRUE; + m_xSpreadEndZoneLabel->set_sensitive(bAcross); + m_aSpreadEndZone.set_sensitive(bAcross); // always gray out MoveLine, if hyphenation is forbidden across spreads bool bAcrossSpread = m_xAcrossSpreadBox->get_state() == TRISTATE_TRUE; m_xAcrossMoveLineBox->set_sensitive( bEnable && !bAcrossSpread ); @@ -2247,6 +2296,10 @@ void SvxExtParagraphTabPage::ChangesApplied() m_xMaxHyphenEdit->save_value(); m_xMinWordLength->save_value(); m_aHyphenZone.save_value(); + m_aParagraphEndZone.save_value(); + m_aColumnEndZone.save_value(); + m_aPageEndZone.save_value(); + m_aSpreadEndZone.save_value(); m_xAcrossParagraphBox->save_state(); m_xAcrossColumnBox->save_state(); m_xAcrossPageBox->save_state(); @@ -2307,6 +2360,14 @@ SvxExtParagraphTabPage::SvxExtParagraphTabPage(weld::Container* pPage, weld::Dia , m_xMinWordLength(m_xBuilder->weld_spin_button(u"spinMinLen"_ustr)) , m_xHyphenZoneLabel(m_xBuilder->weld_label(u"labelHyphenZone"_ustr)) , m_aHyphenZone(m_xBuilder->weld_metric_spin_button(u"spinHyphenZone"_ustr, FieldUnit::CM)) + , m_xParagraphEndZoneLabel(m_xBuilder->weld_label(u"labelParagraphEndZone"_ustr)) + , m_aParagraphEndZone(m_xBuilder->weld_metric_spin_button(u"spinParagraphEndZone"_ustr, FieldUnit::CM)) + , m_xColumnEndZoneLabel(m_xBuilder->weld_label(u"labelColumnEndZone"_ustr)) + , m_aColumnEndZone(m_xBuilder->weld_metric_spin_button(u"spinColumnEndZone"_ustr, FieldUnit::CM)) + , m_xPageEndZoneLabel(m_xBuilder->weld_label(u"labelPageEndZone"_ustr)) + , m_aPageEndZone(m_xBuilder->weld_metric_spin_button(u"spinPageEndZone"_ustr, FieldUnit::CM)) + , m_xSpreadEndZoneLabel(m_xBuilder->weld_label(u"labelSpreadEndZone"_ustr)) + , m_aSpreadEndZone(m_xBuilder->weld_metric_spin_button(u"spinSpreadEndZone"_ustr, FieldUnit::CM)) //Page break , m_xPageBreakBox(m_xBuilder->weld_check_button(u"checkInsert"_ustr)) , m_xBreakTypeFT(m_xBuilder->weld_label(u"labelType"_ustr)) @@ -2392,6 +2453,14 @@ SvxExtParagraphTabPage::SvxExtParagraphTabPage(weld::Container* pPage, weld::Dia m_xMinWordLength->set_sensitive(false); m_xHyphenZoneLabel->set_sensitive(false); m_aHyphenZone.set_sensitive(false); + m_xParagraphEndZoneLabel->set_sensitive(false); + m_aParagraphEndZone.set_sensitive(false); + m_xColumnEndZoneLabel->set_sensitive(false); + m_aColumnEndZone.set_sensitive(false); + m_xPageEndZoneLabel->set_sensitive(false); + m_aPageEndZone.set_sensitive(false); + m_xSpreadEndZoneLabel->set_sensitive(false); + m_aSpreadEndZone.set_sensitive(false); m_xPageNumBox->set_sensitive(false); m_xPagenumEdit->set_sensitive(false); m_xAcrossText->set_sensitive(false); @@ -2538,9 +2607,21 @@ void SvxExtParagraphTabPage::HyphenClickHdl() m_aHyphenZone.set_sensitive(bEnable); m_xAcrossText->set_sensitive(bEnable); m_xAcrossParagraphBox->set_sensitive(bEnable); + bool bAcross = bEnable && m_xAcrossParagraphBox->get_state() == TRISTATE_TRUE; + m_xParagraphEndZoneLabel->set_sensitive(bAcross); + m_aParagraphEndZone.set_sensitive(bAcross); m_xAcrossColumnBox->set_sensitive(bEnable); + bAcross = bEnable && m_xAcrossColumnBox->get_state() == TRISTATE_TRUE; + m_xColumnEndZoneLabel->set_sensitive(bAcross); + m_aColumnEndZone.set_sensitive(bAcross); m_xAcrossPageBox->set_sensitive(bEnable); + bAcross = bEnable && m_xAcrossPageBox->get_state() == TRISTATE_TRUE; + m_xPageEndZoneLabel->set_sensitive(bAcross); + m_aPageEndZone.set_sensitive(bAcross); m_xAcrossSpreadBox->set_sensitive(bEnable); + bAcross = bEnable && m_xAcrossSpreadBox->get_state() == TRISTATE_TRUE; + m_xSpreadEndZoneLabel->set_sensitive(bAcross); + m_aSpreadEndZone.set_sensitive(bAcross); // only sensitive, if the hyphenation is disabled across spreads m_xAcrossMoveLineBox->set_sensitive( m_xAcrossSpreadBox->get_state() != TRISTATE_TRUE ); m_xHyphenBox->set_state(bEnable ? TRISTATE_TRUE : TRISTATE_FALSE); @@ -2653,6 +2734,19 @@ IMPL_LINK(SvxExtParagraphTabPage, AcrossParagraphHdl_Impl, weld::Toggleable&, rT m_xAcrossPageBox->set_state( TRISTATE_FALSE ); m_xAcrossSpreadBox->set_state( TRISTATE_FALSE ); m_xAcrossMoveLineBox->set_sensitive( true ); + m_xParagraphEndZoneLabel->set_sensitive(false); + m_aParagraphEndZone.set_sensitive(false); + m_xColumnEndZoneLabel->set_sensitive(false); + m_aColumnEndZone.set_sensitive(false); + m_xPageEndZoneLabel->set_sensitive(false); + m_aPageEndZone.set_sensitive(false); + m_xSpreadEndZoneLabel->set_sensitive(false); + m_aSpreadEndZone.set_sensitive(false); + } + else + { + m_xParagraphEndZoneLabel->set_sensitive(true); + m_aParagraphEndZone.set_sensitive(true); } } @@ -2664,9 +2758,21 @@ IMPL_LINK(SvxExtParagraphTabPage, AcrossColumnHdl_Impl, weld::Toggleable&, rTogg m_xAcrossPageBox->set_state( TRISTATE_FALSE ); m_xAcrossSpreadBox->set_state( TRISTATE_FALSE ); m_xAcrossMoveLineBox->set_sensitive( true ); + m_xColumnEndZoneLabel->set_sensitive(false); + m_aColumnEndZone.set_sensitive(false); + m_xPageEndZoneLabel->set_sensitive(false); + m_aPageEndZone.set_sensitive(false); + m_xSpreadEndZoneLabel->set_sensitive(false); + m_aSpreadEndZone.set_sensitive(false); } else + { m_xAcrossParagraphBox->set_state( TRISTATE_TRUE ); + m_xParagraphEndZoneLabel->set_sensitive(true); + m_aParagraphEndZone.set_sensitive(true); + m_xColumnEndZoneLabel->set_sensitive(true); + m_aColumnEndZone.set_sensitive(true); + } } IMPL_LINK(SvxExtParagraphTabPage, AcrossPageHdl_Impl, weld::Toggleable&, rToggle, void) @@ -2676,11 +2782,23 @@ IMPL_LINK(SvxExtParagraphTabPage, AcrossPageHdl_Impl, weld::Toggleable&, rToggle { m_xAcrossParagraphBox->set_state( TRISTATE_TRUE ); m_xAcrossColumnBox->set_state( TRISTATE_TRUE ); + m_xParagraphEndZoneLabel->set_sensitive(true); + m_aParagraphEndZone.set_sensitive(true); + m_xColumnEndZoneLabel->set_sensitive(true); + m_aColumnEndZone.set_sensitive(true); + m_xPageEndZoneLabel->set_sensitive(true); + m_aPageEndZone.set_sensitive(true); + m_xSpreadEndZoneLabel->set_sensitive(false); + m_aSpreadEndZone.set_sensitive(false); } else { m_xAcrossSpreadBox->set_state( TRISTATE_FALSE ); m_xAcrossMoveLineBox->set_sensitive( true ); + m_xPageEndZoneLabel->set_sensitive(false); + m_aPageEndZone.set_sensitive(false); + m_xSpreadEndZoneLabel->set_sensitive(false); + m_aSpreadEndZone.set_sensitive(false); } } @@ -2692,12 +2810,24 @@ IMPL_LINK(SvxExtParagraphTabPage, AcrossSpreadHdl_Impl, weld::Toggleable&, rTogg m_xAcrossParagraphBox->set_state( TRISTATE_TRUE ); m_xAcrossColumnBox->set_state( TRISTATE_TRUE ); m_xAcrossPageBox->set_state( TRISTATE_TRUE ); - } - // only sensitive, if the hyphenation is disabled across spreads - bool bAcrossSpread = m_xAcrossSpreadBox->get_state() == TRISTATE_TRUE; - m_xAcrossMoveLineBox->set_sensitive( !bAcrossSpread ); - if ( bAcrossSpread ) + m_xParagraphEndZoneLabel->set_sensitive(true); + m_aParagraphEndZone.set_sensitive(true); + m_xColumnEndZoneLabel->set_sensitive(true); + m_aColumnEndZone.set_sensitive(true); + m_xPageEndZoneLabel->set_sensitive(true); + m_aPageEndZone.set_sensitive(true); + m_xSpreadEndZoneLabel->set_sensitive(true); + m_aSpreadEndZone.set_sensitive(true); + m_xAcrossMoveLineBox->set_sensitive( false ); m_xAcrossMoveLineBox->set_state( TRISTATE_FALSE ); + } + else + { + m_xSpreadEndZoneLabel->set_sensitive(false); + m_aSpreadEndZone.set_sensitive(false); + // only sensitive, if the hyphenation is disabled across spreads + m_xAcrossMoveLineBox->set_sensitive( true ); + } } SvxAsianTabPage::SvxAsianTabPage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rSet) diff --git a/cui/uiconfig/ui/textflowpage.ui b/cui/uiconfig/ui/textflowpage.ui index 6434b4096035..b279a312b12c 100644 --- a/cui/uiconfig/ui/textflowpage.ui +++ b/cui/uiconfig/ui/textflowpage.ui @@ -60,6 +60,26 @@ 1 10 + + 55.88 + 1 + 10 + + + 55.88 + 1 + 10 + + + 55.88 + 1 + 10 + + + 55.88 + 1 + 10 + True @@ -347,39 +367,33 @@ 2 - - - - True - False - 12 - 6 - 6 - 12 - - - True - False - Hyphenation across - True - labelHyphenAcross - 0 - - - - - - 0 - 0 - - - - - 0 - 10 - 2 - - + + + + + True + False + Hyphenation + + + + + + + + 0 + 0 + 2 + + + + + True + False + GDK_EXPOSURE_MASK + 0 + none + @@ -469,6 +483,114 @@ 3 + + + True + True + True + True + adjustment10 + + + 2 + 0 + + + + + True + False + Paragraph end _zone: + True + spinParagraphEndZone + 0 + + + 1 + 0 + + + + + True + True + True + True + adjustment11 + + + 2 + 1 + + + + + True + False + Column end _zone: + True + spinColumnEndZone + 0 + + + 1 + 1 + + + + + True + True + True + True + adjustment12 + + + 2 + 2 + + + + + True + False + Page end _zone: + True + spinPageEndZone + 0 + + + 1 + 2 + + + + + True + True + True + True + adjustment13 + + + 2 + 3 + + + + + True + False + Spread end _zone: + True + spinSpreadEndZone + 0 + + + 1 + 3 + + Move Line @@ -485,24 +607,17 @@ - 1 + 3 3 - - 0 - 11 - 2 - - - - + True False - Hyphenation + Hyphenation across @@ -511,8 +626,8 @@ 0 - 0 - 2 + 2 + 2 diff --git a/editeng/source/items/paraitem.cxx b/editeng/source/items/paraitem.cxx index 91c30e5b55e1..dc209a85e3b2 100644 --- a/editeng/source/items/paraitem.cxx +++ b/editeng/source/items/paraitem.cxx @@ -593,6 +593,10 @@ SvxHyphenZoneItem::SvxHyphenZoneItem( const bool bHyph, const sal_uInt16 nId ) : nMaxHyphens(255), nMinWordLength(0), nTextHyphenZone(0), + nTextHyphenZoneAlways(0), + nTextHyphenZoneColumn(0), + nTextHyphenZonePage(0), + nTextHyphenZoneSpread(0), nKeepType(css::text::ParagraphHyphenationKeepType::COLUMN), bKeepLine(false), nCompoundMinLead(0) @@ -632,6 +636,18 @@ bool SvxHyphenZoneItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) con case MID_HYPHEN_ZONE: rVal <<= static_cast(nTextHyphenZone); break; + case MID_HYPHEN_ZONE_ALWAYS: + rVal <<= static_cast(nTextHyphenZoneAlways); + break; + case MID_HYPHEN_ZONE_COLUMN: + rVal <<= static_cast(nTextHyphenZoneColumn); + break; + case MID_HYPHEN_ZONE_PAGE: + rVal <<= static_cast(nTextHyphenZonePage); + break; + case MID_HYPHEN_ZONE_SPREAD: + rVal <<= static_cast(nTextHyphenZoneSpread); + break; case MID_HYPHEN_KEEP_TYPE: rVal <<= static_cast(nKeepType); break; @@ -687,6 +703,18 @@ bool SvxHyphenZoneItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId ) case MID_HYPHEN_ZONE: nTextHyphenZone = nNewVal; break; + case MID_HYPHEN_ZONE_ALWAYS: + nTextHyphenZoneAlways = nNewVal; + break; + case MID_HYPHEN_ZONE_COLUMN: + nTextHyphenZoneColumn = nNewVal; + break; + case MID_HYPHEN_ZONE_PAGE: + nTextHyphenZonePage = nNewVal; + break; + case MID_HYPHEN_ZONE_SPREAD: + nTextHyphenZoneSpread = nNewVal; + break; case MID_HYPHEN_KEEP_TYPE: nKeepType = static_cast(nNewVal); break; @@ -716,6 +744,10 @@ bool SvxHyphenZoneItem::operator==( const SfxPoolItem& rAttr ) const && rItem.nMaxHyphens == nMaxHyphens && rItem.nMinWordLength == nMinWordLength && rItem.nTextHyphenZone == nTextHyphenZone + && rItem.nTextHyphenZoneAlways == nTextHyphenZoneAlways + && rItem.nTextHyphenZoneColumn == nTextHyphenZoneColumn + && rItem.nTextHyphenZonePage == nTextHyphenZonePage + && rItem.nTextHyphenZoneSpread == nTextHyphenZoneSpread && rItem.bKeepLine == bKeepLine && rItem.nKeepType == nKeepType ); } @@ -748,6 +780,14 @@ bool SvxHyphenZoneItem::GetPresentation OUString::number( nMaxHyphens ) + cpDelimTmp + OUString::number( nMinWordLength ) + cpDelimTmp + GetMetricText( nTextHyphenZone, eCoreUnit, ePresUnit, &rIntl ) + + " " + EditResId(GetMetricId(ePresUnit)) + + GetMetricText( nTextHyphenZoneAlways, eCoreUnit, ePresUnit, &rIntl ) + + " " + EditResId(GetMetricId(ePresUnit)) + + GetMetricText( nTextHyphenZoneColumn, eCoreUnit, ePresUnit, &rIntl ) + + " " + EditResId(GetMetricId(ePresUnit)) + + GetMetricText( nTextHyphenZonePage, eCoreUnit, ePresUnit, &rIntl ) + + " " + EditResId(GetMetricId(ePresUnit)) + + GetMetricText( nTextHyphenZoneSpread, eCoreUnit, ePresUnit, &rIntl ) + " " + EditResId(GetMetricId(ePresUnit)); if ( bNoCapsHyphenation ) @@ -789,11 +829,25 @@ bool SvxHyphenZoneItem::GetPresentation cpDelimTmp + EditResId(RID_SVXITEMS_HYPHEN_MINWORDLEN).replaceAll("%1", OUString::number(nMinWordLength)); - if ( nTextHyphenZone > 0 ) + if ( nTextHyphenZone > 0 || nTextHyphenZoneAlways > 0 || + nTextHyphenZoneColumn > 0 || nTextHyphenZonePage > 0 || + nTextHyphenZoneSpread > 0 ) { rText += cpDelimTmp + EditResId(RID_SVXITEMS_HYPHEN_ZONE) + GetMetricText( nTextHyphenZone, eCoreUnit, ePresUnit, &rIntl ) + " " + EditResId(GetMetricId(ePresUnit)); + rText += cpDelimTmp + EditResId(RID_SVXITEMS_HYPHEN_ZONE_ALWAYS) + + GetMetricText( nTextHyphenZoneAlways, eCoreUnit, ePresUnit, &rIntl ) + + " " + EditResId(GetMetricId(ePresUnit)); + rText += cpDelimTmp + EditResId(RID_SVXITEMS_HYPHEN_ZONE_COLUMN) + + GetMetricText( nTextHyphenZoneColumn, eCoreUnit, ePresUnit, &rIntl ) + + " " + EditResId(GetMetricId(ePresUnit)); + rText += cpDelimTmp + EditResId(RID_SVXITEMS_HYPHEN_ZONE_PAGE) + + GetMetricText( nTextHyphenZonePage, eCoreUnit, ePresUnit, &rIntl ) + + " " + EditResId(GetMetricId(ePresUnit)); + rText += cpDelimTmp + EditResId(RID_SVXITEMS_HYPHEN_ZONE_SPREAD) + + GetMetricText( nTextHyphenZoneSpread, eCoreUnit, ePresUnit, &rIntl ) + + " " + EditResId(GetMetricId(ePresUnit)); } if ( bNoCapsHyphenation ) diff --git a/include/editeng/editrids.hrc b/include/editeng/editrids.hrc index 4cdc87bcf856..d0872f0a88a7 100644 --- a/include/editeng/editrids.hrc +++ b/include/editeng/editrids.hrc @@ -238,6 +238,10 @@ #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_HYPHEN_ZONE_ALWAYS NC_("RID_SVXITEMS_HYPHEN_ZONE_ALWAYS", "Paragraph end zone ") +#define RID_SVXITEMS_HYPHEN_ZONE_COLUMN NC_("RID_SVXITEMS_HYPHEN_ZONE_COLUMN", "Column end zone ") +#define RID_SVXITEMS_HYPHEN_ZONE_PAGE NC_("RID_SVXITEMS_HYPHEN_ZONE_PAGE", "Page end zone ") +#define RID_SVXITEMS_HYPHEN_ZONE_SPREAD NC_("RID_SVXITEMS_HYPHEN_ZONE_SPREAD", "Spread end zone ") #define RID_SVXITEMS_HYPHEN_KEEP_AUTO NC_("RID_SVXITEMS_HYPHEN_KEEP_AUTO", "Hyphenation across page") #define RID_SVXITEMS_HYPHEN_KEEP_SPREAD NC_("RID_SVXITEMS_HYPHEN_KEEP_SPREAD", "Avoid hyphenation across page when the next page is not visible to the reader at the same time") #define RID_SVXITEMS_HYPHEN_KEEP_PAGE NC_("RID_SVXITEMS_HYPHEN_KEEP_PAGE", "Avoid hyphenation across page") diff --git a/include/editeng/hyphenzoneitem.hxx b/include/editeng/hyphenzoneitem.hxx index 05d3c9145ab8..84f4ac333ecc 100644 --- a/include/editeng/hyphenzoneitem.hxx +++ b/include/editeng/hyphenzoneitem.hxx @@ -41,6 +41,10 @@ class EDITENG_DLLPUBLIC SvxHyphenZoneItem final : public SfxPoolItem 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 + sal_uInt16 nTextHyphenZoneAlways; // don't force hyphenation at paragraph end, allow this extra white space + sal_uInt16 nTextHyphenZoneColumn; // don't force hyphenation at column end, allow this extra white space + sal_uInt16 nTextHyphenZonePage; // don't force hyphenation at page end, allow this extra white space + sal_uInt16 nTextHyphenZoneSpread; // don't force hyphenation at spread end, allow this extra white space sal_uInt8 nKeepType; // avoid hyphenation across page etc., see ParagraphHyphenationKeep bool bKeepLine : 1; // if bKeep, shift the hyphenated word (true), or the full line sal_uInt8 nCompoundMinLead; // min. characters between compound word boundary and hyphenation @@ -93,6 +97,18 @@ public: sal_uInt16 &GetTextHyphenZone() { return nTextHyphenZone; } sal_uInt16 GetTextHyphenZone() const { return nTextHyphenZone; } + sal_uInt16 &GetTextHyphenZoneAlways() { return nTextHyphenZoneAlways; } + sal_uInt16 GetTextHyphenZoneAlways() const { return nTextHyphenZoneAlways; } + + sal_uInt16 &GetTextHyphenZoneColumn() { return nTextHyphenZoneColumn; } + sal_uInt16 GetTextHyphenZoneColumn() const { return nTextHyphenZoneColumn; } + + sal_uInt16 &GetTextHyphenZonePage() { return nTextHyphenZonePage; } + sal_uInt16 GetTextHyphenZonePage() const { return nTextHyphenZonePage; } + + sal_uInt16 &GetTextHyphenZoneSpread() { return nTextHyphenZoneSpread; } + sal_uInt16 GetTextHyphenZoneSpread() const { return nTextHyphenZoneSpread; } + sal_uInt8 &GetKeepType() { return nKeepType; } sal_uInt8 GetKeepType() const { return nKeepType; } diff --git a/include/editeng/memberids.h b/include/editeng/memberids.h index f07d051c4825..1bb3d24912dc 100644 --- a/include/editeng/memberids.h +++ b/include/editeng/memberids.h @@ -51,10 +51,14 @@ #define MID_HYPHEN_NO_LAST_WORD 5 #define MID_HYPHEN_MIN_WORD_LENGTH 6 #define MID_HYPHEN_ZONE 7 -#define MID_HYPHEN_KEEP 8 -#define MID_HYPHEN_KEEP_TYPE 9 -#define MID_HYPHEN_COMPOUND_MIN_LEAD 10 -#define MID_HYPHEN_KEEP_LINE 11 +#define MID_HYPHEN_ZONE_ALWAYS 8 +#define MID_HYPHEN_ZONE_COLUMN 9 +#define MID_HYPHEN_ZONE_PAGE 10 +#define MID_HYPHEN_ZONE_SPREAD 11 +#define MID_HYPHEN_KEEP 12 +#define MID_HYPHEN_KEEP_TYPE 13 +#define MID_HYPHEN_COMPOUND_MIN_LEAD 14 +#define MID_HYPHEN_KEEP_LINE 15 // SvxBoxInfoItem #define MID_HORIZONTAL 1 diff --git a/include/unotools/linguprops.hxx b/include/unotools/linguprops.hxx index 0451a0d94a27..dd57dc089d05 100644 --- a/include/unotools/linguprops.hxx +++ b/include/unotools/linguprops.hxx @@ -42,6 +42,10 @@ inline constexpr OUString UPN_HYPH_MIN_WORD_LENGTH = u"HyphMinWordLen inline constexpr OUString UPN_HYPH_NO_CAPS = u"HyphNoCaps"_ustr; inline constexpr OUString UPN_HYPH_NO_LAST_WORD = u"HyphNoLastWord"_ustr; inline constexpr OUString UPN_HYPH_ZONE = u"HyphZone"_ustr; +inline constexpr OUString UPN_HYPH_ZONE_ALWAYS = u"HyphZoneAlways"_ustr; +inline constexpr OUString UPN_HYPH_ZONE_COLUMN = u"HyphZoneColumn"_ustr; +inline constexpr OUString UPN_HYPH_ZONE_PAGE = u"HyphZonePage"_ustr; +inline constexpr OUString UPN_HYPH_ZONE_SPREAD = u"HyphZoneSpread"_ustr; inline constexpr OUString UPN_HYPH_KEEP = u"HyphKeep"_ustr; inline constexpr OUString UPN_HYPH_KEEP_TYPE = u"HyphKeepType"_ustr; inline constexpr OUString UPN_HYPH_KEEP_LINE = u"HyphKeepLine"_ustr; @@ -111,10 +115,14 @@ inline constexpr OUString UPN_IS_GRAMMAR_INTERACTIVE = u"IsInteractiveG #define UPH_HYPH_NO_CAPS 31 #define UPH_HYPH_NO_LAST_WORD 32 #define UPH_HYPH_ZONE 33 -#define UPH_HYPH_KEEP 34 -#define UPH_HYPH_KEEP_TYPE 35 -#define UPH_HYPH_COMPOUND_MIN_LEADING 36 -#define UPH_HYPH_KEEP_LINE 37 +#define UPH_HYPH_ZONE_ALWAYS 34 +#define UPH_HYPH_ZONE_COLUMN 35 +#define UPH_HYPH_ZONE_PAGE 36 +#define UPH_HYPH_ZONE_SPREAD 37 +#define UPH_HYPH_KEEP 38 +#define UPH_HYPH_KEEP_TYPE 39 +#define UPH_HYPH_COMPOUND_MIN_LEADING 40 +#define UPH_HYPH_KEEP_LINE 41 #ifdef __GNUC__ #pragma GCC diagnostic pop diff --git a/include/xmloff/xmltoken.hxx b/include/xmloff/xmltoken.hxx index 3dadf9fa10fe..1c36a3faf4a0 100644 --- a/include/xmloff/xmltoken.hxx +++ b/include/xmloff/xmltoken.hxx @@ -1069,6 +1069,10 @@ namespace xmloff::token { XML_HYPHENATION_NO_LAST_WORD, XML_HYPHENATION_WORD_CHAR_COUNT, XML_HYPHENATION_ZONE, + XML_HYPHENATION_ZONE_ALWAYS, + XML_HYPHENATION_ZONE_COLUMN, + XML_HYPHENATION_ZONE_PAGE, + XML_HYPHENATION_ZONE_SPREAD, XML_HYPHENATION_COMPOUND_REMAIN_CHAR_COUNT, XML_I, XML_ICON, diff --git a/offapi/com/sun/star/style/ParagraphProperties.idl b/offapi/com/sun/star/style/ParagraphProperties.idl index 5b1097feae04..645dfc091e3c 100644 --- a/offapi/com/sun/star/style/ParagraphProperties.idl +++ b/offapi/com/sun/star/style/ParagraphProperties.idl @@ -466,6 +466,34 @@ published service ParagraphProperties @since LibreOffice 25.8 */ [optional, property] boolean ParaHyphenationKeepLine; + + /** specifies the paragraph end zone, i.e. allowed extra white space + in the last full line of paragraph before applying hyphenation. + + @since LibreOffice 25.8 + */ + [optional, property] long ParaHyphenationZoneAlways; + + /** specifies the column end zone, i.e. allowed extra white space + in the last line of columns before applying hyphenation. + + @since LibreOffice 25.8 + */ + [optional, property] long ParaHyphenationZoneColumn; + + /** specifies the page end zone, i.e. allowed extra white space + in the last line of page before applying hyphenation. + + @since LibreOffice 25.8 + */ + [optional, property] long ParaHyphenationZonePage; + + /** specifies the spread end zone, i.e. allowed extra white space + in the last line of spread before applying hyphenation. + + @since LibreOffice 25.8 + */ + [optional, property] long ParaHyphenationZoneSpread; }; diff --git a/schema/libreoffice/OpenDocument-v1.4+libreoffice-schema.rng b/schema/libreoffice/OpenDocument-v1.4+libreoffice-schema.rng index dfc2bba4af45..5c201b4c95b7 100644 --- a/schema/libreoffice/OpenDocument-v1.4+libreoffice-schema.rng +++ b/schema/libreoffice/OpenDocument-v1.4+libreoffice-schema.rng @@ -3202,6 +3202,54 @@ xmlns:loext="urn:org:documentfoundation:names:experimental:office:xmlns:loext:1. + + + + + + no-limit + + + + + + + + + + + + no-limit + + + + + + + + + + + + no-limit + + + + + + + + + + + + no-limit + + + + + + diff --git a/svx/sdi/svxitems.sdi b/svx/sdi/svxitems.sdi index 0415b6955dd9..0810b70e2fa2 100644 --- a/svx/sdi/svxitems.sdi +++ b/svx/sdi/svxitems.sdi @@ -275,6 +275,10 @@ struct SvxHyphenZone INT16 MaxHyphens MID_HYPHEN_MAX_HYPHENS; INT16 MinWordLength MID_HYPHEN_MIN_WORD_LENGTH; INT16 HyphenZone MID_HYPHEN_ZONE; + INT16 HyphenZoneAlways MID_HYPHEN_ZONE_ALWAYS; + INT16 HyphenZoneColumn MID_HYPHEN_ZONE_COLUMN; + INT16 HyphenZonePage MID_HYPHEN_ZONE_PAGE; + INT16 HyphenZoneSpread MID_HYPHEN_ZONE_SPREAD; BOOL HyphenKeep MID_HYPHEN_KEEP; INT16 HyphenKeepType MID_HYPHEN_KEEP_TYPE; BOOL HyphenKeepLine MID_HYPHEN_KEEP_LINE; diff --git a/sw/inc/inspectorproperties.hrc b/sw/inc/inspectorproperties.hrc index 3404018a8c19..faecb2c06e64 100644 --- a/sw/inc/inspectorproperties.hrc +++ b/sw/inc/inspectorproperties.hrc @@ -210,6 +210,10 @@ #define RID_PARA_HYPHENATION_NO_LAST_WORD NC_("RID_ATTRIBUTE_NAMES_MAP", "Para Hyphenation No Last Word") #define RID_PARA_HYPHENATION_MIN_WORD_LENGTH NC_("RID_ATTRIBUTE_NAMES_MAP", "Para Hyphenation Min Word Length") #define RID_PARA_HYPHENATION_ZONE NC_("RID_ATTRIBUTE_NAMES_MAP", "Para Hyphenation Zone") +#define RID_PARA_HYPHENATION_ZONE_ALWAYS NC_("RID_ATTRIBUTE_NAMES_MAP", "Para Hyphenation Paragraph End Zone") +#define RID_PARA_HYPHENATION_ZONE_COLUMN NC_("RID_ATTRIBUTE_NAMES_MAP", "Para Hyphenation Column End Zone") +#define RID_PARA_HYPHENATION_ZONE_PAGE NC_("RID_ATTRIBUTE_NAMES_MAP", "Para Hyphenation Page End Zone") +#define RID_PARA_HYPHENATION_ZONE_SPREAD NC_("RID_ATTRIBUTE_NAMES_MAP", "Para Hyphenation Spread End Zone") #define RID_PARA_HYPHENATION_KEEP NC_("RID_ATTRIBUTE_NAMES_MAP", "Para Hyphenation Keep") #define RID_PARA_HYPHENATION_KEEP_TYPE NC_("RID_ATTRIBUTE_NAMES_MAP", "Para Hyphenation Keep Type") #define RID_PARA_HYPHENATION_KEEP_LINE NC_("RID_ATTRIBUTE_NAMES_MAP", "Para Hyphenation Keep Line") diff --git a/sw/inc/unoprnms.hxx b/sw/inc/unoprnms.hxx index 82bd0b806c93..1cbac3d0a733 100644 --- a/sw/inc/unoprnms.hxx +++ b/sw/inc/unoprnms.hxx @@ -78,6 +78,10 @@ inline constexpr OUString UNO_NAME_PARA_HYPHENATION_MAX_HYPHENS = u"ParaHyphenat inline constexpr OUString UNO_NAME_PARA_HYPHENATION_MIN_WORD_LENGTH = u"ParaHyphenationMinWordLength"_ustr; inline constexpr OUString UNO_NAME_PARA_HYPHENATION_ZONE = u"ParaHyphenationZone"_ustr; +inline constexpr OUString UNO_NAME_PARA_HYPHENATION_ZONE_ALWAYS = u"ParaHyphenationZoneAlways"_ustr; +inline constexpr OUString UNO_NAME_PARA_HYPHENATION_ZONE_COLUMN = u"ParaHyphenationZoneColumn"_ustr; +inline constexpr OUString UNO_NAME_PARA_HYPHENATION_ZONE_PAGE = u"ParaHyphenationZonePage"_ustr; +inline constexpr OUString UNO_NAME_PARA_HYPHENATION_ZONE_SPREAD = u"ParaHyphenationZoneSpread"_ustr; inline constexpr OUString UNO_NAME_PARA_HYPHENATION_NO_CAPS = u"ParaHyphenationNoCaps"_ustr; inline constexpr OUString UNO_NAME_PARA_HYPHENATION_NO_LAST_WORD = u"ParaHyphenationNoLastWord"_ustr; diff --git a/sw/qa/extras/layout/data/tdf165984.fodt b/sw/qa/extras/layout/data/tdf165984.fodt new file mode 100644 index 000000000000..8bda4cc1a2dc --- /dev/null +++ b/sw/qa/extras/layout/data/tdf165984.fodt @@ -0,0 +1,224 @@ + + + + + + 0 + 0 + 68698 + 38887 + true + false + + + view2 + 36348 + 14429 + 0 + 0 + 68696 + 38885 + 0 + 2 + true + 56 + false + false + false + false + false + false + + + + + false + true + true + + false + 0 + false + false + false + false + false + true + false + false + false + 0 + true + false + false + false + false + false + false + true + false + false + true + false + true + true + false + false + false + false + false + false + false + true + false + true + false + false + false + false + false + false + high-resolution + false + 681377 + false + true + false + + + true + + false + false + false + true + true + true + false + 0 + true + false + false + true + true + true + false + true + false + false + false + false + false + + true + false + false + 0 + false + true + + false + false + true + true + false + false + true + 1 + false + false + false + false + false + false + false + false + false + false + false + true + true + true + false + true + false + + true + 906067 + true + false + false + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + The Earth is no different to any other celestial body out there in space. It merely moves along in space inertially. Even + + The Earth is no different to any other celestial body out there in space. It merely moves along in space inertially. Even just one inch above the surface of the Earth is space, except that it has an atmosphere. The Earthisno different to any other celestial body out there in space. It merely moves along in space inertially. Even just one inch above the surface of the Earth is space except that it has an atmosphere. The Earth is no different to any other celestial body out… + + + diff --git a/sw/qa/extras/layout/layout3.cxx b/sw/qa/extras/layout/layout3.cxx index 269d01e8d82b..9189590f6804 100644 --- a/sw/qa/extras/layout/layout3.cxx +++ b/sw/qa/extras/layout/layout3.cxx @@ -980,6 +980,38 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf165354_long_paragraph_3) u"of the Earth is space ex"); } +CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf165984) +{ + // enabled hyphenation on page 1, disabled on page 2 by hyphenation-zone-page + // (no hyphenation, if the word part is completely inside the Page end zone: + // "iner-tially", but "except" and not "ex-cept") + uno::Reference xHyphenator = LinguMgr::GetHyphenator(); + if (!xHyphenator->hasLocale(lang::Locale(u"en"_ustr, u"US"_ustr, OUString()))) + return; + + createSwDoc("tdf165984.fodt"); + // Ensure that all text portions are calculated before testing. + SwViewShell* pViewShell = getSwDoc()->getIDocumentLayoutAccess().GetCurrentViewShell(); + CPPUNIT_ASSERT(pViewShell); + pViewShell->Reformat(); + + xmlDocUniquePtr pXmlDoc = parseLayoutDump(); + + // paragraph with loext:hyphenation-zone-paragraph="7.62cm" + // This was "tially. Even" (now disabled hyphenation in the last full paragraph line) + assertXPath(pXmlDoc, "/root/page[1]/body/txt/SwParaPortion/SwLineLayout[6]", "portion", + u"inertially. Even"); + + // 3-page paragraph, loext:hyphenation-zone-page="5.08cm" + assertXPath(pXmlDoc, "/root/page[2]/body/txt/SwParaPortion/SwLineLayout[1]", "portion", + u"tially. Even just one "); + + // disabled hyphenation by hyphenation-zone-page="5.08cm" + // This ended with "ex-" + assertXPath(pXmlDoc, "/root/page[2]/body/txt/SwParaPortion/SwLineLayout[12]", "portion", + u"of the Earth is space "); +} + CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf106234) { createSwDoc("tdf106234.fodt"); diff --git a/sw/qa/uitest/styleInspector/styleInspector.py b/sw/qa/uitest/styleInspector/styleInspector.py index 2dc13d93cc48..b29f42407f75 100644 --- a/sw/qa/uitest/styleInspector/styleInspector.py +++ b/sw/qa/uitest/styleInspector/styleInspector.py @@ -26,7 +26,7 @@ class styleNavigator(UITestCase): # The cursor is on text without formatting and default style self.assertEqual(1, len(xListBox.getChild('0').getChildren())) self.assertEqual("Default Paragraph Style\t", get_state_as_dict(xListBox.getChild('0').getChild('0'))['Text']) - self.assertEqual(144, len(xListBox.getChild('0').getChild('0').getChildren())) + self.assertEqual(148, len(xListBox.getChild('0').getChild('0').getChildren())) self.assertEqual(0, len(xListBox.getChild('1').getChildren())) self.assertEqual(0, len(xListBox.getChild('2').getChildren())) self.assertEqual(0, len(xListBox.getChild('3').getChildren())) @@ -36,7 +36,7 @@ class styleNavigator(UITestCase): # The cursor is on text with direct formatting self.assertEqual(1, len(xListBox.getChild('0').getChildren())) self.assertEqual("Default Paragraph Style\t", get_state_as_dict(xListBox.getChild('0').getChild('0'))['Text']) - self.assertEqual(144, len(xListBox.getChild('0').getChild('0').getChildren())) + self.assertEqual(148, len(xListBox.getChild('0').getChild('0').getChildren())) self.assertEqual(0, len(xListBox.getChild('1').getChildren())) self.assertEqual(0, len(xListBox.getChild('2').getChildren())) @@ -54,7 +54,7 @@ class styleNavigator(UITestCase): # The cursor is on text with paragraph direct formatting self.assertEqual(1, len(xListBox.getChild('0').getChildren())) self.assertEqual("Default Paragraph Style\t", get_state_as_dict(xListBox.getChild('0').getChild('0'))['Text']) - self.assertEqual(144, len(xListBox.getChild('0').getChild('0').getChildren())) + self.assertEqual(148, len(xListBox.getChild('0').getChild('0').getChildren())) xParDirFormatting = xListBox.getChild('1') self.assertEqual(7, len(xParDirFormatting.getChildren())) @@ -75,7 +75,7 @@ class styleNavigator(UITestCase): xParStyle = xListBox.getChild('0') self.assertEqual(3, len(xParStyle.getChildren())) self.assertEqual("Default Paragraph Style\t", get_state_as_dict(xParStyle.getChild('0'))['Text']) - self.assertEqual(144, len(xParStyle.getChild('0').getChildren())) + self.assertEqual(148, len(xParStyle.getChild('0').getChildren())) self.assertEqual("Heading\t", get_state_as_dict(xParStyle.getChild('1'))['Text']) self.assertEqual(28, len(xParStyle.getChild('1').getChildren())) @@ -109,7 +109,7 @@ class styleNavigator(UITestCase): xParStyle = xListBox.getChild('0') self.assertEqual(3, len(xParStyle.getChildren())) self.assertEqual("Default Paragraph Style\t", get_state_as_dict(xParStyle.getChild('0'))['Text']) - self.assertEqual(144, len(xParStyle.getChild('0').getChildren())) + self.assertEqual(148, len(xParStyle.getChild('0').getChildren())) self.assertEqual("Body Text\t", get_state_as_dict(xParStyle.getChild('1'))['Text']) self.assertEqual(6, len(xParStyle.getChild('1').getChildren())) @@ -144,7 +144,7 @@ class styleNavigator(UITestCase): # The cursor is on text without metadata self.assertEqual(1, len(xListBox.getChild('0').getChildren())) self.assertEqual("Default Paragraph Style\t", get_state_as_dict(xListBox.getChild('0').getChild('0'))['Text']) - self.assertEqual(144, len(xListBox.getChild('0').getChild('0').getChildren())) + self.assertEqual(148, len(xListBox.getChild('0').getChild('0').getChildren())) self.assertEqual(0, len(xListBox.getChild('1').getChildren())) self.assertEqual(0, len(xListBox.getChild('2').getChildren())) self.assertEqual(0, len(xListBox.getChild('3').getChildren())) @@ -154,7 +154,7 @@ class styleNavigator(UITestCase): # The cursor is on text with paragraph metadata showed under direct paragraph formatting self.assertEqual(1, len(xListBox.getChild('0').getChildren())) self.assertEqual("Default Paragraph Style\t", get_state_as_dict(xListBox.getChild('0').getChild('0'))['Text']) - self.assertEqual(144, len(xListBox.getChild('0').getChild('0').getChildren())) + self.assertEqual(148, len(xListBox.getChild('0').getChild('0').getChildren())) xParDirFormatting = xListBox.getChild('1') self.assertEqual(1, len(xParDirFormatting.getChildren())) @@ -207,7 +207,7 @@ class styleNavigator(UITestCase): # The cursor is on text without metadata self.assertEqual(1, len(xListBox.getChild('0').getChildren())) self.assertEqual("Default Paragraph Style\t", get_state_as_dict(xListBox.getChild('0').getChild('0'))['Text']) - self.assertEqual(144, len(xListBox.getChild('0').getChild('0').getChildren())) + self.assertEqual(148, len(xListBox.getChild('0').getChild('0').getChildren())) self.assertEqual(0, len(xListBox.getChild('1').getChildren())) self.assertEqual(0, len(xListBox.getChild('2').getChildren())) self.assertEqual(0, len(xListBox.getChild('3').getChildren())) @@ -217,7 +217,7 @@ class styleNavigator(UITestCase): # The cursor is on text with paragraph metadata showed under direct paragraph formatting self.assertEqual(1, len(xListBox.getChild('1').getChildren())) self.assertEqual("Default Paragraph Style\t", get_state_as_dict(xListBox.getChild('1').getChild('0'))['Text']) - self.assertEqual(144, len(xListBox.getChild('1').getChild('0').getChildren())) + self.assertEqual(148, len(xListBox.getChild('1').getChild('0').getChildren())) # Outer bookmark xBookmarkFormatting = xListBox.getChild('0') @@ -264,7 +264,7 @@ class styleNavigator(UITestCase): # The cursor is on text without metadata self.assertEqual(1, len(xListBox.getChild('0').getChildren())) self.assertEqual("Default Paragraph Style\t", get_state_as_dict(xListBox.getChild('0').getChild('0'))['Text']) - self.assertEqual(144, len(xListBox.getChild('0').getChild('0').getChildren())) + self.assertEqual(148, len(xListBox.getChild('0').getChild('0').getChildren())) self.assertEqual(0, len(xListBox.getChild('1').getChildren())) self.assertEqual(0, len(xListBox.getChild('2').getChildren())) diff --git a/sw/qa/uitest/styleInspector/tdf137513.py b/sw/qa/uitest/styleInspector/tdf137513.py index 70f74c76a5e9..e5da641bbc03 100644 --- a/sw/qa/uitest/styleInspector/tdf137513.py +++ b/sw/qa/uitest/styleInspector/tdf137513.py @@ -35,7 +35,7 @@ class tdf137513(UITestCase): self.assertEqual(2, len(xListBox.getChild('0').getChildren())) self.assertEqual("Default Paragraph Style\t", get_state_as_dict(xListBox.getChild('0').getChild('0'))['Text']) self.assertEqual("Table Contents\t", get_state_as_dict(xListBox.getChild('0').getChild('1'))['Text']) - self.assertEqual(144, len(xListBox.getChild('0').getChild('0').getChildren())) + self.assertEqual(148, len(xListBox.getChild('0').getChild('0').getChildren())) xTableContent = xListBox.getChild('0').getChild('1') self.assertEqual(5, len(xTableContent.getChildren())) diff --git a/sw/source/core/inc/txtfrm.hxx b/sw/source/core/inc/txtfrm.hxx index f2eb15cf187c..d89efec8f16d 100644 --- a/sw/source/core/inc/txtfrm.hxx +++ b/sw/source/core/inc/txtfrm.hxx @@ -208,7 +208,8 @@ class SW_DLLPUBLIC SwTextFrame final : public SwContentFrame std::unique_ptr m_pMergedPara; TextFrameIndex mnOffset; // Is the offset in the Content (character count) - TextFrameIndex mnNoHyphOffset; // Is the offset of the last line to disable its hyphenation + TextFrameIndex mnNoHyphOffset; // Is the offset of the last line with disabled or limited hyphenation + sal_Int16 mnNoHyphEndZone; // size of end zone (-1 means disabled hyphenation) sal_uInt16 mnCacheIndex; // Index into the cache, USHRT_MAX if there's definitely no fitting object in the cache @@ -457,6 +458,8 @@ public: inline void SetOffset (TextFrameIndex nNewOfst); TextFrameIndex GetNoHyphOffset() const { return mnNoHyphOffset; } void SetNoHyphOffset(TextFrameIndex const nNewOfst) { mnNoHyphOffset = nNewOfst; } + sal_Int16 GetNoHyphEndZone() const { return mnNoHyphEndZone; } + void SetNoHyphEndZone(sal_Int16 nNewType) { mnNoHyphEndZone = nNewType; } void ManipOfst(TextFrameIndex const nNewOfst) { mnOffset = nNewOfst; } SwTextFrame *GetFrameAtPos ( const SwPosition &rPos); inline const SwTextFrame *GetFrameAtPos ( const SwPosition &rPos) const; diff --git a/sw/source/core/text/guess.cxx b/sw/source/core/text/guess.cxx index 5754422b4cf7..55e109136e78 100644 --- a/sw/source/core/text/guess.cxx +++ b/sw/source/core/text/guess.cxx @@ -280,11 +280,22 @@ bool SwTextGuess::Guess( const SwTextPortion& rPor, SwTextFormatInfo &rInf, } } - bool bHyph = rInf.IsHyphenate() && !rInf.IsHyphForbud() && - // disable hyphenation in the last line, when hyphenation-keep-line is enabled - ( rInf.GetTextFrame()->GetNoHyphOffset() == TextFrameIndex(COMPLETE_STRING) || + bool bHyph = rInf.IsHyphenate() && !rInf.IsHyphForbud(); + // disable hyphenation according to hyphenation-keep and hyphenation-keep-type, + // or modify hyphenation according to hyphenation-zone-column/page/spread (see widorp.cxx) + sal_Int16 nEndZone = 0; + if ( bHyph && + rInf.GetTextFrame()->GetNoHyphOffset() != TextFrameIndex(COMPLETE_STRING) && // when there is a portion in the last line, rInf.GetIdx() > GetNoHyphOffset() - rInf.GetTextFrame()->GetNoHyphOffset() > rInf.GetIdx() ); + rInf.GetTextFrame()->GetNoHyphOffset() <= rInf.GetIdx() ) + { + nEndZone = rInf.GetTextFrame()->GetNoHyphEndZone(); + // disable hyphenation in the last line, when hyphenation-keep-line is enabled + // and hyphenation-keep, too (i.e. when end zone is not defined), + // also when the end zone is bigger, than the line width + if ( nEndZone < 0 || nEndZone >= nLineWidth ) + bHyph = false; + } TextFrameIndex nHyphPos(0); // nCutPos is the first character not fitting to the current line @@ -296,33 +307,76 @@ bool SwTextGuess::Guess( const SwTextPortion& rPor, SwTextFormatInfo &rInf, // or 0, if the whole line in the hyphenation zone, // or -1, if no hyphenation zone defined (i.e. it is 0) sal_Int32 nHyphZone = -1; + sal_Int32 nParaZone = -1; const css::beans::PropertyValues & rHyphValues = rInf.GetHyphValues(); - assert( rHyphValues.getLength() > 5 && rHyphValues[5].Name == UPN_HYPH_ZONE ); + assert( rHyphValues.getLength() > 10 && rHyphValues[5].Name == UPN_HYPH_ZONE && rHyphValues[10].Name == UPN_HYPH_ZONE_ALWAYS ); // hyphenation zone (distance from the line end in twips) - sal_uInt16 nTextHyphenZone; - if ( rHyphValues[5].Value >>= nTextHyphenZone ) + sal_Int16 nTextHyphenZone = 0; + sal_Int16 nTextHyphenZoneAlways = 0; + rHyphValues[5].Value >>= nTextHyphenZone; + rHyphValues[10].Value >>= nTextHyphenZoneAlways; + if ( nTextHyphenZone || nTextHyphenZoneAlways || nEndZone ) + { nHyphZone = nTextHyphenZone >= nLineWidth ? 0 - : sal_Int32(rInf.GetTextBreak( nLineWidth - nTextHyphenZone, + : sal_Int32(rInf.GetTextBreak( nLineWidth - (nEndZone ? nEndZone : nTextHyphenZone), nMaxLen, nMaxComp, rInf.GetCachedVclData().get() )); - + } m_nCutPos = rInf.GetTextBreak( nLineWidth, nMaxLen, nMaxComp, nHyphPos, rInf.GetCachedVclData().get() ); - // don't try to hyphenate in the hyphenation zone - if ( nHyphZone != -1 && TextFrameIndex(COMPLETE_STRING) != m_nCutPos ) + if ( !nEndZone && nTextHyphenZoneAlways && + // if paragraph end zone is not different from the hyphenation zone, skip its handling + nTextHyphenZoneAlways != nTextHyphenZone && + // end of the paragraph + // FIXME: handle text portions + rInf.GetText().getLength() - sal_Int32(nHyphZone) < + sal_Int32(m_nCutPos) - sal_Int32(rInf.GetIdx() ) ) + { + nParaZone = nTextHyphenZoneAlways >= nLineWidth + ? 0 + : sal_Int32(rInf.GetTextBreak( nLineWidth - nTextHyphenZoneAlways, + nMaxLen, nMaxComp, rInf.GetCachedVclData().get() )); + } + + // don't try to hyphenate in the hyphenation zone or in the paragraph end zone + // maximum end zone is the lower non-negative text break position + // (-1 means that no hyphenation zone is defined) + sal_Int32 nMaxZone = nParaZone > -1 && nParaZone < nHyphZone + ? nParaZone + : nHyphZone; + if ( nMaxZone != -1 && TextFrameIndex(COMPLETE_STRING) != m_nCutPos ) { sal_Int32 nZonePos = sal_Int32(m_nCutPos); - // disable hyphenation, if there is a space within the hyphenation zone + // disable hyphenation, if there is a space within the hyphenation or end zones // Note: for better interoperability, not fitting space character at // rInf.GetIdx()[nHyphZone] always disables the hyphenation, don't need to calculate // with its fitting part. Moreover, do not check double or more spaces there, they // are accepted outside of the hyphenation zone, too. - for (; sal_Int32(rInf.GetIdx()) <= nZonePos && nHyphZone <= nZonePos; --nZonePos ) + for (; sal_Int32(rInf.GetIdx()) <= nZonePos && nMaxZone <= nZonePos; --nZonePos ) { sal_Unicode cChar = rInf.GetText()[nZonePos]; if ( cChar == CH_BLANK || cChar == CH_FULL_BLANK || cChar == CH_SIX_PER_EM ) { - bHyph = false; + // no column/page/spread/end zone (!nEndZone), + // but is it good for a paragraph end zone? + if ( nParaZone != -1 && nParaZone <= nZonePos && + // still end of the paragraph, i.e. still more characters in the original + // last full line, then in the planned last paragraph line + // FIXME: guarantee, that last not full line won't become a full line + // FIXME: handle text portions + rInf.GetText().getLength() - sal_Int32(nZonePos) < + sal_Int32(m_nCutPos) - sal_Int32(rInf.GetIdx() ) ) + { + bHyph = false; + } + // otherwise disable hyphenation, if there is a space in the hyphenation zone + else if ( nHyphZone != 1 && nHyphZone <= nZonePos ) + { + bHyph = false; + } + // set applied end zone + if ( !bHyph && nEndZone ) + rInf.GetTextFrame()->SetNoHyphOffset(TextFrameIndex(COMPLETE_STRING)); } } } @@ -410,6 +464,10 @@ bool SwTextGuess::Guess( const SwTextPortion& rPor, SwTextFormatInfo &rInf, // with hyphenation, i.e. don't skip hyphenation, if the last paragraph // line is already near full. ( !bDoNotHyphenateLastLine || + // FIXME: character count is not fail-safe: remaining characters + // can exceed the line, resulting two last full paragraph lines + // with disabled hyphenation. + // FIXME: handle text portions rInf.GetText().getLength() - sal_Int32(nLastWord) < sal_Int32(m_nCutPos) - sal_Int32(rInf.GetIdx() ) ) ) { diff --git a/sw/source/core/text/inftxt.cxx b/sw/source/core/text/inftxt.cxx index 1ad5fe78934b..b8eca0f24575 100644 --- a/sw/source/core/text/inftxt.cxx +++ b/sw/source/core/text/inftxt.cxx @@ -1563,13 +1563,13 @@ static void lcl_InitHyphValues( PropertyValues &rVals, sal_Int16 nMinLeading, sal_Int16 nMinTrailing, bool bNoCapsHyphenation, bool bNoLastWordHyphenation, sal_Int16 nMinWordLength, sal_Int16 nTextHyphZone, bool bKeep, sal_Int16 nKeepType, - bool bKeepLine, sal_Int16 nCompoundMinLeading ) + bool bKeepLine, sal_Int16 nCompoundMinLeading, sal_Int16 nTextHyphZoneAlways ) { sal_Int32 nLen = rVals.getLength(); if (0 == nLen) // yet to be initialized? { - rVals.realloc( 10 ); + rVals.realloc( 11 ); PropertyValue *pVal = rVals.getArray(); pVal[0].Name = UPN_HYPH_MIN_LEADING; @@ -1611,8 +1611,12 @@ static void lcl_InitHyphValues( PropertyValues &rVals, pVal[9].Name = UPN_HYPH_KEEP_LINE; pVal[9].Handle = UPH_HYPH_KEEP_LINE; pVal[9].Value <<= bKeepLine; + + pVal[10].Name = UPN_HYPH_ZONE_ALWAYS; + pVal[10].Handle = UPH_HYPH_ZONE_ALWAYS; + pVal[10].Value <<= nTextHyphZoneAlways; } - else if (10 == nLen) // already initialized once? + else if (11 == nLen) // already initialized once? { PropertyValue *pVal = rVals.getArray(); pVal[0].Value <<= nMinLeading; @@ -1625,6 +1629,7 @@ static void lcl_InitHyphValues( PropertyValues &rVals, pVal[7].Value <<= nCompoundMinLeading; pVal[8].Value <<= bKeep; pVal[9].Value <<= bKeepLine; + pVal[10].Value <<= nTextHyphZoneAlways; } else { OSL_FAIL( "unexpected size of sequence" ); @@ -1633,7 +1638,7 @@ static void lcl_InitHyphValues( PropertyValues &rVals, const PropertyValues & SwTextFormatInfo::GetHyphValues() const { - OSL_ENSURE( 10 == m_aHyphVals.getLength(), + OSL_ENSURE( 11 == m_aHyphVals.getLength(), "hyphenation values not yet initialized" ); return m_aHyphVals; } @@ -1655,6 +1660,7 @@ bool SwTextFormatInfo::InitHyph( const bool bAutoHyphen ) const bool bNoCapsHyphenation = rAttr.IsNoCapsHyphenation(); const bool bNoLastWordHyphenation = rAttr.IsNoLastWordHyphenation(); const sal_Int16 nTextHyphZone = rAttr.GetTextHyphenZone(); + const sal_Int16 nTextHyphZoneAlways = rAttr.GetTextHyphenZoneAlways(); const bool bKeep = rAttr.IsKeep(); const sal_Int16 nKeepType = rAttr.GetKeepType(); const bool bKeepLine = rAttr.IsKeepLine(); @@ -1662,7 +1668,7 @@ bool SwTextFormatInfo::InitHyph( const bool bAutoHyphen ) lcl_InitHyphValues( m_aHyphVals, nMinimalLeading, nMinimalTrailing, bNoCapsHyphenation, bNoLastWordHyphenation, nMinimalWordLength, nTextHyphZone, bKeep, nKeepType, - bKeepLine, nCompoundMinimalLeading ); + bKeepLine, nCompoundMinimalLeading, nTextHyphZoneAlways ); } return bAuto; } diff --git a/sw/source/core/text/txtfrm.cxx b/sw/source/core/text/txtfrm.cxx index 7eb35cb29e81..9e0c662aa3c1 100644 --- a/sw/source/core/text/txtfrm.cxx +++ b/sw/source/core/text/txtfrm.cxx @@ -774,6 +774,7 @@ SwTextFrame::SwTextFrame(SwTextNode * const pNode, SwFrame* pSib, , mnAdditionalFirstLineOffset( 0 ) , mnOffset( 0 ) , mnNoHyphOffset( COMPLETE_STRING ) + , mnNoHyphEndZone( 0 ) , mnCacheIndex( USHRT_MAX ) , mbLocked( false ) , mbWidow( false ) diff --git a/sw/source/core/text/widorp.cxx b/sw/source/core/text/widorp.cxx index 3f83fd115b7d..1c31d2ba2245 100644 --- a/sw/source/core/text/widorp.cxx +++ b/sw/source/core/text/widorp.cxx @@ -470,6 +470,7 @@ bool WidowsAndOrphans::FindWidows( SwTextFrame *pFrame, SwTextMargin &rLine ) // hyphenation-keep: truncate a hyphenated line at the end of // the column, page or spread (but not more) // hyphenation-keep-line: disable hyphenation in the last line instead of truncating it + // hyphenation-zone-always/page/column/spread: modify hyphenation in the last line (end zone) int nExtraWidLines = 0; if( rLine.GetLineNr() >= m_nWidLines && pMaster->HasPara() ) { @@ -480,26 +481,58 @@ bool WidowsAndOrphans::FindWidows( SwTextFrame *pFrame, SwTextMargin &rLine ) bool bKeep = rAttr.IsHyphen() && rAttr.IsKeep() && rAttr.GetKeepType(); bool bKeepLine = bKeep && rAttr.IsKeepLine(); + // last line of a column inside a page + auto pMasterPage = pMaster->FindPageFrame(); + auto pPage = pFrame->FindPageFrame(); + // across column, but not page or spread, when both parts are there on the same page + bool bAcrossColumnNotPage = pMasterPage == pPage; + // across page, but not spread, when the parts are there not on the same page + bool bAcrossPageNotSpread = !bAcrossColumnNotPage && + !pMasterPage->OnRightPage() && pPage->OnRightPage() && + // linked text frames can be on a different spread, so check + // that the master is there on the previous page + pMasterPage == pPage->GetPrev(); + + // calculate end zones, based on their inheritance (0 means inheritance) + sal_Int16 nEndZoneParagraph = rAttr.GetTextHyphenZoneAlways() > 0 + ? rAttr.GetTextHyphenZoneAlways() + : rAttr.GetTextHyphenZone(); + sal_Int16 nEndZoneColumn = rAttr.GetTextHyphenZoneColumn() > 0 + ? rAttr.GetTextHyphenZoneColumn() + : nEndZoneParagraph; + sal_Int16 nEndZonePage = rAttr.GetTextHyphenZonePage() > 0 + ? rAttr.GetTextHyphenZonePage() + : nEndZoneColumn; + sal_Int16 nEndZoneSpread = rAttr.GetTextHyphenZoneSpread() > 0 + ? rAttr.GetTextHyphenZoneSpread() + : nEndZonePage; + + // set end zone + sal_Int16 nNoHyphEndZone = bAcrossColumnNotPage + ? nEndZoneColumn + : bAcrossPageNotSpread + ? nEndZonePage + : nEndZoneSpread; + // if PAGE or SPREAD, allow hyphenation in the not last column or in the // not last linked frame on the same page - if( bKeep && ( + if( bKeep && bAcrossColumnNotPage && ( rAttr.GetKeepType() == css::text::ParagraphHyphenationKeepType::SPREAD || - rAttr.GetKeepType() == css::text::ParagraphHyphenationKeepType::PAGE ) && - pMaster->FindPageFrame() == pFrame->FindPageFrame() ) + rAttr.GetKeepType() == css::text::ParagraphHyphenationKeepType::PAGE ) ) { bKeep = false; } // if SPREAD, allow hyphenation at bottom of left page on the same spread if ( bKeep && rAttr.GetKeepType() == css::text::ParagraphHyphenationKeepType::SPREAD && - pFrame->FindPageFrame()->OnRightPage() && - pMaster->FindPageFrame() == pFrame->FindPageFrame()->GetPrev() ) + bAcrossPageNotSpread ) { bKeep = false; } // remove remaining NoHyphOffset after enabling Hyphenate Across Spread (!bKeep) or - // enabling Move Line (!bKeepLine), and invalidate the master to update the last line + // enabling Move Line (!bKeepLine), or setting End Zone to no-limit, + // and invalidate the master to update the last line if ( (!bKeep || !bKeepLine) && pMaster->GetNoHyphOffset() != TextFrameIndex(COMPLETE_STRING) ) { @@ -508,7 +541,7 @@ bool WidowsAndOrphans::FindWidows( SwTextFrame *pFrame, SwTextMargin &rLine ) pMaster->InvalidateSize_(); } - if ( bKeep && pMasterPara && pMasterPara->GetNext() ) + if ( ( bKeep || nNoHyphEndZone ) && pMasterPara && pMasterPara->GetNext() ) { // calculate the beginning of last hyphenated line TextFrameIndex nIdx(pMasterPara->GetLen()); @@ -526,13 +559,14 @@ bool WidowsAndOrphans::FindWidows( SwTextFrame *pFrame, SwTextMargin &rLine ) nIdx -= pNext->GetLen(); // hyphenated line, but not the last remaining one // in the case of shifting full line (bKeepLine = false) - if ( pNext->IsEndHyph() && ( bKeepLine || !pNext->IsLastHyph() ) ) + if ( pNext->IsEndHyph() && ( bKeepLine || !pNext->IsLastHyph() || nNoHyphEndZone ) ) { nExtraWidLines = rLine.GetLineNr() - m_nWidLines + 1; // shift only a word: disable hyphenation in the line, if needed - if ( bKeepLine && nExtraWidLines ) + if ( ( bKeepLine || nNoHyphEndZone ) && nExtraWidLines ) { pMaster->SetNoHyphOffset(nIdx); + pMaster->SetNoHyphEndZone(bKeep ? -1 : nNoHyphEndZone); // update also columns and frames pMaster->Prepare( PrepareHint::AdjustSizeWithoutFormatting ); pMaster->InvalidateSize_(); @@ -542,7 +576,7 @@ bool WidowsAndOrphans::FindWidows( SwTextFrame *pFrame, SwTextMargin &rLine ) // set remaining line to "last remaining hyphenated line" // to avoid truncating multiple hyphenated lines instead // of a single one - else if ( !bKeepLine && pCurr->IsEndHyph() ) + else if ( bKeep && !bKeepLine && pCurr->IsEndHyph() ) pCurr->SetLastHyph( true ); // also unset the line before the remaining one // TODO: check also the line after the truncated line? diff --git a/sw/source/core/unocore/unomapproperties.hxx b/sw/source/core/unocore/unomapproperties.hxx index e441125576b7..f93b8e99b09a 100644 --- a/sw/source/core/unocore/unomapproperties.hxx +++ b/sw/source/core/unocore/unomapproperties.hxx @@ -121,6 +121,10 @@ { UNO_NAME_PARA_HYPHENATION_MAX_HYPHENS, RES_PARATR_HYPHENZONE, cppu::UnoType::get(), PropertyAttribute::MAYBEVOID, MID_HYPHEN_MAX_HYPHENS }, \ { UNO_NAME_PARA_HYPHENATION_MIN_WORD_LENGTH, RES_PARATR_HYPHENZONE, cppu::UnoType::get(), PropertyAttribute::MAYBEVOID, MID_HYPHEN_MIN_WORD_LENGTH }, \ { UNO_NAME_PARA_HYPHENATION_ZONE, RES_PARATR_HYPHENZONE, cppu::UnoType::get(), PropertyAttribute::MAYBEVOID, MID_HYPHEN_ZONE}, \ + { UNO_NAME_PARA_HYPHENATION_ZONE_ALWAYS, RES_PARATR_HYPHENZONE, cppu::UnoType::get(), PropertyAttribute::MAYBEVOID, MID_HYPHEN_ZONE_ALWAYS}, \ + { UNO_NAME_PARA_HYPHENATION_ZONE_COLUMN, RES_PARATR_HYPHENZONE, cppu::UnoType::get(), PropertyAttribute::MAYBEVOID, MID_HYPHEN_ZONE_COLUMN}, \ + { UNO_NAME_PARA_HYPHENATION_ZONE_PAGE, RES_PARATR_HYPHENZONE, cppu::UnoType::get(), PropertyAttribute::MAYBEVOID, MID_HYPHEN_ZONE_PAGE}, \ + { UNO_NAME_PARA_HYPHENATION_ZONE_SPREAD, RES_PARATR_HYPHENZONE, cppu::UnoType::get(), PropertyAttribute::MAYBEVOID, MID_HYPHEN_ZONE_SPREAD}, \ { UNO_NAME_PARA_HYPHENATION_KEEP, RES_PARATR_HYPHENZONE, cppu::UnoType::get(), PropertyAttribute::MAYBEVOID, MID_HYPHEN_KEEP }, \ { UNO_NAME_PARA_HYPHENATION_KEEP_TYPE, RES_PARATR_HYPHENZONE, cppu::UnoType::get(), PropertyAttribute::MAYBEVOID, MID_HYPHEN_KEEP_TYPE }, \ { UNO_NAME_PARA_HYPHENATION_KEEP_LINE, RES_PARATR_HYPHENZONE, cppu::UnoType::get(), PropertyAttribute::MAYBEVOID, MID_HYPHEN_KEEP_LINE }, \ @@ -492,6 +496,10 @@ { UNO_NAME_PARA_HYPHENATION_MAX_HYPHENS, RES_PARATR_HYPHENZONE, cppu::UnoType::get(), PropertyAttribute::MAYBEVOID, MID_HYPHEN_MAX_HYPHENS},\ { UNO_NAME_PARA_HYPHENATION_MIN_WORD_LENGTH, RES_PARATR_HYPHENZONE, cppu::UnoType::get(), PropertyAttribute::MAYBEVOID, MID_HYPHEN_MIN_WORD_LENGTH},\ { UNO_NAME_PARA_HYPHENATION_ZONE, RES_PARATR_HYPHENZONE, cppu::UnoType::get(), PropertyAttribute::MAYBEVOID, MID_HYPHEN_ZONE},\ + { UNO_NAME_PARA_HYPHENATION_ZONE_ALWAYS, RES_PARATR_HYPHENZONE, cppu::UnoType::get(), PropertyAttribute::MAYBEVOID, MID_HYPHEN_ZONE_ALWAYS},\ + { UNO_NAME_PARA_HYPHENATION_ZONE_COLUMN, RES_PARATR_HYPHENZONE, cppu::UnoType::get(), PropertyAttribute::MAYBEVOID, MID_HYPHEN_ZONE_COLUMN},\ + { UNO_NAME_PARA_HYPHENATION_ZONE_PAGE, RES_PARATR_HYPHENZONE, cppu::UnoType::get(), PropertyAttribute::MAYBEVOID, MID_HYPHEN_ZONE_PAGE},\ + { UNO_NAME_PARA_HYPHENATION_ZONE_SPREAD, RES_PARATR_HYPHENZONE, cppu::UnoType::get(), PropertyAttribute::MAYBEVOID, MID_HYPHEN_ZONE_SPREAD},\ { UNO_NAME_PARA_HYPHENATION_KEEP, RES_PARATR_HYPHENZONE, cppu::UnoType::get(), PropertyAttribute::MAYBEVOID, MID_HYPHEN_KEEP},\ { UNO_NAME_PARA_HYPHENATION_KEEP_TYPE, RES_PARATR_HYPHENZONE, cppu::UnoType::get(), PropertyAttribute::MAYBEVOID, MID_HYPHEN_KEEP_TYPE},\ { UNO_NAME_PARA_HYPHENATION_KEEP_LINE, RES_PARATR_HYPHENZONE, cppu::UnoType::get(), PropertyAttribute::MAYBEVOID, MID_HYPHEN_KEEP_LINE},\ diff --git a/sw/source/uibase/sidebar/WriterInspectorTextPanel.cxx b/sw/source/uibase/sidebar/WriterInspectorTextPanel.cxx index 858b60e492ba..bc457dbec441 100644 --- a/sw/source/uibase/sidebar/WriterInspectorTextPanel.cxx +++ b/sw/source/uibase/sidebar/WriterInspectorTextPanel.cxx @@ -273,6 +273,10 @@ static OUString PropertyNametoRID(const OUString& rName) { "ParaHyphenationNoLastWord", RID_PARA_HYPHENATION_NO_LAST_WORD }, { "ParaHyphenationMinWordLength", RID_PARA_HYPHENATION_MIN_WORD_LENGTH }, { "ParaHyphenationZone", RID_PARA_HYPHENATION_ZONE }, + { "ParaHyphenationZoneAlways", RID_PARA_HYPHENATION_ZONE_ALWAYS }, + { "ParaHyphenationZoneColumn", RID_PARA_HYPHENATION_ZONE_COLUMN }, + { "ParaHyphenationZonePage", RID_PARA_HYPHENATION_ZONE_PAGE }, + { "ParaHyphenationZoneSpread", RID_PARA_HYPHENATION_ZONE_SPREAD }, { "ParaHyphenationKeep", RID_PARA_HYPHENATION_KEEP }, { "ParaHyphenationKeepType", RID_PARA_HYPHENATION_KEEP_TYPE }, { "ParaHyphenationKeepLine", RID_PARA_HYPHENATION_KEEP_LINE }, diff --git a/xmloff/inc/xmlprop.hxx b/xmloff/inc/xmlprop.hxx index c5cd712e94a6..fe47eaf60ece 100644 --- a/xmloff/inc/xmlprop.hxx +++ b/xmloff/inc/xmlprop.hxx @@ -501,6 +501,10 @@ inline constexpr OUString PROP_ParaHyphenationMinWordLength = u"ParaHyphenationM inline constexpr OUString PROP_ParaHyphenationNoCaps = u"ParaHyphenationNoCaps"_ustr; inline constexpr OUString PROP_ParaHyphenationNoLastWord = u"ParaHyphenationNoLastWord"_ustr; inline constexpr OUString PROP_ParaHyphenationZone = u"ParaHyphenationZone"_ustr; +inline constexpr OUString PROP_ParaHyphenationZoneAlways = u"ParaHyphenationZoneAlways"_ustr; +inline constexpr OUString PROP_ParaHyphenationZoneColumn = u"ParaHyphenationZoneColumn"_ustr; +inline constexpr OUString PROP_ParaHyphenationZonePage = u"ParaHyphenationZonePage"_ustr; +inline constexpr OUString PROP_ParaHyphenationZoneSpread = u"ParaHyphenationZoneSpread"_ustr; inline constexpr OUString PROP_ParaHyphenationKeep = u"ParaHyphenationKeep"_ustr; inline constexpr OUString PROP_ParaHyphenationKeepLine = u"ParaHyphenationKeepLine"_ustr; inline constexpr OUString PROP_ParaHyphenationKeepType = u"ParaHyphenationKeepType"_ustr; diff --git a/xmloff/source/core/xmltoken.cxx b/xmloff/source/core/xmltoken.cxx index aa5b24961ba8..16db497dcb1c 100644 --- a/xmloff/source/core/xmltoken.cxx +++ b/xmloff/source/core/xmltoken.cxx @@ -1082,6 +1082,10 @@ namespace xmloff::token { TOKEN( "hyphenation-no-last-word", XML_HYPHENATION_NO_LAST_WORD ), TOKEN( "hyphenation-word-char-count", XML_HYPHENATION_WORD_CHAR_COUNT ), TOKEN( "hyphenation-zone", XML_HYPHENATION_ZONE ), + TOKEN( "hyphenation-zone-always", XML_HYPHENATION_ZONE_ALWAYS ), + TOKEN( "hyphenation-zone-column", XML_HYPHENATION_ZONE_COLUMN ), + TOKEN( "hyphenation-zone-page", XML_HYPHENATION_ZONE_PAGE ), + TOKEN( "hyphenation-zone-spread", XML_HYPHENATION_ZONE_SPREAD ), TOKEN( "hyphenation-compound-remain-char-count", XML_HYPHENATION_COMPOUND_REMAIN_CHAR_COUNT ), TOKEN( "i", XML_I ), TOKEN( "icon", XML_ICON ), diff --git a/xmloff/source/text/txtprmap.cxx b/xmloff/source/text/txtprmap.cxx index 90365304e06a..f6b1a672326f 100644 --- a/xmloff/source/text/txtprmap.cxx +++ b/xmloff/source/text/txtprmap.cxx @@ -345,6 +345,10 @@ XMLPropertyMapEntry constexpr aXMLParaPropMap[] = MAP_EXT( PROP_ParaHyphenationNoLastWord, XML_NAMESPACE_LO_EXT, XML_HYPHENATION_NO_LAST_WORD, XML_TYPE_BOOL|XML_TYPE_PROP_TEXT, 0 ), MAP_EXT( PROP_ParaHyphenationMinWordLength, XML_NAMESPACE_LO_EXT, XML_HYPHENATION_WORD_CHAR_COUNT, XML_TYPE_NUMBER16_NONE|XML_TYPE_PROP_TEXT, 0 ), MAP_EXT( PROP_ParaHyphenationZone, XML_NAMESPACE_LO_EXT, XML_HYPHENATION_ZONE, XML_TYPE_NUMBER16_NONE|XML_TYPE_PROP_TEXT, 0 ), + MAP_EXT( PROP_ParaHyphenationZoneAlways, XML_NAMESPACE_LO_EXT, XML_HYPHENATION_ZONE_ALWAYS, XML_TYPE_NUMBER16_NONE|XML_TYPE_PROP_TEXT, 0 ), + MAP_EXT( PROP_ParaHyphenationZoneColumn, XML_NAMESPACE_LO_EXT, XML_HYPHENATION_ZONE_COLUMN, XML_TYPE_NUMBER16_NONE|XML_TYPE_PROP_TEXT, 0 ), + MAP_EXT( PROP_ParaHyphenationZonePage, XML_NAMESPACE_LO_EXT, XML_HYPHENATION_ZONE_PAGE, XML_TYPE_NUMBER16_NONE|XML_TYPE_PROP_TEXT, 0 ), + MAP_EXT( PROP_ParaHyphenationZoneSpread, XML_NAMESPACE_LO_EXT, XML_HYPHENATION_ZONE_SPREAD, XML_TYPE_NUMBER16_NONE|XML_TYPE_PROP_TEXT, 0 ), MAP_EXT( PROP_ParaHyphenationCompoundMinLeadingChars, XML_NAMESPACE_LO_EXT, XML_HYPHENATION_COMPOUND_REMAIN_CHAR_COUNT, XML_TYPE_NUMBER16_NO_ZERO|XML_TYPE_PROP_TEXT, 0 ), MP_E( PROP_ParaHyphenationKeep, XML_NAMESPACE_FO, XML_HYPHENATION_KEEP, XML_TYPE_HYPHENATION_KEEP, 0 ), MAP_EXT( PROP_ParaHyphenationKeepType, XML_NAMESPACE_LO_EXT, XML_HYPHENATION_KEEP_TYPE, XML_TYPE_HYPHENATION_KEEP_TYPE|XML_TYPE_PROP_PARAGRAPH, 0 ), diff --git a/xmloff/source/token/tokens.txt b/xmloff/source/token/tokens.txt index d11a6d02e77c..4765c948f775 100644 --- a/xmloff/source/token/tokens.txt +++ b/xmloff/source/token/tokens.txt @@ -982,6 +982,10 @@ hyphenation-no-caps hyphenation-no-last-word hyphenation-word-char-count hyphenation-zone +hyphenation-zone-always +hyphenation-zone-column +hyphenation-zone-page +hyphenation-zone-spread hyphenation-compound-remain-char-count i icon