Kaydet (Commit) 0ad4b257 authored tarafından Henry Castro's avatar Henry Castro

lok: refill font list if empty

After preinit stage the font list is empty
when creating documents.

Reviewed-on: https://gerrit.libreoffice.org/32108Reviewed-by: 's avatarMichael Meeks <michael.meeks@collabora.com>
Tested-by: 's avatarMichael Meeks <michael.meeks@collabora.com>

Conflicts:
	sd/source/ui/docshell/docshel4.cxx
	svtools/source/control/ctrltool.cxx

Change-Id: Ia6938d521626f4b4022f0f993e77c017e4932415
Reviewed-on: https://gerrit.libreoffice.org/32796Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarHenry Castro <hcastro@collabora.com>
üst 6af96092
......@@ -1211,6 +1211,7 @@ public:
int GetDevFontSizeCount( const vcl::Font& ) const;
bool AddTempDevFont( const OUString& rFileURL, const OUString& rFontName );
void RefreshFontData( const bool bNewFontLists );
FontMetric GetFontMetric() const;
FontMetric GetFontMetric( const vcl::Font& rFont ) const;
......
......@@ -32,6 +32,7 @@
#include <svtools/svtresid.hxx>
#include <svtools/ctrltool.hxx>
#include <o3tl/typed_flags_set.hxx>
#include <comphelper/lok.hxx>
// Standard Fontgroessen fuer scalierbare Fonts
const sal_IntPtr FontList::aStdSizeAry[] =
......@@ -248,7 +249,13 @@ void FontList::ImplInsertFonts(OutputDevice* pDevice, bool bInsertData)
nType = FontListFontNameType::PRINTER;
// inquire all fonts from the device
int const n = pDevice->GetDevFontCount();
int n = pDevice->GetDevFontCount();
if (n == 0 && comphelper::LibreOfficeKit::isActive())
{
pDevice->RefreshFontData(true);
n = pDevice->GetDevFontCount();
}
for (int i = 0; i < n; ++i)
{
FontMetric aFontMetric = pDevice->GetDevFont( i );
......
......@@ -548,6 +548,11 @@ void OutputDevice::ImplClearFontData( const bool bNewFontLists )
}
}
void OutputDevice::RefreshFontData( const bool bNewFontLists )
{
ImplRefreshFontData( bNewFontLists );
}
void OutputDevice::ImplRefreshFontData( const bool bNewFontLists )
{
// if ( GetOutDevType() == OUTDEV_PRINTER || mpPDFWriter )
......
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