summaryrefslogtreecommitdiff
path: root/editeng/source
diff options
context:
space:
mode:
authorSamuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>2019-11-28 11:13:44 +0100
committerMichael Stahl <michael.stahl@cib.de>2019-12-07 19:58:33 +0100
commitad86ebb1f86f6347ccb9bbe40b0ca080562cbae8 (patch)
treeb598bad7d2ae57861cc57cd81271bd96b9aa9929 /editeng/source
parente000187243b9b90f9c8c9110fcd9a82c01ba0fe7 (diff)
tdf#121658 Add option to not hyphenate words in CAPS
* Add checkbox to pagraph dialog * Store property in paragraph model * Move docx import/export from grabbag to paragraph model * Add ODF import/export * Add ODF unit test * Add layout test Change-Id: Id4e7c5a0ad145c042f862995d227c31ae2aa0abd Reviewed-on: https://gerrit.libreoffice.org/83979 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@cib.de> (cherry picked from commit 72bd0df107ee47c4d54fa88b4960d32ea03e9f69) Reviewed-on: https://gerrit.libreoffice.org/84620
Diffstat (limited to 'editeng/source')
-rw-r--r--editeng/source/editeng/editdoc.cxx1
-rw-r--r--editeng/source/editeng/eerdll.cxx99
-rw-r--r--editeng/source/items/paraitem.cxx10
3 files changed, 60 insertions, 50 deletions
diff --git a/editeng/source/editeng/editdoc.cxx b/editeng/source/editeng/editdoc.cxx
index ad71436ab89f..6fb8c3cfe181 100644
--- a/editeng/source/editeng/editdoc.cxx
+++ b/editeng/source/editeng/editdoc.cxx
@@ -164,6 +164,7 @@ const SfxItemInfo aItemInfos[EDITITEMCOUNT] = {
{ SID_ATTR_PARA_SCRIPTSPACE, true }, // EE_PARA_ASIANCJKSPACING
{ SID_ATTR_NUMBERING_RULE, true }, // EE_PARA_NUMBULL
{ 0, true }, // EE_PARA_HYPHENATE
+ { 0, true }, // EE_PARA_HYPHENATE_NO_CAPS
{ 0, true }, // EE_PARA_BULLETSTATE
{ 0, true }, // EE_PARA_OUTLLRSPACE
{ SID_ATTR_PARA_OUTLLEVEL, true }, // EE_PARA_OUTLLEVEL
diff --git a/editeng/source/editeng/eerdll.cxx b/editeng/source/editeng/eerdll.cxx
index 48bc52ed6485..fa28d7f5692e 100644
--- a/editeng/source/editeng/eerdll.cxx
+++ b/editeng/source/editeng/eerdll.cxx
@@ -97,59 +97,60 @@ DefItems::DefItems()
rDefItems[4] = new SvxScriptSpaceItem( true, EE_PARA_ASIANCJKSPACING );
rDefItems[5] = new SvxNumBulletItem( aDefaultNumRule, EE_PARA_NUMBULLET );
rDefItems[6] = new SfxBoolItem( EE_PARA_HYPHENATE, false );
- rDefItems[7] = new SfxBoolItem( EE_PARA_BULLETSTATE, true );
- rDefItems[8] = new SvxLRSpaceItem( EE_PARA_OUTLLRSPACE );
- rDefItems[9] = new SfxInt16Item( EE_PARA_OUTLLEVEL, -1 );
- rDefItems[10] = new SvxBulletItem( EE_PARA_BULLET );
- rDefItems[11] = new SvxLRSpaceItem( EE_PARA_LRSPACE );
- rDefItems[12] = new SvxULSpaceItem( EE_PARA_ULSPACE );
- rDefItems[13] = new SvxLineSpacingItem( 0, EE_PARA_SBL );
- rDefItems[14] = new SvxAdjustItem( SvxAdjust::Left, EE_PARA_JUST );
- rDefItems[15] = new SvxTabStopItem( 0, 0, SvxTabAdjust::Left, EE_PARA_TABS );
- rDefItems[16] = new SvxJustifyMethodItem( SvxCellJustifyMethod::Auto, EE_PARA_JUST_METHOD );
- rDefItems[17] = new SvxVerJustifyItem( SvxCellVerJustify::Standard, EE_PARA_VER_JUST );
+ rDefItems[7] = new SfxBoolItem( EE_PARA_HYPHENATE_NO_CAPS, false );
+ rDefItems[8] = new SfxBoolItem( EE_PARA_BULLETSTATE, true );
+ rDefItems[9] = new SvxLRSpaceItem( EE_PARA_OUTLLRSPACE );
+ rDefItems[10] = new SfxInt16Item( EE_PARA_OUTLLEVEL, -1 );
+ rDefItems[11] = new SvxBulletItem( EE_PARA_BULLET );
+ rDefItems[12] = new SvxLRSpaceItem( EE_PARA_LRSPACE );
+ rDefItems[13] = new SvxULSpaceItem( EE_PARA_ULSPACE );
+ rDefItems[14] = new SvxLineSpacingItem( 0, EE_PARA_SBL );
+ rDefItems[15] = new SvxAdjustItem( SvxAdjust::Left, EE_PARA_JUST );
+ rDefItems[16] = new SvxTabStopItem( 0, 0, SvxTabAdjust::Left, EE_PARA_TABS );
+ rDefItems[17] = new SvxJustifyMethodItem( SvxCellJustifyMethod::Auto, EE_PARA_JUST_METHOD );
+ rDefItems[18] = new SvxVerJustifyItem( SvxCellVerJustify::Standard, EE_PARA_VER_JUST );
// Character attributes:
- rDefItems[18] = new SvxColorItem( COL_AUTO, EE_CHAR_COLOR );
- rDefItems[19] = new SvxFontItem( EE_CHAR_FONTINFO );
- rDefItems[20] = new SvxFontHeightItem( 240, 100, EE_CHAR_FONTHEIGHT );
- rDefItems[21] = new SvxCharScaleWidthItem( 100, EE_CHAR_FONTWIDTH );
- rDefItems[22] = new SvxWeightItem( WEIGHT_NORMAL, EE_CHAR_WEIGHT );
- rDefItems[23] = new SvxUnderlineItem( LINESTYLE_NONE, EE_CHAR_UNDERLINE );
- rDefItems[24] = new SvxCrossedOutItem( STRIKEOUT_NONE, EE_CHAR_STRIKEOUT );
- rDefItems[25] = new SvxPostureItem( ITALIC_NONE, EE_CHAR_ITALIC );
- rDefItems[26] = new SvxContourItem( false, EE_CHAR_OUTLINE );
- rDefItems[27] = new SvxShadowedItem( false, EE_CHAR_SHADOW );
- rDefItems[28] = new SvxEscapementItem( 0, 100, EE_CHAR_ESCAPEMENT );
- rDefItems[29] = new SvxAutoKernItem( false, EE_CHAR_PAIRKERNING );
- rDefItems[30] = new SvxKerningItem( 0, EE_CHAR_KERNING );
- rDefItems[31] = new SvxWordLineModeItem( false, EE_CHAR_WLM );
- rDefItems[32] = new SvxLanguageItem( LANGUAGE_DONTKNOW, EE_CHAR_LANGUAGE );
- rDefItems[33] = new SvxLanguageItem( LANGUAGE_DONTKNOW, EE_CHAR_LANGUAGE_CJK );
- rDefItems[34] = new SvxLanguageItem( LANGUAGE_DONTKNOW, EE_CHAR_LANGUAGE_CTL );
- rDefItems[35] = new SvxFontItem( EE_CHAR_FONTINFO_CJK );
- rDefItems[36] = new SvxFontItem( EE_CHAR_FONTINFO_CTL );
- rDefItems[37] = new SvxFontHeightItem( 240, 100, EE_CHAR_FONTHEIGHT_CJK );
- rDefItems[38] = new SvxFontHeightItem( 240, 100, EE_CHAR_FONTHEIGHT_CTL );
- rDefItems[39] = new SvxWeightItem( WEIGHT_NORMAL, EE_CHAR_WEIGHT_CJK );
- rDefItems[40] = new SvxWeightItem( WEIGHT_NORMAL, EE_CHAR_WEIGHT_CTL );
- rDefItems[41] = new SvxPostureItem( ITALIC_NONE, EE_CHAR_ITALIC_CJK );
- rDefItems[42] = new SvxPostureItem( ITALIC_NONE, EE_CHAR_ITALIC_CTL );
- rDefItems[43] = new SvxEmphasisMarkItem( FontEmphasisMark::NONE, EE_CHAR_EMPHASISMARK );
- rDefItems[44] = new SvxCharReliefItem( FontRelief::NONE, EE_CHAR_RELIEF );
- rDefItems[45] = new SfxVoidItem( EE_CHAR_RUBI_DUMMY );
- rDefItems[46] = new SvXMLAttrContainerItem( EE_CHAR_XMLATTRIBS );
- rDefItems[47] = new SvxOverlineItem( LINESTYLE_NONE, EE_CHAR_OVERLINE );
- rDefItems[48] = new SvxCaseMapItem( SvxCaseMap::NotMapped, EE_CHAR_CASEMAP );
- rDefItems[49] = new SfxGrabBagItem( EE_CHAR_GRABBAG );
- rDefItems[50] = new SvxBackgroundColorItem( COL_AUTO, EE_CHAR_BKGCOLOR );
+ rDefItems[19] = new SvxColorItem( COL_AUTO, EE_CHAR_COLOR );
+ rDefItems[20] = new SvxFontItem( EE_CHAR_FONTINFO );
+ rDefItems[21] = new SvxFontHeightItem( 240, 100, EE_CHAR_FONTHEIGHT );
+ rDefItems[22] = new SvxCharScaleWidthItem( 100, EE_CHAR_FONTWIDTH );
+ rDefItems[23] = new SvxWeightItem( WEIGHT_NORMAL, EE_CHAR_WEIGHT );
+ rDefItems[24] = new SvxUnderlineItem( LINESTYLE_NONE, EE_CHAR_UNDERLINE );
+ rDefItems[25] = new SvxCrossedOutItem( STRIKEOUT_NONE, EE_CHAR_STRIKEOUT );
+ rDefItems[26] = new SvxPostureItem( ITALIC_NONE, EE_CHAR_ITALIC );
+ rDefItems[27] = new SvxContourItem( false, EE_CHAR_OUTLINE );
+ rDefItems[28] = new SvxShadowedItem( false, EE_CHAR_SHADOW );
+ rDefItems[29] = new SvxEscapementItem( 0, 100, EE_CHAR_ESCAPEMENT );
+ rDefItems[30] = new SvxAutoKernItem( false, EE_CHAR_PAIRKERNING );
+ rDefItems[31] = new SvxKerningItem( 0, EE_CHAR_KERNING );
+ rDefItems[32] = new SvxWordLineModeItem( false, EE_CHAR_WLM );
+ rDefItems[33] = new SvxLanguageItem( LANGUAGE_DONTKNOW, EE_CHAR_LANGUAGE );
+ rDefItems[34] = new SvxLanguageItem( LANGUAGE_DONTKNOW, EE_CHAR_LANGUAGE_CJK );
+ rDefItems[35] = new SvxLanguageItem( LANGUAGE_DONTKNOW, EE_CHAR_LANGUAGE_CTL );
+ rDefItems[36] = new SvxFontItem( EE_CHAR_FONTINFO_CJK );
+ rDefItems[37] = new SvxFontItem( EE_CHAR_FONTINFO_CTL );
+ rDefItems[38] = new SvxFontHeightItem( 240, 100, EE_CHAR_FONTHEIGHT_CJK );
+ rDefItems[39] = new SvxFontHeightItem( 240, 100, EE_CHAR_FONTHEIGHT_CTL );
+ rDefItems[40] = new SvxWeightItem( WEIGHT_NORMAL, EE_CHAR_WEIGHT_CJK );
+ rDefItems[41] = new SvxWeightItem( WEIGHT_NORMAL, EE_CHAR_WEIGHT_CTL );
+ rDefItems[42] = new SvxPostureItem( ITALIC_NONE, EE_CHAR_ITALIC_CJK );
+ rDefItems[43] = new SvxPostureItem( ITALIC_NONE, EE_CHAR_ITALIC_CTL );
+ rDefItems[44] = new SvxEmphasisMarkItem( FontEmphasisMark::NONE, EE_CHAR_EMPHASISMARK );
+ rDefItems[45] = new SvxCharReliefItem( FontRelief::NONE, EE_CHAR_RELIEF );
+ rDefItems[46] = new SfxVoidItem( EE_CHAR_RUBI_DUMMY );
+ rDefItems[47] = new SvXMLAttrContainerItem( EE_CHAR_XMLATTRIBS );
+ rDefItems[48] = new SvxOverlineItem( LINESTYLE_NONE, EE_CHAR_OVERLINE );
+ rDefItems[49] = new SvxCaseMapItem( SvxCaseMap::NotMapped, EE_CHAR_CASEMAP );
+ rDefItems[50] = new SfxGrabBagItem( EE_CHAR_GRABBAG );
+ rDefItems[51] = new SvxBackgroundColorItem( COL_AUTO, EE_CHAR_BKGCOLOR );
// Features
- rDefItems[51] = new SfxVoidItem( EE_FEATURE_TAB );
- rDefItems[52] = new SfxVoidItem( EE_FEATURE_LINEBR );
- rDefItems[53] = new SvxColorItem( COL_RED, EE_FEATURE_NOTCONV );
- rDefItems[54] = new SvxFieldItem( SvxFieldData(), EE_FEATURE_FIELD );
+ rDefItems[52] = new SfxVoidItem( EE_FEATURE_TAB );
+ rDefItems[53] = new SfxVoidItem( EE_FEATURE_LINEBR );
+ rDefItems[54] = new SvxColorItem( COL_RED, EE_FEATURE_NOTCONV );
+ rDefItems[55] = new SvxFieldItem( SvxFieldData(), EE_FEATURE_FIELD );
- assert(EDITITEMCOUNT == 55 && "ITEMCOUNT changed, adjust DefItems!");
+ assert(EDITITEMCOUNT == 56 && "ITEMCOUNT changed, adjust DefItems!");
// Init DefFonts:
GetDefaultFonts( *static_cast<SvxFontItem*>(rDefItems[EE_CHAR_FONTINFO - EE_ITEMS_START]),
diff --git a/editeng/source/items/paraitem.cxx b/editeng/source/items/paraitem.cxx
index 983f210dec3a..ec2839c355b5 100644
--- a/editeng/source/items/paraitem.cxx
+++ b/editeng/source/items/paraitem.cxx
@@ -563,6 +563,7 @@ SvxHyphenZoneItem::SvxHyphenZoneItem( const bool bHyph, const sal_uInt16 nId ) :
SfxPoolItem( nId ),
bHyphen(bHyph),
bPageEnd(true),
+ bNoCapsHyphenation(false),
nMinLead(0),
nMinTrail(0),
nMaxHyphens(255)
@@ -587,6 +588,9 @@ bool SvxHyphenZoneItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) con
case MID_HYPHEN_MAX_HYPHENS:
rVal <<= static_cast<sal_Int16>(nMaxHyphens);
break;
+ case MID_HYPHEN_NO_CAPS:
+ rVal <<= bNoCapsHyphenation;
+ break;
}
return true;
}
@@ -596,7 +600,7 @@ bool SvxHyphenZoneItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
nMemberId &= ~CONVERT_TWIPS;
sal_Int16 nNewVal = 0;
- if( nMemberId != MID_IS_HYPHEN )
+ if( nMemberId != MID_IS_HYPHEN && nMemberId != MID_HYPHEN_NO_CAPS )
if(!(rVal >>= nNewVal))
return false;
@@ -614,6 +618,9 @@ bool SvxHyphenZoneItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
case MID_HYPHEN_MAX_HYPHENS:
nMaxHyphens = static_cast<sal_uInt8>(nNewVal);
break;
+ case MID_HYPHEN_NO_CAPS:
+ bNoCapsHyphenation = Any2Bool(rVal);
+ break;
}
return true;
}
@@ -625,6 +632,7 @@ bool SvxHyphenZoneItem::operator==( const SfxPoolItem& rAttr ) const
const SvxHyphenZoneItem& rItem = static_cast<const SvxHyphenZoneItem&>(rAttr);
return ( rItem.bHyphen == bHyphen
+ && rItem.bNoCapsHyphenation == bNoCapsHyphenation
&& rItem.bPageEnd == bPageEnd
&& rItem.nMinLead == nMinLead
&& rItem.nMinTrail == nMinTrail