From 78bbb58df9158159ef4390ba135abe3e235de905 Mon Sep 17 00:00:00 2001
From: Jan Nieuwenhuizen <janneke@gnu.org>
Date: Mon, 9 Jun 2008 14:34:56 +0200
Subject: [PATCH] Pass set argument to layout::TabPage. Fixes OO.o integration crasher.

---
 sc/source/ui/dbgui/tpsort.cxx        |    2 +-
 toolkit/inc/layout/layout.hxx        |   12 ++++++------
 toolkit/source/vclcompat/wrapper.cxx |   12 ++++++++----
 toolkit/workben/layout/tpsort.cxx    |    2 +-
 4 files changed, 16 insertions(+), 12 deletions(-)

diff --git a/sc/source/ui/dbgui/tpsort.cxx b/sc/source/ui/dbgui/tpsort.cxx
index 491014f..f3f7e64 100644
--- a/sc/source/ui/dbgui/tpsort.cxx
+++ b/sc/source/ui/dbgui/tpsort.cxx
@@ -542,7 +542,7 @@ IMPL_LINK( ScTabPageSortFields, SelectHdl, ListBox *, pLb )
 #undef ScResId
 #define ScResId(x) #x
 #undef SfxTabPage
-#define SfxTabPage( parent, id, args ) TabPage( parent, "sort-options.xml", id )
+#define SfxTabPage( parent, id, args ) TabPage( parent, "sort-options.xml", id, 0, &args )
 #endif /* ENABLE_LAYOUT */
 
 ScTabPageSortOptions::ScTabPageSortOptions( Window* 			pParent,
diff --git a/toolkit/inc/layout/layout.hxx b/toolkit/inc/layout/layout.hxx
index fe954e8..d231f54 100644
--- a/toolkit/inc/layout/layout.hxx
+++ b/toolkit/inc/layout/layout.hxx
@@ -466,8 +466,8 @@ class TOOLKIT_DLLPUBLIC TabPage : public Context, public Window
 public:
     static ::Window* global_parent;
     
-    TabPage( Window *pOptParent, char const* pXMLPath, char const* pId, sal_uInt32 nId = 0 );
-    TabPage( ::Window *pOptParent, char const* pXMLPath, char const* pId, sal_uInt32 nId = 0 );
+    TabPage( Window *pOptParent, char const* pXMLPath, char const* pId, sal_uInt32 nId = 0, SfxItemSet const* set = 0 );
+    TabPage( ::Window *pOptParent, char const* pXMLPath, char const* pId, sal_uInt32 nId = 0, SfxItemSet const* set = 0 );
     //DECL_GET_WINDOW( TabPage );
     ::TabPage* GetTabPage();
     virtual void ActivatePage();
@@ -479,16 +479,16 @@ public:
 class TOOLKIT_DLLPUBLIC SfxTabPage : public TabPage
 {
 public:
-    SfxTabPage( Window *pOptParent, char const* pXMLPath, char const* pId, sal_uInt32 nId = 0 );
-    SfxTabPage( ::Window *pOptParent, char const* pXMLPath, char const* pId, sal_uInt32 nId = 0 );
+    SfxTabPage( Window *pOptParent, char const* pXMLPath, char const* pId, sal_uInt32 nId = 0, SfxItemSet const* set = 0 );
+    SfxTabPage( ::Window *pOptParent, char const* pXMLPath, char const* pId, sal_uInt32 nId = 0, SfxItemSet const* set = 0 );
 #endif
     // SfxTabPage...
     enum PageAction { KEEP_PAGE, LEAVE_PAGE, REFRESH_SET };
 
     bool bHasExchangeSupport;
     bool HasExchangeSupport() { return bHasExchangeSupport; }
-    SfxItemSet *pSet;
-    SfxItemSet& GetItemSet() const { return *pSet; }
+    SfxItemSet const* pSet;
+    SfxItemSet const& GetItemSet() const { return *pSet; }
     virtual void Reset( SfxItemSet const& r );
     void SetExchangeSupport( bool exchangeSupport = true ) { bHasExchangeSupport = exchangeSupport; }
     //static const SfxPoolItem* GetItem( const SfxItemSet& rSet, USHORT nSlot );
diff --git a/toolkit/source/vclcompat/wrapper.cxx b/toolkit/source/vclcompat/wrapper.cxx
index 0b02790..b0e8418 100644
--- a/toolkit/source/vclcompat/wrapper.cxx
+++ b/toolkit/source/vclcompat/wrapper.cxx
@@ -443,19 +443,21 @@ public:
 
 IMPL_GET_IMPL( TabPage )
 
-TabPage::TabPage( Window *pParent, const char *pXMLPath, const char *pId, sal_uInt32 nId )
+TabPage::TabPage( Window *pParent, const char *pXMLPath, const char *pId, sal_uInt32 nId, SfxItemSet const* set )
     : Context( pXMLPath )
     , Window( new TabPageImpl( this, Context::GetPeerHandle( pId, nId ), this ) )
     , bHasExchangeSupport( false )
+    , pSet( set )
 {
     if ( pParent )
         SetParent( pParent );
 }
 
-TabPage::TabPage( ::Window *pParent, const char *pXMLPath, const char *pId, sal_uInt32 nId )
+TabPage::TabPage( ::Window *pParent, const char *pXMLPath, const char *pId, sal_uInt32 nId, SfxItemSet const* set )
     : Context( pXMLPath )
     , Window( new TabPageImpl( this, Context::GetPeerHandle( pId, nId ), this ) )
     , bHasExchangeSupport( false )
+    , pSet( set )
 {
     if ( pParent )
         SetParent( pParent );
@@ -472,12 +474,14 @@ void TabPage::DeactivatePage()
 }
 
 #if 0
-SfxTabPage::SfxTabPage( Window *pParent, const char *pXMLPath, const char *pId, sal_uInt32 nId )
+SfxTabPage::SfxTabPage( Window *pParent, const char *pXMLPath, const char *pId, sal_uInt32 nId, SfxItemSet const* set )
     : TabPage( pParent, pXMLPath, pId, nId )
+    , bHasExchangeSupport( false )
+    , pSet( set )
 {
 }
 
-SfxTabPage::SfxTabPage( ::Window *pParent, const char *pXMLPath, const char *pId, sal_uInt32 nId )
+SfxTabPage::SfxTabPage( ::Window *pParent, const char *pXMLPath, const char *pId, sal_uInt32 nId, SfxItemSet const* set )
     : TabPage( pParent, pXMLPath, pId, nId )
 {
 }
diff --git a/toolkit/workben/layout/tpsort.cxx b/toolkit/workben/layout/tpsort.cxx
index 7faeec6..9468c5d 100644
--- a/toolkit/workben/layout/tpsort.cxx
+++ b/toolkit/workben/layout/tpsort.cxx
@@ -554,7 +554,7 @@ IMPL_LINK( ScTabPageSortFields, SelectHdl, ListBox *, pLb )
 #undef ScResId
 #define ScResId(x) #x
 #undef SfxTabPage
-#define SfxTabPage( parent, id, args ) TabPage( parent, "sort-options.xml", id )
+#define SfxTabPage( parent, id, args ) TabPage( parent, "sort-options.xml", id, 0, &args )
 #endif /* ENABLE_LAYOUT */
 
 ScTabPageSortOptions::ScTabPageSortOptions( Window* 			pParent,
-- 
1.5.6.3.317.g5d44c9.dirty


