summaryrefslogtreecommitdiff
path: root/vcl/headless
diff options
context:
space:
mode:
authorJan-Marek Glogowski <glogow@fbihome.de>2022-01-13 21:04:19 +0100
committerJan-Marek Glogowski <glogow@fbihome.de>2022-01-14 16:13:04 +0100
commit7d990aafdc363b2a12b5db78637d7f3bef7780bd (patch)
tree3d32337824b6003769318510822110ba09351b9d /vcl/headless
parent4bdf28b404f90236d93ce207671f755a71f28496 (diff)
VCL drop m_pInstance from *nix SalData
AKA the "*nix SalData untangling" commit. The original plan was to get rid of vcl/inc/saldatabasic.hxx and even SalData for all the *nix backends. But after many backs and forths, reinspecting the code and imagining the resulting code, I decided against that plan. All these variants would have resulted in reinterpret_cast calls, I wanted to prevent. And they would have required larger renames for no benefit. An other, related idea was to include all SalData implementations in the vcl/inc/svdata.hxx header, but that seemed like an include explosion, so was also dropped. I tried to untangling iOS from using GenericUnixSalData, as it doesn't use any of it's features. The new, minimal SalData should be sufficient. I'm leaving the easier drop of mpInstance from the Windows and MacOSX backend as a minimal interesting EasyHack. Change-Id: I5be01c1f42131a7e31cb30899392308e1e2de53b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128402 Tested-by: Jenkins Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
Diffstat (limited to 'vcl/headless')
-rw-r--r--vcl/headless/headlessinst.cxx11
-rw-r--r--vcl/headless/svpdata.cxx2
-rw-r--r--vcl/headless/svpinst.cxx7
-rw-r--r--vcl/headless/svpprn.cxx2
4 files changed, 6 insertions, 16 deletions
diff --git a/vcl/headless/headlessinst.cxx b/vcl/headless/headlessinst.cxx
index c2458756ba24..a1fa7a78b217 100644
--- a/vcl/headless/headlessinst.cxx
+++ b/vcl/headless/headlessinst.cxx
@@ -66,20 +66,11 @@ const OUString& SalGetDesktopEnvironment()
return aEnv;
}
-SalData::SalData()
- : m_pInstance(nullptr)
-{
-}
-
-SalData::~SalData()
-{
-}
-
// This is our main entry point:
SalInstance *CreateSalInstance()
{
HeadlessSalInstance* pInstance = new HeadlessSalInstance(std::make_unique<SvpSalYieldMutex>());
- new SvpSalData(pInstance);
+ new SvpSalData();
pInstance->AcquireYieldMutex();
return pInstance;
}
diff --git a/vcl/headless/svpdata.cxx b/vcl/headless/svpdata.cxx
index ab9fa5e22f0a..a5d17b007115 100644
--- a/vcl/headless/svpdata.cxx
+++ b/vcl/headless/svpdata.cxx
@@ -14,7 +14,7 @@
SalInstance* svp_create_SalInstance()
{
SvpSalInstance* pInstance = new SvpSalInstance( std::make_unique<SvpSalYieldMutex>() );
- new SvpSalData( pInstance );
+ new SvpSalData();
return pInstance;
}
diff --git a/vcl/headless/svpinst.cxx b/vcl/headless/svpinst.cxx
index 181e01782214..bf53dc24faf3 100644
--- a/vcl/headless/svpinst.cxx
+++ b/vcl/headless/svpinst.cxx
@@ -52,7 +52,6 @@
#include <salframe.hxx>
#include <svdata.hxx>
-#include <unx/gendata.hxx>
// FIXME: remove when we re-work the svp mainloop
#include <unx/salunxtime.h>
#include <comphelper/lok.hxx>
@@ -339,7 +338,7 @@ SvpSalYieldMutex::~SvpSalYieldMutex()
void SvpSalYieldMutex::doAcquire(sal_uInt32 const nLockCount)
{
- SvpSalInstance *const pInst = static_cast<SvpSalInstance *>(GetSalData()->m_pInstance);
+ auto *const pInst = static_cast<SvpSalInstance*>(GetSalInstance());
if (pInst && pInst->IsMainThread())
{
if (m_bNoYieldLock)
@@ -386,7 +385,7 @@ void SvpSalYieldMutex::doAcquire(sal_uInt32 const nLockCount)
sal_uInt32 SvpSalYieldMutex::doRelease(bool const bUnlockAll)
{
- SvpSalInstance *const pInst = static_cast<SvpSalInstance *>(GetSalData()->m_pInstance);
+ auto *const pInst = static_cast<SvpSalInstance*>(GetSalInstance());
if (pInst && pInst->IsMainThread())
{
if (m_bNoYieldLock)
@@ -420,7 +419,7 @@ sal_uInt32 SvpSalYieldMutex::doRelease(bool const bUnlockAll)
bool SvpSalYieldMutex::IsCurrentThread() const
{
- if (GetSalData()->m_pInstance->IsMainThread() && m_bNoYieldLock)
+ if (GetSalInstance()->IsMainThread() && m_bNoYieldLock)
return true;
else
return SalYieldMutex::IsCurrentThread();
diff --git a/vcl/headless/svpprn.cxx b/vcl/headless/svpprn.cxx
index c50a01023824..a6b448af68d4 100644
--- a/vcl/headless/svpprn.cxx
+++ b/vcl/headless/svpprn.cxx
@@ -29,7 +29,7 @@
#include <jobset.h>
#include <print.h>
#include <salptype.hxx>
-#include <saldatabasic.hxx>
+#include <svdata.hxx>
#include <unx/genpspgraphics.h>