From aeac2420bc6a274fbf0ff0851d05ac21737182b7 Mon Sep 17 00:00:00 2001 From: Seth Chaiklin Date: Sat, 21 Dec 2019 14:02:14 +0100 Subject: tdf#114090 Create a new paragraph style with name "Appendix" followed recommendation in bug report: 16pt, bold, centered - inheritance from Heading - when tdf#128858 is resolved then Appendix will inherit outline level 1 One attempt at filter modifications, but maybe there are others? Change-Id: I0f91327cfe5578cd888528b2c6fac5065951eec0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/85657 Reviewed-by: Heiko Tietze Tested-by: Heiko Tietze --- sw/inc/poolfmt.hxx | 1 + sw/inc/strings.hrc | 1 + sw/qa/python/check_styles.py | 2 +- sw/source/core/doc/DocumentStylePoolManager.cxx | 14 +++++++++++++- sw/source/core/doc/SwStyleNameMapper.cxx | 1 + sw/source/filter/ww8/wrtw8sty.cxx | 1 + 6 files changed, 18 insertions(+), 2 deletions(-) diff --git a/sw/inc/poolfmt.hxx b/sw/inc/poolfmt.hxx index 2f66749e30a9..5fb0ace5e941 100644 --- a/sw/inc/poolfmt.hxx +++ b/sw/inc/poolfmt.hxx @@ -422,6 +422,7 @@ RES_POOLCOLL_DOC_BEGIN = COLL_DOC_BITS, RES_POOLCOLL_DOC_TITEL = RES_POOLCOLL_DOC_BEGIN, ///< Doc. title. RES_POOLCOLL_DOC_SUBTITEL, ///< Doc. subtitle. +RES_POOLCOLL_DOC_APPENDIX, ///< Doc. appendix. RES_POOLCOLL_DOC_END, diff --git a/sw/inc/strings.hrc b/sw/inc/strings.hrc index 88bf8e91f5a2..1193d78f9823 100644 --- a/sw/inc/strings.hrc +++ b/sw/inc/strings.hrc @@ -181,6 +181,7 @@ // Document title style, not to be confused with Heading style #define STR_POOLCOLL_DOC_TITEL NC_("STR_POOLCOLL_DOC_TITEL", "Title") #define STR_POOLCOLL_DOC_SUBTITEL NC_("STR_POOLCOLL_DOC_SUBTITEL", "Subtitle") +#define STR_POOLCOLL_DOC_APPENDIX NC_("STR_POOLCOLL_DOC_APPENDIX", "Appendix") #define STR_POOLCOLL_HTML_BLOCKQUOTE NC_("STR_POOLCOLL_HTML_BLOCKQUOTE", "Quotations") #define STR_POOLCOLL_HTML_PRE NC_("STR_POOLCOLL_HTML_PRE", "Preformatted Text") #define STR_POOLCOLL_HTML_HR NC_("STR_POOLCOLL_HTML_HR", "Horizontal Line") diff --git a/sw/qa/python/check_styles.py b/sw/qa/python/check_styles.py index c0c3a24e2a02..c12d5ef0d708 100644 --- a/sw/qa/python/check_styles.py +++ b/sw/qa/python/check_styles.py @@ -132,7 +132,7 @@ class CheckStyle(unittest.TestCase): def test_ParagraphFamily(self): xDoc = CheckStyle._uno.openEmptyWriterDoc() xParaStyles = xDoc.StyleFamilies["ParagraphStyles"] - vEmptyDocStyles = ['Standard', 'Heading', 'Text body', 'List', 'Caption', 'Index', 'First line indent', 'Hanging indent', 'Text body indent', 'Salutation', 'Signature', 'List Indent', 'Marginalia', 'Heading 1', 'Heading 2', 'Heading 3', 'Heading 4', 'Heading 5', 'Heading 6', 'Heading 7', 'Heading 8', 'Heading 9', 'Heading 10', 'Title', 'Subtitle', 'Numbering 1 Start', 'Numbering 1', 'Numbering 1 End', 'Numbering 1 Cont.', 'Numbering 2 Start', 'Numbering 2', 'Numbering 2 End', 'Numbering 2 Cont.', 'Numbering 3 Start', 'Numbering 3', 'Numbering 3 End', 'Numbering 3 Cont.', 'Numbering 4 Start', 'Numbering 4', 'Numbering 4 End', 'Numbering 4 Cont.', 'Numbering 5 Start', 'Numbering 5', 'Numbering 5 End', 'Numbering 5 Cont.', 'List 1 Start', 'List 1', 'List 1 End', 'List 1 Cont.', 'List 2 Start', 'List 2', 'List 2 End', 'List 2 Cont.', 'List 3 Start', 'List 3', 'List 3 End', 'List 3 Cont.', 'List 4 Start', 'List 4', 'List 4 End', 'List 4 Cont.', 'List 5 Start', 'List 5', 'List 5 End', 'List 5 Cont.', 'Index Heading', 'Index 1', 'Index 2', 'Index 3', 'Index Separator', 'Contents Heading', 'Contents 1', 'Contents 2', 'Contents 3', 'Contents 4', 'Contents 5', 'User Index Heading', 'User Index 1', 'User Index 2', 'User Index 3', 'User Index 4', 'User Index 5', 'Contents 6', 'Contents 7', 'Contents 8', 'Contents 9', 'Contents 10', 'Figure Index Heading', 'Figure Index 1', 'Object index heading', 'Object index 1', 'Table index heading', 'Table index 1', 'Bibliography Heading', 'Bibliography 1', 'User Index 6', 'User Index 7', 'User Index 8', 'User Index 9', 'User Index 10', 'Header and Footer','Header', 'Header left', 'Header right', 'Footer', 'Footer left', 'Footer right', 'Table Contents', 'Table Heading', 'Illustration', 'Table', 'Text','Figure', 'Frame contents', 'Footnote', 'Addressee', 'Sender', 'Endnote', 'Drawing', 'Quotations', 'Preformatted Text', 'Horizontal Line', 'List Contents', 'List Heading'] + vEmptyDocStyles = ['Standard', 'Heading', 'Text body', 'List', 'Caption', 'Index', 'First line indent', 'Hanging indent', 'Text body indent', 'Salutation', 'Signature', 'List Indent', 'Marginalia', 'Heading 1', 'Heading 2', 'Heading 3', 'Heading 4', 'Heading 5', 'Heading 6', 'Heading 7', 'Heading 8', 'Heading 9', 'Heading 10', 'Title', 'Subtitle', 'Appendix', 'Numbering 1 Start', 'Numbering 1', 'Numbering 1 End', 'Numbering 1 Cont.', 'Numbering 2 Start', 'Numbering 2', 'Numbering 2 End', 'Numbering 2 Cont.', 'Numbering 3 Start', 'Numbering 3', 'Numbering 3 End', 'Numbering 3 Cont.', 'Numbering 4 Start', 'Numbering 4', 'Numbering 4 End', 'Numbering 4 Cont.', 'Numbering 5 Start', 'Numbering 5', 'Numbering 5 End', 'Numbering 5 Cont.', 'List 1 Start', 'List 1', 'List 1 End', 'List 1 Cont.', 'List 2 Start', 'List 2', 'List 2 End', 'List 2 Cont.', 'List 3 Start', 'List 3', 'List 3 End', 'List 3 Cont.', 'List 4 Start', 'List 4', 'List 4 End', 'List 4 Cont.', 'List 5 Start', 'List 5', 'List 5 End', 'List 5 Cont.', 'Index Heading', 'Index 1', 'Index 2', 'Index 3', 'Index Separator', 'Contents Heading', 'Contents 1', 'Contents 2', 'Contents 3', 'Contents 4', 'Contents 5', 'User Index Heading', 'User Index 1', 'User Index 2', 'User Index 3', 'User Index 4', 'User Index 5', 'Contents 6', 'Contents 7', 'Contents 8', 'Contents 9', 'Contents 10', 'Figure Index Heading', 'Figure Index 1', 'Object index heading', 'Object index 1', 'Table index heading', 'Table index 1', 'Bibliography Heading', 'Bibliography 1', 'User Index 6', 'User Index 7', 'User Index 8', 'User Index 9', 'User Index 10', 'Header and Footer','Header', 'Header left', 'Header right', 'Footer', 'Footer left', 'Footer right', 'Table Contents', 'Table Heading', 'Illustration', 'Table', 'Text','Figure', 'Frame contents', 'Footnote', 'Addressee', 'Sender', 'Endnote', 'Drawing', 'Quotations', 'Preformatted Text', 'Horizontal Line', 'List Contents', 'List Heading'] self.__test_StyleFamily(xParaStyles, vEmptyDocStyles, "SwXStyle") self.__test_StyleFamilyIndex(xParaStyles, vEmptyDocStyles, "SwXStyle") self.__test_StyleFamilyInsert(xDoc, xParaStyles, vEmptyDocStyles, "com.sun.star.style.ParagraphStyle", "com.sun.star.style.CharacterStyle") diff --git a/sw/source/core/doc/DocumentStylePoolManager.cxx b/sw/source/core/doc/DocumentStylePoolManager.cxx index 1b9d524e33a0..fb3d2a15c752 100644 --- a/sw/source/core/doc/DocumentStylePoolManager.cxx +++ b/sw/source/core/doc/DocumentStylePoolManager.cxx @@ -435,7 +435,8 @@ static const char* STR_POOLCOLL_DOC_ARY[] = { // Category Chapter/Document STR_POOLCOLL_DOC_TITEL, - STR_POOLCOLL_DOC_SUBTITEL + STR_POOLCOLL_DOC_SUBTITEL, + STR_POOLCOLL_DOC_APPENDIX }; static const char* STR_POOLCOLL_HTML_ARY[] = @@ -1309,6 +1310,17 @@ SwTextFormatColl* DocumentStylePoolManager::GetTextCollFromPool( sal_uInt16 nId, } break; + case RES_POOLCOLL_DOC_APPENDIX: // Document Appendix tdf#114090 + { + SetAllScriptItem( aSet, SvxWeightItem( WEIGHT_BOLD, RES_CHRATR_WEIGHT ) ); + SetAllScriptItem( aSet, SvxFontHeightItem( PT_16, 100, RES_CHRATR_FONTSIZE ) ); + + aSet.Put( SvxAdjustItem( SvxAdjust::Center, RES_PARATR_ADJUST ) ); + + pNewColl->SetNextTextFormatColl( *GetTextCollFromPool( RES_POOLCOLL_TEXT )); + } + break; + case RES_POOLCOLL_HTML_BLOCKQUOTE: { SvxLRSpaceItem aLR( RES_LR_SPACE ); diff --git a/sw/source/core/doc/SwStyleNameMapper.cxx b/sw/source/core/doc/SwStyleNameMapper.cxx index ca43036a704d..6f7f18c4ee29 100644 --- a/sw/source/core/doc/SwStyleNameMapper.cxx +++ b/sw/source/core/doc/SwStyleNameMapper.cxx @@ -608,6 +608,7 @@ const std::vector& SwStyleNameMapper::GetDocProgNameArray() static const std::vector s_aDocProgNameArray = { "Title", // STR_POCO_PRGM_DOC_TITLE "Subtitle", + "Appendix", }; return s_aDocProgNameArray; } diff --git a/sw/source/filter/ww8/wrtw8sty.cxx b/sw/source/filter/ww8/wrtw8sty.cxx index 7db63308dc58..5b580122e3d9 100644 --- a/sw/source/filter/ww8/wrtw8sty.cxx +++ b/sw/source/filter/ww8/wrtw8sty.cxx @@ -250,6 +250,7 @@ sal_uInt16 MSWordStyles::GetWWId( const SwFormat& rFormat ) case RES_POOLCOLL_NUM_LEVEL4: nRet = 60; break; case RES_POOLCOLL_NUM_LEVEL5: nRet = 61; break; case RES_POOLCOLL_DOC_TITEL: nRet = 62; break; + case RES_POOLCOLL_DOC_APPENDIX: nRet = 63; break; case RES_POOLCOLL_SIGNATURE: nRet = 64; break; case RES_POOLCOLL_TEXT: nRet = 66; break; case RES_POOLCOLL_TEXT_MOVE: nRet = 67; break; -- cgit