tdf#121369 - Header and Footer parent styles

New "Header and Footer" style introduced as parent to header/footer styles
Right alignment set for HeaderR and FooterR

Change-Id: Iff407da8907b761236ebc2aa8877b9d6b8294e10
Reviewed-on: https://gerrit.libreoffice.org/64152
Tested-by: Jenkins
Reviewed-by: Heiko Tietze <tietze.heiko@gmail.com>
This commit is contained in:
heiko tietze 2018-11-28 10:51:04 +01:00 committed by Heiko Tietze
parent 3bb64c0b26
commit a9022502e0
6 changed files with 21 additions and 6 deletions

View File

@ -327,7 +327,8 @@ RES_POOLCOLL_LISTS_END,
RES_POOLCOLL_EXTRA_BEGIN = COLL_EXTRA_BITS,
/// Subgroup header.
RES_POOLCOLL_HEADER = RES_POOLCOLL_EXTRA_BEGIN, ///< Header Left&Right.
RES_POOLCOLL_HEADERFOOTER = RES_POOLCOLL_EXTRA_BEGIN, ///< Header and Footer.
RES_POOLCOLL_HEADER, ///< Header Left&Right.
RES_POOLCOLL_HEADERL, ///< Header Left.
RES_POOLCOLL_HEADERR, ///< Header Right.

View File

@ -122,6 +122,7 @@
#define STR_POOLCOLL_BUL_LEVEL5 NC_("STR_POOLCOLL_BUL_LEVEL5", "List 5")
#define STR_POOLCOLL_BUL_LEVEL5E NC_("STR_POOLCOLL_BUL_LEVEL5E", "List 5 End")
#define STR_POOLCOLL_BUL_NONUM5 NC_("STR_POOLCOLL_BUL_NONUM5", "List 5 Cont.")
#define STR_POOLCOLL_HEADERFOOTER NC_("STR_POOLCOLL_HEADER", "Header and Footer")
#define STR_POOLCOLL_HEADER NC_("STR_POOLCOLL_HEADER", "Header")
#define STR_POOLCOLL_HEADERL NC_("STR_POOLCOLL_HEADERL", "Header Left")
#define STR_POOLCOLL_HEADERR NC_("STR_POOLCOLL_HEADERR", "Header Right")

View File

@ -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', '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', '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")

View File

@ -357,6 +357,7 @@ static const char* STR_POOLCOLL_LISTS_ARY[]
static const char* STR_POOLCOLL_EXTRA_ARY[]
{
// Subcategory Header
STR_POOLCOLL_HEADERFOOTER,
STR_POOLCOLL_HEADER,
STR_POOLCOLL_HEADERL,
STR_POOLCOLL_HEADERR,
@ -875,6 +876,7 @@ SwTextFormatColl* DocumentStylePoolManager::GetTextCollFromPool( sal_uInt16 nId,
// Special sections:
// Header
case RES_POOLCOLL_HEADERFOOTER:
case RES_POOLCOLL_HEADER:
case RES_POOLCOLL_HEADERL:
case RES_POOLCOLL_HEADERR:
@ -894,6 +896,11 @@ SwTextFormatColl* DocumentStylePoolManager::GetTextCollFromPool( sal_uInt16 nId,
aTStops.Insert( SvxTabStop( nRightMargin, SvxTabAdjust::Right ) );
aSet.Put( aTStops );
if ( (nId==RES_POOLCOLL_HEADERR) || (nId==RES_POOLCOLL_FOOTERR) ) {
SvxAdjustItem aAdjust(SvxAdjust::Right, RES_PARATR_ADJUST );
aSet.Put(aAdjust);
}
}
break;

View File

@ -147,7 +147,8 @@ const struct SwTableEntry ListsProgNameTable [] =
const struct SwTableEntry ExtraProgNameTable [] =
{
ENTRY( "Header" ), // RES_POOLCOLL_EXTRA_BEGIN
ENTRY( "Header and Footer" ), // RES_POOLCOLL_EXTRA_BEGIN
ENTRY( "Header" ),
ENTRY( "Header left" ),
ENTRY( "Header right" ),
ENTRY( "Footer" ),

View File

@ -250,7 +250,7 @@ sal_uInt16 GetPoolParent( sal_uInt16 nId )
switch( nId )
{
case RES_POOLCOLL_TABLE_HDLN:
nRet = RES_POOLCOLL_TABLE; break;
nRet = RES_POOLCOLL_TABLE; break;
case RES_POOLCOLL_FRAME:
case RES_POOLCOLL_TABLE:
@ -258,14 +258,19 @@ sal_uInt16 GetPoolParent( sal_uInt16 nId )
case RES_POOLCOLL_ENDNOTE:
case RES_POOLCOLL_JAKETADRESS:
case RES_POOLCOLL_SENDADRESS:
case RES_POOLCOLL_HEADERFOOTER:
case RES_POOLCOLL_LABEL:
nRet = RES_POOLCOLL_STANDARD; break;
case RES_POOLCOLL_HEADER:
nRet = RES_POOLCOLL_HEADERFOOTER; break;
case RES_POOLCOLL_HEADERL:
case RES_POOLCOLL_HEADERR:
nRet = RES_POOLCOLL_HEADER; break;
case RES_POOLCOLL_FOOTER:
nRet = RES_POOLCOLL_HEADERFOOTER; break;
case RES_POOLCOLL_FOOTERL:
case RES_POOLCOLL_FOOTERR:
case RES_POOLCOLL_LABEL:
nRet = RES_POOLCOLL_STANDARD; break;
nRet = RES_POOLCOLL_FOOTER; break;
case RES_POOLCOLL_LABEL_ABB:
case RES_POOLCOLL_LABEL_TABLE: