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

New commits:
commit 6e2c8f3f56ab52dfaa9bdce37423bac44cc64061
Author:     Maxim Monastirsky <momonas...@gmail.com>
AuthorDate: Thu Jun 15 11:23:02 2023 +0300
Commit:     Maxim Monastirsky <momonas...@gmail.com>
CommitDate: Thu Jun 15 19:34:13 2023 +0200

    tdf#103064 sw: add a comment style
    
    Change-Id: I96acdf3200836efe1d66e19dd85000fca9e7a6fa
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153109
    Tested-by: Jenkins
    Reviewed-by: Maxim Monastirsky <momonas...@gmail.com>

diff --git a/sw/inc/poolfmt.hxx b/sw/inc/poolfmt.hxx
index 358747e37808..4f017de21d3a 100644
--- a/sw/inc/poolfmt.hxx
+++ b/sw/inc/poolfmt.hxx
@@ -356,6 +356,8 @@ RES_POOLCOLL_SEND_ADDRESS,                              
///< Sender.
 RES_POOLCOLL_ENDNOTE,                                   ///< Endnotes.
 
 RES_POOLCOLL_LABEL_DRAWING,                             ///< Label drawing 
objects.
+RES_POOLCOLL_COMMENT,                                   ///< Comment
+
 RES_POOLCOLL_EXTRA_END,
 
 /// Group indices.
diff --git a/sw/inc/strings.hrc b/sw/inc/strings.hrc
index 38ae2f61bff9..97d216e7ba83 100644
--- a/sw/inc/strings.hrc
+++ b/sw/inc/strings.hrc
@@ -152,6 +152,7 @@
 #define STR_POOLCOLL_LABEL_FRAME                
NC_("STR_POOLCOLL_LABEL_FRAME", "Text")
 #define STR_POOLCOLL_LABEL_DRAWING              
NC_("STR_POOLCOLL_LABEL_DRAWING", "Drawing")
 #define STR_POOLCOLL_LABEL_FIGURE               
NC_("STR_POOLCOLL_LABEL_FIGURE", "Figure")
+#define STR_POOLCOLL_COMMENT                    NC_("STR_POOLCOLL_COMMENT", 
"Comment")
 #define STR_POOLCOLL_ENVELOPE_ADDRESS           
NC_("STR_POOLCOLL_ENVELOPE_ADDRESS", "Addressee")
 #define STR_POOLCOLL_SEND_ADDRESS               
NC_("STR_POOLCOLL_SEND_ADDRESS", "Sender")
 #define STR_POOLCOLL_TOX_IDXH                   NC_("STR_POOLCOLL_TOX_IDXH", 
"Index Heading")
diff --git a/sw/qa/python/check_styles.py b/sw/qa/python/check_styles.py
index 113fd801593c..aca3d8f0486e 100644
--- a/sw/qa/python/check_styles.py
+++ b/sw/qa/python/check_styles.py
@@ -131,7 +131,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', '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']
+        vEmptyDocStyles = ['Standard', 'Heading', 'Text body', 'List', 
'Caption', 'Comment', '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 Star
 t', '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 ad0c00ff42c0..b67e34ade4cc 100644
--- a/sw/source/core/doc/DocumentStylePoolManager.cxx
+++ b/sw/source/core/doc/DocumentStylePoolManager.cxx
@@ -386,7 +386,8 @@ const TranslateId STR_POOLCOLL_EXTRA_ARY[]
     STR_POOLCOLL_ENVELOPE_ADDRESS,
     STR_POOLCOLL_SEND_ADDRESS,
     STR_POOLCOLL_ENDNOTE,
-    STR_POOLCOLL_LABEL_DRAWING
+    STR_POOLCOLL_LABEL_DRAWING,
+    STR_POOLCOLL_COMMENT
 };
 
 const TranslateId STR_POOLCOLL_REGISTER_ARY[] =
@@ -1009,6 +1010,13 @@ SwTextFormatColl* 
DocumentStylePoolManager::GetTextCollFromPool( sal_uInt16 nId,
                 aSet.Put( aLN );
             }
             break;
+
+        case RES_POOLCOLL_COMMENT:       // Comment
+            {
+                SetAllScriptItem(aSet, SvxFontHeightItem(PT_10, 100, 
RES_CHRATR_FONTSIZE));
+            }
+            break;
+
         // User defined indexes:
         case RES_POOLCOLL_TOX_USERH:            // Header
             lcl_SetRegister( m_rDoc, aSet, 0, true, false );
diff --git a/sw/source/core/doc/SwStyleNameMapper.cxx 
b/sw/source/core/doc/SwStyleNameMapper.cxx
index 9861e4cc4f11..17f732d6d31e 100644
--- a/sw/source/core/doc/SwStyleNameMapper.cxx
+++ b/sw/source/core/doc/SwStyleNameMapper.cxx
@@ -556,7 +556,8 @@ const std::vector<OUString>& 
SwStyleNameMapper::GetExtraProgNameArray()
         "Addressee",
         "Sender",
         "Endnote",
-        "Drawing", // RES_POOLCOLL_LABEL_DRAWING
+        "Drawing",
+        "Comment", // RES_POOLCOLL_COMMENT
     };
     return s_aExtraProgNameArray;
 }
diff --git a/sw/source/core/doc/poolfmt.cxx b/sw/source/core/doc/poolfmt.cxx
index a7788cd0f56a..5f25ea6b0f0e 100644
--- a/sw/source/core/doc/poolfmt.cxx
+++ b/sw/source/core/doc/poolfmt.cxx
@@ -224,6 +224,7 @@ sal_uInt16 GetPoolParent( sal_uInt16 nId )
             case RES_POOLCOLL_SEND_ADDRESS:
             case RES_POOLCOLL_HEADERFOOTER:
             case RES_POOLCOLL_LABEL:
+            case RES_POOLCOLL_COMMENT:
                     nRet = RES_POOLCOLL_STANDARD;              break;        
             case RES_POOLCOLL_HEADER:
                     nRet = RES_POOLCOLL_HEADERFOOTER;          break;

Reply via email to