sw/qa/python/check_styles.py                |   10 ++++++++++
 sw/source/core/unocore/unomap1.cxx          |    2 +-
 sw/source/core/unocore/unomapproperties.hxx |    2 +-
 3 files changed, 12 insertions(+), 2 deletions(-)

New commits:
commit a73959947cc78bc9afc1d8b0216a2ddf7584eb6d
Author:     Thomas Viehmann <t...@beamnet.de>
AuthorDate: Fri Sep 13 11:24:43 2019 +0200
Commit:     Michael Stahl <michael.st...@cib.de>
CommitDate: Tue Sep 17 13:30:06 2019 +0200

    sw: Mark uno property ParaChapterNumberingLevel as MAYBEVOID
    
    tdf#127534 TextRange.getPropertyValues runs into RuntimeException when
    getting all properties form PropertySetinfo
    
    We suspect that the property might be completely unused / useless.
    However, removing it might be BC breaking for "buggy" uses of
    the property, so this is a lower-risk fix.
    
    Björn helped with great advice, thank you! All errors in the patch
    are my own, though.
    
    Change-Id: Ie80b61003de2b8516e458c800531aac951ebc148
    Reviewed-on: https://gerrit.libreoffice.org/78865
    Tested-by: Jenkins
    Reviewed-by: Björn Michaelsen <bjoern.michael...@libreoffice.org>
    (cherry picked from commit 2f679fd3e6f46df7cda77eb70a014bcfcac7df52)
    Reviewed-on: https://gerrit.libreoffice.org/79052
    Reviewed-by: Michael Stahl <michael.st...@cib.de>

diff --git a/sw/qa/python/check_styles.py b/sw/qa/python/check_styles.py
index 8746c479fbbe..cfd8a9e1bec1 100644
--- a/sw/qa/python/check_styles.py
+++ b/sw/qa/python/check_styles.py
@@ -27,6 +27,16 @@ class CheckStyle(unittest.TestCase):
     def tearDownClass(cls):
         cls._uno.tearDown()
 
+    def test_TextRangeProperties(self):
+        xDoc = CheckStyle._uno.openEmptyWriterDoc()
+        xBodyText = xDoc.getText()
+        xCursor = xBodyText.createTextCursor()
+        xBodyText.insertString(xCursor, "Hello world", 0)
+        xTextRange = list(xBodyText)[0]
+        pnames = [p.Name for p in xTextRange.PropertySetInfo.Properties]
+        xTextRange.getPropertyValues(pnames)
+        xDoc.dispose()
+
     def test_StyleFamilies(self):
         xDoc = CheckStyle._uno.openEmptyWriterDoc()
         xStyleFamilies = xDoc.StyleFamilies
diff --git a/sw/source/core/unocore/unomap1.cxx 
b/sw/source/core/unocore/unomap1.cxx
index f5976ca50a4c..41e2d644f313 100644
--- a/sw/source/core/unocore/unomap1.cxx
+++ b/sw/source/core/unocore/unomap1.cxx
@@ -199,7 +199,7 @@ const SfxItemPropertyMapEntry*  
SwUnoPropertyMapProvider::GetAutoParaStyleProper
         { OUString(UNO_NAME_CELL), FN_UNO_CELL,         
cppu::UnoType<css::table::XCell>::get(),         
PropertyAttribute::MAYBEVOID|PropertyAttribute::READONLY ,0 },
         { OUString(UNO_NAME_TEXT_FRAME), FN_UNO_TEXT_FRAME,     
cppu::UnoType<css::text::XTextFrame>::get(),        
PropertyAttribute::MAYBEVOID|PropertyAttribute::READONLY ,0 },
         { OUString(UNO_NAME_TEXT_SECTION), FN_UNO_TEXT_SECTION, 
cppu::UnoType<css::text::XTextSection>::get(),  
PropertyAttribute::MAYBEVOID|PropertyAttribute::READONLY ,0 },
-        { OUString(UNO_NAME_PARA_CHAPTER_NUMBERING_LEVEL), 
FN_UNO_PARA_CHAPTER_NUMBERING_LEVEL,cppu::UnoType<sal_Int8>::get(), 
PROPERTY_NONE, 0},
+        { OUString(UNO_NAME_PARA_CHAPTER_NUMBERING_LEVEL), 
FN_UNO_PARA_CHAPTER_NUMBERING_LEVEL,cppu::UnoType<sal_Int8>::get(), 
PropertyAttribute::MAYBEVOID, 0},
         { OUString(UNO_NAME_PARA_CONDITIONAL_STYLE_NAME), 
RES_FRMATR_CONDITIONAL_STYLE_NAME,        cppu::UnoType<OUString>::get(),       
  PropertyAttribute::MAYBEVOID|PropertyAttribute::READONLY,   0},
         { OUString(UNO_NAME_PARA_IS_NUMBERING_RESTART), FN_NUMBER_NEWSTART,    
 cppu::UnoType<bool>::get(),     PropertyAttribute::MAYBEVOID, 0 },
         { OUString(UNO_NAME_OUTLINE_LEVEL), RES_PARATR_OUTLINELEVEL,        
cppu::UnoType<sal_Int16>::get(),                PropertyAttribute::MAYBEVOID,   
  0},
diff --git a/sw/source/core/unocore/unomapproperties.hxx 
b/sw/source/core/unocore/unomapproperties.hxx
index 549f97cbee70..f9353e8b6b77 100644
--- a/sw/source/core/unocore/unomapproperties.hxx
+++ b/sw/source/core/unocore/unomapproperties.hxx
@@ -89,7 +89,7 @@
         { OUString(UNO_NAME_TEXT_FRAME), FN_UNO_TEXT_FRAME,     
cppu::UnoType<css::text::XTextFrame>::get(),        
PropertyAttribute::MAYBEVOID|PropertyAttribute::READONLY ,0 },                  
   \
         { OUString(UNO_NAME_TEXT_SECTION), FN_UNO_TEXT_SECTION, 
cppu::UnoType<css::text::XTextSection>::get(),  
PropertyAttribute::MAYBEVOID|PropertyAttribute::READONLY ,0 },                  
  \
         { OUString(UNO_NAME_TEXT_PARAGRAPH), FN_UNO_TEXT_PARAGRAPH, 
cppu::UnoType<css::text::XTextContent>::get(),  
PropertyAttribute::MAYBEVOID|PropertyAttribute::READONLY ,0 },                  
  \
-        { OUString(UNO_NAME_PARA_CHAPTER_NUMBERING_LEVEL), 
FN_UNO_PARA_CHAPTER_NUMBERING_LEVEL,cppu::UnoType<sal_Int8>::get(), 
PROPERTY_NONE, 0},                                                     \
+        { OUString(UNO_NAME_PARA_CHAPTER_NUMBERING_LEVEL), 
FN_UNO_PARA_CHAPTER_NUMBERING_LEVEL,cppu::UnoType<sal_Int8>::get(), 
PropertyAttribute::MAYBEVOID, 0},                                               
      \
         { OUString(UNO_NAME_PARA_CONDITIONAL_STYLE_NAME), 
FN_UNO_PARA_CONDITIONAL_STYLE_NAME, cppu::UnoType<OUString>::get(),      
PropertyAttribute::READONLY, 0},                                                
     \
         { OUString(UNO_NAME_LIST_ID), FN_UNO_LIST_ID, 
cppu::UnoType<OUString>::get(), PropertyAttribute::MAYBEVOID, 0}, \
         { OUString(UNO_NAME_PARA_IS_NUMBERING_RESTART), FN_NUMBER_NEWSTART,    
 cppu::UnoType<bool>::get(),     PropertyAttribute::MAYBEVOID, 0 }, \
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to