diff options
author | Felix Zhang <fezhang@suse.com> | 2011-11-15 10:13:52 +0800 |
---|---|---|
committer | Jan Holesovsky <kendy@suse.cz> | 2011-11-15 14:39:55 +0100 |
commit | eacfa0f77c3d161f3e0c207120dcf3c2958acee4 (patch) | |
tree | 20252ab2bbb91255dc5ad35edc76ec21819111b8 /sfx2 | |
parent | cfc84011b3fb609ac78f35666d9aecda4ca34678 (diff) |
removing obsolete layout code
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/Module_sfx2.mk | 1 | ||||
-rw-r--r-- | sfx2/Package_inc.mk | 2 | ||||
-rw-r--r-- | sfx2/inc/sfx2/layout-post.hxx | 8 | ||||
-rw-r--r-- | sfx2/inc/sfx2/layout-pre.hxx | 17 | ||||
-rw-r--r-- | sfx2/inc/sfx2/layout-tabdlg.hxx | 12 | ||||
-rw-r--r-- | sfx2/inc/sfx2/layout.hxx | 5 | ||||
-rw-r--r-- | sfx2/inc/sfx2/tabdlg.hxx | 37 | ||||
-rw-r--r-- | sfx2/source/dialog/tabdlg.cxx | 92 | ||||
-rw-r--r-- | sfx2/source/layout/sfxtabdialog.cxx | 1 |
9 files changed, 1 insertions, 174 deletions
diff --git a/sfx2/Module_sfx2.mk b/sfx2/Module_sfx2.mk index 4084d3927ead..7aaf257898fc 100644 --- a/sfx2/Module_sfx2.mk +++ b/sfx2/Module_sfx2.mk @@ -53,7 +53,6 @@ endif endif #todo: source/dialog BUILD_VER_STRING -#todo: ENABLE_LAYOUT #todo: clean up quickstarter stuff in both libraries #todo: move standard pool to svl diff --git a/sfx2/Package_inc.mk b/sfx2/Package_inc.mk index e308d1bde626..1c801ac259b5 100644 --- a/sfx2/Package_inc.mk +++ b/sfx2/Package_inc.mk @@ -75,8 +75,6 @@ $(eval $(call gb_Package_add_file,sfx2_inc,inc/sfx2/imgmgr.hxx,sfx2/imgmgr.hxx)) $(eval $(call gb_Package_add_file,sfx2_inc,inc/sfx2/ipclient.hxx,sfx2/ipclient.hxx)) $(eval $(call gb_Package_add_file,sfx2_inc,inc/sfx2/itemconnect.hxx,sfx2/itemconnect.hxx)) $(eval $(call gb_Package_add_file,sfx2_inc,inc/sfx2/itemwrapper.hxx,sfx2/itemwrapper.hxx)) -$(eval $(call gb_Package_add_file,sfx2_inc,inc/sfx2/layout-post.hxx,sfx2/layout-post.hxx)) -$(eval $(call gb_Package_add_file,sfx2_inc,inc/sfx2/layout-pre.hxx,sfx2/layout-pre.hxx)) $(eval $(call gb_Package_add_file,sfx2_inc,inc/sfx2/layout-tabdlg.hxx,sfx2/layout-tabdlg.hxx)) $(eval $(call gb_Package_add_file,sfx2_inc,inc/sfx2/layout.hxx,sfx2/layout.hxx)) $(eval $(call gb_Package_add_file,sfx2_inc,inc/sfx2/linkmgr.hxx,sfx2/linkmgr.hxx)) diff --git a/sfx2/inc/sfx2/layout-post.hxx b/sfx2/inc/sfx2/layout-post.hxx index e7eddef08f39..b216e6b464ac 100644 --- a/sfx2/inc/sfx2/layout-post.hxx +++ b/sfx2/inc/sfx2/layout-post.hxx @@ -29,14 +29,6 @@ #ifndef _SFX2_LAYOUT_POST_HXX #define _SFX2_LAYOUT_POST_HXX -#include <layout/layout-post.hxx> - -#if ENABLE_LAYOUT - -/* Allow re-inclusion for cxx file. */ -#undef _SFX2_LAYOUT_PRE_HXX - -#endif /* ENABLE_LAYOUT */ #endif /* _SFX2_LAYOUT_POST_HXX */ diff --git a/sfx2/inc/sfx2/layout-pre.hxx b/sfx2/inc/sfx2/layout-pre.hxx index db467fd06da7..d3bb7d431ce5 100644 --- a/sfx2/inc/sfx2/layout-pre.hxx +++ b/sfx2/inc/sfx2/layout-pre.hxx @@ -29,23 +29,6 @@ #ifndef _SFX2_LAYOUT_PRE_HXX #define _SFX2_LAYOUT_PRE_HXX -#include <layout/layout-pre.hxx> - -#if ENABLE_LAYOUT - -///* Allow re-inclusion for next hxx file. */ -#undef _SFX2_LAYOUT_POST_HXX - -#undef SfxDialog -#undef SfxModalDialog -#undef SfxModelessDialog - -#define SfxDialog layout::SfxDialog - -#define SfxModalDialog SfxDialog -#define SfxModelessDialog SfxDialog - -#endif /* ENABLE_LAYOUT */ #endif /* _SFX2_LAYOUT_PRE_HXX */ diff --git a/sfx2/inc/sfx2/layout-tabdlg.hxx b/sfx2/inc/sfx2/layout-tabdlg.hxx index 2629b2c7c106..d41731ce5e5b 100644 --- a/sfx2/inc/sfx2/layout-tabdlg.hxx +++ b/sfx2/inc/sfx2/layout-tabdlg.hxx @@ -28,18 +28,6 @@ #ifndef _LAYOUT_SFX_TABDLG_HXX #define _LAYOUT_SFX_TABDLG_HXX -#undef ENABLE_LAYOUT_SFX_TABDIALOG -#define ENABLE_LAYOUT_SFX_TABDIALOG 1 - -#undef NAMESPACE_LAYOUT_SFX_TABDIALOG -#define NAMESPACE_LAYOUT_SFX_TABDIALOG namespace layout { - -#undef END_NAMESPACE_LAYOUT_SFX_TABDIALOG -#define END_NAMESPACE_LAYOUT_SFX_TABDIALOG } //end namespace layout - -#undef LAYOUT_NS_SFX_TABDIALOG -#define LAYOUT_NS_SFX_TABDIALOG layout:: - #undef _SFXTABDLG_HXX #include <sfx2/tabdlg.hxx> diff --git a/sfx2/inc/sfx2/layout.hxx b/sfx2/inc/sfx2/layout.hxx index 95bd42d39c88..a8540ecbd430 100644 --- a/sfx2/inc/sfx2/layout.hxx +++ b/sfx2/inc/sfx2/layout.hxx @@ -31,11 +31,6 @@ #include <layout/layout.hxx> #include <sfx2/tabdlg.hxx> -#if ENABLE_LAYOUT -#undef ENABLE_LAYOUT_SFX_TABDIALOG -#define ENABLE_LAYOUT_SFX_TABDIALOG 1 -#include <sfx2/layout-tabdlg.hxx> -#endif class SfxChildWindow; class SfxBindings; diff --git a/sfx2/inc/sfx2/tabdlg.hxx b/sfx2/inc/sfx2/tabdlg.hxx index ce1f84aa0040..8df8018da514 100644 --- a/sfx2/inc/sfx2/tabdlg.hxx +++ b/sfx2/inc/sfx2/tabdlg.hxx @@ -39,37 +39,17 @@ #include <svl/itemset.hxx> #include <com/sun/star/frame/XFrame.hpp> -#if ENABLE_LAYOUT -#include <layout/layout.hxx> -namespace layout { class SfxTabDialog; class SfxTabDialogController; } -#endif /* ENABLE_LAYOUT */ - class SfxPoolItem; class SfxTabDialog; class SfxViewFrame; class SfxTabPage; class SfxBindings; -#ifndef ENABLE_LAYOUT_SFX_TABDIALOG -#define ENABLE_LAYOUT_SFX_TABDIALOG 0 -#define NAMESPACE_LAYOUT_SFX_TABDIALOG -#define END_NAMESPACE_LAYOUT_SFX_TABDIALOG -#define LAYOUT_NS_SFX_TABDIALOG -#endif /* !ENABLE_LAYOUT_SFX_TABDIALOG*/ - typedef SfxTabPage* (*CreateTabPage)(Window *pParent, const SfxItemSet &rAttrSet); typedef sal_uInt16* (*GetTabPageRanges)(); // provides international Which-value struct TabPageImpl; class SfxUs_Impl; -#if ENABLE_LAYOUT_SFX_TABDIALOG -#include <layout/layout-pre.hxx> -#undef SfxTabDialog -#undef SfxTabPage -#endif /* ENABLE_LAYOUT_SFX_TABDIALOG */ - -NAMESPACE_LAYOUT_SFX_TABDIALOG - struct TabDlg_Impl; #define ID_TABCONTROL 1 @@ -205,11 +185,7 @@ public: void StartExecuteModal( const Link& rEndDialogHdl ); void Start( sal_Bool bShow = sal_True ); -#if !ENABLE_LAYOUT_SFX_TABDIALOG const SfxItemSet* GetExampleSet() const { return pExampleSet; } -#else /* ENABLE_LAYOUT_SFX_TABDIALOG */ - SfxItemSet* GetExampleSet() const { return 0; } -#endif /* ENABLE_LAYOUT_SFX_TABDIALOG */ SfxViewFrame* GetViewFrame() const { return pFrame; } void EnableApplyButton(sal_Bool bEnable = sal_True); @@ -221,22 +197,11 @@ public: SAL_DLLPRIVATE sal_Bool OK_Impl() { return PrepareLeaveCurrentPage(); } }; -END_NAMESPACE_LAYOUT_SFX_TABDIALOG - -#if ENABLE_LAYOUT_SFX_TABDIALOG -#include <layout/layout-post.hxx> -#endif /* ENABLE_LAYOUT_SFX_TABDIALOG */ - -#if !ENABLE_LAYOUT_SFX_TABDIALOG - namespace sfx { class ItemConnectionBase; } class SFX2_DLLPUBLIC SfxTabPage: public TabPage { friend class SfxTabDialog; - #if ENABLE_LAYOUT - friend class layout::SfxTabDialog; - #endif private: const SfxItemSet* pSet; @@ -299,8 +264,6 @@ public: ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > GetFrame(); }; -#endif /* !ENABLE_LAYOUT_SFX_TABDIALOG */ - #endif /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/dialog/tabdlg.cxx b/sfx2/source/dialog/tabdlg.cxx index 2390c005f86d..c2ec5d9d5c5c 100644 --- a/sfx2/source/dialog/tabdlg.cxx +++ b/sfx2/source/dialog/tabdlg.cxx @@ -51,19 +51,12 @@ #include "dialog.hrc" #include "helpid.hrc" -#if ENABLE_LAYOUT_SFX_TABDIALOG -#undef TabPage -#undef SfxTabPage -#define SfxTabPage ::SfxTabPage -#undef SfxTabDialog -#endif /* ENABLE_LAYOUT_SFX_TABDIALOG */ - using namespace ::com::sun::star::uno; using namespace ::rtl; #define USERITEM_NAME OUString(RTL_CONSTASCII_USTRINGPARAM("UserItem")) -TYPEINIT1(LAYOUT_NS_SFX_TABDIALOG SfxTabDialogItem,SfxSetItem); +TYPEINIT1(SfxTabDialogItem,SfxSetItem); struct TabPageImpl { @@ -74,8 +67,6 @@ struct TabPageImpl TabPageImpl() : mbStandard( sal_False ) {} }; -NAMESPACE_LAYOUT_SFX_TABDIALOG - struct Data_Impl { sal_uInt16 nId; // The ID @@ -220,8 +211,6 @@ Data_Impl* Find( SfxTabDlgData_Impl& rArr, sal_uInt16 nId, sal_uInt16* pPos ) return 0; } -#if !ENABLE_LAYOUT_SFX_TABDIALOG - void SfxTabPage::SetFrame(const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& xFrame) { if (pImpl) @@ -271,9 +260,7 @@ SfxTabPage::~SfxTabPage() */ { -#if !ENABLE_LAYOUT delete pImpl; -#endif /* ENABLE_LAYOUT */ } // ----------------------------------------------------------------------- @@ -407,23 +394,6 @@ void SfxTabPage::AddItemConnection( sfx::ItemConnectionBase* pConnection ) pImpl->maItemConn.AddConnection( pConnection ); } -#endif /* !ENABLE_LAYOUT_SFX_TABDIALOG */ - -#if ENABLE_LAYOUT_SFX_TABDIALOG -#undef ResId -#define ResId(id, foo) #id -#undef TabDialog -#define TabDialog(parent, res_id) Dialog (parent, "tab-dialog.xml", "tab-dialog") - -#define aOKBtn(this) aOKBtn (this, "BTN_OK") -#undef PushButton -#define PushButton(this) layout::PushButton (this, "BTN_USER") -#define aCancelBtn(this) aCancelBtn (this, "BTN_CANCEL") -#define aHelpBtn(this) aHelpBtn (this, "BTN_HELP") -#define aResetBtn(this) aResetBtn (this, "BTN_RESET") -#define aBaseFmtBtn(this) aBaseFmtBtn (this, "BTN_BASEFMT") -#endif /* ENABLE_LAYOUT_SFX_TABDIALOG */ - #define INI_LIST(ItemSetPtr) \ aTabCtrl ( this, ResId(ID_TABCONTROL,*rResId.GetResMgr() ) ),\ aOKBtn ( this ),\ @@ -498,24 +468,11 @@ SfxTabDialog::SfxTabDialog // ----------------------------------------------------------------------- -#if ENABLE_LAYOUT_SFX_TABDIALOG -#undef ResId -#undef TabDialog -#undef aOKBtn -#undef PushButton -#undef aCancelBtn -#undef aHelpBtn -#undef aResetBtn -#undef aBaseFmtBtn -#endif /* ENABLE_LAYOUT_SFX_TABDIALOG */ - SfxTabDialog::~SfxTabDialog() { // save settings (screen position and current page) SvtViewOptions aDlgOpt( E_TABDIALOG, String::CreateFromInt32( nResId ) ); -#if !ENABLE_LAYOUT_SFX_TABDIALOG aDlgOpt.SetWindowState(OStringToOUString(GetWindowState(WINDOWSTATE_MASK_POS),RTL_TEXTENCODING_ASCII_US)); -#endif /* !ENABLE_LAYOUT_SFX_TABDIALOG */ aDlgOpt.SetPageID( aTabCtrl.GetCurPageId() ); const sal_uInt16 nCount = pImpl->pData->Count(); @@ -624,11 +581,6 @@ void SfxTabDialog::RemoveResetButton() // ----------------------------------------------------------------------- -#if ENABLE_LAYOUT_SFX_TABDIALOG -#undef TabDialog -#define TabDialog Dialog -#endif /* ENABLE_LAYOUT_SFX_TABDIALOG */ - short SfxTabDialog::Execute() { if ( !aTabCtrl.GetPageCount() ) @@ -641,14 +593,10 @@ short SfxTabDialog::Execute() void SfxTabDialog::StartExecuteModal( const Link& rEndDialogHdl ) { -#if !ENABLE_LAYOUT_SFX_TABDIALOG if ( !aTabCtrl.GetPageCount() ) return; Start_Impl(); TabDialog::StartExecuteModal( rEndDialogHdl ); -#else - rEndDialogHdl.IsSet(); -#endif /* !ENABLE_LAYOUT_SFX_TABDIALOG */ } // ----------------------------------------------------------------------- @@ -695,10 +643,8 @@ void SfxTabDialog::EnableApplyButton(sal_Bool bEnable) if ( bEnable ) { pImpl->pApplyButton = new PushButton( this ); -#if !ENABLE_LAYOUT_SFX_TABDIALOG // in the z-order, the apply button should be behind the ok button, thus appearing at the right side of it pImpl->pApplyButton->SetZOrder(&aOKBtn, WINDOW_ZORDER_BEHIND); -#endif /* ENABLE_LAYOUT_SFX_TABDIALOG */ pImpl->pApplyButton->SetText( String( SfxResId( STR_APPLY ) ) ); pImpl->pApplyButton->Show(); @@ -710,11 +656,9 @@ void SfxTabDialog::EnableApplyButton(sal_Bool bEnable) pImpl->pApplyButton = NULL; } -#if !ENABLE_LAYOUT_SFX_TABDIALOG // adjust the layout if (IsReallyShown()) AdjustLayout(); -#endif /* !ENABLE_LAYOUT_SFX_TABDIALOG */ } // ----------------------------------------------------------------------- @@ -735,9 +679,7 @@ void SfxTabDialog::Start_Impl() SvtViewOptions aDlgOpt( E_TABDIALOG, String::CreateFromInt32( nResId ) ); if ( aDlgOpt.Exists() ) { -#if !ENABLE_LAYOUT_SFX_TABDIALOG SetWindowState(rtl::OUStringToOString(aDlgOpt.GetWindowState().getStr(), RTL_TEXTENCODING_ASCII_US)); -#endif /* !ENABLE_LAYOUT_SFX_TABDIALOG */ // initial TabPage from Program/Help/config nActPage = (sal_uInt16)aDlgOpt.GetPageID(); @@ -1250,11 +1192,7 @@ IMPL_LINK( SfxTabDialog, BaseFmtHdl, Button *, EMPTYARG ) // ----------------------------------------------------------------------- -#if ENABLE_LAYOUT_SFX_TABDIALOG -#define tabControlWindow pTabCtrl->GetWindow () -#else /* !ENABLE_LAYOUT_SFX_TABDIALOG */ #define tabControlWindow pTabCtrl -#endif /* !ENABLE_LAYOUT_SFX_TABDIALOG */ IMPL_LINK( SfxTabDialog, ActivatePageHdl, TabControl *, pTabCtrl ) @@ -1281,10 +1219,6 @@ IMPL_LINK( SfxTabDialog, ActivatePageHdl, TabControl *, pTabCtrl ) // Create TabPage if possible: if ( !pTabPage ) { -#if ENABLE_LAYOUT_SFX_TABDIALOG - if (dynamic_cast<layout SfxTabPage*> (pTabPage)) - layout::TabPage::global_parent = pTabCtrl->GetWindow (); -#endif const SfxItemSet* pTmpSet = 0; if ( pSet ) @@ -1303,9 +1237,7 @@ IMPL_LINK( SfxTabDialog, ActivatePageHdl, TabControl *, pTabCtrl ) DBG_ASSERT( NULL == pDataObject->pTabPage, "create TabPage more than once" ); pDataObject->pTabPage = pTabPage; -#if !ENABLE_LAYOUT_SFX_TABDIALOG pDataObject->pTabPage->SetTabDialog( this ); -#endif /* ENABLE_LAYOUT_SFX_TABDIALOG */ SvtViewOptions aPageOpt( E_TABPAGE, String::CreateFromInt32( pDataObject->nId ) ); String sUserData; Any aUserItem = aPageOpt.GetUserItem( USERITEM_NAME ); @@ -1315,22 +1247,6 @@ IMPL_LINK( SfxTabDialog, ActivatePageHdl, TabControl *, pTabCtrl ) pTabPage->SetUserData( sUserData ); Size aSiz = pTabPage->GetSizePixel(); -#if ENABLE_LAYOUT - Size optimalSize = pTabPage->GetOptimalSize (WINDOWSIZE_MINIMUM); -#if ENABLE_LAYOUT_SFX_TABDIALOG - if (dynamic_cast<layout SfxTabPage*> (pTabPage)) - { - if (optimalSize.Height () && optimalSize.Width ()) - { - optimalSize.Width () = optimalSize.Width (); - optimalSize.Height () = optimalSize.Height () + 40; - } - } -#endif /* ENABLE_LAYOUT_SFX_TABDIALOG */ - if (optimalSize.Height () > 0 && optimalSize.Width () > 0 ) - aSiz = optimalSize; -#endif /* ENABLE_LAYOUT */ - Size aCtrlSiz = pTabCtrl->GetTabPageSizePixel(); // Only set Size on TabControl when < as TabPage if ( aCtrlSiz.Width() < aSiz.Width() || @@ -1352,10 +1268,6 @@ IMPL_LINK( SfxTabDialog, ActivatePageHdl, TabControl *, pTabCtrl ) pTabPage->Reset( *pSet ); pDataObject->bRefresh = sal_False; -#if ENABLE_LAYOUT_SFX_TABDIALOG - pTabCtrl->GetPagePos (nId); -#endif /* ENABLE_LAYOUT_SFX_TABDIALOG */ - if ( pExampleSet ) pTabPage->ActivatePage( *pExampleSet ); sal_Bool bReadOnly = pTabPage->IsReadOnly(); @@ -1578,6 +1490,4 @@ long SfxTabDialog::Notify( NotifyEvent& rNEvt ) return TabDialog::Notify( rNEvt ); } -END_NAMESPACE_LAYOUT_SFX_TABDIALOG - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/layout/sfxtabdialog.cxx b/sfx2/source/layout/sfxtabdialog.cxx index da2dc738ae4e..2e7d1aa476f3 100644 --- a/sfx2/source/layout/sfxtabdialog.cxx +++ b/sfx2/source/layout/sfxtabdialog.cxx @@ -62,7 +62,6 @@ using namespace ::com::sun::star; } #include <sfx2/layout.hxx> -#include <layout/layout-pre.hxx> #undef TabPage #undef SfxTabPage |