sw/qa/uitest/writer_tests2/formatBulletsNumbering.py |    7 +++++++
 sw/source/core/doc/docnum.cxx                        |    5 ++++-
 2 files changed, 11 insertions(+), 1 deletion(-)

New commits:
commit 708d619e32f251f06af8e8a057bf802627b81fbd
Author:     Tibor Nagy <tibor.nagy.ext...@allotropia.de>
AuthorDate: Sat May 18 23:31:56 2024 +0200
Commit:     Nagy Tibor <tibor.nagy.ext...@allotropia.de>
CommitDate: Tue May 21 11:00:04 2024 +0200

    fix crash when push the Bullets button on the toolbar and then press the
    
    dropdown part of the button
    
    caused by commit I40cfc39501006146f7c6c04a1f3c7cf877c6f1c4
    (tdf#161056 Show bullets used in document in bullets dropdown)
    
    Change-Id: I215d7cb677825821917a4fd8c498deaaab9fc9b8
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167838
    Tested-by: Jenkins
    Reviewed-by: Nagy Tibor <tibor.nagy.ext...@allotropia.de>

diff --git a/sw/qa/uitest/writer_tests2/formatBulletsNumbering.py 
b/sw/qa/uitest/writer_tests2/formatBulletsNumbering.py
index b3c5484964d4..abf090f7d16e 100644
--- a/sw/qa/uitest/writer_tests2/formatBulletsNumbering.py
+++ b/sw/qa/uitest/writer_tests2/formatBulletsNumbering.py
@@ -259,4 +259,11 @@ class formatBulletsNumbering(UITestCase):
                 
self.assertEqual(get_state_as_dict(xselector)["SelectedItemId"], "73")
 
 
+   def test_bullets_and_numbering_document_bullet_list(self):
+        with self.ui_test.create_doc_in_start_center("writer"):
+            self.xUITest.executeCommand(".uno:DefaultBullet")
+            # Without the fix in place, this test would have crashed here
+            self.xUITest.executeCommand(".uno:DocumentBulletList")
+
+
 # vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sw/source/core/doc/docnum.cxx b/sw/source/core/doc/docnum.cxx
index adf0f5b9f699..c4afeac7c50f 100644
--- a/sw/source/core/doc/docnum.cxx
+++ b/sw/source/core/doc/docnum.cxx
@@ -2534,8 +2534,11 @@ std::vector<OUString> SwDoc::GetUsedBullets()
         for (int nLevel=0; nLevel<10; ++nLevel)
         {
             const SwNumFormat& rFormat = (*mpNumRuleTable)[nRule]->Get(nLevel);
-            if (SVX_NUM_CHAR_SPECIAL != rFormat.GetNumberingType())
+            if (SVX_NUM_CHAR_SPECIAL != rFormat.GetNumberingType()
+                || !rFormat.GetBulletFont().has_value())
+            {
                 continue;
+            }
             vcl::Font aFont(*rFormat.GetBulletFont());
             sal_UCS4 cBullet = rFormat.GetBulletChar();
             OUString sBullet(&cBullet, 1);

Reply via email to