26 #include <osl/mutex.hxx>
46 ::std::vector< uno::Reference< container::XChild> >
m_aSections;
64 ,m_aFormattedFieldBeautifier(_rController)
65 ,m_aFixedTextColor(_rController)
81 if (nEvent != VclEventId::ApplicationDataChanged )
85 if ( !(pData && ((( pData->
GetType() == DataChangedEventType::SETTINGS ) ||
86 ( pData->
GetType() == DataChangedEventType::DISPLAY )) &&
87 ( pData->
GetFlags() & AllSettingsFlags::STYLE ))))
90 OEnvLock
aLock(*
this);
94 for (
const uno::Reference<container::XChild>& xChild :
m_pImpl->m_aSections)
98 uno::Reference<report::XSection> xSection(xChild, uno::UNO_QUERY);
101 const sal_Int32
nCount = xSection->getCount();
102 for (sal_Int32
i = 0;
i < nCount; ++
i)
104 const uno::Any aObj = xSection->getByIndex(
i);
105 uno::Reference < report::XReportComponent > xReportComponent(aObj, uno::UNO_QUERY);
106 if (xReportComponent.is())
108 m_aFormattedFieldBeautifier.handle(xReportComponent);
109 m_aFixedTextColor.handle(xReportComponent);
121 uno::Reference< beans::XPropertySet > xSourceSet(e.Source, uno::UNO_QUERY);
122 if ( xSourceSet.is() )
124 uno::Reference< report::XSection> xSection(xSourceSet,uno::UNO_QUERY);
141 osl::MutexGuard aGuard(
m_pImpl->m_aMutex );
153 OSL_ENSURE(
m_refCount,
"Illegal call to dead object!");
154 osl_atomic_increment( &
m_pImpl->m_nLocks );
159 OSL_ENSURE(
m_refCount,
"Illegal call to dead object!");
161 osl_atomic_decrement( &
m_pImpl->m_nLocks );
169 uno::Reference<container::XChild> xChild = _xSection;
170 m_pImpl->m_aSections.push_back(xChild);
171 uno::Reference< uno::XInterface > xInt(_xSection);
174 catch(
const uno::Exception&)
186 uno::Reference<container::XChild> xChild(_xSection);
188 xChild),
m_pImpl->m_aSections.end());
189 uno::Reference< uno::XInterface > xInt(_xSection);
192 catch(uno::Exception&)
201 OSL_PRECOND( _rxContainer.is(),
"OXReportControllerObserver::switchListening: invalid container!" );
202 if ( !_rxContainer.is() )
208 uno::Reference< uno::XInterface > xInterface;
209 sal_Int32
nCount = _rxContainer->getCount();
210 for(sal_Int32 i = 0;
i != nCount;++
i)
212 xInterface.set(_rxContainer->getByIndex( i ),uno::UNO_QUERY);
213 if ( _bStartListening )
220 uno::Reference< container::XContainer > xSimpleContainer( _rxContainer, uno::UNO_QUERY );
221 if ( xSimpleContainer.is() )
223 if ( _bStartListening )
224 xSimpleContainer->addContainerListener(
this );
226 xSimpleContainer->removeContainerListener(
this );
229 catch(
const uno::Exception& )
238 OSL_PRECOND( _rxObject.is(),
"OXReportControllerObserver::switchListening: how should I listen at a NULL object?" );
242 uno::Reference< beans::XPropertySet > xProps( _rxObject, uno::UNO_QUERY );
245 if ( _bStartListening )
246 xProps->addPropertyChangeListener( OUString(),
this );
248 xProps->removePropertyChangeListener( OUString(),
this );
251 uno::Reference< util::XModifyBroadcaster > xBroadcaster( _rxObject, uno::UNO_QUERY );
252 if ( xBroadcaster.is() )
254 if ( _bStartListening )
255 xBroadcaster->addModifyListener(
this );
257 xBroadcaster->removeModifyListener(
this );
260 catch(
const uno::Exception& )
278 uno::Reference< container::XIndexAccess > xContainer( _rxElement, uno::UNO_QUERY );
279 if ( xContainer.is() )
290 uno::Reference< container::XIndexAccess > xContainer( _rxElement, uno::UNO_QUERY );
291 if ( xContainer.is() )
301 ::osl::MutexGuard aGuard(
m_pImpl->m_aMutex );
304 uno::Reference< uno::XInterface > xIface( evt.Element, uno::UNO_QUERY );
315 ::osl::MutexGuard aGuard(
m_pImpl->m_aMutex );
317 uno::Reference< uno::XInterface > xIface(evt.ReplacedElement,uno::UNO_QUERY);
318 OSL_ENSURE(xIface.is(),
"OXReportControllerObserver::elementReplaced: invalid container notification!");
321 xIface.set(evt.Element,uno::UNO_QUERY);
329 ::osl::MutexGuard aGuard(
m_pImpl->m_aMutex );
331 uno::Reference< uno::XInterface > xIface( evt.Element, uno::UNO_QUERY );
#define LINK(Instance, Class, Member)
::std::map< Reference< XPropertySet >, ObjectInfo > PropertySetInfoCache
std::map< OUString, bool > AllProperties
virtual void SAL_CALL elementRemoved(const css::container::ContainerEvent &rEvent) override
std::unique_ptr< sal_Int32[]> pData
static void RemoveEventListener(const Link< VclSimpleEvent &, void > &rEventListener)
OXReportControllerObserver(const OXReportControllerObserver &)=delete
void RemoveSection(const css::uno::Reference< css::report::XSection > &_xSection)
void notifyElementInserted(const css::uno::Reference< css::uno::XInterface > &_rxElement) override
DataChangedEventType GetType() const
static void AddEventListener(const Link< VclSimpleEvent &, void > &rEventListener)
void AddSection(const css::uno::Reference< css::report::XSection > &_xSection)
virtual void SAL_CALL modified(const css::lang::EventObject &aEvent) override
AllSettingsFlags GetFlags() const
virtual void SAL_CALL elementInserted(const css::container::ContainerEvent &rEvent) override
OXReportControllerObserverImpl()
#define DBG_UNHANDLED_EXCEPTION(...)
const ::std::unique_ptr< OXReportControllerObserverImpl > m_pImpl
void AddElement(const css::uno::Reference< css::uno::XInterface > &Element)
oslInterlockedCount m_nLocks
::std::vector< uno::Reference< container::XChild > > m_aSections
void notifyPropertyChange(const css::beans::PropertyChangeEvent &_rEvent) override
IMPL_LINK(OAddFieldWindow, DragBeginHdl, bool &, rUnsetDragIcon, bool)
void switchListening(const css::uno::Reference< css::container::XIndexAccess > &_rxContainer, bool _bStartListening)
FormattedFieldBeautifier m_aFormattedFieldBeautifier
virtual void SAL_CALL elementReplaced(const css::container::ContainerEvent &rEvent) override
void RemoveElement(const css::uno::Reference< css::uno::XInterface > &Element)
FixedTextColor m_aFixedTextColor
virtual ~OXReportControllerObserver() override
OXReportControllerObserverImpl & operator=(const OXReportControllerObserverImpl &)=delete
virtual void SAL_CALL propertyChange(const css::beans::PropertyChangeEvent &evt) override
virtual void SAL_CALL disposing(const css::lang::EventObject &Source) override
Create an object ob OUndoEnvLock locks the undo possibility As long as in the OUndoEnvLock scope...