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