[Libreoffice-commits] core.git: Branch 'libreoffice-6-1' - cui/source include/svx starmath/source svx/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Tue Jul 17 09:02:21 UTC 2018


 cui/source/dialogs/cuicharmap.cxx   |    9 +++------
 include/svx/charmap.hxx             |    5 +++--
 starmath/source/dialog.cxx          |    3 +--
 svx/source/dialog/charmap.cxx       |    8 ++++++--
 svx/source/dialog/searchcharmap.cxx |    1 -
 5 files changed, 13 insertions(+), 13 deletions(-)

New commits:
commit a09d357daf65e285323ff77653a6de3058fc44da
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Mon Jul 16 16:04:11 2018 +0100
Commit:     Eike Rathke <erack at redhat.com>
CommitDate: Tue Jul 17 11:01:57 2018 +0200

    tdf#118681 make sure we're using the right font char map
    
    Change-Id: I64265dac5d0d18b092d64ef656997d7177a425a4
    Reviewed-on: https://gerrit.libreoffice.org/57505
    Tested-by: Jenkins
    Reviewed-by: Eike Rathke <erack at redhat.com>

diff --git a/cui/source/dialogs/cuicharmap.cxx b/cui/source/dialogs/cuicharmap.cxx
index 117ab6f5813d..7c6d8f50a342 100755
--- a/cui/source/dialogs/cuicharmap.cxx
+++ b/cui/source/dialogs/cuicharmap.cxx
@@ -668,8 +668,7 @@ IMPL_LINK_NOARG(SvxCharacterMap, FontSelectHdl, weld::ComboBoxText&, void)
     bool bNeedSubset = (aFont.GetCharSet() != RTL_TEXTENCODING_SYMBOL);
     if (bNeedSubset)
     {
-        FontCharMapRef xFontCharMap( new FontCharMap() );
-        m_xShowSet->GetFontCharMap( xFontCharMap );
+        FontCharMapRef xFontCharMap = m_xShowSet->GetFontCharMap();
         pSubsetMap = new SubsetMap( xFontCharMap );
 
         // update subset listbox for new font's unicode subsets
@@ -841,8 +840,7 @@ IMPL_LINK_NOARG(SvxCharacterMap, SearchUpdateHdl, weld::Entry&, void)
 
         toggleSearchView(true);
 
-        FontCharMapRef xFontCharMap(new FontCharMap());
-        m_xSearchSet->GetFontCharMap(xFontCharMap);
+        FontCharMapRef xFontCharMap = m_xSearchSet->GetFontCharMap();
 
         sal_UCS4 sChar = xFontCharMap->GetFirstChar();
         while(sChar != xFontCharMap->GetLastChar())
@@ -1061,8 +1059,7 @@ void SvxCharacterMap::selectCharByCode(Radix radix)
     // Convert the code back to a character using the appropriate radix
     sal_UCS4 cChar = aCodeString.toUInt32(static_cast<sal_Int16> (radix));
     // Use FontCharMap::HasChar(sal_UCS4 cChar) to see if the desired character is in the font
-    FontCharMapRef xFontCharMap(new FontCharMap());
-    m_xShowSet->GetFontCharMap(xFontCharMap);
+    FontCharMapRef xFontCharMap = m_xShowSet->GetFontCharMap();
     if (xFontCharMap->HasChar(cChar))
         // Select the corresponding character
         SetChar(cChar);
diff --git a/include/svx/charmap.hxx b/include/svx/charmap.hxx
index 6e18581c4786..5101b230059f 100644
--- a/include/svx/charmap.hxx
+++ b/include/svx/charmap.hxx
@@ -32,6 +32,7 @@
 #include <tools/link.hxx>
 #include <vcl/ctrl.hxx>
 #include <vcl/event.hxx>
+#include <vcl/fontcharmap.hxx>
 #include <vcl/outdev.hxx>
 #include <vcl/metric.hxx>
 #include <vcl/vclptr.hxx>
@@ -80,8 +81,8 @@ public:
     void            SetFavClickHdl( const Link<SvxShowCharSet*,void>& rHdl ) { aFavClickHdl = rHdl; }
     static sal_uInt32& getSelectedChar();
     void            SetFont( const vcl::Font& rFont );
-    vcl::Font const & GetFont() const { return mxVirDev->GetFont(); }
-    bool            GetFontCharMap(FontCharMapRef& rxFontCharMap) const { return mxVirDev->GetFontCharMap(rxFontCharMap); }
+    vcl::Font const & GetFont() const { return maFont; }
+    FontCharMapRef  GetFontCharMap();
     bool            isFavChar(const OUString& sTitle, const OUString& rFont);
     void            getFavCharacterList(); //gets both Fav char and Fav char font list
     void            updateFavCharacterList(const OUString& rChar, const OUString& rFont);
diff --git a/starmath/source/dialog.cxx b/starmath/source/dialog.cxx
index ac7269345c0c..1dabf0abd0b3 100644
--- a/starmath/source/dialog.cxx
+++ b/starmath/source/dialog.cxx
@@ -1987,8 +1987,7 @@ void SmSymDefineDialog::SetFont(const OUString &rFontName, const OUString &rStyl
     m_aSymbolDisplay.SetFont(aFontMetric);
 
     // update subset listbox for new font's unicode subsets
-    FontCharMapRef xFontCharMap;
-    m_xCharsetDisplay->GetFontCharMap( xFontCharMap );
+    FontCharMapRef xFontCharMap = m_xCharsetDisplay->GetFontCharMap();
     m_xSubsetMap.reset(new SubsetMap( xFontCharMap ));
 
     m_xFontsSubsetLB->clear();
diff --git a/svx/source/dialog/charmap.cxx b/svx/source/dialog/charmap.cxx
index 1d8d286d03cc..4dd8dec69cde 100644
--- a/svx/source/dialog/charmap.cxx
+++ b/svx/source/dialog/charmap.cxx
@@ -20,7 +20,6 @@
 #include <vcl/svapp.hxx>
 #include <vcl/settings.hxx>
 #include <vcl/builderfactory.hxx>
-#include <vcl/fontcharmap.hxx>
 #include <svtools/colorcfg.hxx>
 
 #include <rtl/textenc.h>
@@ -845,12 +844,17 @@ svx::SvxShowCharSetItem* SvxShowCharSet::ImplGetItem( int _nPos )
     return aFind->second.get();
 }
 
-
 sal_Int32 SvxShowCharSet::getMaxCharCount() const
 {
     return mxFontCharMap->GetCharCount();
 }
 
+FontCharMapRef SvxShowCharSet::GetFontCharMap()
+{
+    RecalculateFont(*mxVirDev);
+    return mxFontCharMap;
+}
+
 // TODO: should be moved into Font Attributes stuff
 // we let it mature here though because it is currently the only use
 
diff --git a/svx/source/dialog/searchcharmap.cxx b/svx/source/dialog/searchcharmap.cxx
index cf9faf363673..ba2a8a36eb56 100644
--- a/svx/source/dialog/searchcharmap.cxx
+++ b/svx/source/dialog/searchcharmap.cxx
@@ -20,7 +20,6 @@
 #include <vcl/svapp.hxx>
 #include <vcl/settings.hxx>
 #include <vcl/builderfactory.hxx>
-#include <vcl/fontcharmap.hxx>
 #include <svtools/colorcfg.hxx>
 
 #include <rtl/textenc.h>


More information about the Libreoffice-commits mailing list