summaryrefslogtreecommitdiff
path: root/vcl/unx/generic/fontmanager/fontmanager.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'vcl/unx/generic/fontmanager/fontmanager.cxx')
-rw-r--r--vcl/unx/generic/fontmanager/fontmanager.cxx24
1 files changed, 18 insertions, 6 deletions
diff --git a/vcl/unx/generic/fontmanager/fontmanager.cxx b/vcl/unx/generic/fontmanager/fontmanager.cxx
index 6726deeefb90..c7ff4c1f5e45 100644
--- a/vcl/unx/generic/fontmanager/fontmanager.cxx
+++ b/vcl/unx/generic/fontmanager/fontmanager.cxx
@@ -30,6 +30,7 @@
#include "impfontcharmap.hxx"
#include "svdata.hxx"
#include "unx/geninst.h"
+#include "unx/gendata.hxx"
#include <vcl/strhelper.hxx>
#include <vcl/ppdparser.hxx>
#include <vcl/embeddedfontshelper.hxx>
@@ -111,19 +112,30 @@ PrintFontManager::PrintFont::PrintFont()
{
}
+GenericUnixSalData::GenericUnixSalData(GenericUnixSalDataType const t, SalInstance *const pInstance)
+ : m_eType(t), m_pDisplay(nullptr), m_pPrintFontManager(nullptr)
+{
+ m_pInstance = pInstance; SetSalData(this);
+}
+
+GenericUnixSalData::~GenericUnixSalData()
+{
+}
+
/*
* one instance only
*/
PrintFontManager& PrintFontManager::get()
{
- static PrintFontManager* pManager = nullptr;
- if( ! pManager )
+ GenericUnixSalData *const pSalData(GetGenericUnixSalData());
+ assert(pSalData);
+
+ if (!pSalData->m_pPrintFontManager)
{
- static PrintFontManager theManager;
- pManager = &theManager;
- pManager->initialize();
+ pSalData->m_pPrintFontManager.reset( new PrintFontManager );
+ pSalData->m_pPrintFontManager->initialize();
}
- return *pManager;
+ return *pSalData->m_pPrintFontManager;
}
/*