[Libreoffice-commits] .: vcl/inc vcl/unx
Stephan Bergmann
sbergmann at kemper.freedesktop.org
Wed Oct 26 03:58:42 PDT 2011
vcl/inc/aqua/saldata.hxx | 6 +++---
vcl/inc/ios/saldata.hxx | 6 +++---
vcl/inc/saldatabasic.hxx | 4 ++--
vcl/inc/svdata.hxx | 3 ++-
vcl/inc/unx/saldata.hxx | 2 ++
vcl/inc/win/saldata.hxx | 6 +++---
vcl/unx/generic/app/saldata.cxx | 8 ++++++--
vcl/unx/generic/app/saldisp.cxx | 7 +------
8 files changed, 22 insertions(+), 20 deletions(-)
New commits:
commit 273a15e4903e6ea21de77c238ab769361f2fc84f
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Wed Oct 26 12:54:24 2011 +0200
Clean up ImplSVData::mpSalData.
soffice currently fails upon start up at least in GTK case due to
vcl/unx/generic/app/saldisp.cxx SalDisplay ctor calling GetX11SalData()
when the data is actually of type SalGenericData instead.
diff --git a/vcl/inc/aqua/saldata.hxx b/vcl/inc/aqua/saldata.hxx
index 5c6fb32..5b75b92 100644
--- a/vcl/inc/aqua/saldata.hxx
+++ b/vcl/inc/aqua/saldata.hxx
@@ -127,9 +127,9 @@ struct SalData
static NSStatusItem* getStatusItem();
};
-inline void SetSalData( SalData* pData ) { ImplGetSVData()->mpSalData = (void*)pData; }
-inline SalData *GetSalData() { return (SalData*)ImplGetSVData()->mpSalData; }
-inline SalData *GetAppSalData() { return (SalData*)ImplGetAppSVData()->mpSalData; }
+inline void SetSalData( SalData* pData ) { ImplGetSVData()->mpSalData = pData; }
+inline SalData *GetSalData() { return ImplGetSVData()->mpSalData; }
+inline SalData *GetAppSalData() { return ImplGetAppSVData()->mpSalData; }
// --- Prototypes ---
diff --git a/vcl/inc/ios/saldata.hxx b/vcl/inc/ios/saldata.hxx
index 764264e..73a7081 100644
--- a/vcl/inc/ios/saldata.hxx
+++ b/vcl/inc/ios/saldata.hxx
@@ -111,9 +111,9 @@ struct SalData
static void drainThreadAutoreleasePool();
};
-inline void SetSalData( SalData* pData ) { ImplGetSVData()->mpSalData = (void*)pData; }
-inline SalData *GetSalData() { return (SalData*)ImplGetSVData()->mpSalData; }
-inline SalData *GetAppSalData() { return (SalData*)ImplGetAppSVData()->mpSalData; }
+inline void SetSalData( SalData* pData ) { ImplGetSVData()->mpSalData = pData; }
+inline SalData *GetSalData() { return ImplGetSVData()->mpSalData; }
+inline SalData *GetAppSalData() { return ImplGetAppSVData()->mpSalData; }
// --- Prototypes ---
diff --git a/vcl/inc/saldatabasic.hxx b/vcl/inc/saldatabasic.hxx
index dc040eb..06b785f 100644
--- a/vcl/inc/saldatabasic.hxx
+++ b/vcl/inc/saldatabasic.hxx
@@ -53,10 +53,10 @@ public:
// -=-= inlines =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
inline void SetSalData( SalData* pData )
-{ ImplGetSVData()->mpSalData = (void*)pData; }
+{ ImplGetSVData()->mpSalData = pData; }
inline SalData* GetSalData()
-{ return (SalData*)ImplGetSVData()->mpSalData; }
+{ return ImplGetSVData()->mpSalData; }
#endif
diff --git a/vcl/inc/svdata.hxx b/vcl/inc/svdata.hxx
index c27636c..e0a17d0 100644
--- a/vcl/inc/svdata.hxx
+++ b/vcl/inc/svdata.hxx
@@ -114,6 +114,7 @@ class SalTimer;
class SalI18NImeStatus;
class DockingManager;
class VclEventListeners2;
+class SalData;
namespace vcl { class DisplayConnection; class SettingsConfigItem; class DeleteOnDeinitBase; }
namespace utl { class DefaultFontConfiguration; class FontSubstConfiguration; }
@@ -332,7 +333,7 @@ struct ImplSVNWFData
struct ImplSVData
{
- void* mpSalData; // SalData
+ SalData* mpSalData;
SalInstance* mpDefInst; // Default SalInstance
Application* mpApp; // pApp
WorkWindow* mpDefaultWin; // Default-Window
diff --git a/vcl/inc/unx/saldata.hxx b/vcl/inc/unx/saldata.hxx
index 9c49014..591f4f6 100644
--- a/vcl/inc/unx/saldata.hxx
+++ b/vcl/inc/unx/saldata.hxx
@@ -109,6 +109,8 @@ public:
void PopXErrorLevel();
};
+X11SalData* GetX11SalData();
+
#endif // _SV_SALDATA_HXX
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/inc/win/saldata.hxx b/vcl/inc/win/saldata.hxx
index 1126869..9a097ee 100644
--- a/vcl/inc/win/saldata.hxx
+++ b/vcl/inc/win/saldata.hxx
@@ -147,9 +147,9 @@ public:
DwmIsCompositionEnabled_ptr mpDwmIsCompositionEnabled;
};
-inline void SetSalData( SalData* pData ) { ImplGetSVData()->mpSalData = (void*)pData; }
-inline SalData* GetSalData() { return (SalData*)ImplGetSVData()->mpSalData; }
-inline SalData* GetAppSalData() { return (SalData*)ImplGetAppSVData()->mpSalData; }
+inline void SetSalData( SalData* pData ) { ImplGetSVData()->mpSalData = pData; }
+inline SalData* GetSalData() { return ImplGetSVData()->mpSalData; }
+inline SalData* GetAppSalData() { return ImplGetAppSVData()->mpSalData; }
// --------------
// - SalShlData -
diff --git a/vcl/unx/generic/app/saldata.cxx b/vcl/unx/generic/app/saldata.cxx
index 1164a4e..8eb6602 100644
--- a/vcl/unx/generic/app/saldata.cxx
+++ b/vcl/unx/generic/app/saldata.cxx
@@ -91,9 +91,13 @@
#endif
#endif
-inline X11SalData* GetX11SalData()
+X11SalData* GetX11SalData()
{
- return (X11SalData*)ImplGetSVData()->mpSalData;
+ SalData * p1 = ImplGetSVData()->mpSalData;
+ OSL_ASSERT(p1 != 0);
+ X11SalData * p2 = dynamic_cast< X11SalData * >(p1);
+ OSL_ASSERT(p2 != 0);
+ return p2;
}
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
diff --git a/vcl/unx/generic/app/saldisp.cxx b/vcl/unx/generic/app/saldisp.cxx
index 004b3fc..515f433 100644
--- a/vcl/unx/generic/app/saldisp.cxx
+++ b/vcl/unx/generic/app/saldisp.cxx
@@ -113,11 +113,6 @@ using ::rtl::OUString;
#define SALCOLOR_WHITE MAKE_SALCOLOR( 0xFF, 0xFF, 0xFF )
#define SALCOLOR_BLACK MAKE_SALCOLOR( 0x00, 0x00, 0x00 )
-inline X11SalData* GetX11SalData()
-{
- return (X11SalData*)ImplGetSVData()->mpSalData;
-}
-
// -=-= Prototyps =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
// -=-= static variables -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
@@ -504,7 +499,7 @@ SalDisplay::SalDisplay( Display *display ) :
DBG_ASSERT( ! pData->GetDisplay(), "Second SalDisplay created !!!\n" );
pData->SetDisplay( this );
- pXLib_ = ((X11SalData *)ImplGetSVData()->mpSalData)->GetLib();
+ pXLib_ = GetX11SalData()->GetLib();
m_nDefaultScreen = DefaultScreen( pDisp_ );
}
More information about the Libreoffice-commits
mailing list