[Libreoffice-commits] core.git: 4 commits - cui/source svx/source

Caolán McNamara caolanm at redhat.com
Fri Mar 31 14:25:39 UTC 2017


 cui/source/dialogs/cuicharmap.cxx       |    7 ++++++
 cui/source/tabpages/numpages.cxx        |   10 ++++----
 svx/source/dialog/svxbmpnumvalueset.cxx |    2 -
 svx/source/sidebar/nbdtmg.cxx           |   37 ++++++--------------------------
 4 files changed, 20 insertions(+), 36 deletions(-)

New commits:
commit 011e1cdbf33e50626f1fefa8b7b4031fa368f3e8
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri Mar 31 15:15:31 2017 +0100

    Related: tdf#106515 show OpenSymbol if unavailable StarSymbol requested
    
    Change-Id: I442df1c44839642bd1f91afedee577214032466b

diff --git a/cui/source/dialogs/cuicharmap.cxx b/cui/source/dialogs/cuicharmap.cxx
index a92f99b6d00c..8d1180a9e9b3 100644
--- a/cui/source/dialogs/cuicharmap.cxx
+++ b/cui/source/dialogs/cuicharmap.cxx
@@ -380,6 +380,13 @@ void SvxCharacterMap::SetCharFont( const vcl::Font& rFont )
     // like "Times New Roman;Times" resolved
     vcl::Font aTmp( GetFontMetric( rFont ) );
 
+    if (aTmp.GetFamilyName() == "StarSymbol" && m_pFontLB->GetEntryPos(aTmp.GetFamilyName()) == LISTBOX_ENTRY_NOTFOUND)
+    {
+        //if for some reason, like font in an old document, StarSymbol is requested and its not available, then
+        //try OpenSymbol instead
+        aTmp.SetFamilyName("OpenSymbol");
+    }
+
     if ( m_pFontLB->GetEntryPos( aTmp.GetFamilyName() ) == LISTBOX_ENTRY_NOTFOUND )
         return;
 
commit 286e907cd42015f8311ecbb8568d75bf21da4f88
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri Mar 31 15:10:32 2017 +0100

    can use a reference here
    
    Change-Id: I042baab66ff67d0599cffcbfe2db374eb182ea5b

diff --git a/svx/source/sidebar/nbdtmg.cxx b/svx/source/sidebar/nbdtmg.cxx
index 318ebb4dcbd9..6f9ef286743d 100644
--- a/svx/source/sidebar/nbdtmg.cxx
+++ b/svx/source/sidebar/nbdtmg.cxx
@@ -266,7 +266,7 @@ void BulletsTypeMgr::Init()
     {
         pActualBullets[i] = new BulletsSettings;
         pActualBullets[i]->cBulletChar = aDefaultBulletTypes[i];
-        pActualBullets[i]->aFont =rActBulletFont;
+        pActualBullets[i]->aFont = rActBulletFont;
         pActualBullets[i]->sDescription = SVX_RESSTR( RID_SVXSTR_BULLET_DESCRIPTION_0 + i );
     }
 }
@@ -377,7 +377,7 @@ void BulletsTypeMgr::ApplyNumRule(SvxNumRule& aNum, sal_uInt16 nIndex, sal_uInt1
     if ( nIndex >= DEFAULT_BULLET_TYPES )
         return;
     sal_Unicode cChar = pActualBullets[nIndex]->cBulletChar;
-    vcl::Font rActBulletFont = pActualBullets[nIndex]->aFont;
+    const vcl::Font& rActBulletFont = pActualBullets[nIndex]->aFont;
 
     sal_uInt16 nMask = 1;
     OUString sBulletCharFormatName = GetBulCharFmtName();
commit 54f8ed8b8386c03922e7a98e0125309eca264d04
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri Mar 31 15:03:04 2017 +0100

    const these up
    
    Change-Id: If79187b8e2624da132ed47f5baf374211cc6e449

diff --git a/cui/source/tabpages/numpages.cxx b/cui/source/tabpages/numpages.cxx
index 4516054ff2c8..794e012f230f 100644
--- a/cui/source/tabpages/numpages.cxx
+++ b/cui/source/tabpages/numpages.cxx
@@ -157,7 +157,7 @@ static bool lcl_IsNumFmtSet(SvxNumRule* pNum, sal_uInt16 nLevelMask)
     return bRet;
 }
 
-static vcl::Font& lcl_GetDefaultBulletFont()
+static const vcl::Font& lcl_GetDefaultBulletFont()
 {
     static bool bInit = false;
     static vcl::Font aDefBulletFont("OpenSymbol", "", Size(0, 14));
@@ -490,7 +490,7 @@ IMPL_LINK_NOARG(SvxBulletPickTabPage, NumSelectHdl_Impl, ValueSet*, void)
         bPreset = false;
         bModified = true;
         sal_Unicode cChar = aBulletTypes[m_pExamplesVS->GetSelectItemId() - 1];
-        vcl::Font& rActBulletFont = lcl_GetDefaultBulletFont();
+        const vcl::Font& rActBulletFont = lcl_GetDefaultBulletFont();
 
         sal_uInt16 nMask = 1;
         for(sal_uInt16 i = 0; i < pActNum->GetLevelCount(); i++)
@@ -695,7 +695,7 @@ IMPL_LINK_NOARG(SvxNumPickTabPage, NumSelectHdl_Impl, ValueSet*, void)
 
         SvxNumSettingsArr_Impl& rItemArr = aNumSettingsArrays[m_pExamplesVS->GetSelectItemId() - 1];
 
-        vcl::Font& rActBulletFont = lcl_GetDefaultBulletFont();
+        const vcl::Font& rActBulletFont = lcl_GetDefaultBulletFont();
         SvxNumSettings_Impl* pLevelSettings = nullptr;
         for(sal_uInt16 i = 0; i < pActNum->GetLevelCount(); i++)
         {
diff --git a/svx/source/sidebar/nbdtmg.cxx b/svx/source/sidebar/nbdtmg.cxx
index 170032fea9a5..318ebb4dcbd9 100644
--- a/svx/source/sidebar/nbdtmg.cxx
+++ b/svx/source/sidebar/nbdtmg.cxx
@@ -63,7 +63,7 @@ using namespace com::sun::star::style;
 
 namespace svx { namespace sidebar {
 
-vcl::Font& lcl_GetDefaultBulletFont()
+const vcl::Font& lcl_GetDefaultBulletFont()
 {
     static bool bInit = false;
     static vcl::Font aDefBulletFont("OpenSymbol", "", Size(0, 14));
@@ -260,7 +260,7 @@ BulletsTypeMgr& BulletsTypeMgr::GetInstance()
 
 void BulletsTypeMgr::Init()
 {
-    vcl::Font& rActBulletFont = lcl_GetDefaultBulletFont();
+    const vcl::Font& rActBulletFont = lcl_GetDefaultBulletFont();
 
     for (sal_uInt16 i=0;i<DEFAULT_BULLET_TYPES;i++)
     {
@@ -374,32 +374,9 @@ void BulletsTypeMgr::RelplaceNumRule(SvxNumRule& aNum, sal_uInt16 nIndex, sal_uI
 
 void BulletsTypeMgr::ApplyNumRule(SvxNumRule& aNum, sal_uInt16 nIndex, sal_uInt16 mLevel, bool /*isDefault*/, bool isResetSize)
 {
-    //if ( mLevel == (sal_uInt16)0xFFFF )
-    //  return sal_False;
-
-    sal_Unicode cChar;
-    //sal_uInt16 nLength = 0;
-    /*if( AllSettings::GetLayoutRTL() )
-    {
-        nLength = sizeof(aDynamicRTLBulletTypes)/sizeof(sal_Unicode);
-
-        if ( nIndex >= nLength )
-            return sal_False;
-
-        cChar = aDynamicRTLBulletTypes[nIndex];
-    }else
-    {
-        nLength = sizeof(aDynamicBulletTypes)/sizeof(sal_Unicode);
-
-        if ( nIndex >= nLength )
-            return sal_False;
-
-        cChar = aDynamicBulletTypes[nIndex];
-    }*/
     if ( nIndex >= DEFAULT_BULLET_TYPES )
         return;
-    cChar = pActualBullets[nIndex]->cBulletChar;
-    //vcl::Font& rActBulletFont = lcl_GetDefaultBulletFont();
+    sal_Unicode cChar = pActualBullets[nIndex]->cBulletChar;
     vcl::Font rActBulletFont = pActualBullets[nIndex]->aFont;
 
     sal_uInt16 nMask = 1;
@@ -863,7 +840,7 @@ void OutlineTypeMgr::ApplyNumRule(SvxNumRule& aNum, sal_uInt16 nIndex, sal_uInt1
             break;
 
         SvxNumberFormat aFmt(aNum.GetLevel(i));
-        vcl::Font& rActBulletFont = lcl_GetDefaultBulletFont();
+        const vcl::Font& rActBulletFont = lcl_GetDefaultBulletFont();
         if (pLevelSettings->nNumberType !=aFmt.GetNumberingType()) isResetSize=true;
         aFmt.SetNumberingType( pLevelSettings->nNumberType );
         sal_uInt16 nUpperLevelOrChar = (sal_uInt16)pLevelSettings->nParentNumbering;
commit f4b7338f989bd5f7e934c4dc38045e812eb3d59f
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri Mar 31 14:54:00 2017 +0100

    Resolves: tdf#106515 use OpenSymbol, not StarSymbol as the default bullet font
    
    For choosing a bullet from a real font it matters while otherwise its a synonym. Of
    course we have this code duplicated three times.
    
    Change-Id: I2428b9a23d997925de3e731b8afe9fb8cf18ed54

diff --git a/cui/source/tabpages/numpages.cxx b/cui/source/tabpages/numpages.cxx
index 3da5e1033da7..4516054ff2c8 100644
--- a/cui/source/tabpages/numpages.cxx
+++ b/cui/source/tabpages/numpages.cxx
@@ -130,7 +130,7 @@ static SvxNumSettings_Impl* lcl_CreateNumSettingsPtr(const Sequence<PropertyValu
     return pNew;
 }
 
-// the selection of bullets from the StarSymbol
+// the selection of bullets from the OpenSymbol
 static const sal_Unicode aBulletTypes[] =
 {
     0x2022,
@@ -160,7 +160,7 @@ static bool lcl_IsNumFmtSet(SvxNumRule* pNum, sal_uInt16 nLevelMask)
 static vcl::Font& lcl_GetDefaultBulletFont()
 {
     static bool bInit = false;
-    static vcl::Font aDefBulletFont( "StarSymbol", OUString(), Size( 0, 14 ) );
+    static vcl::Font aDefBulletFont("OpenSymbol", "", Size(0, 14));
     if(!bInit)
     {
         aDefBulletFont.SetCharSet( RTL_TEXTENCODING_SYMBOL );
diff --git a/svx/source/dialog/svxbmpnumvalueset.cxx b/svx/source/dialog/svxbmpnumvalueset.cxx
index f4c27d362f19..79791f414242 100644
--- a/svx/source/dialog/svxbmpnumvalueset.cxx
+++ b/svx/source/dialog/svxbmpnumvalueset.cxx
@@ -81,7 +81,7 @@ static const sal_Unicode aBulletTypes[] =
 static vcl::Font& lcl_GetDefaultBulletFont()
 {
     static bool bInit = false;
-    static vcl::Font aDefBulletFont( "StarSymbol", "", Size( 0, 14 ) );
+    static vcl::Font aDefBulletFont("OpenSymbol", "", Size(0, 14));
     if(!bInit)
     {
         aDefBulletFont.SetCharSet( RTL_TEXTENCODING_SYMBOL );
diff --git a/svx/source/sidebar/nbdtmg.cxx b/svx/source/sidebar/nbdtmg.cxx
index b1c1f6a4386f..170032fea9a5 100644
--- a/svx/source/sidebar/nbdtmg.cxx
+++ b/svx/source/sidebar/nbdtmg.cxx
@@ -66,7 +66,7 @@ namespace svx { namespace sidebar {
 vcl::Font& lcl_GetDefaultBulletFont()
 {
     static bool bInit = false;
-    static vcl::Font aDefBulletFont( "StarSymbol", "", Size( 0, 14 ) );
+    static vcl::Font aDefBulletFont("OpenSymbol", "", Size(0, 14));
     if(!bInit)
     {
         aDefBulletFont.SetCharSet( RTL_TEXTENCODING_SYMBOL );


More information about the Libreoffice-commits mailing list