[Libreoffice-commits] core.git: vcl/android vcl/headless vcl/inc vcl/ios vcl/qt5 vcl/unx
Jan-Marek Glogowski (via logerrit)
logerrit at kemper.freedesktop.org
Fri Jul 2 21:51:32 UTC 2021
vcl/android/androidinst.cxx | 2 +-
vcl/headless/headlessinst.cxx | 2 +-
vcl/headless/svpdata.cxx | 2 +-
vcl/inc/unx/gendata.hxx | 18 +-----------------
vcl/inc/unx/saldata.hxx | 2 +-
vcl/inc/unx/saldisp.hxx | 1 -
vcl/ios/dummies.cxx | 5 ++---
vcl/ios/iosinst.cxx | 2 +-
vcl/qt5/Qt5Data.cxx | 2 +-
vcl/unx/generic/app/gendata.cxx | 5 ++---
vcl/unx/generic/app/saldata.cxx | 10 +++-------
vcl/unx/generic/app/salinst.cxx | 2 +-
vcl/unx/gtk3/gtkdata.cxx | 2 +-
13 files changed, 16 insertions(+), 39 deletions(-)
New commits:
commit 00d0d8f58cefb76bf9a8867228af1d6c9a9a5ad3
Author: Jan-Marek Glogowski <glogow at fbihome.de>
AuthorDate: Fri Jul 2 12:23:23 2021 +0200
Commit: Jan-Marek Glogowski <glogow at fbihome.de>
CommitDate: Fri Jul 2 23:50:56 2021 +0200
vcl: drop GenericUnixSalDataType
It's just used for a singke assert and SalData is generally just
used as a static cast.
Change-Id: I8d74e82e511413d940a3f200f022a9204e588cd7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118288
Tested-by: Jenkins
Reviewed-by: Jan-Marek Glogowski <glogow at fbihome.de>
diff --git a/vcl/android/androidinst.cxx b/vcl/android/androidinst.cxx
index 8febcd23a729..dd8a76dce9d6 100644
--- a/vcl/android/androidinst.cxx
+++ b/vcl/android/androidinst.cxx
@@ -29,7 +29,7 @@ static int viewWidth = 1, viewHeight = 1;
class AndroidSalData : public GenericUnixSalData
{
public:
- explicit AndroidSalData( SalInstance *pInstance ) : GenericUnixSalData( SAL_DATA_ANDROID, pInstance ) {}
+ explicit AndroidSalData(SalInstance *pInstance) : GenericUnixSalData(pInstance) {}
virtual void ErrorTrapPush() {}
virtual bool ErrorTrapPop( bool ) { return false; }
};
diff --git a/vcl/headless/headlessinst.cxx b/vcl/headless/headlessinst.cxx
index a644613eeaf2..913403041e2f 100644
--- a/vcl/headless/headlessinst.cxx
+++ b/vcl/headless/headlessinst.cxx
@@ -48,7 +48,7 @@ SalSystem *HeadlessSalInstance::CreateSalSystem()
class HeadlessSalData : public GenericUnixSalData
{
public:
- explicit HeadlessSalData( SalInstance *pInstance ) : GenericUnixSalData( SAL_DATA_HEADLESS, pInstance ) {}
+ explicit HeadlessSalData(SalInstance *pInstance) : GenericUnixSalData(pInstance) {}
virtual void ErrorTrapPush() override {}
virtual bool ErrorTrapPop( bool ) override { return false; }
};
diff --git a/vcl/headless/svpdata.cxx b/vcl/headless/svpdata.cxx
index 4ac909c67c1f..f30f0f5728c8 100644
--- a/vcl/headless/svpdata.cxx
+++ b/vcl/headless/svpdata.cxx
@@ -15,7 +15,7 @@ namespace {
class SvpSalData : public GenericUnixSalData
{
public:
- explicit SvpSalData( SalInstance *pInstance ) : GenericUnixSalData( SAL_DATA_SVP, pInstance ) {}
+ explicit SvpSalData(SalInstance *pInstance) : GenericUnixSalData(pInstance) {}
virtual void ErrorTrapPush() override {}
virtual bool ErrorTrapPop( bool /*bIgnoreError*/ = true ) override { return false; }
};
diff --git a/vcl/inc/unx/gendata.hxx b/vcl/inc/unx/gendata.hxx
index f06dda35cb2e..f20281ff0602 100644
--- a/vcl/inc/unx/gendata.hxx
+++ b/vcl/inc/unx/gendata.hxx
@@ -23,23 +23,9 @@ namespace psp
class PrintFontManager;
}
-enum GenericUnixSalDataType
-{
- SAL_DATA_GTK,
- SAL_DATA_GTK3,
- SAL_DATA_KF5,
- SAL_DATA_UNX,
- SAL_DATA_SVP,
- SAL_DATA_ANDROID,
- SAL_DATA_IOS,
- SAL_DATA_HEADLESS,
- SAL_DATA_QT5
-};
-
class VCL_DLLPUBLIC GenericUnixSalData : public SalData
{
private:
- GenericUnixSalDataType m_eType;
SalGenericDisplay* m_pDisplay;
// cached hostname to avoid slow lookup
OUString m_aHostname;
@@ -53,7 +39,7 @@ private:
void InitPrintFontManager();
public:
- GenericUnixSalData(GenericUnixSalDataType const t, SalInstance* const pInstance);
+ GenericUnixSalData(SalInstance* const pInstance);
virtual ~GenericUnixSalData() override;
virtual void Dispose() {}
@@ -69,8 +55,6 @@ public:
OUString& GetUnicodeCommand() { return m_aUnicodeEntry; }
- GenericUnixSalDataType GetType() const { return m_eType; }
-
FreetypeManager* GetFreetypeManager()
{
if (!m_pFreetypeManager)
diff --git a/vcl/inc/unx/saldata.hxx b/vcl/inc/unx/saldata.hxx
index de66ace37def..f5819403ba63 100644
--- a/vcl/inc/unx/saldata.hxx
+++ b/vcl/inc/unx/saldata.hxx
@@ -44,7 +44,7 @@ class X11SalData final : public GenericUnixSalData
std::unique_ptr<SalXLib> pXLib_;
public:
- X11SalData( GenericUnixSalDataType t, SalInstance *pInstance );
+ X11SalData(SalInstance *pInstance);
virtual ~X11SalData() override;
virtual void Init();
diff --git a/vcl/inc/unx/saldisp.hxx b/vcl/inc/unx/saldisp.hxx
index 591423df7683..59d02f394da0 100644
--- a/vcl/inc/unx/saldisp.hxx
+++ b/vcl/inc/unx/saldisp.hxx
@@ -417,7 +417,6 @@ namespace vcl_sal {
inline SalDisplay *getSalDisplay(GenericUnixSalData const * data)
{
assert(data != nullptr);
- assert(data->GetType() != SAL_DATA_GTK3);
return static_cast<SalDisplay *>(data->GetDisplay());
}
}
diff --git a/vcl/ios/dummies.cxx b/vcl/ios/dummies.cxx
index 135a534243fd..340fefce26a2 100644
--- a/vcl/ios/dummies.cxx
+++ b/vcl/ios/dummies.cxx
@@ -112,9 +112,8 @@ void SalGenericInstance::jobEndedPrinterUpdate()
using namespace psp;
-GenericUnixSalData::GenericUnixSalData(GenericUnixSalDataType const t, SalInstance *const pInstance)
- : m_eType(t)
- , m_pDisplay(nullptr)
+GenericUnixSalData::GenericUnixSalData(SalInstance *const pInstance)
+ : m_pDisplay(nullptr)
, m_pFreetypeManager(new FreetypeManager)
, m_pPrintFontManager(nullptr)
{
diff --git a/vcl/ios/iosinst.cxx b/vcl/ios/iosinst.cxx
index 65963ef9c099..2eff5234de2b 100644
--- a/vcl/ios/iosinst.cxx
+++ b/vcl/ios/iosinst.cxx
@@ -35,7 +35,7 @@ class IosSalData : public GenericUnixSalData
{
public:
explicit IosSalData(SalInstance *pInstance)
- : GenericUnixSalData(SAL_DATA_IOS, pInstance)
+ : GenericUnixSalData(pInstance)
{
}
virtual void ErrorTrapPush() {}
diff --git a/vcl/qt5/Qt5Data.cxx b/vcl/qt5/Qt5Data.cxx
index 45e71765bac1..85efaefc1893 100644
--- a/vcl/qt5/Qt5Data.cxx
+++ b/vcl/qt5/Qt5Data.cxx
@@ -156,7 +156,7 @@
#include <unx/glyphcache.hxx>
Qt5Data::Qt5Data(SalInstance* pInstance)
- : GenericUnixSalData(SAL_DATA_QT5, pInstance)
+ : GenericUnixSalData(pInstance)
{
ImplSVData* pSVData = ImplGetSVData();
diff --git a/vcl/unx/generic/app/gendata.cxx b/vcl/unx/generic/app/gendata.cxx
index 500d3b13331e..39dbc6224e5a 100644
--- a/vcl/unx/generic/app/gendata.cxx
+++ b/vcl/unx/generic/app/gendata.cxx
@@ -22,9 +22,8 @@
#include <unx/fontmanager.hxx>
#include <unx/glyphcache.hxx>
-GenericUnixSalData::GenericUnixSalData(GenericUnixSalDataType const t, SalInstance* const pInstance)
- : m_eType(t)
- , m_pDisplay(nullptr)
+GenericUnixSalData::GenericUnixSalData(SalInstance* const pInstance)
+ : m_pDisplay(nullptr)
{
m_pInstance = pInstance;
SetSalData(this);
diff --git a/vcl/unx/generic/app/saldata.cxx b/vcl/unx/generic/app/saldata.cxx
index c5a97ee4d5cd..25efc5529b28 100644
--- a/vcl/unx/generic/app/saldata.cxx
+++ b/vcl/unx/generic/app/saldata.cxx
@@ -57,11 +57,7 @@
X11SalData* GetX11SalData()
{
- SalData * p1 = ImplGetSVData()->mpSalData;
- OSL_ASSERT(p1 != nullptr);
- X11SalData * p2 = dynamic_cast< X11SalData * >(p1);
- OSL_ASSERT(p2 != nullptr);
- return p2;
+ return static_cast<X11SalData*>(ImplGetSVData()->mpSalData);
}
extern "C" {
@@ -236,8 +232,8 @@ static const char* XRequest[] = {
"X_NoOperation"
};
-X11SalData::X11SalData( GenericUnixSalDataType t, SalInstance *pInstance )
- : GenericUnixSalData( t, pInstance )
+X11SalData::X11SalData(SalInstance *pInstance)
+ : GenericUnixSalData(pInstance)
{
pXLib_ = nullptr;
diff --git a/vcl/unx/generic/app/salinst.cxx b/vcl/unx/generic/app/salinst.cxx
index 21d878cfa612..dc53368e3e6e 100644
--- a/vcl/unx/generic/app/salinst.cxx
+++ b/vcl/unx/generic/app/salinst.cxx
@@ -57,7 +57,7 @@ extern "C"
X11SalInstance* pInstance = new X11SalInstance( std::make_unique<SalYieldMutex>() );
// initialize SalData
- X11SalData *pSalData = new X11SalData( SAL_DATA_UNX, pInstance );
+ X11SalData *pSalData = new X11SalData(pInstance);
pSalData->Init();
pInstance->SetLib( pSalData->GetLib() );
diff --git a/vcl/unx/gtk3/gtkdata.cxx b/vcl/unx/gtk3/gtkdata.cxx
index 426a27219bf2..d4f3622337d5 100644
--- a/vcl/unx/gtk3/gtkdata.cxx
+++ b/vcl/unx/gtk3/gtkdata.cxx
@@ -330,7 +330,7 @@ int GtkSalDisplay::CaptureMouse( SalFrame* pSFrame )
**********************************************************************/
GtkSalData::GtkSalData( SalInstance *pInstance )
- : GenericUnixSalData( SAL_DATA_GTK3, pInstance )
+ : GenericUnixSalData(pInstance)
, m_aDispatchMutex()
, m_aDispatchCondition()
{
More information about the Libreoffice-commits
mailing list