1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
24 #include <vcl/builder.hxx>
25 #include <vcl/msgbox.hxx>
26 #include <unotools/viewoptions.hxx>
28 #include "appdata.hxx"
29 #include "sfxtypes.hxx"
30 #include <sfx2/tabdlg.hxx>
31 #include <sfx2/viewfrm.hxx>
32 #include <sfx2/app.hxx>
33 #include "sfx2/sfxresid.hxx"
34 #include "sfx2/sfxhelp.hxx"
35 #include <sfx2/ctrlitem.hxx>
36 #include <sfx2/bindings.hxx>
37 #include <sfx2/sfxdlg.hxx>
38 #include <sfx2/itemconnect.hxx>
43 using namespace ::com::sun::star::uno
;
44 using namespace ::rtl
;
46 #define USERITEM_NAME OUString("UserItem")
48 TYPEINIT1(SfxTabDialogItem
,SfxSetItem
);
53 sfx::ItemConnectionArray maItemConn
;
54 ::com::sun::star::uno::Reference
< ::com::sun::star::frame::XFrame
> mxFrame
;
56 TabPageImpl() : mbStandard( sal_False
) {}
61 sal_uInt16 nId
; // The ID
62 CreateTabPage fnCreatePage
; // Pointer to Factory
63 GetTabPageRanges fnGetRanges
; // Pointer to Ranges-Function
64 SfxTabPage
* pTabPage
; // The TabPage itself
65 sal_Bool bOnDemand
; // Flag: ItemSet onDemand
66 sal_Bool bRefresh
; // Flag: Page must be re-initialized
69 Data_Impl( sal_uInt16 Id
, CreateTabPage fnPage
,
70 GetTabPageRanges fnRanges
, sal_Bool bDemand
) :
73 fnCreatePage( fnPage
),
74 fnGetRanges ( fnRanges
),
76 bOnDemand ( bDemand
),
77 bRefresh ( sal_False
)
81 SfxAbstractDialogFactory
* pFact
= SfxAbstractDialogFactory::Create();
84 fnCreatePage
= pFact
->GetTabPageCreatorFunc( nId
);
85 fnGetRanges
= pFact
->GetTabPageRangesFunc( nId
);
91 SfxTabDialogItem::SfxTabDialogItem( const SfxTabDialogItem
& rAttr
, SfxItemPool
* pItemPool
)
92 : SfxSetItem( rAttr
, pItemPool
)
96 SfxTabDialogItem::SfxTabDialogItem( sal_uInt16 nId
, const SfxItemSet
& rItemSet
)
97 : SfxSetItem( nId
, rItemSet
)
101 SfxPoolItem
* SfxTabDialogItem::Clone(SfxItemPool
* pToPool
) const
103 return new SfxTabDialogItem( *this, pToPool
);
106 SfxPoolItem
* SfxTabDialogItem::Create(SvStream
& /*rStream*/, sal_uInt16
/*nVersion*/) const
108 OSL_FAIL( "Use it only in UI!" );
112 class SfxTabDialogController
: public SfxControllerItem
114 SfxTabDialog
* pDialog
;
115 const SfxItemSet
* pSet
;
117 SfxTabDialogController( sal_uInt16 nSlotId
, SfxBindings
& rBindings
, SfxTabDialog
* pDlg
)
118 : SfxControllerItem( nSlotId
, rBindings
)
123 ~SfxTabDialogController();
125 virtual void StateChanged( sal_uInt16 nSID
, SfxItemState eState
, const SfxPoolItem
* pState
);
128 SfxTabDialogController::~SfxTabDialogController()
133 void SfxTabDialogController::StateChanged( sal_uInt16
/*nSID*/, SfxItemState
/*eState*/, const SfxPoolItem
* pState
)
135 const SfxSetItem
* pSetItem
= PTR_CAST( SfxSetItem
, pState
);
138 pSet
= pDialog
->pSet
= pSetItem
->GetItemSet().Clone();
139 sal_Bool bDialogStarted
= sal_False
;
140 for ( sal_uInt16 n
=0; n
<pDialog
->m_pTabCtrl
->GetPageCount(); n
++ )
142 sal_uInt16 nPageId
= pDialog
->m_pTabCtrl
->GetPageId( n
);
143 SfxTabPage
* pTabPage
= dynamic_cast<SfxTabPage
*> (pDialog
->m_pTabCtrl
->GetTabPage( nPageId
));
146 pTabPage
->Reset( pSetItem
->GetItemSet() );
147 bDialogStarted
= sal_True
;
151 if ( bDialogStarted
)
158 typedef std::vector
<Data_Impl
*> SfxTabDlgData_Impl
;
162 sal_Bool bModified
: 1,
165 SfxTabDlgData_Impl aData
;
167 SfxTabDialogController
* pController
;
169 TabDlg_Impl( sal_uInt8 nCnt
) :
171 bModified ( sal_False
),
173 bHideResetBtn ( sal_False
),
176 aData
.reserve( nCnt
);
185 static Data_Impl
* Find( const SfxTabDlgData_Impl
& rArr
, sal_uInt16 nId
, sal_uInt16
* pPos
= 0)
187 const sal_uInt16 nCount
= rArr
.size();
189 for ( sal_uInt16 i
= 0; i
< nCount
; ++i
)
191 Data_Impl
* pObj
= rArr
[i
];
193 if ( pObj
->nId
== nId
)
203 void SfxTabPage::SetFrame(const ::com::sun::star::uno::Reference
< ::com::sun::star::frame::XFrame
>& xFrame
)
206 pImpl
->mxFrame
= xFrame
;
209 ::com::sun::star::uno::Reference
< ::com::sun::star::frame::XFrame
> SfxTabPage::GetFrame()
212 return pImpl
->mxFrame
;
213 return ::com::sun::star::uno::Reference
< ::com::sun::star::frame::XFrame
>();
216 SfxTabPage::SfxTabPage( Window
*pParent
,
217 const ResId
&rResId
, const SfxItemSet
&rAttrSet
) :
224 TabPage( pParent
, rResId
),
227 bHasExchangeSupport ( sal_False
),
229 pImpl ( new TabPageImpl
)
235 SfxTabPage::SfxTabPage(Window
*pParent
, const OString
& rID
, const OUString
& rUIXMLDescription
, const SfxItemSet
&rAttrSet
)
236 : TabPage(pParent
, rID
, rUIXMLDescription
)
238 , bHasExchangeSupport ( sal_False
)
240 , pImpl ( new TabPageImpl
)
244 // -----------------------------------------------------------------------
246 SfxTabPage::~SfxTabPage()
257 // -----------------------------------------------------------------------
259 sal_Bool
SfxTabPage::FillItemSet( SfxItemSet
& rSet
)
261 return pImpl
->maItemConn
.DoFillItemSet( rSet
, GetItemSet() );
264 // -----------------------------------------------------------------------
266 void SfxTabPage::Reset( const SfxItemSet
& rSet
)
268 pImpl
->maItemConn
.DoApplyFlags( rSet
);
269 pImpl
->maItemConn
.DoReset( rSet
);
272 // -----------------------------------------------------------------------
274 void SfxTabPage::ActivatePage( const SfxItemSet
& )
278 Default implementation of the virtual ActivatePage method. This method is
279 called when a page of dialogue supports the exchange of data between pages.
280 <SfxTabPage::DeactivatePage(SfxItemSet *)>
286 // -----------------------------------------------------------------------
288 int SfxTabPage::DeactivatePage( SfxItemSet
* )
292 Default implementation of the virtual DeactivatePage method. This method is
293 called by Sfx when leaving a page; the application can, through the return
294 value, control whether to leave the page. If the page is displayed through
295 bHasExchangeSupport which supports data exchange between pages, then a
296 pointer to the exchange set is passed as parameter. This takes on data for
297 the exchange, then the set is available as a parameter in
298 <SfxTabPage::ActivatePage(const SfxItemSet &)>.
302 LEAVE_PAGE; Allow leaving the page
309 // -----------------------------------------------------------------------
311 void SfxTabPage::FillUserData()
315 Virtual method is called by the base class in the destructor to save
316 specific information of the TabPage in the ini-file. When overloading a
317 string must be compiled, which is then flushed with the <SetUserData()>.
323 // -----------------------------------------------------------------------
325 sal_Bool
SfxTabPage::IsReadOnly() const
330 // -----------------------------------------------------------------------
332 const SfxPoolItem
* SfxTabPage::GetItem( const SfxItemSet
& rSet
, sal_uInt16 nSlot
, sal_Bool bDeep
)
336 static Method: hereby are the implementations of the TabPage code
341 const SfxItemPool
* pPool
= rSet
.GetPool();
342 sal_uInt16 nWh
= pPool
->GetWhich( nSlot
, bDeep
);
343 const SfxPoolItem
* pItem
= 0;
344 rSet
.GetItemState( nWh
, sal_True
, &pItem
);
346 if ( !pItem
&& nWh
!= nSlot
)
347 pItem
= &pPool
->GetDefaultItem( nWh
);
351 // -----------------------------------------------------------------------
353 const SfxPoolItem
* SfxTabPage::GetOldItem( const SfxItemSet
& rSet
,
354 sal_uInt16 nSlot
, sal_Bool bDeep
)
358 This method returns an attribute for comparison of the old value.
362 const SfxItemSet
& rOldSet
= GetItemSet();
363 sal_uInt16 nWh
= GetWhich( nSlot
, bDeep
);
364 const SfxPoolItem
* pItem
= 0;
366 if ( pImpl
->mbStandard
&& rOldSet
.GetParent() )
367 pItem
= GetItem( *rOldSet
.GetParent(), nSlot
);
368 else if ( rSet
.GetParent() &&
369 SFX_ITEM_DONTCARE
== rSet
.GetItemState( nWh
) )
370 pItem
= GetItem( *rSet
.GetParent(), nSlot
);
372 pItem
= GetItem( rOldSet
, nSlot
);
376 void SfxTabPage::PageCreated( SfxAllItemSet
/*aSet*/ )
378 DBG_ASSERT(0, "SfxTabPage::PageCreated should not be called");
381 // -----------------------------------------------------------------------
383 void SfxTabPage::AddItemConnection( sfx::ItemConnectionBase
* pConnection
)
385 pImpl
->maItemConn
.AddConnection( pConnection
);
388 #define INI_LIST(ItemSetPtr) \
392 , nResId(rResId.GetId()) \
393 , nAppPageId(USHRT_MAX) \
394 , bItemsReset(sal_False) \
398 // -----------------------------------------------------------------------
400 SfxTabDialog::SfxTabDialog
408 SfxViewFrame
* pViewFrame
, // Frame, to which the Dialog belongs
409 Window
* pParent
, // Parent Window
410 const ResId
& rResId
, // ResourceId
411 const SfxItemSet
* pItemSet
, // Itemset with the data;
412 // can be NULL, when Pages are onDemand
413 sal_Bool bEditFmt
, // Flag: templates are processed
414 // when yes -> additional Button for standard
415 const String
* pUserButtonText
// Text for UserButton;
416 // if != 0, the UserButton is created
418 : TabDialog(pParent
, rResId
)
422 Init_Impl( bFmt
, pUserButtonText
, &rResId
);
425 SfxTabDialog::SfxTabDialog
427 SfxViewFrame
* pViewFrame
, // Frame, to which the Dialog belongs
428 Window
* pParent
, // Parent Window
429 const OString
& rID
, const OUString
& rUIXMLDescription
, //Dialog Name, Dialog .ui path
430 const SfxItemSet
* pItemSet
, // Itemset with the data;
431 // can be NULL, when Pages are onDemand
432 sal_Bool bEditFmt
// Flag: templates are processed
433 // when yes -> additional Button for standard
435 : TabDialog(pParent
, rID
, rUIXMLDescription
)
441 , nAppPageId(USHRT_MAX
)
442 , bItemsReset(sal_False
)
446 Init_Impl( bFmt
, NULL
, NULL
);
449 // -----------------------------------------------------------------------
451 SfxTabDialog::SfxTabDialog
455 Constructor, temporary without Frame
459 Window
* pParent
, // Parent Window
460 const ResId
& rResId
, // ResourceId
461 const SfxItemSet
* pItemSet
, // Itemset with the data;
462 // can be NULL, when Pages are onDemand
463 sal_Bool bEditFmt
, // Flag: templates are processed
464 // when yes -> additional Button for standard
465 const String
* pUserButtonText
// Text for UserButton;
466 // if != 0, the UserButton is created
468 : TabDialog(pParent
, rResId
)
472 Init_Impl( bFmt
, pUserButtonText
, &rResId
);
473 DBG_WARNING( "Please use the Construtor with the ViewFrame" );
476 SfxTabDialog::SfxTabDialog
480 Constructor, temporary without Frame
484 Window
* pParent
, // Parent Window
485 const OString
& rID
, const OUString
& rUIXMLDescription
, //Dialog Name, Dialog .ui path
486 const SfxItemSet
* pItemSet
, // Itemset with the data;
487 // can be NULL, when Pages are onDemand
488 sal_Bool bEditFmt
// Flag: templates are processed
489 // when yes -> additional Button for standard
491 : TabDialog(pParent
, rID
, rUIXMLDescription
)
497 , nAppPageId(USHRT_MAX
)
498 , bItemsReset(sal_False
)
502 Init_Impl(bFmt
, NULL
, NULL
);
503 DBG_WARNING( "Please use the Construtor with the ViewFrame" );
506 // -----------------------------------------------------------------------
508 SfxTabDialog::~SfxTabDialog()
512 for ( SfxTabDlgData_Impl::const_iterator it
= pImpl
->aData
.begin(); it
!= pImpl
->aData
.end(); ++it
)
514 Data_Impl
* pDataObject
= *it
;
516 if ( pDataObject
->pTabPage
)
518 // save settings of all pages (user data)
519 pDataObject
->pTabPage
->FillUserData();
520 String
aPageData( pDataObject
->pTabPage
->GetUserData() );
521 if ( aPageData
.Len() )
523 // save settings of all pages (user data)
524 SvtViewOptions
aPageOpt( E_TABPAGE
, OUString::number( pDataObject
->nId
) );
525 aPageOpt
.SetUserItem( USERITEM_NAME
, makeAny( OUString( aPageData
) ) );
528 if ( pDataObject
->bOnDemand
)
529 delete (SfxItemSet
*)&pDataObject
->pTabPage
->GetItemSet();
530 delete pDataObject
->pTabPage
;
540 if (m_bOwnsBaseFmtBtn
)
541 delete m_pBaseFmtBtn
;
546 if (m_bOwnsCancelBtn
)
554 if (m_bOwnsActionArea
)
555 delete m_pActionArea
;
562 // -----------------------------------------------------------------------
564 void SfxTabDialog::Init_Impl( sal_Bool bFmtFlag
, const String
* pUserButtonText
, const ResId
*pResId
)
568 internal initialization of the dialogue
572 m_pBox
= get_content_area();
573 m_bOwnsVBox
= m_pBox
== NULL
;
576 m_pBox
= new VclVBox(this, false, 7);
577 m_pBox
->set_expand(true);
578 set_content_area(m_pBox
);
581 m_pTabCtrl
= m_pUIBuilder
? m_pUIBuilder
->get
<TabControl
>("tabcontrol") : NULL
;
582 m_bOwnsTabCtrl
= m_pTabCtrl
== NULL
;
585 m_pTabCtrl
= new TabControl(m_pBox
, ResId(ID_TABCONTROL
, *pResId
->GetResMgr()));
586 m_pTabCtrl
->set_expand(true);
589 m_pActionArea
= get_action_area();
590 m_bOwnsActionArea
= m_pActionArea
== NULL
;
591 if (m_bOwnsActionArea
)
593 m_pActionArea
= new VclHButtonBox(m_pBox
);
594 set_action_area(m_pActionArea
);
597 m_pOKBtn
= m_pUIBuilder
? m_pUIBuilder
->get
<OKButton
>("ok") : NULL
;
598 m_bOwnsOKBtn
= m_pOKBtn
== NULL
;
600 m_pOKBtn
= new OKButton(m_pActionArea
);
602 m_pApplyBtn
= m_pUIBuilder
? m_pUIBuilder
->get
<PushButton
>("apply") : NULL
;
603 m_bOwnsApplyBtn
= m_pApplyBtn
== NULL
;
607 m_pUserBtn
= m_pUIBuilder
? m_pUIBuilder
->get
<PushButton
>("user") : NULL
;
608 m_bOwnsUserBtn
= m_pUserBtn
== NULL
;
610 m_pUserBtn
= pUserButtonText
? new PushButton(m_pActionArea
) : NULL
;
612 m_pCancelBtn
= m_pUIBuilder
? m_pUIBuilder
->get
<CancelButton
>("cancel") : NULL
;
613 m_bOwnsCancelBtn
= m_pCancelBtn
== NULL
;
614 if (m_bOwnsCancelBtn
)
615 m_pCancelBtn
= new CancelButton(m_pActionArea
);
617 m_pHelpBtn
= m_pUIBuilder
? m_pUIBuilder
->get
<HelpButton
>("help") : NULL
;
618 m_bOwnsHelpBtn
= m_pHelpBtn
== NULL
;
620 m_pHelpBtn
= new HelpButton(m_pActionArea
);
622 m_pResetBtn
= m_pUIBuilder
? m_pUIBuilder
->get
<PushButton
>("reset") : NULL
;
623 m_bOwnsResetBtn
= m_pResetBtn
== NULL
;
625 m_pResetBtn
= new PushButton(m_pActionArea
);
627 m_pBaseFmtBtn
= m_pUIBuilder
? m_pUIBuilder
->get
<PushButton
>("standard") : NULL
;
628 m_bOwnsBaseFmtBtn
= m_pBaseFmtBtn
== NULL
;
629 if (m_bOwnsBaseFmtBtn
)
630 m_pBaseFmtBtn
= new PushButton(m_pActionArea
);
632 pImpl
= new TabDlg_Impl(m_pTabCtrl
->GetPageCount());
634 m_pOKBtn
->SetClickHdl( LINK( this, SfxTabDialog
, OkHdl
) );
635 m_pCancelBtn
->SetClickHdl( LINK( this, SfxTabDialog
, CancelHdl
) );
636 m_pResetBtn
->SetClickHdl( LINK( this, SfxTabDialog
, ResetHdl
) );
637 m_pResetBtn
->SetText( SfxResId( STR_RESET
).toString() );
638 m_pTabCtrl
->SetActivatePageHdl(
639 LINK( this, SfxTabDialog
, ActivatePageHdl
) );
640 m_pTabCtrl
->SetDeactivatePageHdl(
641 LINK( this, SfxTabDialog
, DeactivatePageHdl
) );
642 m_pActionArea
->Show();
646 m_pCancelBtn
->Show();
649 m_pResetBtn
->SetHelpId( HID_TABDLG_RESET_BTN
);
654 m_pUserBtn
->SetText(*pUserButtonText
);
655 m_pUserBtn
->SetClickHdl( LINK( this, SfxTabDialog
, UserHdl
) );
659 /* TODO: Check what is up with bFmt/bFmtFlag. Comment below suggests a
660 different behavior than implemented!! */
663 m_pBaseFmtBtn
->SetText( SfxResId( STR_STANDARD_SHORTCUT
).toString() );
664 m_pBaseFmtBtn
->SetClickHdl( LINK( this, SfxTabDialog
, BaseFmtHdl
) );
665 m_pBaseFmtBtn
->SetHelpId( HID_TABDLG_STANDARD_BTN
);
667 // bFmt = temporary Flag passed on in the Constructor(),
668 // if bFmt == 2, then also sal_True,
669 // additional suppression of the standard button,
670 // after the Initializing set to sal_True again
672 m_pBaseFmtBtn
->Show();
679 pExampleSet
= new SfxItemSet( *pSet
);
680 pOutSet
= new SfxItemSet( *pSet
->GetPool(), pSet
->GetRanges() );
683 m_pOKBtn
->SetAccessibleRelationMemberOf( m_pOKBtn
);
684 m_pCancelBtn
->SetAccessibleRelationMemberOf( m_pCancelBtn
);
685 m_pHelpBtn
->SetAccessibleRelationMemberOf( m_pHelpBtn
);
686 m_pResetBtn
->SetAccessibleRelationMemberOf( m_pResetBtn
);
689 // -----------------------------------------------------------------------
691 void SfxTabDialog::RemoveResetButton()
694 pImpl
->bHideResetBtn
= sal_True
;
697 // -----------------------------------------------------------------------
699 short SfxTabDialog::Execute()
701 if ( !m_pTabCtrl
->GetPageCount() )
704 return TabDialog::Execute();
707 // -----------------------------------------------------------------------
709 void SfxTabDialog::StartExecuteModal( const Link
& rEndDialogHdl
)
711 if ( !m_pTabCtrl
->GetPageCount() )
714 TabDialog::StartExecuteModal( rEndDialogHdl
);
717 // -----------------------------------------------------------------------
719 void SfxTabDialog::Start( sal_Bool bShow
)
721 pImpl
->bModal
= sal_False
;
728 // -----------------------------------------------------------------------
730 void SfxTabDialog::SetApplyHandler(const Link
& _rHdl
)
732 DBG_ASSERT( m_pApplyBtn
, "SfxTabDialog::GetApplyHandler: no apply button enabled!" );
734 m_pApplyBtn
->SetClickHdl( _rHdl
);
737 // -----------------------------------------------------------------------
739 void SfxTabDialog::EnableApplyButton(sal_Bool bEnable
)
741 if ( IsApplyButtonEnabled() == bEnable
)
745 // create or remove the apply button
748 m_pApplyBtn
= new PushButton(m_pActionArea
);
749 // in the z-order, the apply button should be behind the ok button, thus appearing at the right side of it
750 m_pApplyBtn
->SetZOrder(m_pOKBtn
, WINDOW_ZORDER_BEHIND
);
751 m_pApplyBtn
->SetText(SfxResId( STR_APPLY
).toString());
754 m_pApplyBtn
->SetHelpId( HID_TABDLG_APPLY_BTN
);
767 // -----------------------------------------------------------------------
769 sal_Bool
SfxTabDialog::IsApplyButtonEnabled() const
771 return ( NULL
!= m_pApplyBtn
);
774 // -----------------------------------------------------------------------
776 void SfxTabDialog::Start_Impl()
778 DBG_ASSERT( pImpl
->aData
.size() == m_pTabCtrl
->GetPageCount(), "not all pages registered" );
779 sal_uInt16 nActPage
= m_pTabCtrl
->GetPageId( 0 );
781 // load old settings, when exists
782 SvtViewOptions
aDlgOpt( E_TABDIALOG
, OUString::number( nResId
) );
783 if ( aDlgOpt
.Exists() )
785 SetWindowState(OUStringToOString(aDlgOpt
.GetWindowState().getStr(), RTL_TEXTENCODING_ASCII_US
));
787 // initial TabPage from Program/Help/config
788 nActPage
= (sal_uInt16
)aDlgOpt
.GetPageID();
790 if ( USHRT_MAX
!= nAppPageId
)
791 nActPage
= nAppPageId
;
794 sal_uInt16 nAutoTabPageId
= SFX_APP()->Get_Impl()->nAutoTabPageId
;
795 if ( nAutoTabPageId
)
796 nActPage
= nAutoTabPageId
;
799 if ( TAB_PAGE_NOTFOUND
== m_pTabCtrl
->GetPagePos( nActPage
) )
800 nActPage
= m_pTabCtrl
->GetPageId( 0 );
802 else if ( USHRT_MAX
!= nAppPageId
&& TAB_PAGE_NOTFOUND
!= m_pTabCtrl
->GetPagePos( nAppPageId
) )
803 nActPage
= nAppPageId
;
805 m_pTabCtrl
->SetCurPageId( nActPage
);
806 ActivatePageHdl( m_pTabCtrl
);
809 void SfxTabDialog::AddTabPage( sal_uInt16 nId
, sal_Bool bItemsOnDemand
)
811 AddTabPage( nId
, 0, 0, bItemsOnDemand
);
814 void SfxTabDialog::AddTabPage( sal_uInt16 nId
, const String
&rRiderText
, sal_Bool bItemsOnDemand
, sal_uInt16 nPos
)
816 AddTabPage( nId
, rRiderText
, 0, 0, bItemsOnDemand
, nPos
);
819 #ifdef SV_HAS_RIDERBITMAPS
821 void SfxTabDialog::AddTabPage( sal_uInt16 nId
, const Bitmap
&rRiderBitmap
, sal_Bool bItemsOnDemand
, sal_uInt16 nPos
)
823 AddTabPage( nId
, rRiderBitmap
, 0, 0, bItemsOnDemand
, nPos
);
828 // -----------------------------------------------------------------------
830 void SfxTabDialog::AddTabPage
834 Adding a page to the dialogue. Must correspond to a entry in the
835 TabControl in the resource of the dialogue.
839 sal_uInt16 nId
, // Page ID
840 CreateTabPage pCreateFunc
, // Pointer to the Factory Method
841 GetTabPageRanges pRangesFunc
, // Pointer to the Method for quering
843 sal_Bool bItemsOnDemand
// indicates whether the set of this page is
844 // requested when created
847 pImpl
->aData
.push_back(
848 new Data_Impl( nId
, pCreateFunc
, pRangesFunc
, bItemsOnDemand
) );
853 Adds a page to the dialog. The Name must correspond to a entry in the
854 TabControl in the dialog .ui
856 sal_uInt16
SfxTabDialog::AddTabPage
858 const OString
&rName
, // Page ID
859 CreateTabPage pCreateFunc
, // Pointer to the Factory Method
860 GetTabPageRanges pRangesFunc
, // Pointer to the Method for quering
862 sal_Bool bItemsOnDemand
// indicates whether the set of this page is
863 // requested when created
866 sal_uInt16 nId
= m_pTabCtrl
->GetPageId(rName
);
867 pImpl
->aData
.push_back(
868 new Data_Impl( nId
, pCreateFunc
, pRangesFunc
, bItemsOnDemand
) );
873 Adds a page to the dialog. The Name must correspond to a entry in the
874 TabControl in the dialog .ui
876 sal_uInt16
SfxTabDialog::AddTabPage
878 const OString
&rName
, // Page ID
879 sal_uInt16 nPageCreateId
// Identifier of the Factory Method to create the page
882 SfxAbstractDialogFactory
* pFact
= SfxAbstractDialogFactory::Create();
884 CreateTabPage pCreateFunc
= pFact
->GetTabPageCreatorFunc(nPageCreateId
);
886 GetTabPageRanges pRangesFunc
= pFact
->GetTabPageRangesFunc(nPageCreateId
);
887 sal_uInt16 nPageId
= m_pTabCtrl
->GetPageId(rName
);
888 pImpl
->aData
.push_back(new Data_Impl(nPageId
, pCreateFunc
, pRangesFunc
, false));
892 // -----------------------------------------------------------------------
894 void SfxTabDialog::AddTabPage
898 Add a page to the dialog. The Rider text is passed on, the page has no
899 counterpart in the TabControl in the resource of the dialogue.
904 const String
& rRiderText
,
905 CreateTabPage pCreateFunc
,
906 GetTabPageRanges pRangesFunc
,
907 sal_Bool bItemsOnDemand
,
911 DBG_ASSERT( TAB_PAGE_NOTFOUND
== m_pTabCtrl
->GetPagePos( nId
),
912 "Double Page-Ids in the Tabpage" );
913 m_pTabCtrl
->InsertPage( nId
, rRiderText
, nPos
);
914 pImpl
->aData
.push_back(
915 new Data_Impl( nId
, pCreateFunc
, pRangesFunc
, bItemsOnDemand
) );
918 // -----------------------------------------------------------------------
919 #ifdef SV_HAS_RIDERBITMAPS
921 void SfxTabDialog::AddTabPage
925 Add a page to the dialog. The riders bitmap is passed on, the page has no
926 counterpart in the TabControl in the resource of the dialogue.
931 const Bitmap
&rRiderBitmap
,
932 CreateTabPage pCreateFunc
,
933 GetTabPageRanges pRangesFunc
,
934 sal_Bool bItemsOnDemand
,
938 DBG_ASSERT( TAB_PAGE_NOTFOUND
== m_pTabCtrl
->GetPagePos( nId
),
939 "Duplicate Page-Ids in the Tabpage" );
940 m_pTabCtrl
->InsertPage( nId
, rRiderBitmap
, nPos
);
941 pImpl
->aData
.push_back(
942 new Data_Impl( nId
, pCreateFunc
, pRangesFunc
, bItemsOnDemand
) );
946 // -----------------------------------------------------------------------
948 void SfxTabDialog::RemoveTabPage( sal_uInt16 nId
)
952 Delete the TabPage with ID nId
957 m_pTabCtrl
->RemovePage( nId
);
958 Data_Impl
* pDataObject
= Find( pImpl
->aData
, nId
, &nPos
);
962 if ( pDataObject
->pTabPage
)
964 pDataObject
->pTabPage
->FillUserData();
965 String
aPageData( pDataObject
->pTabPage
->GetUserData() );
966 if ( aPageData
.Len() )
968 // save settings of this page (user data)
969 SvtViewOptions
aPageOpt( E_TABPAGE
, OUString::number( pDataObject
->nId
) );
970 aPageOpt
.SetUserItem( USERITEM_NAME
, makeAny( OUString( aPageData
) ) );
973 if ( pDataObject
->bOnDemand
)
974 delete (SfxItemSet
*)&pDataObject
->pTabPage
->GetItemSet();
975 delete pDataObject
->pTabPage
;
979 pImpl
->aData
.erase( pImpl
->aData
.begin() + nPos
);
983 SAL_INFO( "sfx2.dialog", "TabPage-Id not known" );
987 void SfxTabDialog::RemoveTabPage(const OString
&rName
)
989 RemoveTabPage(m_pTabCtrl
->GetPageId(rName
));
992 // -----------------------------------------------------------------------
994 void SfxTabDialog::PageCreated
998 Default implemetation of the virtual method. This is called immediately
999 after creating a page. Here the dialogue can call the TabPage Method
1004 sal_uInt16
, // Id of the created page
1005 SfxTabPage
& // Reference to the created page
1010 // -----------------------------------------------------------------------
1012 SfxItemSet
* SfxTabDialog::GetInputSetImpl()
1016 Derived classes may create new storage for the InputSet. This has to be
1017 released in the Destructor. To do this, this method must be called.
1021 return (SfxItemSet
*)pSet
;
1024 // -----------------------------------------------------------------------
1026 SfxTabPage
* SfxTabDialog::GetTabPage( sal_uInt16 nPageId
) const
1030 Return TabPage with the specified Id.
1034 sal_uInt16 nPos
= 0;
1035 Data_Impl
* pDataObject
= Find( pImpl
->aData
, nPageId
, &nPos
);
1038 return pDataObject
->pTabPage
;
1042 void SfxTabDialog::SavePosAndId()
1044 // save settings (screen position and current page)
1045 SvtViewOptions
aDlgOpt( E_TABDIALOG
, OUString::number( nResId
) );
1046 aDlgOpt
.SetWindowState(OStringToOUString(GetWindowState(WINDOWSTATE_MASK_POS
),RTL_TEXTENCODING_ASCII_US
));
1047 aDlgOpt
.SetPageID( m_pTabCtrl
->GetCurPageId() );
1050 // -----------------------------------------------------------------------
1052 short SfxTabDialog::Ok()
1056 Ok handler for the Dialogue.
1058 Dialog's current location and current page are saved for the next time
1059 the dialog is shown.
1061 The OutputSet is created and for each page this or the special OutputSet
1062 is set by calling the method <SfxTabPage::FillItemSet(SfxItemSet &)>, to
1063 insert the entered data by the user into the set.
1067 RET_OK: if at least one page has returned from FillItemSet,
1068 otherwise RET_CANCEL.
1072 SavePosAndId(); //See fdo#38828 "Apply" resetting window position
1076 if ( !pExampleSet
&& pSet
)
1077 pOutSet
= pSet
->Clone( sal_False
); // without Items
1078 else if ( pExampleSet
)
1079 pOutSet
= new SfxItemSet( *pExampleSet
);
1081 sal_Bool bModified
= sal_False
;
1083 for ( SfxTabDlgData_Impl::const_iterator it
= pImpl
->aData
.begin(); it
!= pImpl
->aData
.end(); ++it
)
1085 Data_Impl
* pDataObject
= *it
;
1086 SfxTabPage
* pTabPage
= pDataObject
->pTabPage
;
1090 if ( pDataObject
->bOnDemand
)
1092 SfxItemSet
& rSet
= (SfxItemSet
&)pTabPage
->GetItemSet();
1094 bModified
|= pTabPage
->FillItemSet( rSet
);
1096 else if ( pSet
&& !pTabPage
->HasExchangeSupport() )
1098 SfxItemSet
aTmp( *pSet
->GetPool(), pSet
->GetRanges() );
1100 if ( pTabPage
->FillItemSet( aTmp
) )
1102 bModified
|= sal_True
;
1103 pExampleSet
->Put( aTmp
);
1104 pOutSet
->Put( aTmp
);
1110 if ( pImpl
->bModified
|| ( pOutSet
&& pOutSet
->Count() > 0 ) )
1111 bModified
|= sal_True
;
1114 bModified
|= sal_True
;
1115 return bModified
? RET_OK
: RET_CANCEL
;
1118 // -----------------------------------------------------------------------
1120 IMPL_LINK_NOARG(SfxTabDialog
, CancelHdl
)
1122 EndDialog( RET_USER_CANCEL
);
1126 // -----------------------------------------------------------------------
1128 SfxItemSet
* SfxTabDialog::CreateInputItemSet( sal_uInt16
)
1132 Default implemetation of the virtual Method.
1133 This is called when pages create their sets onDenamd.
1137 SAL_WARN( "sfx2.dialog", "CreateInputItemSet not implemented" );
1138 return new SfxAllItemSet( SFX_APP()->GetPool() );
1141 // -----------------------------------------------------------------------
1143 const SfxItemSet
* SfxTabDialog::GetRefreshedSet()
1147 Default implemetation of the virtual Method.
1148 This is called, when <SfxTabPage::DeactivatePage(SfxItemSet *)>
1149 returns <SfxTabPage::REFRESH_SET>.
1153 SAL_INFO ( "sfx2.dialog", "GetRefreshedSet not implemented" );
1157 // -----------------------------------------------------------------------
1159 IMPL_LINK_NOARG(SfxTabDialog
, OkHdl
)
1163 Handler of the Ok-Buttons
1164 This calls the current page <SfxTabPage::DeactivatePage(SfxItemSet *)>.
1165 Returns <SfxTabPage::LEAVE_PAGE>, <SfxTabDialog::Ok()> is called
1166 and the Dialog is ended.
1170 if (PrepareLeaveCurrentPage())
1172 if ( pImpl
->bModal
)
1183 bool SfxTabDialog::Apply()
1185 bool bApplied
= false;
1186 if (PrepareLeaveCurrentPage())
1187 bApplied
= (Ok() == RET_OK
);
1191 // -----------------------------------------------------------------------
1193 bool SfxTabDialog::PrepareLeaveCurrentPage()
1195 sal_uInt16
const nId
= m_pTabCtrl
->GetCurPageId();
1196 SfxTabPage
* pPage
= dynamic_cast<SfxTabPage
*> (m_pTabCtrl
->GetTabPage( nId
));
1201 int nRet
= SfxTabPage::LEAVE_PAGE
;
1204 SfxItemSet
aTmp( *pSet
->GetPool(), pSet
->GetRanges() );
1206 if ( pPage
->HasExchangeSupport() )
1207 nRet
= pPage
->DeactivatePage( &aTmp
);
1209 nRet
= pPage
->DeactivatePage( NULL
);
1211 if ( ( SfxTabPage::LEAVE_PAGE
& nRet
) == SfxTabPage::LEAVE_PAGE
1214 pExampleSet
->Put( aTmp
);
1215 pOutSet
->Put( aTmp
);
1219 nRet
= pPage
->DeactivatePage( NULL
);
1227 // -----------------------------------------------------------------------
1229 IMPL_LINK_NOARG(SfxTabDialog
, UserHdl
)
1233 Handler of the User-Buttons
1234 This calls the current page <SfxTabPage::DeactivatePage(SfxItemSet *)>.
1235 returns this <SfxTabPage::LEAVE_PAGE> and <SfxTabDialog::Ok()> is called.
1236 Then the Dialog is ended with the Return value <SfxTabDialog::Ok()>
1240 if ( PrepareLeaveCurrentPage () )
1244 if ( RET_OK
== nRet
)
1247 nRet
= RET_USER_CANCEL
;
1253 // -----------------------------------------------------------------------
1255 IMPL_LINK_NOARG(SfxTabDialog
, ResetHdl
)
1259 Handler behind the reset button.
1260 The Current Page is new initialized with their initial data, all the
1261 settings that the user has made on this page are repealed.
1265 const sal_uInt16 nId
= m_pTabCtrl
->GetCurPageId();
1266 Data_Impl
* pDataObject
= Find( pImpl
->aData
, nId
);
1267 DBG_ASSERT( pDataObject
, "Id not known" );
1269 if ( pDataObject
->bOnDemand
)
1271 // CSet on AIS has problems here, thus separated
1272 const SfxItemSet
* pItemSet
= &pDataObject
->pTabPage
->GetItemSet();
1273 pDataObject
->pTabPage
->Reset( *(SfxItemSet
*)pItemSet
);
1276 pDataObject
->pTabPage
->Reset( *pSet
);
1280 // -----------------------------------------------------------------------
1282 IMPL_LINK_NOARG(SfxTabDialog
, BaseFmtHdl
)
1286 Handler behind the Standard-Button.
1287 This button is available when editing style sheets. All the set attributes
1288 in the edited stylesheet are deleted.
1292 const sal_uInt16 nId
= m_pTabCtrl
->GetCurPageId();
1293 Data_Impl
* pDataObject
= Find( pImpl
->aData
, nId
);
1294 DBG_ASSERT( pDataObject
, "Id not known" );
1297 if ( pDataObject
->fnGetRanges
)
1300 pExampleSet
= new SfxItemSet( *pSet
);
1302 const SfxItemPool
* pPool
= pSet
->GetPool();
1303 const sal_uInt16
* pTmpRanges
= (pDataObject
->fnGetRanges
)();
1304 SfxItemSet
aTmpSet( *pExampleSet
);
1306 while ( *pTmpRanges
)
1308 const sal_uInt16
* pU
= pTmpRanges
+ 1;
1310 if ( *pTmpRanges
== *pU
)
1312 // Range which two identical values -> only set one Item
1313 sal_uInt16 nWh
= pPool
->GetWhich( *pTmpRanges
);
1314 pExampleSet
->ClearItem( nWh
);
1315 aTmpSet
.ClearItem( nWh
);
1316 // At the Outset of InvalidateItem,
1317 // so that the change takes effect
1318 pOutSet
->InvalidateItem( nWh
);
1322 // Correct Range with multiple values
1323 sal_uInt16 nTmp
= *pTmpRanges
, nTmpEnd
= *pU
;
1324 DBG_ASSERT( nTmp
<= nTmpEnd
, "Range is sorted the wrong way" );
1326 if ( nTmp
> nTmpEnd
)
1328 // If really sorted wrongly, then set new
1329 sal_uInt16 nTmp1
= nTmp
;
1334 while ( nTmp
<= nTmpEnd
)
1336 // Iterate over the Range and set the Items
1337 sal_uInt16 nWh
= pPool
->GetWhich( nTmp
);
1338 pExampleSet
->ClearItem( nWh
);
1339 aTmpSet
.ClearItem( nWh
);
1340 // At the Outset of InvalidateItem,
1341 // so that the change takes effect
1342 pOutSet
->InvalidateItem( nWh
);
1346 // Go to the next pair
1349 // Set all Items as new -> the call the current Page Reset()
1350 DBG_ASSERT( pDataObject
->pTabPage
, "the Page is gone" );
1351 pDataObject
->pTabPage
->Reset( aTmpSet
);
1352 pDataObject
->pTabPage
->pImpl
->mbStandard
= sal_True
;
1357 // -----------------------------------------------------------------------
1359 IMPL_LINK( SfxTabDialog
, ActivatePageHdl
, TabControl
*, pTabCtrl
)
1363 Handler that is called by StarView for switching to a different page.
1364 If the page not exist yet then it is created and the virtual Method
1365 <SfxTabDialog::PageCreated( sal_uInt16, SfxTabPage &)> is called. If the page
1366 exist, then the if possible the <SfxTabPage::Reset(const SfxItemSet &)> or
1367 <SfxTabPage::ActivatePage(const SfxItemSet &)> is called.
1371 sal_uInt16
const nId
= pTabCtrl
->GetCurPageId();
1373 DBG_ASSERT( pImpl
->aData
.size(), "no Pages registered" );
1376 // Tab Page schon da?
1377 SfxTabPage
* pTabPage
= dynamic_cast<SfxTabPage
*> (pTabCtrl
->GetTabPage( nId
));
1378 Data_Impl
* pDataObject
= Find( pImpl
->aData
, nId
);
1379 DBG_ASSERT( pDataObject
, "Id not known" );
1381 // Create TabPage if possible:
1384 const SfxItemSet
* pTmpSet
= 0;
1388 if ( bItemsReset
&& pSet
->GetParent() )
1389 pTmpSet
= pSet
->GetParent();
1394 if ( pTmpSet
&& !pDataObject
->bOnDemand
)
1395 pTabPage
= (pDataObject
->fnCreatePage
)( pTabCtrl
, *pTmpSet
);
1397 pTabPage
= (pDataObject
->fnCreatePage
)
1398 ( pTabCtrl
, *CreateInputItemSet( nId
) );
1399 DBG_ASSERT( NULL
== pDataObject
->pTabPage
, "create TabPage more than once" );
1400 pDataObject
->pTabPage
= pTabPage
;
1402 pDataObject
->pTabPage
->SetTabDialog( this );
1403 SvtViewOptions
aPageOpt( E_TABPAGE
, OUString::number( pDataObject
->nId
) );
1405 Any aUserItem
= aPageOpt
.GetUserItem( USERITEM_NAME
);
1407 if ( aUserItem
>>= aTemp
)
1408 sUserData
= String( aTemp
);
1409 pTabPage
->SetUserData( sUserData
);
1410 Size aSiz
= pTabPage
->GetSizePixel();
1412 Size aCtrlSiz
= pTabCtrl
->GetTabPageSizePixel();
1413 // Only set Size on TabControl when < as TabPage
1414 if ( aCtrlSiz
.Width() < aSiz
.Width() ||
1415 aCtrlSiz
.Height() < aSiz
.Height() )
1417 pTabCtrl
->SetTabPageSizePixel( aSiz
);
1420 PageCreated( nId
, *pTabPage
);
1422 if ( pDataObject
->bOnDemand
)
1423 pTabPage
->Reset( (SfxItemSet
&)pTabPage
->GetItemSet() );
1425 pTabPage
->Reset( *pSet
);
1427 pTabCtrl
->SetTabPage( nId
, pTabPage
);
1429 else if ( pDataObject
->bRefresh
)
1430 pTabPage
->Reset( *pSet
);
1431 pDataObject
->bRefresh
= sal_False
;
1434 pTabPage
->ActivatePage( *pExampleSet
);
1435 sal_Bool bReadOnly
= pTabPage
->IsReadOnly();
1436 ( bReadOnly
|| pImpl
->bHideResetBtn
) ? m_pResetBtn
->Hide() : m_pResetBtn
->Show();
1440 // -----------------------------------------------------------------------
1442 IMPL_LINK( SfxTabDialog
, DeactivatePageHdl
, TabControl
*, pTabCtrl
)
1446 Handler that is called by StarView before leaving a page.
1450 <SfxTabPage::DeactivatePage(SfxItemSet *)>
1454 sal_uInt16 nId
= pTabCtrl
->GetCurPageId();
1456 SfxTabPage
*pPage
= dynamic_cast<SfxTabPage
*> (pTabCtrl
->GetTabPage( nId
));
1457 DBG_ASSERT( pPage
, "no active Page" );
1459 Data_Impl
* pDataObject
= Find( pImpl
->aData
, pTabCtrl
->GetCurPageId() );
1460 DBG_ASSERT( pDataObject
, "no Data structur for current page" );
1461 if ( pPage
->HasExchangeSupport() && pDataObject
->bOnDemand
)
1463 DBG_WARNING( "Data exchange in ItemsOnDemand is not desired!" );
1467 int nRet
= SfxTabPage::LEAVE_PAGE
;
1469 if ( !pExampleSet
&& pPage
->HasExchangeSupport() && pSet
)
1470 pExampleSet
= new SfxItemSet( *pSet
->GetPool(), pSet
->GetRanges() );
1474 SfxItemSet
aTmp( *pSet
->GetPool(), pSet
->GetRanges() );
1476 if ( pPage
->HasExchangeSupport() )
1477 nRet
= pPage
->DeactivatePage( &aTmp
);
1479 nRet
= pPage
->DeactivatePage( NULL
);
1480 if ( ( SfxTabPage::LEAVE_PAGE
& nRet
) == SfxTabPage::LEAVE_PAGE
&&
1483 pExampleSet
->Put( aTmp
);
1484 pOutSet
->Put( aTmp
);
1489 if ( pPage
->HasExchangeSupport() ) //!!!
1493 SfxItemPool
* pPool
= pPage
->GetItemSet().GetPool();
1495 new SfxItemSet( *pPool
, GetInputRanges( *pPool
) );
1497 nRet
= pPage
->DeactivatePage( pExampleSet
);
1500 nRet
= pPage
->DeactivatePage( NULL
);
1503 if ( nRet
& SfxTabPage::REFRESH_SET
)
1505 pSet
= GetRefreshedSet();
1506 DBG_ASSERT( pSet
, "GetRefreshedSet() returns NULL" );
1507 // Flag all Pages as to be initialized as new
1509 for ( SfxTabDlgData_Impl::const_iterator it
= pImpl
->aData
.begin(); it
!= pImpl
->aData
.end(); ++it
)
1511 Data_Impl
* pObj
= *it
;
1513 if ( pObj
->pTabPage
!= pPage
) // Do not refresh own Page anymore
1514 pObj
->bRefresh
= sal_True
;
1516 pObj
->bRefresh
= sal_False
;
1519 if ( nRet
& SfxTabPage::LEAVE_PAGE
)
1525 // -----------------------------------------------------------------------
1527 void SfxTabDialog::ShowPage( sal_uInt16 nId
)
1531 The TabPage is activated with the specified Id.
1535 m_pTabCtrl
->SetCurPageId( nId
);
1536 ActivatePageHdl( m_pTabCtrl
);
1539 // -----------------------------------------------------------------------
1541 const sal_uInt16
* SfxTabDialog::GetInputRanges( const SfxItemPool
& rPool
)
1545 Makes the set over the range of all pages of the dialogue. Pages have the
1546 static method for querying their range in AddTabPage, ie deliver their
1551 Pointer to a null-terminated array of sal_uInt16. This array belongs to the
1552 dialog and is deleted when the dialogue is destroy.
1556 <SfxTabDialog::AddTabPage(sal_uInt16, CreateTabPage, GetTabPageRanges, sal_Bool)>
1557 <SfxTabDialog::AddTabPage(sal_uInt16, const String &, CreateTabPage, GetTabPageRanges, sal_Bool, sal_uInt16)>
1558 <SfxTabDialog::AddTabPage(sal_uInt16, const Bitmap &, CreateTabPage, GetTabPageRanges, sal_Bool, sal_uInt16)>
1564 SAL_WARN( "sfx2.dialog", "Set already exists!" );
1565 return pSet
->GetRanges();
1570 std::vector
<sal_uInt16
> aUS
;
1572 for ( SfxTabDlgData_Impl::const_iterator it
= pImpl
->aData
.begin(); it
!= pImpl
->aData
.end(); ++it
)
1574 Data_Impl
* pDataObject
= *it
;
1576 if ( pDataObject
->fnGetRanges
)
1578 const sal_uInt16
* pTmpRanges
= (pDataObject
->fnGetRanges
)();
1579 const sal_uInt16
* pIter
= pTmpRanges
;
1582 for( nLen
= 0; *pIter
; ++nLen
, ++pIter
)
1584 aUS
.insert( aUS
.end(), pTmpRanges
, pTmpRanges
+ nLen
);
1588 //! Remove duplicated Ids?
1590 sal_uInt16 nCount
= aUS
.size();
1591 for ( sal_uInt16 i
= 0; i
< nCount
; ++i
)
1592 aUS
[i
] = rPool
.GetWhich( aUS
[i
] );
1596 if ( aUS
.size() > 1 )
1598 std::sort( aUS
.begin(), aUS
.end() );
1601 pRanges
= new sal_uInt16
[aUS
.size() + 1];
1602 std::copy( aUS
.begin(), aUS
.end(), pRanges
);
1603 pRanges
[aUS
.size()] = 0;
1607 // -----------------------------------------------------------------------
1609 void SfxTabDialog::SetInputSet( const SfxItemSet
* pInSet
)
1613 With this method the Input-Set can subsequently be set initally or re-set.
1617 bool bSet
= ( pSet
!= NULL
);
1621 if ( !bSet
&& !pExampleSet
&& !pOutSet
)
1623 pExampleSet
= new SfxItemSet( *pSet
);
1624 pOutSet
= new SfxItemSet( *pSet
->GetPool(), pSet
->GetRanges() );
1628 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */