summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHenry Castro <hcastro@collabora.com>2016-12-16 23:23:31 -0400
committerMichael Meeks <michael.meeks@collabora.com>2016-12-19 17:10:53 +0000
commitd8b22b3e6c1247b344c8cf446815f237e1d3ecd2 (patch)
tree7f80cdd74accc7ddded8e48ceefcd89a160d2d20
parentd2fd633f35ad70ab8adcd8a0b54d2e991a56e475 (diff)
lok: refill font list if empty
After preinit stage the font list is empty when creating documents. Change-Id: Ia6938d521626f4b4022f0f993e77c017e4932415 Reviewed-on: https://gerrit.libreoffice.org/32108 Reviewed-by: Michael Meeks <michael.meeks@collabora.com> Tested-by: Michael Meeks <michael.meeks@collabora.com>
-rw-r--r--include/vcl/outdev.hxx1
-rw-r--r--sd/source/ui/docshell/docshel4.cxx1
-rw-r--r--svtools/source/control/ctrltool.cxx7
-rw-r--r--vcl/source/outdev/font.cxx5
4 files changed, 14 insertions, 0 deletions
diff --git a/include/vcl/outdev.hxx b/include/vcl/outdev.hxx
index a146c86dc635..bc8b20e0887b 100644
--- a/include/vcl/outdev.hxx
+++ b/include/vcl/outdev.hxx
@@ -1258,6 +1258,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;
diff --git a/sd/source/ui/docshell/docshel4.cxx b/sd/source/ui/docshell/docshel4.cxx
index 672823758601..54a19a3b1e63 100644
--- a/sd/source/ui/docshell/docshel4.cxx
+++ b/sd/source/ui/docshell/docshel4.cxx
@@ -164,6 +164,7 @@ void DrawDocShell::UpdateFontList()
pRefDevice = GetPrinter(true);
else
pRefDevice = SD_MOD()->GetVirtualRefDevice();
+
mpFontList = new FontList( pRefDevice, nullptr, false );
SvxFontListItem aFontListItem( mpFontList, SID_ATTR_CHAR_FONTLIST );
PutItem( aFontListItem );
diff --git a/svtools/source/control/ctrltool.cxx b/svtools/source/control/ctrltool.cxx
index 282462e96188..9d806cf71888 100644
--- a/svtools/source/control/ctrltool.cxx
+++ b/svtools/source/control/ctrltool.cxx
@@ -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[] =
@@ -250,6 +251,12 @@ void FontList::ImplInsertFonts( OutputDevice* pDevice, bool bAll,
// inquire all fonts from the device
int n = pDevice->GetDevFontCount();
+ if (n == 0 && comphelper::LibreOfficeKit::isActive())
+ {
+ pDevice->RefreshFontData(true);
+ n = pDevice->GetDevFontCount();
+ }
+
sal_uInt16 i;
for( i = 0; i < n; i++ )
{
diff --git a/vcl/source/outdev/font.cxx b/vcl/source/outdev/font.cxx
index a7c8b3a41bf2..edc7cfce3109 100644
--- a/vcl/source/outdev/font.cxx
+++ b/vcl/source/outdev/font.cxx
@@ -568,6 +568,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 )