xref: /aoo41x/main/sfx2/source/dialog/itemconnect.cxx (revision d119d52d)
1*d119d52dSAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*d119d52dSAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*d119d52dSAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*d119d52dSAndrew Rist  * distributed with this work for additional information
6*d119d52dSAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*d119d52dSAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*d119d52dSAndrew Rist  * "License"); you may not use this file except in compliance
9*d119d52dSAndrew Rist  * with the License.  You may obtain a copy of the License at
10*d119d52dSAndrew Rist  *
11*d119d52dSAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*d119d52dSAndrew Rist  *
13*d119d52dSAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*d119d52dSAndrew Rist  * software distributed under the License is distributed on an
15*d119d52dSAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*d119d52dSAndrew Rist  * KIND, either express or implied.  See the License for the
17*d119d52dSAndrew Rist  * specific language governing permissions and limitations
18*d119d52dSAndrew Rist  * under the License.
19*d119d52dSAndrew Rist  *
20*d119d52dSAndrew Rist  *************************************************************/
21*d119d52dSAndrew Rist 
22*d119d52dSAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir // MARKER(update_precomp.py): autogen include statement, do not remove
25cdf0e10cSrcweir #include "precompiled_sfx2.hxx"
26cdf0e10cSrcweir #include <sfx2/itemconnect.hxx>
27cdf0e10cSrcweir 
28cdf0e10cSrcweir #include <boost/shared_ptr.hpp>
29cdf0e10cSrcweir #include <list>
30cdf0e10cSrcweir #include <svl/itempool.hxx>
31cdf0e10cSrcweir 
32cdf0e10cSrcweir // ============================================================================
33cdf0e10cSrcweir 
34cdf0e10cSrcweir namespace sfx {
35cdf0e10cSrcweir 
36cdf0e10cSrcweir // ============================================================================
37cdf0e10cSrcweir // Helpers
38cdf0e10cSrcweir // ============================================================================
39cdf0e10cSrcweir 
40cdf0e10cSrcweir namespace {
41cdf0e10cSrcweir 
lclConvertToTriState(bool bKnown,bool bIsKnownFlag,bool bIsUnknownFlag)42cdf0e10cSrcweir TriState lclConvertToTriState( bool bKnown, bool bIsKnownFlag, bool bIsUnknownFlag )
43cdf0e10cSrcweir {
44cdf0e10cSrcweir     return (bKnown && bIsKnownFlag) ? STATE_CHECK : ((!bKnown && bIsUnknownFlag) ? STATE_NOCHECK : STATE_DONTKNOW);
45cdf0e10cSrcweir }
46cdf0e10cSrcweir 
47cdf0e10cSrcweir } // namespace
48cdf0e10cSrcweir 
49cdf0e10cSrcweir // ----------------------------------------------------------------------------
50cdf0e10cSrcweir 
GetWhichId(const SfxItemSet & rItemSet,sal_uInt16 nSlot)51cdf0e10cSrcweir sal_uInt16 ItemWrapperHelper::GetWhichId( const SfxItemSet& rItemSet, sal_uInt16 nSlot )
52cdf0e10cSrcweir {
53cdf0e10cSrcweir     return rItemSet.GetPool()->GetWhich( nSlot );
54cdf0e10cSrcweir }
55cdf0e10cSrcweir 
IsKnownItem(const SfxItemSet & rItemSet,sal_uInt16 nSlot)56cdf0e10cSrcweir bool ItemWrapperHelper::IsKnownItem( const SfxItemSet& rItemSet, sal_uInt16 nSlot )
57cdf0e10cSrcweir {
58cdf0e10cSrcweir     return rItemSet.GetItemState( GetWhichId( rItemSet, nSlot ), sal_True ) != SFX_ITEM_UNKNOWN;
59cdf0e10cSrcweir }
60cdf0e10cSrcweir 
GetUniqueItem(const SfxItemSet & rItemSet,sal_uInt16 nSlot)61cdf0e10cSrcweir const SfxPoolItem* ItemWrapperHelper::GetUniqueItem( const SfxItemSet& rItemSet, sal_uInt16 nSlot )
62cdf0e10cSrcweir {
63cdf0e10cSrcweir     sal_uInt16 nWhich = GetWhichId( rItemSet, nSlot );
64cdf0e10cSrcweir     return (rItemSet.GetItemState( nWhich, sal_True ) >= SFX_ITEM_DEFAULT) ? rItemSet.GetItem( nWhich, sal_True ) : 0;
65cdf0e10cSrcweir }
66cdf0e10cSrcweir 
GetDefaultItem(const SfxItemSet & rItemSet,sal_uInt16 nSlot)67cdf0e10cSrcweir const SfxPoolItem& ItemWrapperHelper::GetDefaultItem( const SfxItemSet& rItemSet, sal_uInt16 nSlot )
68cdf0e10cSrcweir {
69cdf0e10cSrcweir     return rItemSet.GetPool()->GetDefaultItem( GetWhichId( rItemSet, nSlot ) );
70cdf0e10cSrcweir }
71cdf0e10cSrcweir 
RemoveDefaultItem(SfxItemSet & rDestSet,const SfxItemSet & rOldSet,sal_uInt16 nSlot)72cdf0e10cSrcweir void ItemWrapperHelper::RemoveDefaultItem( SfxItemSet& rDestSet, const SfxItemSet& rOldSet, sal_uInt16 nSlot )
73cdf0e10cSrcweir {
74cdf0e10cSrcweir     sal_uInt16 nWhich = GetWhichId( rDestSet, nSlot );
75cdf0e10cSrcweir     if( rOldSet.GetItemState( nWhich, sal_False ) == SFX_ITEM_DEFAULT )
76cdf0e10cSrcweir         rDestSet.ClearItem( nWhich );
77cdf0e10cSrcweir }
78cdf0e10cSrcweir 
79cdf0e10cSrcweir // ============================================================================
80cdf0e10cSrcweir // Base control wrapper classes
81cdf0e10cSrcweir // ============================================================================
82cdf0e10cSrcweir 
~ControlWrapperBase()83cdf0e10cSrcweir ControlWrapperBase::~ControlWrapperBase()
84cdf0e10cSrcweir {
85cdf0e10cSrcweir }
86cdf0e10cSrcweir 
87cdf0e10cSrcweir // ============================================================================
88cdf0e10cSrcweir // Single control wrappers
89cdf0e10cSrcweir // ============================================================================
90cdf0e10cSrcweir 
DummyWindowWrapper(Window & rWindow)91cdf0e10cSrcweir DummyWindowWrapper::DummyWindowWrapper( Window& rWindow ) :
92cdf0e10cSrcweir     SingleControlWrapperType( rWindow )
93cdf0e10cSrcweir {
94cdf0e10cSrcweir }
95cdf0e10cSrcweir 
IsControlDontKnow() const96cdf0e10cSrcweir bool DummyWindowWrapper::IsControlDontKnow() const
97cdf0e10cSrcweir {
98cdf0e10cSrcweir     return false;
99cdf0e10cSrcweir }
100cdf0e10cSrcweir 
SetControlDontKnow(bool)101cdf0e10cSrcweir void DummyWindowWrapper::SetControlDontKnow( bool )
102cdf0e10cSrcweir {
103cdf0e10cSrcweir }
104cdf0e10cSrcweir 
GetControlValue() const105cdf0e10cSrcweir void* DummyWindowWrapper::GetControlValue() const
106cdf0e10cSrcweir {
107cdf0e10cSrcweir     return 0;
108cdf0e10cSrcweir }
109cdf0e10cSrcweir 
SetControlValue(void *)110cdf0e10cSrcweir void DummyWindowWrapper::SetControlValue( void* )
111cdf0e10cSrcweir {
112cdf0e10cSrcweir }
113cdf0e10cSrcweir 
114cdf0e10cSrcweir // ----------------------------------------------------------------------------
115cdf0e10cSrcweir 
CheckBoxWrapper(CheckBox & rCheckBox)116cdf0e10cSrcweir CheckBoxWrapper::CheckBoxWrapper( CheckBox& rCheckBox ) :
117cdf0e10cSrcweir         SingleControlWrapperType( rCheckBox )
118cdf0e10cSrcweir {
119cdf0e10cSrcweir }
120cdf0e10cSrcweir 
IsControlDontKnow() const121cdf0e10cSrcweir bool CheckBoxWrapper::IsControlDontKnow() const
122cdf0e10cSrcweir {
123cdf0e10cSrcweir     return GetControl().GetState() == STATE_DONTKNOW;
124cdf0e10cSrcweir }
125cdf0e10cSrcweir 
SetControlDontKnow(bool bSet)126cdf0e10cSrcweir void CheckBoxWrapper::SetControlDontKnow( bool bSet )
127cdf0e10cSrcweir {
128cdf0e10cSrcweir     GetControl().EnableTriState( bSet );
129cdf0e10cSrcweir     GetControl().SetState( bSet ? STATE_DONTKNOW : STATE_NOCHECK );
130cdf0e10cSrcweir }
131cdf0e10cSrcweir 
GetControlValue() const132cdf0e10cSrcweir sal_Bool CheckBoxWrapper::GetControlValue() const
133cdf0e10cSrcweir {
134cdf0e10cSrcweir     return GetControl().IsChecked();
135cdf0e10cSrcweir }
136cdf0e10cSrcweir 
SetControlValue(sal_Bool bValue)137cdf0e10cSrcweir void CheckBoxWrapper::SetControlValue( sal_Bool bValue )
138cdf0e10cSrcweir {
139cdf0e10cSrcweir     GetControl().Check( bValue );
140cdf0e10cSrcweir }
141cdf0e10cSrcweir 
142cdf0e10cSrcweir // ----------------------------------------------------------------------------
143cdf0e10cSrcweir 
EditWrapper(Edit & rEdit)144cdf0e10cSrcweir EditWrapper::EditWrapper( Edit& rEdit ) :
145cdf0e10cSrcweir         SingleControlWrapperType( rEdit )
146cdf0e10cSrcweir {
147cdf0e10cSrcweir }
148cdf0e10cSrcweir 
IsControlDontKnow() const149cdf0e10cSrcweir bool EditWrapper::IsControlDontKnow() const
150cdf0e10cSrcweir {
151cdf0e10cSrcweir     // no "don't know" state - empty string is a valid value of an Edit
152cdf0e10cSrcweir     return false;
153cdf0e10cSrcweir }
154cdf0e10cSrcweir 
SetControlDontKnow(bool bSet)155cdf0e10cSrcweir void EditWrapper::SetControlDontKnow( bool bSet )
156cdf0e10cSrcweir {
157cdf0e10cSrcweir     if( bSet )
158cdf0e10cSrcweir         GetControl().SetText( String() );
159cdf0e10cSrcweir }
160cdf0e10cSrcweir 
GetControlValue() const161cdf0e10cSrcweir String EditWrapper::GetControlValue() const
162cdf0e10cSrcweir {
163cdf0e10cSrcweir     return GetControl().GetText();
164cdf0e10cSrcweir }
165cdf0e10cSrcweir 
SetControlValue(String aValue)166cdf0e10cSrcweir void EditWrapper::SetControlValue( String aValue )
167cdf0e10cSrcweir {
168cdf0e10cSrcweir     GetControl().SetText( aValue );
169cdf0e10cSrcweir }
170cdf0e10cSrcweir 
171cdf0e10cSrcweir // ----------------------------------------------------------------------------
172cdf0e10cSrcweir 
ColorListBoxWrapper(ColorListBox & rListBox)173cdf0e10cSrcweir ColorListBoxWrapper::ColorListBoxWrapper(ColorListBox & rListBox):
174cdf0e10cSrcweir     SingleControlWrapper< ColorListBox, Color >(rListBox)
175cdf0e10cSrcweir {}
176cdf0e10cSrcweir 
~ColorListBoxWrapper()177cdf0e10cSrcweir ColorListBoxWrapper::~ColorListBoxWrapper()
178cdf0e10cSrcweir {}
179cdf0e10cSrcweir 
IsControlDontKnow() const180cdf0e10cSrcweir bool ColorListBoxWrapper::IsControlDontKnow() const
181cdf0e10cSrcweir {
182cdf0e10cSrcweir     return GetControl().GetSelectEntryCount() == 0;
183cdf0e10cSrcweir }
184cdf0e10cSrcweir 
SetControlDontKnow(bool bSet)185cdf0e10cSrcweir void ColorListBoxWrapper::SetControlDontKnow( bool bSet )
186cdf0e10cSrcweir {
187cdf0e10cSrcweir     if( bSet ) GetControl().SetNoSelection();
188cdf0e10cSrcweir }
189cdf0e10cSrcweir 
GetControlValue() const190cdf0e10cSrcweir Color ColorListBoxWrapper::GetControlValue() const
191cdf0e10cSrcweir {
192cdf0e10cSrcweir     return GetControl().GetSelectEntryColor();
193cdf0e10cSrcweir }
194cdf0e10cSrcweir 
SetControlValue(Color aColor)195cdf0e10cSrcweir void ColorListBoxWrapper::SetControlValue( Color aColor )
196cdf0e10cSrcweir {
197cdf0e10cSrcweir     GetControl().SelectEntry( aColor );
198cdf0e10cSrcweir }
199cdf0e10cSrcweir 
200cdf0e10cSrcweir // ============================================================================
201cdf0e10cSrcweir // Multi control wrappers
202cdf0e10cSrcweir // ============================================================================
203cdf0e10cSrcweir 
204cdf0e10cSrcweir typedef std::vector< ControlWrapperBase* >  ControlWrpVec;
205cdf0e10cSrcweir typedef ControlWrpVec::iterator             ControlWrpVecI;
206cdf0e10cSrcweir typedef ControlWrpVec::const_iterator       ControlWrpVecCI;
207cdf0e10cSrcweir 
208cdf0e10cSrcweir struct MultiControlWrapperHelper_Impl
209cdf0e10cSrcweir {
210cdf0e10cSrcweir     ControlWrpVec       maVec;
211cdf0e10cSrcweir };
212cdf0e10cSrcweir 
MultiControlWrapperHelper()213cdf0e10cSrcweir MultiControlWrapperHelper::MultiControlWrapperHelper() :
214cdf0e10cSrcweir     mxImpl( new MultiControlWrapperHelper_Impl )
215cdf0e10cSrcweir {
216cdf0e10cSrcweir }
217cdf0e10cSrcweir 
~MultiControlWrapperHelper()218cdf0e10cSrcweir MultiControlWrapperHelper::~MultiControlWrapperHelper()
219cdf0e10cSrcweir {
220cdf0e10cSrcweir }
221cdf0e10cSrcweir 
RegisterControlWrapper(ControlWrapperBase & rWrapper)222cdf0e10cSrcweir void MultiControlWrapperHelper::RegisterControlWrapper( ControlWrapperBase& rWrapper )
223cdf0e10cSrcweir {
224cdf0e10cSrcweir     mxImpl->maVec.push_back( &rWrapper );
225cdf0e10cSrcweir }
226cdf0e10cSrcweir 
ModifyControl(TriState eEnable,TriState eShow)227cdf0e10cSrcweir void MultiControlWrapperHelper::ModifyControl( TriState eEnable, TriState eShow )
228cdf0e10cSrcweir {
229cdf0e10cSrcweir     for( ControlWrpVecI aIt = mxImpl->maVec.begin(), aEnd = mxImpl->maVec.end(); aIt != aEnd; ++aIt )
230cdf0e10cSrcweir         (*aIt)->ModifyControl( eEnable, eShow );
231cdf0e10cSrcweir }
232cdf0e10cSrcweir 
IsControlDontKnow() const233cdf0e10cSrcweir bool MultiControlWrapperHelper::IsControlDontKnow() const
234cdf0e10cSrcweir {
235cdf0e10cSrcweir     bool bIs = !mxImpl->maVec.empty();
236cdf0e10cSrcweir     for( ControlWrpVecCI aIt = mxImpl->maVec.begin(), aEnd = mxImpl->maVec.end(); bIs && (aIt != aEnd); ++aIt )
237cdf0e10cSrcweir         bIs &= (*aIt)->IsControlDontKnow();
238cdf0e10cSrcweir     return bIs;
239cdf0e10cSrcweir }
240cdf0e10cSrcweir 
SetControlDontKnow(bool bSet)241cdf0e10cSrcweir void MultiControlWrapperHelper::SetControlDontKnow( bool bSet )
242cdf0e10cSrcweir {
243cdf0e10cSrcweir     for( ControlWrpVecI aIt = mxImpl->maVec.begin(), aEnd = mxImpl->maVec.end(); aIt != aEnd; ++aIt )
244cdf0e10cSrcweir         (*aIt)->SetControlDontKnow( bSet );
245cdf0e10cSrcweir }
246cdf0e10cSrcweir 
247cdf0e10cSrcweir // ============================================================================
248cdf0e10cSrcweir // Base connection classes
249cdf0e10cSrcweir // ============================================================================
250cdf0e10cSrcweir 
ItemConnectionBase(ItemConnFlags nFlags)251cdf0e10cSrcweir ItemConnectionBase::ItemConnectionBase( ItemConnFlags nFlags ) :
252cdf0e10cSrcweir     mnFlags( nFlags )
253cdf0e10cSrcweir {
254cdf0e10cSrcweir }
255cdf0e10cSrcweir 
~ItemConnectionBase()256cdf0e10cSrcweir ItemConnectionBase::~ItemConnectionBase()
257cdf0e10cSrcweir {
258cdf0e10cSrcweir }
259cdf0e10cSrcweir 
Activate(bool bActive)260cdf0e10cSrcweir void ItemConnectionBase::Activate( bool bActive )
261cdf0e10cSrcweir {
262cdf0e10cSrcweir     if( bActive ) mnFlags &= ~ITEMCONN_INACTIVE; else mnFlags |= ITEMCONN_INACTIVE;
263cdf0e10cSrcweir }
264cdf0e10cSrcweir 
IsActive() const265cdf0e10cSrcweir bool ItemConnectionBase::IsActive() const
266cdf0e10cSrcweir {
267cdf0e10cSrcweir     return !(mnFlags & ITEMCONN_INACTIVE);
268cdf0e10cSrcweir }
269cdf0e10cSrcweir 
DoApplyFlags(const SfxItemSet & rItemSet)270cdf0e10cSrcweir void ItemConnectionBase::DoApplyFlags( const SfxItemSet& rItemSet )
271cdf0e10cSrcweir {
272cdf0e10cSrcweir     if( IsActive() )
273cdf0e10cSrcweir         ApplyFlags( rItemSet );
274cdf0e10cSrcweir }
275cdf0e10cSrcweir 
DoReset(const SfxItemSet & rItemSet)276cdf0e10cSrcweir void ItemConnectionBase::DoReset( const SfxItemSet& rItemSet )
277cdf0e10cSrcweir {
278cdf0e10cSrcweir     if( IsActive() )
279cdf0e10cSrcweir         Reset( rItemSet );
280cdf0e10cSrcweir }
281cdf0e10cSrcweir 
DoFillItemSet(SfxItemSet & rDestSet,const SfxItemSet & rOldSet)282cdf0e10cSrcweir bool ItemConnectionBase::DoFillItemSet( SfxItemSet& rDestSet, const SfxItemSet& rOldSet )
283cdf0e10cSrcweir {
284cdf0e10cSrcweir     return IsActive() && FillItemSet( rDestSet, rOldSet );
285cdf0e10cSrcweir }
286cdf0e10cSrcweir 
GetEnableState(bool bKnown) const287cdf0e10cSrcweir TriState ItemConnectionBase::GetEnableState( bool bKnown ) const
288cdf0e10cSrcweir {
289cdf0e10cSrcweir     return lclConvertToTriState( bKnown, mnFlags & ITEMCONN_ENABLE_KNOWN, mnFlags & ITEMCONN_DISABLE_UNKNOWN );
290cdf0e10cSrcweir }
291cdf0e10cSrcweir 
GetShowState(bool bKnown) const292cdf0e10cSrcweir TriState ItemConnectionBase::GetShowState( bool bKnown ) const
293cdf0e10cSrcweir {
294cdf0e10cSrcweir     return lclConvertToTriState( bKnown, mnFlags & ITEMCONN_SHOW_KNOWN, mnFlags & ITEMCONN_HIDE_UNKNOWN );
295cdf0e10cSrcweir }
296cdf0e10cSrcweir 
297cdf0e10cSrcweir // ============================================================================
298cdf0e10cSrcweir // Standard connections
299cdf0e10cSrcweir // ============================================================================
300cdf0e10cSrcweir 
DummyItemConnection(sal_uInt16 nSlot,Window & rWindow,ItemConnFlags nFlags)301cdf0e10cSrcweir DummyItemConnection::DummyItemConnection( sal_uInt16 nSlot, Window& rWindow, ItemConnFlags nFlags ) :
302cdf0e10cSrcweir     ItemConnectionBase( nFlags ),
303cdf0e10cSrcweir     DummyWindowWrapper( rWindow ),
304cdf0e10cSrcweir     mnSlot( nSlot )
305cdf0e10cSrcweir {
306cdf0e10cSrcweir }
307cdf0e10cSrcweir 
ApplyFlags(const SfxItemSet & rItemSet)308cdf0e10cSrcweir void DummyItemConnection::ApplyFlags( const SfxItemSet& rItemSet )
309cdf0e10cSrcweir {
310cdf0e10cSrcweir     bool bKnown = ItemWrapperHelper::IsKnownItem( rItemSet, mnSlot );
311cdf0e10cSrcweir     ModifyControl( GetEnableState( bKnown ), GetShowState( bKnown ) );
312cdf0e10cSrcweir }
313cdf0e10cSrcweir 
Reset(const SfxItemSet &)314cdf0e10cSrcweir void DummyItemConnection::Reset( const SfxItemSet& /*rItemSet*/ )
315cdf0e10cSrcweir {
316cdf0e10cSrcweir }
317cdf0e10cSrcweir 
FillItemSet(SfxItemSet &,const SfxItemSet &)318cdf0e10cSrcweir bool DummyItemConnection::FillItemSet( SfxItemSet& /*rDestSet*/, const SfxItemSet& /*rOldSet*/ )
319cdf0e10cSrcweir {
320cdf0e10cSrcweir     return false;   // item set not changed
321cdf0e10cSrcweir }
322cdf0e10cSrcweir 
323cdf0e10cSrcweir // ============================================================================
324cdf0e10cSrcweir // Array of connections
325cdf0e10cSrcweir // ============================================================================
326cdf0e10cSrcweir 
327cdf0e10cSrcweir class ItemConnectionArrayImpl
328cdf0e10cSrcweir {
329cdf0e10cSrcweir public:
330cdf0e10cSrcweir     void                        Append( ItemConnectionBase* pConnection );
331cdf0e10cSrcweir 
332cdf0e10cSrcweir     void                        ApplyFlags( const SfxItemSet& rItemSet );
333cdf0e10cSrcweir     void                        Reset( const SfxItemSet& rItemSet );
334cdf0e10cSrcweir     bool                        FillItemSet( SfxItemSet& rDestSet, const SfxItemSet& rOldSet );
335cdf0e10cSrcweir 
336cdf0e10cSrcweir private:
337cdf0e10cSrcweir     typedef boost::shared_ptr< ItemConnectionBase > ItemConnectionRef;
338cdf0e10cSrcweir     typedef std::list< ItemConnectionRef >          ItemConnectionList;
339cdf0e10cSrcweir     typedef ItemConnectionList::iterator            ItemConnectionListIt;
340cdf0e10cSrcweir 
341cdf0e10cSrcweir     ItemConnectionList          maList;
342cdf0e10cSrcweir };
343cdf0e10cSrcweir 
Append(ItemConnectionBase * pConnection)344cdf0e10cSrcweir void ItemConnectionArrayImpl::Append( ItemConnectionBase* pConnection )
345cdf0e10cSrcweir {
346cdf0e10cSrcweir     if( pConnection )
347cdf0e10cSrcweir         maList.push_back( ItemConnectionRef( pConnection ) );
348cdf0e10cSrcweir }
349cdf0e10cSrcweir 
ApplyFlags(const SfxItemSet & rItemSet)350cdf0e10cSrcweir void ItemConnectionArrayImpl::ApplyFlags( const SfxItemSet& rItemSet )
351cdf0e10cSrcweir {
352cdf0e10cSrcweir     for( ItemConnectionListIt aIt = maList.begin(), aEnd = maList.end(); aIt != aEnd; ++aIt )
353cdf0e10cSrcweir         (*aIt)->DoApplyFlags( rItemSet );
354cdf0e10cSrcweir }
355cdf0e10cSrcweir 
Reset(const SfxItemSet & rItemSet)356cdf0e10cSrcweir void ItemConnectionArrayImpl::Reset( const SfxItemSet& rItemSet )
357cdf0e10cSrcweir {
358cdf0e10cSrcweir     for( ItemConnectionListIt aIt = maList.begin(), aEnd = maList.end(); aIt != aEnd; ++aIt )
359cdf0e10cSrcweir         (*aIt)->DoReset( rItemSet );
360cdf0e10cSrcweir }
361cdf0e10cSrcweir 
FillItemSet(SfxItemSet & rDestSet,const SfxItemSet & rOldSet)362cdf0e10cSrcweir bool ItemConnectionArrayImpl::FillItemSet( SfxItemSet& rDestSet, const SfxItemSet& rOldSet )
363cdf0e10cSrcweir {
364cdf0e10cSrcweir     bool bChanged = false;
365cdf0e10cSrcweir     for( ItemConnectionListIt aIt = maList.begin(), aEnd = maList.end(); aIt != aEnd; ++aIt )
366cdf0e10cSrcweir         bChanged |= (*aIt)->DoFillItemSet( rDestSet, rOldSet );
367cdf0e10cSrcweir     return bChanged;
368cdf0e10cSrcweir }
369cdf0e10cSrcweir 
370cdf0e10cSrcweir // ----------------------------------------------------------------------------
371cdf0e10cSrcweir 
ItemConnectionArray()372cdf0e10cSrcweir ItemConnectionArray::ItemConnectionArray() :
373cdf0e10cSrcweir     mxImpl( new ItemConnectionArrayImpl )
374cdf0e10cSrcweir {
375cdf0e10cSrcweir }
376cdf0e10cSrcweir 
~ItemConnectionArray()377cdf0e10cSrcweir ItemConnectionArray::~ItemConnectionArray()
378cdf0e10cSrcweir {
379cdf0e10cSrcweir }
380cdf0e10cSrcweir 
AddConnection(ItemConnectionBase * pConnection)381cdf0e10cSrcweir void ItemConnectionArray::AddConnection( ItemConnectionBase* pConnection )
382cdf0e10cSrcweir {
383cdf0e10cSrcweir     mxImpl->Append( pConnection );
384cdf0e10cSrcweir }
385cdf0e10cSrcweir 
ApplyFlags(const SfxItemSet & rItemSet)386cdf0e10cSrcweir void ItemConnectionArray::ApplyFlags( const SfxItemSet& rItemSet )
387cdf0e10cSrcweir {
388cdf0e10cSrcweir     mxImpl->ApplyFlags( rItemSet );
389cdf0e10cSrcweir }
390cdf0e10cSrcweir 
Reset(const SfxItemSet & rItemSet)391cdf0e10cSrcweir void ItemConnectionArray::Reset( const SfxItemSet& rItemSet )
392cdf0e10cSrcweir {
393cdf0e10cSrcweir     mxImpl->Reset( rItemSet );
394cdf0e10cSrcweir }
395cdf0e10cSrcweir 
FillItemSet(SfxItemSet & rDestSet,const SfxItemSet & rOldSet)396cdf0e10cSrcweir bool ItemConnectionArray::FillItemSet( SfxItemSet& rDestSet, const SfxItemSet& rOldSet )
397cdf0e10cSrcweir {
398cdf0e10cSrcweir     return mxImpl->FillItemSet( rDestSet, rOldSet );
399cdf0e10cSrcweir }
400cdf0e10cSrcweir 
401cdf0e10cSrcweir // ============================================================================
402cdf0e10cSrcweir 
403cdf0e10cSrcweir } // namespace sfx
404cdf0e10cSrcweir 
405