update ooo310-m15
[ooovba.git] / applied_patches / 0637-layout-simple-dialogs-sfx2.diff
blob757b0ef7b875929b9ae9d0ed5c34600d21699cbd
1 diff --git a/sfx2/inc/sfx2/layout-post.hxx b/sfx2/inc/sfx2/layout-post.hxx
2 new file mode 100644
3 index 0000000..0eab118
4 --- /dev/null
5 +++ sfx2/inc/sfx2/layout-post.hxx
6 @@ -0,0 +1,44 @@
7 +/*************************************************************************
8 + *
9 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
10 + *
11 + * Copyright 2008 by Sun Microsystems, Inc.
12 + *
13 + * OpenOffice.org - a multi-platform office productivity suite
14 + *
15 + * $RCSfile$
16 + *
17 + * $Revision$
18 + *
19 + * This file is part of OpenOffice.org.
20 + *
21 + * OpenOffice.org is free software: you can redistribute it and/or modify
22 + * it under the terms of the GNU Lesser General Public License version 3
23 + * only, as published by the Free Software Foundation.
24 + *
25 + * OpenOffice.org is distributed in the hope that it will be useful,
26 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
27 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
28 + * GNU Lesser General Public License version 3 for more details
29 + * (a copy is included in the LICENSE file that accompanied this code).
30 + *
31 + * You should have received a copy of the GNU Lesser General Public License
32 + * version 3 along with OpenOffice.org. If not, see
33 + * <http://www.openoffice.org/license.html>
34 + * for a copy of the LGPLv3 License.
35 + *
36 + ************************************************************************/
38 +#ifndef _SFX2_LAYOUT_POST_HXX
39 +#define _SFX2_LAYOUT_POST_HXX
41 +#include <layout/layout-post.hxx>
43 +#if ENABLE_LAYOUT
45 +/* Allow re-inclusion for cxx file. */
46 +#undef _SFX2_LAYOUT_PRE_HXX
48 +#endif /* ENABLE_LAYOUT */
50 +#endif /* _SFX2_LAYOUT_POST_HXX */
51 diff --git a/sfx2/inc/sfx2/layout-pre.hxx b/sfx2/inc/sfx2/layout-pre.hxx
52 new file mode 100644
53 index 0000000..bb8935c
54 --- /dev/null
55 +++ sfx2/inc/sfx2/layout-pre.hxx
56 @@ -0,0 +1,53 @@
57 +/*************************************************************************
58 + *
59 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
60 + *
61 + * Copyright 2008 by Sun Microsystems, Inc.
62 + *
63 + * OpenOffice.org - a multi-platform office productivity suite
64 + *
65 + * $RCSfile$
66 + *
67 + * $Revision$
68 + *
69 + * This file is part of OpenOffice.org.
70 + *
71 + * OpenOffice.org is free software: you can redistribute it and/or modify
72 + * it under the terms of the GNU Lesser General Public License version 3
73 + * only, as published by the Free Software Foundation.
74 + *
75 + * OpenOffice.org is distributed in the hope that it will be useful,
76 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
77 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
78 + * GNU Lesser General Public License version 3 for more details
79 + * (a copy is included in the LICENSE file that accompanied this code).
80 + *
81 + * You should have received a copy of the GNU Lesser General Public License
82 + * version 3 along with OpenOffice.org. If not, see
83 + * <http://www.openoffice.org/license.html>
84 + * for a copy of the LGPLv3 License.
85 + *
86 + ************************************************************************/
88 +#ifndef _SFX2_LAYOUT_PRE_HXX
89 +#define _SFX2_LAYOUT_PRE_HXX
91 +#include <layout/layout-pre.hxx>
93 +#if ENABLE_LAYOUT
95 +///* Allow re-inclusion for next hxx file. */
96 +#undef _SFX2_LAYOUT_POST_HXX
98 +#undef SfxDialog
99 +#undef SfxModalDialog
100 +#undef SfxModelessDialog
102 +#define SfxDialog layout::SfxDialog
104 +#define SfxModalDialog SfxDialog
105 +#define SfxModelessDialog SfxDialog
107 +#endif /* ENABLE_LAYOUT */
109 +#endif /* _SFX2_LAYOUT_PRE_HXX */
110 diff --git a/sfx2/inc/sfx2/layout-tabdlg.hxx b/sfx2/inc/sfx2/layout-tabdlg.hxx
111 new file mode 100644
112 index 0000000..4b84083
113 --- /dev/null
114 +++ sfx2/inc/sfx2/layout-tabdlg.hxx
115 @@ -0,0 +1,49 @@
116 +/*************************************************************************
118 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
119 + *
120 + * Copyright 2008 by Sun Microsystems, Inc.
122 + * OpenOffice.org - a multi-platform office productivity suite
124 + * $RCSfile: tabdlg.hxx,v $
125 + * $Revision: 1.4 $
127 + * This file is part of OpenOffice.org.
129 + * OpenOffice.org is free software: you can redistribute it and/or modify
130 + * it under the terms of the GNU Lesser General Public License version 3
131 + * only, as published by the Free Software Foundation.
133 + * OpenOffice.org is distributed in the hope that it will be useful,
134 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
135 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
136 + * GNU Lesser General Public License version 3 for more details
137 + * (a copy is included in the LICENSE file that accompanied this code).
139 + * You should have received a copy of the GNU Lesser General Public License
140 + * version 3 along with OpenOffice.org. If not, see
141 + * <http://www.openoffice.org/license.html>
142 + * for a copy of the LGPLv3 License.
144 + ************************************************************************/
145 +#ifndef _LAYOUT_SFX_TABDLG_HXX
146 +#define _LAYOUT_SFX_TABDLG_HXX
148 +#undef ENABLE_LAYOUT_SFX_TABDIALOG
149 +#define ENABLE_LAYOUT_SFX_TABDIALOG 1
151 +#undef NAMESPACE_LAYOUT_SFX_TABDIALOG
152 +#define NAMESPACE_LAYOUT_SFX_TABDIALOG namespace layout {
154 +#undef END_NAMESPACE_LAYOUT_SFX_TABDIALOG
155 +#define END_NAMESPACE_LAYOUT_SFX_TABDIALOG } //end namespace layout
157 +#undef LAYOUT_NS_SFX_TABDIALOG
158 +#define LAYOUT_NS_SFX_TABDIALOG layout::
160 +#undef _SFXTABDLG_HXX
161 +#include <sfx2/tabdlg.hxx>
163 +#endif /* _LAYOUT_SFX_TABDLG_HXX */
165 diff --git a/sfx2/inc/sfx2/layout.hxx b/sfx2/inc/sfx2/layout.hxx
166 new file mode 100644
167 index 0000000..1807213
168 --- /dev/null
169 +++ sfx2/inc/sfx2/layout.hxx
170 @@ -0,0 +1,79 @@
171 +/*************************************************************************
172 +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
174 +* Copyright 2008 by Sun Microsystems, Inc.
176 +* OpenOffice.org - a multi-platform office productivity suite
178 +* $RCSfile: code,v $
180 +* $Revision: 1.3 $
182 +* This file is part of OpenOffice.org.
184 +* OpenOffice.org is free software: you can redistribute it and/or modify
185 +* it under the terms of the GNU Lesser General Public License version 3
186 +* only, as published by the Free Software Foundation.
188 +* OpenOffice.org is distributed in the hope that it will be useful,
189 +* but WITHOUT ANY WARRANTY; without even the implied warranty of
190 +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
191 +* GNU Lesser General Public License version 3 for more details
192 +* (a copy is included in the LICENSE file that accompanied this code).
194 +* You should have received a copy of the GNU Lesser General Public License
195 +* version 3 along with OpenOffice.org. If not, see
196 +* <http://www.openoffice.org/license.html>
197 +* for a copy of the LGPLv3 License.
198 +************************************************************************/
200 +#ifndef _SFX2_LAYOUT_HXX
201 +#define _SFX2_LAYOUT_HXX
203 +#include <layout/layout.hxx>
204 +#include <sfx2/tabdlg.hxx>
205 +#undef ENABLE_LAYOUT_SFX_TABDIALOG
206 +#define ENABLE_LAYOUT_SFX_TABDIALOG 1
207 +#include <sfx2/layout-tabdlg.hxx>
209 +class SfxChildWindow;
211 +namespace layout
214 +namespace css = ::com::sun::star;
217 +class SFX2_DLLPUBLIC SfxDialog
218 + : public Dialog
220 +public:
221 + SfxDialog (::Window* parent, char const* xml_file, char const* id, SfxBindings* bindings=0, SfxChildWindow* child=0);
224 +#if 0
225 +class SFX2_DLLPUBLIC SfxTabDialog
226 + : public ::SfxTabDialog
227 + , public InPlug
229 +public:
230 + SfxTabDialog (::Window *parent, char const* xml_file, char const* id, ResId const& res_id, SfxItemSet const* set=0);
231 + ::Window* GetParent () const;
232 + void FreeResource ();
234 +#endif
236 +class SFX2_DLLPUBLIC SfxTabPage
237 + : public ::SfxTabPage
238 + , public InPlug
240 +public:
241 + SfxTabPage (::Window *parent, char const* xml_file, char const* id, SfxItemSet const* set=0);
242 + ::Window* GetParent () const;
243 + Size GetOptimalSize (WindowSizeType eType) const;
244 + void FreeResource ();
247 +} // end namespace layout
249 +#endif /* _SFX2_LAYOUT_HXX */
250 diff --git a/sfx2/inc/sfx2/sfxdlg.hxx b/sfx2/inc/sfx2/sfxdlg.hxx
251 index a13c5a8..9e47ca1 100644
252 --- sfx2/inc/sfx2/sfxdlg.hxx
253 +++ sfx2/inc/sfx2/sfxdlg.hxx
254 @@ -55,8 +55,9 @@ class SvObjectServerList;
255 class TransferableDataHelper;
256 struct TransferableObjectDescriptor;
258 -typedef SfxTabPage* (*CreateTabPage)(Window *pParent, const SfxItemSet &rAttrSet);
259 -typedef USHORT* (*GetTabPageRanges)();
260 +#include <sfx2/tabdlg.hxx>
261 +//typedef SfxTabPage* (*CreateTabPage)(Window *pParent, const SfxItemSet &rAttrSet);
262 +//typedef USHORT* (*GetTabPageRanges)();
264 namespace sfx2
266 diff --git a/sfx2/inc/sfx2/tabdlg.hxx b/sfx2/inc/sfx2/tabdlg.hxx
267 index b3eb789..b02bd15 100644
268 --- sfx2/inc/sfx2/tabdlg.hxx
269 +++ sfx2/inc/sfx2/tabdlg.hxx
270 @@ -34,17 +34,17 @@
271 #include "sfx2/dllapi.h"
272 #include "sal/types.h"
273 #include <vcl/tabdlg.hxx>
274 -#ifndef _SV_BUTTON_HXX //autogen
275 #include <vcl/button.hxx>
276 -#endif
277 #include <vcl/tabctrl.hxx>
278 #include <vcl/tabpage.hxx>
279 #include <svtools/itempool.hxx>
280 #include <svtools/itemset.hxx>
281 #include <com/sun/star/frame/XFrame.hpp>
283 -#include <map>
284 -namespace layout { class TabPage; }
285 +#if ENABLE_LAYOUT
286 +#include <layout/layout.hxx>
287 +namespace layout { class SfxTabDialog; }
288 +#endif /* ENABLE_LAYOUT */
290 class SfxPoolItem;
291 class SfxTabDialog;
292 @@ -52,21 +52,27 @@ class SfxViewFrame;
293 class SfxTabPage;
294 class SfxBindings;
296 -// typedefs --------------------------------------------------------------
297 +#ifndef ENABLE_LAYOUT_SFX_TABDIALOG
298 +#define ENABLE_LAYOUT_SFX_TABDIALOG 0
299 +#define NAMESPACE_LAYOUT_SFX_TABDIALOG
300 +#define END_NAMESPACE_LAYOUT_SFX_TABDIALOG
301 +#define LAYOUT_NS_SFX_TABDIALOG
302 +#endif /* !ENABLE_LAYOUT_SFX_TABDIALOG*/
304 typedef SfxTabPage* (*CreateTabPage)(Window *pParent, const SfxItemSet &rAttrSet);
305 -namespace layout
307 -class TabPage;
308 -typedef TabPage* (*CreateTabPage)(::Window *pParent, ::SfxItemSet const& set );
310 typedef USHORT* (*GetTabPageRanges)(); // liefert internationale Which-Wert
312 -struct TabDlg_Impl;
313 struct TabPageImpl;
314 class SfxUs_Impl;
316 -// class SfxTabDialog ----------------------------------------------------
317 +#if ENABLE_LAYOUT_SFX_TABDIALOG
318 +#include <layout/layout-pre.hxx>
319 +#undef SfxTabDialog
320 +#undef SfxTabPage
321 +#endif /* ENABLE_LAYOUT_SFX_TABDIALOG */
323 +NAMESPACE_LAYOUT_SFX_TABDIALOG
325 +class TabDlg_Impl;
327 #define ID_TABCONTROL 1
328 #define RET_USER 100
329 @@ -106,8 +112,6 @@ friend class SfxTabDialogController;
330 USHORT nAppPageId;
331 BOOL bItemsReset;
332 BOOL bFmt;
333 - std::map<int, layout::TabPage*> layoutPages;
334 - std::map<int, layout::CreateTabPage> layoutPageFuncs;
336 //#if 0 // _SOLAR__PRIVATE
337 DECL_DLLPRIVATE_LINK( ActivatePageHdl, TabControl * );
338 @@ -178,8 +182,6 @@ public:
339 BOOL bItemsOnDemand = FALSE,
340 USHORT nPos = TAB_APPEND);
342 - void AddTabPage( int id, layout::TabPage* page, bool=false );
343 - void AddTabPage( int id, layout::CreateTabPage, bool=false );
344 void RemoveTabPage( USHORT nId );
346 void SetCurPageId( USHORT nId ) { nAppPageId = nId; }
347 @@ -215,7 +217,11 @@ public:
348 void StartExecuteModal( const Link& rEndDialogHdl );
349 void Start( BOOL bShow = TRUE );
351 +#if !ENABLE_LAYOUT_SFX_TABDIALOG
352 const SfxItemSet* GetExampleSet() const { return pExampleSet; }
353 +#else /* ENABLE_LAYOUT_SFX_TABDIALOG */
354 + SfxItemSet* GetExampleSet() const { return 0; }
355 +#endif /* ENABLE_LAYOUT_SFX_TABDIALOG */
356 SfxViewFrame* GetViewFrame() const { return pFrame; }
358 void EnableApplyButton(BOOL bEnable = TRUE);
359 @@ -229,13 +235,20 @@ public:
360 //#endif
363 -// class SfxTabPage ------------------------------------------------------
364 +END_NAMESPACE_LAYOUT_SFX_TABDIALOG
366 +#if ENABLE_LAYOUT_SFX_TABDIALOG
367 +#include <layout/layout-post.hxx>
368 +#endif /* ENABLE_LAYOUT_SFX_TABDIALOG */
370 +#if !ENABLE_LAYOUT_SFX_TABDIALOG
372 namespace sfx { class ItemConnectionBase; }
374 class SFX2_DLLPUBLIC SfxTabPage: public TabPage
376 friend class SfxTabDialog;
377 +friend class layout::SfxTabDialog;
379 private:
380 const SfxItemSet* pSet;
381 @@ -300,5 +313,7 @@ public:
382 ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > GetFrame();
385 +#endif /* !ENABLE_LAYOUT_SFX_TABDIALOG */
387 #endif
389 diff --git a/sfx2/prj/build.lst b/sfx2/prj/build.lst
390 index d762a1d..72ba4ac 100644
391 --- sfx2/prj/build.lst
392 +++ sfx2/prj/build.lst
393 @@ -13,10 +13,11 @@ sf sfx2\source\config nmake - all sf_cnfg sf_sdi sf_inc NULL
394 sf sfx2\source\control nmake - all sf_ctrl sf_sdi sf_inc NULL
395 sf sfx2\source\dialog nmake - all sf_dlg sf_sdi sf_inc NULL
396 sf sfx2\source\doc nmake - all sf_doc sf_sdi sf_inc NULL
397 +sf sfx2\source\layout nmake - all sf_layout sf_sdi sf_inc NULL
398 sf sfx2\source\menu nmake - all sf_menu sf_sdi sf_inc NULL
399 sf sfx2\source\notify nmake - all sf_noti sf_sdi sf_inc NULL
400 sf sfx2\source\statbar nmake - all sf_sbar sf_sdi sf_inc NULL
401 sf sfx2\source\toolbox nmake - all sf_tbox sf_sdi sf_inc NULL
402 sf sfx2\source\inet nmake - all sf_inet sf_sdi sf_inc NULL
403 sf sfx2\source\explorer nmake - all sf_expl sf_sdi sf_inc NULL
404 -sf sfx2\util nmake - all sf_util sf_appl sf_bast sf_cnfg sf_ctrl sf_dlg sf_doc sf_expl sf_inet sf_menu sf_noti sf_sbar sf_tbox sf_view NULL
405 +sf sfx2\util nmake - all sf_util sf_appl sf_bast sf_cnfg sf_ctrl sf_dlg sf_doc sf_expl sf_inet sf_menu sf_layout sf_noti sf_sbar sf_tbox sf_view NULL
406 diff --git a/sfx2/prj/d.lst b/sfx2/prj/d.lst
407 index 03d2c01..53ed0df 100644
408 --- sfx2/prj/d.lst
409 +++ sfx2/prj/d.lst
410 @@ -126,3 +126,7 @@ mkdir: %_DEST%\inc%_EXT%\sfx2
411 ..\inc\QuerySaveDocument.hxx %_DEST%\inc%_EXT%\sfx2\QuerySaveDocument.hxx
412 ..\inc\mailmodelapi.hxx %_DEST%\inc%_EXT%\sfx2\mailmodelapi.hxx
413 ..\inc\docinsert.hxx %_DEST%\inc%_EXT%\sfx2\docinsert.hxx
414 +..\inc\sfx2\layout.hxx %_DEST%\inc%_EXT%\sfx2\layout.hxx
415 +..\inc\sfx2\layout-tabdlg.hxx %_DEST%\inc%_EXT%\sfx2\layout-tabdlg.hxx
416 +..\inc\sfx2\layout-post.hxx %_DEST%\inc%_EXT%\sfx2\layout-post.hxx
417 +..\inc\sfx2\layout-pre.hxx %_DEST%\inc%_EXT%\sfx2\layout-pre.hxx
418 diff --git a/sfx2/source/dialog/tabdlg.cxx b/sfx2/source/dialog/tabdlg.cxx
419 index d3254ed..fb35c4f 100644
420 --- sfx2/source/dialog/tabdlg.cxx
421 +++ sfx2/source/dialog/tabdlg.cxx
422 @@ -31,19 +31,14 @@
423 // MARKER(update_precomp.py): autogen include statement, do not remove
424 #include "precompiled_sfx2.hxx"
426 -// include ---------------------------------------------------------------
428 #include <limits.h>
429 #include <stdlib.h>
430 #include <vcl/msgbox.hxx>
431 #include <svtools/viewoptions.hxx>
432 -#ifndef GCC
433 -#endif
435 #define _SVSTDARR_USHORTS
436 #include <svtools/svstdarr.hxx>
438 -// wg. nAutoPageID
439 #include "appdata.hxx"
440 #include "sfxtypes.hxx"
441 #include <sfx2/minarray.hxx>
442 @@ -56,20 +51,35 @@
443 #include <sfx2/bindings.hxx>
444 #include <sfx2/sfxdlg.hxx>
445 #include <sfx2/itemconnect.hxx>
446 -#include <layout/layout.hxx>
448 #include "dialog.hrc"
449 #include "helpid.hrc"
451 -// for OUString and Any
452 +#if ENABLE_LAYOUT_SFX_TABDIALOG
453 +#undef TabPage
454 +#undef SfxTabPage
455 +#define SfxTabPage ::SfxTabPage
456 +#undef SfxTabDialog
457 +#endif /* ENABLE_LAYOUT_SFX_TABDIALOG */
459 using namespace ::com::sun::star::uno;
460 using namespace ::rtl;
462 #define USERITEM_NAME OUString::createFromAscii( "UserItem" )
464 -/* -----------------------------------------------------------------
465 - Verwaltungsdatenstruktur f"ur jede Seite
466 - ----------------------------------------------------------------- */
467 +TYPEINIT1(LAYOUT_NS_SFX_TABDIALOG SfxTabDialogItem,SfxSetItem);
469 +struct TabPageImpl
471 + BOOL mbStandard;
472 + sfx::ItemConnectionArray maItemConn;
473 + ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > mxFrame;
475 + TabPageImpl() : mbStandard( FALSE ) {}
478 +NAMESPACE_LAYOUT_SFX_TABDIALOG
480 struct Data_Impl
482 USHORT nId; // Die ID
483 @@ -102,8 +112,6 @@ struct Data_Impl
487 -TYPEINIT1(SfxTabDialogItem,SfxSetItem);
489 SfxTabDialogItem::SfxTabDialogItem( const SfxTabDialogItem& rAttr, SfxItemPool* pItemPool )
490 : SfxSetItem( rAttr, pItemPool )
492 @@ -172,13 +180,7 @@ void SfxTabDialogController::StateChanged( USHORT /*nSID*/, SfxItemState /*eStat
493 for ( USHORT n=0; n<pDialog->aTabCtrl.GetPageCount(); n++ )
495 USHORT nPageId = pDialog->aTabCtrl.GetPageId( n );
496 - if ( layout::TabPage* page = pDialog->layoutPages[nPageId] )
498 - page->Reset( pSetItem->GetItemSet() );
499 - bDialogStarted = TRUE;
502 - SfxTabPage* pTabPage = (SfxTabPage*) pDialog->aTabCtrl.GetTabPage( nPageId );
503 + SfxTabPage* pTabPage = dynamic_cast<SfxTabPage*> (pDialog->aTabCtrl.GetTabPage( nPageId ));
504 if ( pTabPage )
506 pTabPage->Reset( pSetItem->GetItemSet() );
507 @@ -218,32 +220,6 @@ struct TabDlg_Impl
511 -struct TabPageImpl
513 - BOOL mbStandard;
514 - sfx::ItemConnectionArray maItemConn;
515 - ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > mxFrame;
517 - TabPageImpl() : mbStandard( FALSE ) {}
520 -void SfxTabPage::SetFrame(const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& xFrame)
522 - if (pImpl)
523 - pImpl->mxFrame = xFrame;
526 -::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > SfxTabPage::GetFrame()
528 - if (pImpl)
529 - return pImpl->mxFrame;
530 - return ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >();
534 -/* -----------------------------------------------------------------
535 - Hilfsfunktion: Finden einer Page anhand seiner Id
536 - ----------------------------------------------------------------- */
537 Data_Impl* Find( SfxTabDlgData_Impl& rArr, USHORT nId, USHORT* pPos = 0 );
539 Data_Impl* Find( SfxTabDlgData_Impl& rArr, USHORT nId, USHORT* pPos )
540 @@ -264,8 +240,21 @@ Data_Impl* Find( SfxTabDlgData_Impl& rArr, USHORT nId, USHORT* pPos )
541 return 0;
544 -// class SfxTabPage-------------------------------------------------------
545 +#if !ENABLE_LAYOUT_SFX_TABDIALOG
547 +void SfxTabPage::SetFrame(const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& xFrame)
549 + if (pImpl)
550 + pImpl->mxFrame = xFrame;
553 +::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > SfxTabPage::GetFrame()
555 + if (pImpl)
556 + return pImpl->mxFrame;
557 + return ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >();
560 SfxTabPage::SfxTabPage( Window *pParent,
561 const ResId &rResId, const SfxItemSet &rAttrSet ) :
563 @@ -474,7 +463,22 @@ void SfxTabPage::AddItemConnection( sfx::ItemConnectionBase* pConnection )
564 pImpl->maItemConn.AddConnection( pConnection );
567 -// class SfxTabDialog ----------------------------------------------------
568 +#endif /* !ENABLE_LAYOUT_SFX_TABDIALOG */
570 +#if ENABLE_LAYOUT_SFX_TABDIALOG
571 +#undef ResId
572 +#define ResId(id, foo) #id
573 +#undef TabDialog
574 +#define TabDialog(parent, res_id) Dialog (parent, "tab-dialog.xml", "tab-dialog")
576 +#define aOKBtn(this) aOKBtn (this, "BTN_OK")
577 +#undef PushButton
578 +#define PushButton(this) layout::PushButton (this, "BTN_USER")
579 +#define aCancelBtn(this) aCancelBtn (this, "BTN_CANCEL")
580 +#define aHelpBtn(this) aHelpBtn (this, "BTN_HELP")
581 +#define aResetBtn(this) aResetBtn (this, "BTN_RESET")
582 +#define aBaseFmtBtn(this) aBaseFmtBtn (this, "BTN_BASEFMT")
583 +#endif /* ENABLE_LAYOUT_SFX_TABDIALOG */
585 #define INI_LIST(ItemSetPtr) \
586 aTabCtrl ( this, ResId(ID_TABCONTROL,*rResId.GetResMgr() ) ),\
587 @@ -585,11 +589,24 @@ SfxTabDialog::SfxTabDialog
589 // -----------------------------------------------------------------------
591 +#if ENABLE_LAYOUT_SFX_TABDIALOG
592 +#undef ResId
593 +#undef TabDialog
594 +#undef aOKBtn
595 +#undef PushButton
596 +#undef aCancelBtn
597 +#undef aHelpBtn
598 +#undef aResetBtn
599 +#undef aBaseFmtBtn
600 +#endif /* ENABLE_LAYOUT_SFX_TABDIALOG */
602 SfxTabDialog::~SfxTabDialog()
604 // save settings (screen position and current page)
605 SvtViewOptions aDlgOpt( E_TABDIALOG, String::CreateFromInt32( nResId ) );
606 +#if !ENABLE_LAYOUT_SFX_TABDIALOG
607 aDlgOpt.SetWindowState( OUString::createFromAscii( GetWindowState( WINDOWSTATE_MASK_POS ).GetBuffer() ) );
608 +#endif /* !ENABLE_LAYOUT_SFX_TABDIALOG */
609 aDlgOpt.SetPageID( aTabCtrl.GetCurPageId() );
611 const USHORT nCount = pImpl->pData->Count();
612 @@ -624,10 +641,6 @@ SfxTabDialog::~SfxTabDialog()
613 delete pOutSet;
614 delete pExampleSet;
615 delete [] pRanges;
617 - for ( size_t i = 0; i < layoutPages.size(); i++ )
618 - if (layout::TabPage *page = layoutPages[i])
619 - delete page;
622 // -----------------------------------------------------------------------
623 @@ -697,6 +710,11 @@ void SfxTabDialog::RemoveResetButton()
625 // -----------------------------------------------------------------------
627 +#if ENABLE_LAYOUT_SFX_TABDIALOG
628 +#undef TabDialog
629 +#define TabDialog Dialog
630 +#endif /* ENABLE_LAYOUT_SFX_TABDIALOG */
632 short SfxTabDialog::Execute()
634 if ( !aTabCtrl.GetPageCount() )
635 @@ -709,10 +727,12 @@ short SfxTabDialog::Execute()
637 void SfxTabDialog::StartExecuteModal( const Link& rEndDialogHdl )
639 +#if !ENABLE_LAYOUT_SFX_TABDIALOG
640 if ( !aTabCtrl.GetPageCount() )
641 return;
642 Start_Impl();
643 TabDialog::StartExecuteModal( rEndDialogHdl );
644 +#endif /* !ENABLE_LAYOUT_SFX_TABDIALOG */
647 // -----------------------------------------------------------------------
648 @@ -759,9 +779,10 @@ void SfxTabDialog::EnableApplyButton(BOOL bEnable)
649 if ( bEnable )
651 pImpl->pApplyButton = new PushButton( this );
652 +#if !ENABLE_LAYOUT_SFX_TABDIALOG
653 // in the z-order, the apply button should be behind the ok button, thus appearing at the right side of it
654 pImpl->pApplyButton->SetZOrder(&aOKBtn, WINDOW_ZORDER_BEHIND);
656 +#endif /* ENABLE_LAYOUT_SFX_TABDIALOG */
657 pImpl->pApplyButton->SetText( String( SfxResId( STR_APPLY ) ) );
658 pImpl->pApplyButton->Show();
660 @@ -773,9 +794,11 @@ void SfxTabDialog::EnableApplyButton(BOOL bEnable)
661 pImpl->pApplyButton = NULL;
664 +#if !ENABLE_LAYOUT_SFX_TABDIALOG
665 // adjust the layout
666 if (IsReallyShown())
667 AdjustLayout();
668 +#endif /* !ENABLE_LAYOUT_SFX_TABDIALOG */
671 // -----------------------------------------------------------------------
672 @@ -810,7 +833,9 @@ void SfxTabDialog::Start_Impl()
673 SvtViewOptions aDlgOpt( E_TABDIALOG, String::CreateFromInt32( nResId ) );
674 if ( aDlgOpt.Exists() )
676 +#if !ENABLE_LAYOUT_SFX_TABDIALOG
677 SetWindowState( ByteString( aDlgOpt.GetWindowState().getStr(), RTL_TEXTENCODING_ASCII_US ) );
678 +#endif /* !ENABLE_LAYOUT_SFX_TABDIALOG */
680 // initiale TabPage aus Programm/Hilfe/Konfig
681 nActPage = (USHORT)aDlgOpt.GetPageID();
682 @@ -933,16 +958,6 @@ void SfxTabDialog::AddTabPage
684 #endif
686 -void SfxTabDialog::AddTabPage( int id, layout::TabPage* page, bool )
688 - layoutPages[id] = page;
691 -void SfxTabDialog::AddTabPage( int id, layout::CreateTabPage func, bool )
693 - layoutPageFuncs[id] = func;
696 // -----------------------------------------------------------------------
698 void SfxTabDialog::RemoveTabPage( USHORT nId )
699 @@ -1188,28 +1203,7 @@ IMPL_LINK( SfxTabDialog, OkHdl, Button *, EMPTYARG )
700 bool SfxTabDialog::PrepareLeaveCurrentPage()
702 USHORT const nId = aTabCtrl.GetCurPageId();
704 - if ( layout::TabPage* page = layoutPages[nId] )
706 - if ( !pSet )
707 - return page->DeactivatePage( 0 );
709 - SfxItemSet set( *pSet->GetPool(), pSet->GetRanges() );
711 - if ( page->HasExchangeSupport() )
712 - return page->DeactivatePage( &set );
714 - int result = page->DeactivatePage( 0 );
715 - if ( result & layout::TabPage::LEAVE_PAGE && set.Count() )
717 - pExampleSet->Put( set );
718 - pOutSet->Put( set );
720 - return result;
723 - SfxTabPage* pPage = (SfxTabPage*)aTabCtrl.GetTabPage( nId );
725 + SfxTabPage* pPage = dynamic_cast<SfxTabPage*> (aTabCtrl.GetTabPage( nId ));
726 bool bEnd = !pPage;
728 if ( pPage )
729 @@ -1281,12 +1275,6 @@ IMPL_LINK( SfxTabDialog, ResetHdl, Button *, EMPTYARG )
732 int const nId = aTabCtrl.GetCurPageId();
733 - if ( layout::TabPage* page = layoutPages[nId] )
735 - page->Reset( *pSet );
736 - return 0;
739 Data_Impl* pDataObject = Find( *pImpl->pData, nId );
740 DBG_ASSERT( pDataObject, "Id nicht bekannt" );
742 @@ -1381,6 +1369,11 @@ IMPL_LINK( SfxTabDialog, BaseFmtHdl, Button *, EMPTYARG )
744 // -----------------------------------------------------------------------
746 +#if ENABLE_LAYOUT_SFX_TABDIALOG
747 +#define tabControlWindow pTabCtrl->GetWindow ()
748 +#else /* !ENABLE_LAYOUT_SFX_TABDIALOG */
749 +#define tabControlWindow pTabCtrl
750 +#endif /* !ENABLE_LAYOUT_SFX_TABDIALOG */
752 IMPL_LINK( SfxTabDialog, ActivatePageHdl, TabControl *, pTabCtrl )
754 @@ -1397,42 +1390,22 @@ IMPL_LINK( SfxTabDialog, ActivatePageHdl, TabControl *, pTabCtrl )
757 int const nId = pTabCtrl->GetCurPageId();
758 - OSL_TRACE ("%s: page: %d", __FUNCTION__, nId );
759 - if ( !layoutPages[nId] )
760 - if ( layout::CreateTabPage func = layoutPageFuncs[nId] )
762 - layout::TabPage::global_parent = pTabCtrl;
763 - layout::TabPage* page = (func) (pTabCtrl, *pSet);
764 - AddTabPage( nId, page );
766 - if ( layout::TabPage* page = layoutPages[nId] )
768 - TabPage *vclPage = page->GetTabPage();
769 - TabControl *dialog = pTabCtrl;
770 - page->Reset( page->GetItemSet() );
771 - page->ActivatePage();
772 - dialog->SetTabPage( nId, vclPage );
774 - Size tabSize = vclPage->GetSizePixel();
775 - Size dialogSize = dialog->GetTabPageSizePixel();
776 - OSL_TRACE ("%s: tabSize: %d, %d", __FUNCTION__, tabSize.Width(), tabSize.Height() );
777 - OSL_TRACE ("%s: dialogSize: %d, %d", __FUNCTION__, dialogSize.Width(), dialogSize.Height() );
779 - dialog->SetTabPageSizePixel( dialogSize );
780 - return 0;
783 DBG_ASSERT( pImpl->pData->Count(), "keine Pages angemeldet" );
784 SFX_APP();
786 // Tab Page schon da?
787 - SfxTabPage* pTabPage = (SfxTabPage *)pTabCtrl->GetTabPage( nId );
788 + SfxTabPage* pTabPage = dynamic_cast<SfxTabPage*> (pTabCtrl->GetTabPage( nId ));
789 Data_Impl* pDataObject = Find( *pImpl->pData, nId );
790 DBG_ASSERT( pDataObject, "Id nicht bekannt" );
792 // ggf. TabPage erzeugen:
793 if ( !pTabPage )
795 +#if ENABLE_LAYOUT_SFX_TABDIALOG
796 + if (layout SfxTabPage* inplug = dynamic_cast<layout SfxTabPage*> (pTabPage))
797 + layout::TabPage::global_parent = pTabCtrl->GetWindow ();
798 +#endif
799 const SfxItemSet* pTmpSet = 0;
801 if ( pSet )
802 @@ -1444,13 +1417,16 @@ IMPL_LINK( SfxTabDialog, ActivatePageHdl, TabControl *, pTabCtrl )
805 if ( pTmpSet && !pDataObject->bOnDemand )
806 - pTabPage = (pDataObject->fnCreatePage)( pTabCtrl, *pTmpSet );
807 + pTabPage = (pDataObject->fnCreatePage)( tabControlWindow, *pTmpSet );
808 else
809 pTabPage = (pDataObject->fnCreatePage)
810 - ( pTabCtrl, *CreateInputItemSet( nId ) );
811 + ( tabControlWindow, *CreateInputItemSet( nId ) );
812 DBG_ASSERT( NULL == pDataObject->pTabPage, "create TabPage more than once" );
813 pDataObject->pTabPage = pTabPage;
815 +#if !ENABLE_LAYOUT_SFX_TABDIALOG
816 pDataObject->pTabPage->SetTabDialog( this );
817 +#endif /* ENABLE_LAYOUT_SFX_TABDIALOG */
818 SvtViewOptions aPageOpt( E_TABPAGE, String::CreateFromInt32( pDataObject->nId ) );
819 String sUserData;
820 Any aUserItem = aPageOpt.GetUserItem( USERITEM_NAME );
821 @@ -1459,23 +1435,48 @@ IMPL_LINK( SfxTabDialog, ActivatePageHdl, TabControl *, pTabCtrl )
822 sUserData = String( aTemp );
823 pTabPage->SetUserData( sUserData );
824 Size aSiz = pTabPage->GetSizePixel();
826 +#if ENABLE_LAYOUT
827 + Size optimalSize = pTabPage->GetOptimalSize (WINDOWSIZE_MINIMUM);
828 +#if ENABLE_LAYOUT_SFX_TABDIALOG
829 + if (layout SfxTabPage* inplug = dynamic_cast<layout SfxTabPage*> (pTabPage))
831 + if (optimalSize.Height () && optimalSize.Width ())
833 + optimalSize.Width () = optimalSize.Width ();
834 + optimalSize.Height () = optimalSize.Height () + 40;
837 +#endif /* ENABLE_LAYOUT_SFX_TABDIALOG */
838 + if (optimalSize.Height () > 0 && optimalSize.Width () > 0 )
839 + aSiz = optimalSize;
840 +#endif /* ENABLE_LAYOUT */
842 Size aCtrlSiz = pTabCtrl->GetTabPageSizePixel();
843 // Gr"o/se am TabControl nur dann setzen, wenn < als TabPage
844 if ( aCtrlSiz.Width() < aSiz.Width() ||
845 aCtrlSiz.Height() < aSiz.Height() )
847 pTabCtrl->SetTabPageSizePixel( aSiz );
850 PageCreated( nId, *pTabPage );
852 if ( pDataObject->bOnDemand )
853 pTabPage->Reset( (SfxItemSet &)pTabPage->GetItemSet() );
854 else
855 pTabPage->Reset( *pSet );
857 pTabCtrl->SetTabPage( nId, pTabPage );
859 else if ( pDataObject->bRefresh )
860 pTabPage->Reset( *pSet );
861 pDataObject->bRefresh = FALSE;
863 +#if ENABLE_LAYOUT_SFX_TABDIALOG
864 + pTabCtrl->GetPagePos (nId);
865 +#endif /* ENABLE_LAYOUT_SFX_TABDIALOG */
867 if ( pExampleSet )
868 pTabPage->ActivatePage( *pExampleSet );
869 BOOL bReadOnly = pTabPage->IsReadOnly();
870 @@ -1497,12 +1498,9 @@ IMPL_LINK( SfxTabDialog, DeactivatePageHdl, TabControl *, pTabCtrl )
874 - if ( /* layout::TabPage* p = */ layoutPages[pTabCtrl->GetCurPageId()] )
875 - return SfxTabPage::LEAVE_PAGE;
877 USHORT nId = pTabCtrl->GetCurPageId();
878 SFX_APP();
879 - SfxTabPage *pPage = (SfxTabPage*)pTabCtrl->GetTabPage( nId );
880 + SfxTabPage *pPage = dynamic_cast<SfxTabPage*> (pTabCtrl->GetTabPage( nId ));
881 DBG_ASSERT( pPage, "keine aktive Page" );
882 #ifdef DBG_UTIL
883 Data_Impl* pDataObject = Find( *pImpl->pData, pTabCtrl->GetCurPageId() );
884 @@ -1796,3 +1794,4 @@ long SfxTabDialog::Notify( NotifyEvent& rNEvt )
885 return TabDialog::Notify( rNEvt );
888 +END_NAMESPACE_LAYOUT_SFX_TABDIALOG
889 diff --git a/sfx2/source/layout/factory.cxx b/sfx2/source/layout/factory.cxx
890 new file mode 100644
891 index 0000000..407e626
892 --- /dev/null
893 +++ sfx2/source/layout/factory.cxx
894 @@ -0,0 +1,71 @@
895 +/*************************************************************************
897 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
898 + *
899 + * Copyright 2008 by Sun Microsystems, Inc.
901 + * OpenOffice.org - a multi-platform office productivity suite
903 + * $RCSfile: tabdlg.cxx,v $
904 + * $Revision: 1.38 $
906 + * This file is part of OpenOffice.org.
908 + * OpenOffice.org is free software: you can redistribute it and/or modify
909 + * it under the terms of the GNU Lesser General Public License version 3
910 + * only, as published by the Free Software Foundation.
912 + * OpenOffice.org is distributed in the hope that it will be useful,
913 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
914 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
915 + * GNU Lesser General Public License version 3 for more details
916 + * (a copy is included in the LICENSE file that accompanied this code).
918 + * You should have received a copy of the GNU Lesser General Public License
919 + * version 3 along with OpenOffice.org. If not, see
920 + * <http://www.openoffice.org/license.html>
921 + * for a copy of the LGPLv3 License.
923 + ************************************************************************/
925 +#include <com/sun/star/awt/WindowAttribute.hpp>
926 +#include <sal/types.h>
927 +#include <sfx2/basedlgs.hxx>
928 +#include <toolkit/awt/vclxtoolkit.hxx>
929 +#include <toolkit/awt/vclxdialog.hxx>
931 +using rtl::OUString;
933 +class SfxModelessDialog_unprotect : public SfxModelessDialog
935 +public:
936 + SfxModelessDialog_unprotect (Window *parent, WinBits attributes);
939 +SFX2_DLLPUBLIC SfxBindings* sfx2_global_bindings;
940 +SFX2_DLLPUBLIC SfxChildWindow* sfx2_global_child;
942 +SfxModelessDialog_unprotect::SfxModelessDialog_unprotect (Window *parent, WinBits bits)
943 + : SfxModelessDialog (sfx2_global_bindings, sfx2_global_child, parent, bits)
947 +extern "C"
950 +SAL_DLLPUBLIC_EXPORT Window* CreateWindow (VCLXWindow** vcl, OUString const& name, Window* parent, long& attributes)
952 + Window* window = 0;
953 + if (0)
957 + else if (name.equalsAscii ("sfxmodelessdialog"))
959 + window = new SfxModelessDialog_unprotect (parent, ImplGetWinBits (attributes, 0));
960 + *vcl = new layoutimpl::VCLXDialog ();
962 + return window;
966 diff --git a/sfx2/source/layout/makefile.mk b/sfx2/source/layout/makefile.mk
967 new file mode 100644
968 index 0000000..3dc2346
969 --- /dev/null
970 +++ sfx2/source/layout/makefile.mk
971 @@ -0,0 +1,59 @@
972 +#*************************************************************************
974 +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
976 +# Copyright 2008 by Sun Microsystems, Inc.
978 +# OpenOffice.org - a multi-platform office productivity suite
980 +# $RCSfile: makefile.mk,v $
982 +# $Revision: 1.7 $
984 +# This file is part of OpenOffice.org.
986 +# OpenOffice.org is free software: you can redistribute it and/or modify
987 +# it under the terms of the GNU Lesser General Public License version 3
988 +# only, as published by the Free Software Foundation.
990 +# OpenOffice.org is distributed in the hope that it will be useful,
991 +# but WITHOUT ANY WARRANTY; without even the implied warranty of
992 +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
993 +# GNU Lesser General Public License version 3 for more details
994 +# (a copy is included in the LICENSE file that accompanied this code).
996 +# You should have received a copy of the GNU Lesser General Public License
997 +# version 3 along with OpenOffice.org. If not, see
998 +# <http://www.openoffice.org/license.html>
999 +# for a copy of the LGPLv3 License.
1001 +#*************************************************************************
1003 +PRJ=..$/..
1005 +PRJNAME=sfx2
1006 +TARGET=layout
1007 +ENABLE_EXCEPTIONS=true
1009 +# --- Settings -----------------------------------------------------
1011 +.INCLUDE : settings.mk
1012 +.INCLUDE : $(PRJ)$/util$/makefile.pmk
1014 +# --- Files --------------------------------------------------------
1016 +.IF "$(ENABLE_LAYOUT)" == "TRUE"
1018 +SLOFILES = \
1019 + $(SLO)$/factory.obj \
1020 + $(SLO)$/sfxdialog.obj \
1021 + $(SLO)$/sfxtabpage.obj \
1022 + $(SLO)$/sfxtabdialog.obj \
1025 +.ENDIF # ENABLE_LAYOUT == TRUE
1027 +# --- Tagets -------------------------------------------------------
1029 +.INCLUDE : target.mk
1031 diff --git a/sfx2/source/layout/sfxdialog.cxx b/sfx2/source/layout/sfxdialog.cxx
1032 new file mode 100644
1033 index 0000000..32e11c9
1034 --- /dev/null
1035 +++ sfx2/source/layout/sfxdialog.cxx
1036 @@ -0,0 +1,41 @@
1037 +/*************************************************************************
1039 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
1040 + *
1041 + * Copyright 2008 by Sun Microsystems, Inc.
1043 + * OpenOffice.org - a multi-platform office productivity suite
1045 + * $RCSfile: tabdlg.cxx,v $
1046 + * $Revision: 1.38 $
1048 + * This file is part of OpenOffice.org.
1050 + * OpenOffice.org is free software: you can redistribute it and/or modify
1051 + * it under the terms of the GNU Lesser General Public License version 3
1052 + * only, as published by the Free Software Foundation.
1054 + * OpenOffice.org is distributed in the hope that it will be useful,
1055 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
1056 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1057 + * GNU Lesser General Public License version 3 for more details
1058 + * (a copy is included in the LICENSE file that accompanied this code).
1060 + * You should have received a copy of the GNU Lesser General Public License
1061 + * version 3 along with OpenOffice.org. If not, see
1062 + * <http://www.openoffice.org/license.html>
1063 + * for a copy of the LGPLv3 License.
1065 + ************************************************************************/
1067 +#include <sfx2/layout.hxx>
1069 +namespace layout
1072 +SfxDialog::SfxDialog(::Window* parent, char const* xml_file, char const* id, SfxBindings*, SfxChildWindow*)
1073 + : Dialog (parent, xml_file, id)
1077 +} // end namespace layout
1078 diff --git a/sfx2/source/layout/sfxtabdialog.cxx b/sfx2/source/layout/sfxtabdialog.cxx
1079 new file mode 100644
1080 index 0000000..bf7c521
1081 --- /dev/null
1082 +++ sfx2/source/layout/sfxtabdialog.cxx
1083 @@ -0,0 +1,75 @@
1084 +/*************************************************************************
1086 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
1087 + *
1088 + * Copyright 2008 by Sun Microsystems, Inc.
1090 + * OpenOffice.org - a multi-platform office productivity suite
1092 + * $RCSfile: tabdlg.cxx,v $
1093 + * $Revision: 1.38 $
1095 + * This file is part of OpenOffice.org.
1097 + * OpenOffice.org is free software: you can redistribute it and/or modify
1098 + * it under the terms of the GNU Lesser General Public License version 3
1099 + * only, as published by the Free Software Foundation.
1101 + * OpenOffice.org is distributed in the hope that it will be useful,
1102 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
1103 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1104 + * GNU Lesser General Public License version 3 for more details
1105 + * (a copy is included in the LICENSE file that accompanied this code).
1107 + * You should have received a copy of the GNU Lesser General Public License
1108 + * version 3 along with OpenOffice.org. If not, see
1109 + * <http://www.openoffice.org/license.html>
1110 + * for a copy of the LGPLv3 License.
1112 + ************************************************************************/
1114 +// MARKER(update_precomp.py): autogen include statement, do not remove
1115 +#include "precompiled_sfx2.hxx"
1117 +#include <limits.h>
1118 +#include <stdlib.h>
1119 +#include <vcl/msgbox.hxx>
1120 +#include <svtools/viewoptions.hxx>
1122 +#define _SVSTDARR_USHORTS
1123 +#include <svtools/svstdarr.hxx>
1125 +#include "appdata.hxx"
1126 +#include "sfxtypes.hxx"
1127 +#include <sfx2/minarray.hxx>
1128 +#include <sfx2/tabdlg.hxx>
1129 +#include <sfx2/viewfrm.hxx>
1130 +#include <sfx2/app.hxx>
1131 +#include "sfxresid.hxx"
1132 +#include "sfxhelp.hxx"
1133 +#include <sfx2/ctrlitem.hxx>
1134 +#include <sfx2/bindings.hxx>
1135 +#include <sfx2/sfxdlg.hxx>
1136 +#include <sfx2/itemconnect.hxx>
1137 +#include <layout/layout.hxx>
1139 +//FIXME
1140 +#include <toolkit/awt/vclxwindow.hxx>
1141 +#include <com/sun/star/awt/PosSize.hpp>
1143 +using namespace ::com::sun::star;
1144 +namespace layout
1146 +using namespace ::com::sun::star;
1149 +#include <sfx2/layout.hxx>
1150 +#include <layout/layout-pre.hxx>
1152 +#undef TabPage
1153 +#undef SfxTabPage
1154 +#undef SfxTabDialog
1156 +#define TabDlgCmpUS_Impl layout__TabDlgCmpUS_Impl
1158 +#include "../dialog/tabdlg.cxx"
1159 diff --git a/sfx2/source/layout/sfxtabpage.cxx b/sfx2/source/layout/sfxtabpage.cxx
1160 new file mode 100644
1161 index 0000000..6b7806d
1162 --- /dev/null
1163 +++ sfx2/source/layout/sfxtabpage.cxx
1164 @@ -0,0 +1,81 @@
1165 +/*************************************************************************
1166 +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
1168 +* Copyright 2008 by Sun Microsystems, Inc.
1170 +* OpenOffice.org - a multi-platform office productivity suite
1172 +* $RCSfile: code,v $
1174 +* $Revision: 1.3 $
1176 +* This file is part of OpenOffice.org.
1178 +* OpenOffice.org is free software: you can redistribute it and/or modify
1179 +* it under the terms of the GNU Lesser General Public License version 3
1180 +* only, as published by the Free Software Foundation.
1182 +* OpenOffice.org is distributed in the hope that it will be useful,
1183 +* but WITHOUT ANY WARRANTY; without even the implied warranty of
1184 +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1185 +* GNU Lesser General Public License version 3 for more details
1186 +* (a copy is included in the LICENSE file that accompanied this code).
1188 +* You should have received a copy of the GNU Lesser General Public License
1189 +* version 3 along with OpenOffice.org. If not, see
1190 +* <http://www.openoffice.org/license.html>
1191 +* for a copy of the LGPLv3 License.
1192 +************************************************************************/
1194 +#include <sfx2/layout.hxx>
1196 +#include <com/sun/star/awt/PosSize.hpp>
1197 +#include <toolkit/awt/vclxwindow.hxx>
1199 +namespace layout
1202 +using namespace ::com::sun::star;
1204 +#if 0
1205 +SfxTabDialog::SfxTabDialog (::Window *parent, char const* xml_file, char const* id, ResId const& res_id, SfxItemSet const* set)
1206 + : ::SfxTabDialog (parent, res_id, set)
1207 + , InPlug (parent, xml_file, id)
1211 +::Window* SfxTabDialog::GetParent () const
1213 + return Window::GetParent ();
1216 +void SfxTabDialog::FreeResource ()
1218 + //::Window::FreeResource ();
1220 +#endif
1222 +SfxTabPage::SfxTabPage (::Window *parent, char const* xml_file, char const* id, SfxItemSet const* set)
1223 + : ::SfxTabPage (parent, 0, *set)
1224 + , InPlug (parent, xml_file, id)
1226 + dynamic_cast< ::Window* > (this)->SetComponentInterface (GetVCLXWindow ());
1229 +::Window* SfxTabPage::GetParent () const
1231 + return Window::GetParent ();
1234 +void SfxTabPage::FreeResource ()
1236 + //::Window::FreeResource ();
1239 +Size SfxTabPage::GetOptimalSize (WindowSizeType) const
1241 + awt::Size s = GetVCLXWindow()->getMinimumSize ();
1242 + return Size (s.Width, s.Height);
1245 +} // end namespace layout
1246 diff --git a/sfx2/util/makefile.mk b/sfx2/util/makefile.mk
1247 index 3e08460..b987fae 100644
1248 --- sfx2/util/makefile.mk
1249 +++ sfx2/util/makefile.mk
1250 @@ -61,6 +61,10 @@ LIB1FILES= $(SLB)$/appl.lib \
1251 $(SLB)$/bastyp.lib \
1252 $(SLB)$/config.lib
1254 +.IF "$(ENABLE_LAYOUT)" == "TRUE"
1255 +LIB1FILES += $(SLB)$/layout.lib
1256 +.ENDIF # ENABLE_LAYOUT == TRUE
1258 HELPIDFILES=\
1259 ..\inc\sfx2\sfxsids.hrc \
1260 ..\source\inc\helpid.hrc