Kaydet (Commit) cf6c748f authored tarafından Caolán McNamara's avatar Caolán McNamara

tdf#118681 make sure we're using the right font char map

Change-Id: I64265dac5d0d18b092d64ef656997d7177a425a4
Reviewed-on: https://gerrit.libreoffice.org/57504
Tested-by: Jenkins
Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst 66537c7c
......@@ -667,8 +667,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.reset(new SubsetMap( xFontCharMap ));
// update subset listbox for new font's unicode subsets
......@@ -840,8 +839,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())
......@@ -1060,8 +1058,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);
......
......@@ -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);
......
......@@ -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();
......
......@@ -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>
......@@ -844,12 +843,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
......
......@@ -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>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment