cui/source/tabpages/numpages.cxx                           |   23 +-----
 include/svx/strings.hrc                                    |    9 --
 officecfg/registry/schema/org/openoffice/Office/Common.xcs |   35 +++++++++
 sc/source/ui/view/output2.cxx                              |   14 ++-
 svx/source/dialog/svxbmpnumvalueset.cxx                    |   48 ++++---------
 svx/source/sidebar/nbdtmg.cxx                              |   26 ++-----
 sw/qa/uitest/writer_tests2/formatBulletsNumbering.py       |    3 
 7 files changed, 74 insertions(+), 84 deletions(-)

New commits:
commit 22abd40d51fd6be26eae529a3380c09a5b647cec
Author:     Samuel Mehrbrodt <samuel.mehrbr...@allotropia.de>
AuthorDate: Thu Feb 22 11:55:30 2024 +0100
Commit:     Thorsten Behrens <thorsten.behr...@allotropia.de>
CommitDate: Sun Apr 7 01:00:16 2024 +0200

    tdf#108697 Allow modifying default bullet selection
    
    Allow to change bullets in configuration.
    
    Change-Id: Iab26118dd597417997d6f0a7355f516a4da97ee4
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163735
    Tested-by: Jenkins
    Reviewed-by: Samuel Mehrbrodt <samuel.mehrbr...@allotropia.de>

diff --git a/cui/source/tabpages/numpages.cxx b/cui/source/tabpages/numpages.cxx
index 2179ad2cf107..efd1192bc03d 100644
--- a/cui/source/tabpages/numpages.cxx
+++ b/cui/source/tabpages/numpages.cxx
@@ -54,6 +54,7 @@
 #include <comphelper/propertyvalue.hxx>
 #include <svx/svxids.hrc>
 #include <o3tl/string_view.hxx>
+#include <officecfg/Office/Common.hxx>
 
 #include <algorithm>
 #include <memory>
@@ -119,19 +120,6 @@ static SvxNumSettings_Impl* lcl_CreateNumSettingsPtr(const 
Sequence<PropertyValu
     return pNew;
 }
 
-// the selection of bullets from the OpenSymbol
-const sal_Unicode aBulletTypes[] =
-{
-    0x2022,
-    0x25cf,
-    0xe00c,
-    0xe00a,
-    0x2794,
-    0x27a2,
-    0x2717,
-    0x2714
-};
-
 // Is one of the masked formats set?
 static bool lcl_IsNumFmtSet(SvxNumRule const * pNum, sal_uInt16 nLevelMask)
 {
@@ -146,7 +134,7 @@ static bool lcl_IsNumFmtSet(SvxNumRule const * pNum, 
sal_uInt16 nLevelMask)
     return bRet;
 }
 
-static const vcl::Font& lcl_GetDefaultBulletFont()
+static vcl::Font& lcl_GetDefaultBulletFont()
 {
     static vcl::Font aDefBulletFont = []()
     {
@@ -440,8 +428,11 @@ IMPL_LINK_NOARG(SvxBulletPickTabPage, NumSelectHdl_Impl, 
ValueSet*, void)
 
     bPreset = false;
     bModified = true;
-    sal_Unicode cChar = aBulletTypes[m_xExamplesVS->GetSelectedItemId() - 1];
-    const vcl::Font& rActBulletFont = lcl_GetDefaultBulletFont();
+    sal_uInt16 nIndex = m_xExamplesVS->GetSelectedItemId() - 1;
+    sal_Unicode cChar = 
officecfg::Office::Common::BulletsNumbering::DefaultBullets::get()[nIndex].toChar();
+    vcl::Font& rActBulletFont = lcl_GetDefaultBulletFont();
+    rActBulletFont.SetFamilyName(
+        
officecfg::Office::Common::BulletsNumbering::DefaultBulletsFonts::get()[nIndex]);
 
     sal_uInt16 nMask = 1;
     for(sal_uInt16 i = 0; i < pActNum->GetLevelCount(); i++)
diff --git a/include/svx/strings.hrc b/include/svx/strings.hrc
index 80066b3d33f3..75e0c42cffbb 100644
--- a/include/svx/strings.hrc
+++ b/include/svx/strings.hrc
@@ -1367,15 +1367,6 @@
 #define RID_SVXSTR_ERR_OLD_PASSWD                           
NC_("RID_SVXSTR_ERR_OLD_PASSWD", "Invalid password")
 #define RID_SVXSTR_ERR_REPEAT_PASSWD                        
NC_("RID_SVXSTR_ERR_REPEAT_PASSWD", "Passwords do not match")
 
-#define RID_SVXSTR_BULLET_DESCRIPTION_0                     
NC_("RID_SVXSTR_BULLET_DESCRIPTION_0", "Solid small circular bullets")
-#define RID_SVXSTR_BULLET_DESCRIPTION_1                     
NC_("RID_SVXSTR_BULLET_DESCRIPTION_1", "Solid large circular bullets")
-#define RID_SVXSTR_BULLET_DESCRIPTION_2                     
NC_("RID_SVXSTR_BULLET_DESCRIPTION_2", "Solid diamond bullets")
-#define RID_SVXSTR_BULLET_DESCRIPTION_3                     
NC_("RID_SVXSTR_BULLET_DESCRIPTION_3", "Solid large square bullets")
-#define RID_SVXSTR_BULLET_DESCRIPTION_4                     
NC_("RID_SVXSTR_BULLET_DESCRIPTION_4", "Right pointing arrow bullets filled 
out")
-#define RID_SVXSTR_BULLET_DESCRIPTION_5                     
NC_("RID_SVXSTR_BULLET_DESCRIPTION_5", "Right pointing arrow bullets")
-#define RID_SVXSTR_BULLET_DESCRIPTION_6                     
NC_("RID_SVXSTR_BULLET_DESCRIPTION_6", "Cross mark bullets")
-#define RID_SVXSTR_BULLET_DESCRIPTION_7                     
NC_("RID_SVXSTR_BULLET_DESCRIPTION_7", "Check mark bullets")
-
 // do not translate this; instead describe the nth numbering style 
(LC_NumberingLevel) defined by your locale
 #define RID_SVXSTR_SINGLENUM_DESCRIPTION_0                  
NC_("RID_SVXSTR_SINGLENUM_DESCRIPTION_0", "Number 1) 2) 3)")
 #define RID_SVXSTR_SINGLENUM_DESCRIPTION_1                  
NC_("RID_SVXSTR_SINGLENUM_DESCRIPTION_1", "Number 1. 2. 3.")
diff --git a/officecfg/registry/schema/org/openoffice/Office/Common.xcs 
b/officecfg/registry/schema/org/openoffice/Office/Common.xcs
index 9fe1915a8b9c..616ae5bf2955 100644
--- a/officecfg/registry/schema/org/openoffice/Office/Common.xcs
+++ b/officecfg/registry/schema/org/openoffice/Office/Common.xcs
@@ -3343,6 +3343,41 @@
         </value>
       </prop>
     </group>
+    <group oor:name="BulletsNumbering">
+      <info>
+        <desc>Contains Favorite characters</desc>
+      </info>
+      <prop oor:name="DefaultBullets" oor:type="oor:string-list" 
oor:nillable="false">
+        <info>
+          <desc>List of default bullets</desc>
+        </info>
+        <value>
+          <it>•</it>
+          <it>●</it>
+          <it></it>
+          <it></it>
+          <it>➔</it>
+          <it>➢</it>
+          <it>✗</it>
+          <it>✔</it>
+        </value>
+      </prop>
+      <prop oor:name="DefaultBulletsFonts" oor:type="oor:string-list" 
oor:nillable="false">
+        <info>
+          <desc>List of default bullet fonts. Matching font for 
`DefaultBullets`.</desc>
+        </info>
+        <value>
+          <it>OpenSymbol</it>
+          <it>OpenSymbol</it>
+          <it>OpenSymbol</it>
+          <it>OpenSymbol</it>
+          <it>OpenSymbol</it>
+          <it>OpenSymbol</it>
+          <it>OpenSymbol</it>
+          <it>OpenSymbol</it>
+        </value>
+      </prop>
+    </group>
     <group oor:name="Help">
       <info>
         <desc>Contains settings that specify the common help settings.</desc>
diff --git a/svx/source/dialog/svxbmpnumvalueset.cxx 
b/svx/source/dialog/svxbmpnumvalueset.cxx
index c75e54482f40..a1f8dc76aaf0 100644
--- a/svx/source/dialog/svxbmpnumvalueset.cxx
+++ b/svx/source/dialog/svxbmpnumvalueset.cxx
@@ -25,6 +25,7 @@
 #include <i18nlangtag/mslangid.hxx>
 #include <svtools/valueset.hxx>
 #include <editeng/numitem.hxx>
+#include <officecfg/Office/Common.hxx>
 #include <svx/gallery.hxx>
 #include <vcl/event.hxx>
 #include <vcl/graph.hxx>
@@ -46,20 +47,6 @@ using namespace com::sun::star::text;
 using namespace com::sun::star::container;
 using namespace com::sun::star::style;
 
-
-// The selection of bullets from the star symbol
-const sal_Unicode aBulletTypes[] =
-{
-    0x2022,
-    0x25cf,
-    0xe00c,
-    0xe00a,
-    0x2794,
-    0x27a2,
-    0x2717,
-    0x2714
-};
-
 static vcl::Font& lcl_GetDefaultBulletFont()
 {
     static vcl::Font aDefBulletFont = []()
@@ -95,18 +82,6 @@ static void lcl_PaintLevel(OutputDevice* pVDev, sal_Int16 
nNumberingType,
     }
 }
 
- const TranslateId RID_SVXSTR_BULLET_DESCRIPTIONS[] =
-{
-    RID_SVXSTR_BULLET_DESCRIPTION_0,
-    RID_SVXSTR_BULLET_DESCRIPTION_1,
-    RID_SVXSTR_BULLET_DESCRIPTION_2,
-    RID_SVXSTR_BULLET_DESCRIPTION_3,
-    RID_SVXSTR_BULLET_DESCRIPTION_4,
-    RID_SVXSTR_BULLET_DESCRIPTION_5,
-    RID_SVXSTR_BULLET_DESCRIPTION_6,
-    RID_SVXSTR_BULLET_DESCRIPTION_7
-};
-
 const TranslateId RID_SVXSTR_SINGLENUM_DESCRIPTIONS[] =
 {
     RID_SVXSTR_SINGLENUM_DESCRIPTION_0,
@@ -152,7 +127,8 @@ void SvxNumValueSet::UserDraw( const UserDrawEvent& rUDEvt )
 
     vcl::RenderContext* pDev = rUDEvt.GetRenderContext();
     tools::Rectangle aRect = rUDEvt.GetRect();
-    sal_uInt16 nItemId = rUDEvt.GetItemId();
+    sal_uInt16 nIndex = rUDEvt.GetItemId() - 1;
+
 
     tools::Long nRectWidth = aRect.GetWidth();
     tools::Long nRectHeight = aRect.GetHeight();
@@ -171,8 +147,15 @@ void SvxNumValueSet::UserDraw( const UserDrawEvent& rUDEvt 
)
     aRuleFont.SetFontSize(aSize);
     aRuleFont.SetColor(aTextColor);
     aRuleFont.SetFillColor(aBackColor);
+    css::uno::Sequence< OUString > aBulletSymbols;
+
     if(ePageType == NumberingPageType::BULLET)
+    {
+        aBulletSymbols = 
officecfg::Office::Common::BulletsNumbering::DefaultBullets::get();
+        css::uno::Sequence< OUString > 
aBulletFonts(officecfg::Office::Common::BulletsNumbering::DefaultBulletsFonts::get());
+        aRuleFont.SetFamilyName(aBulletFonts[nIndex]);
         aFont = aRuleFont;
+    }
     else if(ePageType == NumberingPageType::OUTLINE)
     {
         aSize.setHeight( nRectHeight/8 );
@@ -225,15 +208,15 @@ void SvxNumValueSet::UserDraw( const UserDrawEvent& 
rUDEvt )
             OUString sText;
             if(ePageType == NumberingPageType::BULLET)
             {
-                sText = OUString( aBulletTypes[nItemId - 1] );
+                sText = aBulletSymbols[nIndex];
                 aStart.AdjustY( -(pDev->GetTextHeight()/2) );
                 aStart.setX( aBLPos.X() + 5 );
             }
             else
             {
-                if(xFormatter.is() && aNumSettings.getLength() > nItemId - 1)
+                if(xFormatter.is() && aNumSettings.getLength() > nIndex)
                 {
-                    Sequence<PropertyValue> aLevel = 
aNumSettings.getConstArray()[nItemId - 1];
+                    Sequence<PropertyValue> aLevel = 
aNumSettings.getConstArray()[nIndex];
                     try
                     {
                         aLevel.realloc(aLevel.getLength() + 1);
@@ -264,9 +247,9 @@ void SvxNumValueSet::UserDraw( const UserDrawEvent& rUDEvt )
         tools::Long nStartX = aOrgRect.Left();
         tools::Long nStartY = aOrgRect.Top();
 
-        if(xFormatter.is() && aOutlineSettings.getLength() > nItemId - 1)
+        if(xFormatter.is() && aOutlineSettings.getLength() > nIndex)
         {
-            Reference<XIndexAccess> xLevel = 
aOutlineSettings.getArray()[nItemId - 1];
+            Reference<XIndexAccess> xLevel = 
aOutlineSettings.getArray()[nIndex];
             try
             {
                 OUString sLevelTexts[5];
@@ -419,7 +402,6 @@ void SvxNumValueSet::init(NumberingPageType eType)
         for ( sal_uInt16 i = 0; i < 8; i++ )
         {
             InsertItem( i + 1, i );
-            SetItemText(i + 1, SvxResId(RID_SVXSTR_BULLET_DESCRIPTIONS[i]));
         }
     }
 }
diff --git a/svx/source/sidebar/nbdtmg.cxx b/svx/source/sidebar/nbdtmg.cxx
index 5cc216324a58..121ce8ee90b9 100644
--- a/svx/source/sidebar/nbdtmg.cxx
+++ b/svx/source/sidebar/nbdtmg.cxx
@@ -40,6 +40,7 @@
 #include <unotools/ucbstreamhelper.hxx>
 #include <unotools/pathoptions.hxx>
 #include <editeng/eeitem.hxx>
+#include <officecfg/Office/Common.hxx>
 
 #include <com/sun/star/text/VertOrientation.hpp>
 #include <com/sun/star/style/NumberingType.hpp>
@@ -61,7 +62,7 @@ namespace svx::sidebar {
 
 namespace {
 
-const vcl::Font& lcl_GetDefaultBulletFont()
+vcl::Font& lcl_GetDefaultBulletFont()
 {
     static vcl::Font aDefBulletFont = []()
     {
@@ -76,18 +77,6 @@ const vcl::Font& lcl_GetDefaultBulletFont()
     return aDefBulletFont;
 }
 
-const sal_Unicode aDefaultBulletTypes[] =
-{
-    0x2022,
-    0x25cf,
-    0xe00c,
-    0xe00a,
-    0x2794,
-    0x27a2,
-    0x2717,
-    0x2714
-};
-
 NumSettings_Impl* lcl_CreateNumberingSettingsPtr(const 
Sequence<PropertyValue>& rLevelProps)
 {
     NumSettings_Impl* pNew = new NumSettings_Impl;
@@ -261,17 +250,20 @@ BulletsTypeMgr& BulletsTypeMgr::GetInstance()
 
 void BulletsTypeMgr::Init()
 {
-    const vcl::Font& rActBulletFont = lcl_GetDefaultBulletFont();
+    css::uno::Sequence< OUString > 
aBulletSymbols(officecfg::Office::Common::BulletsNumbering::DefaultBullets::get());
+    css::uno::Sequence< OUString > 
aBulletSymbolsFonts(officecfg::Office::Common::BulletsNumbering::DefaultBulletsFonts::get());
+
+    vcl::Font& rActBulletFont = lcl_GetDefaultBulletFont();
 
     for (sal_uInt16 i=0;i<DEFAULT_BULLET_TYPES;i++)
     {
         pActualBullets[i] = new BulletsSettings;
-        pActualBullets[i]->cBulletChar = aDefaultBulletTypes[i];
+        pActualBullets[i]->cBulletChar = aBulletSymbols[i].toChar();
+        rActBulletFont.SetFamilyName(aBulletSymbolsFonts[i]);
         pActualBullets[i]->aFont = rActBulletFont;
-        OString id = OString::Concat(RID_SVXSTR_BULLET_DESCRIPTION_0.mpId) + 
OString::number(i);
-        pActualBullets[i]->sDescription = SvxResId( 
TranslateId(RID_SVXSTR_BULLET_DESCRIPTION_0.mpContext, id.getStr()) );
     }
 }
+
 sal_uInt16 BulletsTypeMgr::GetNBOIndexForNumRule(SvxNumRule& aNum,sal_uInt16 
mLevel,sal_uInt16 nFromIndex)
 {
     if ( mLevel == sal_uInt16(0xFFFF) || mLevel == 0)
diff --git a/sw/qa/uitest/writer_tests2/formatBulletsNumbering.py 
b/sw/qa/uitest/writer_tests2/formatBulletsNumbering.py
index c01ad8010587..b3c5484964d4 100644
--- a/sw/qa/uitest/writer_tests2/formatBulletsNumbering.py
+++ b/sw/qa/uitest/writer_tests2/formatBulletsNumbering.py
@@ -207,13 +207,10 @@ class formatBulletsNumbering(UITestCase):
                 xselector.executeAction("CHOOSE", mkPropertyValues({"POS": 
"3"}))
                 
self.assertEqual(get_state_as_dict(xselector)["SelectedItemPos"], "2")
                 
self.assertEqual(get_state_as_dict(xselector)["SelectedItemId"], "3")
-                self.assertEqual(get_state_as_dict(xselector)["ItemText"], 
"Solid diamond bullets")
                 # Select element num 7
                 xselector.executeAction("CHOOSE", mkPropertyValues({"POS": 
"7"}))
                 
self.assertEqual(get_state_as_dict(xselector)["SelectedItemPos"], "6")
                 
self.assertEqual(get_state_as_dict(xselector)["SelectedItemId"], "7")
-                self.assertEqual(get_state_as_dict(xselector)["ItemText"], 
"Cross mark bullets")
-
 
             # Test other Pages
             with 
self.ui_test.execute_dialog_through_command(".uno:BulletsAndNumberingDialog") 
as xDialog:
commit 2c4fd9517a1c598af2cb60d842cc4326a4357b25
Author:     Tibor Nagy <tibor.nagy.ext...@allotropia.de>
AuthorDate: Wed Mar 13 08:28:41 2024 +0100
Commit:     Thorsten Behrens <thorsten.behr...@allotropia.de>
CommitDate: Sun Apr 7 00:38:36 2024 +0200

    tdf#156655 sc: fix disappear text in merged cell
    
    The text does not appear if the first row or column of the merged cell
    is hidden.
    
    Change-Id: I398f0d572226e44ffaa4e33c066b51480ad124cb
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164757
    Tested-by: Jenkins
    Reviewed-by: Nagy Tibor <tibor.nagy.ext...@allotropia.de>
    (cherry picked from commit d5f25d9c0026ec06a0b46e1560e26adba2725290)

diff --git a/sc/source/ui/view/output2.cxx b/sc/source/ui/view/output2.cxx
index 13ef10025947..472ffb36870e 100644
--- a/sc/source/ui/view/output2.cxx
+++ b/sc/source/ui/view/output2.cxx
@@ -1870,8 +1870,7 @@ tools::Rectangle ScOutputData::LayoutStrings(bool 
bPixelToLogic, bool bPaint, co
                     //  Cells to the left are marked directly, cells to the
                     //  right are handled by the flag for nX2
                     SCCOL nMarkX = ( nCellX <= nX2 ) ? nCellX : nX2;
-                    RowInfo* pMarkRowInfo = ( nCellY == nY ) ? pThisRowInfo : 
&pRowInfo[0];
-                    pMarkRowInfo->basicCellInfo(nMarkX).bEditEngine = true;
+                    pThisRowInfo->basicCellInfo(nMarkX).bEditEngine = true;
                     bDoCell = false;    // don't draw here
                 }
                 if ( bDoCell )
@@ -4341,14 +4340,17 @@ void ScOutputData::DrawEdit(bool bPixelToLogic)
                     SCROW nCellY = nY;
                     bool bDoCell = false;
 
+                    // if merged cell contains hidden row or column or both
+                    const ScMergeFlagAttr* pMergeFlag = mpDoc->GetAttr(nX, nY, 
nTab, ATTR_MERGE_FLAG);
+                    bool bOverlapped = (pMergeFlag->IsHorOverlapped() || 
pMergeFlag->IsVerOverlapped());
+
                     tools::Long nPosY = nRowPosY;
-                    if ( nArrY == 0 )
+                    if (bOverlapped)
                     {
-                        nPosY = nScrY;
-                        nY = pRowInfo[1].nRowNo;
+                        nY = pRowInfo[nArrY].nRowNo;
                         SCCOL nOverX;                   // start of the merged 
cells
                         SCROW nOverY;
-                        if (GetMergeOrigin( nX,nY, 1, nOverX,nOverY, true ))
+                        if (GetMergeOrigin( nX,nY, nArrY, nOverX,nOverY, true 
))
                         {
                             nCellX = nOverX;
                             nCellY = nOverY;

Reply via email to