[Libreoffice-commits] core.git: sw/inc sw/qa sw/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Wed Nov 28 17:50:12 UTC 2018


 sw/inc/poolfmt.hxx                              |    3 ++-
 sw/inc/strings.hrc                              |    1 +
 sw/qa/python/check_styles.py                    |    2 +-
 sw/source/core/doc/DocumentStylePoolManager.cxx |    7 +++++++
 sw/source/core/doc/SwStyleNameMapper.cxx        |    3 ++-
 sw/source/core/doc/poolfmt.cxx                  |   11 ++++++++---
 6 files changed, 21 insertions(+), 6 deletions(-)

New commits:
commit a9022502e0b0e2b40aa55aeee375467fc0ab75e6
Author:     heiko tietze <tietze.heiko at gmail.com>
AuthorDate: Wed Nov 28 10:51:04 2018 +0100
Commit:     Heiko Tietze <tietze.heiko at gmail.com>
CommitDate: Wed Nov 28 18:49:48 2018 +0100

    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 at gmail.com>

diff --git a/sw/inc/poolfmt.hxx b/sw/inc/poolfmt.hxx
index 67191db7f676..22b075978aff 100644
--- a/sw/inc/poolfmt.hxx
+++ b/sw/inc/poolfmt.hxx
@@ -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.
 
diff --git a/sw/inc/strings.hrc b/sw/inc/strings.hrc
index ac8ad3c44826..a53b4546e8c2 100644
--- a/sw/inc/strings.hrc
+++ b/sw/inc/strings.hrc
@@ -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")
diff --git a/sw/qa/python/check_styles.py b/sw/qa/python/check_styles.py
index a52d84cd1b44..8746c479fbbe 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 E
 nd', '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 E
 nd', '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 626578f2ad14..703420a1f35b 100644
--- a/sw/source/core/doc/DocumentStylePoolManager.cxx
+++ b/sw/source/core/doc/DocumentStylePoolManager.cxx
@@ -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;
 
diff --git a/sw/source/core/doc/SwStyleNameMapper.cxx b/sw/source/core/doc/SwStyleNameMapper.cxx
index 5ca2e5df8046..1768a464d3da 100644
--- a/sw/source/core/doc/SwStyleNameMapper.cxx
+++ b/sw/source/core/doc/SwStyleNameMapper.cxx
@@ -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" ),
diff --git a/sw/source/core/doc/poolfmt.cxx b/sw/source/core/doc/poolfmt.cxx
index ff8ce3cd5105..0db28109528b 100644
--- a/sw/source/core/doc/poolfmt.cxx
+++ b/sw/source/core/doc/poolfmt.cxx
@@ -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:


More information about the Libreoffice-commits mailing list