[Libreoffice-commits] core.git: sfx2/source
Ariel Constenla-Haile
arielch at apache.org
Wed Jun 19 07:40:04 PDT 2013
sfx2/source/doc/printhelper.cxx | 47 +++++++++++++++++++---------------------
1 file changed, 23 insertions(+), 24 deletions(-)
New commits:
commit bf4ecd6138f07ca6207eeec306517eff4aff220e
Author: Ariel Constenla-Haile <arielch at apache.org>
Date: Sun Feb 24 18:23:09 2013 +0000
Resolves: fdo#65908 #i114817# missing PrintableState_JOB_STARTED notification
(cherry picked from commit 914cb68eed75ee8aa38fbf48d029057a66a21f30)
Change-Id: Icb7c304b856cfca7f80090c2d193a0b92a27bb30
diff --git a/sfx2/source/doc/printhelper.cxx b/sfx2/source/doc/printhelper.cxx
index e55276b..1b00652 100644
--- a/sfx2/source/doc/printhelper.cxx
+++ b/sfx2/source/doc/printhelper.cxx
@@ -789,32 +789,31 @@ void SAL_CALL SfxPrintHelper::print(const uno::Sequence< beans::PropertyValue >&
void IMPL_PrintListener_DataContainer::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
{
- if ( &rBC == m_pObjectShell )
+ SfxPrintingHint* pPrintHint = PTR_CAST( SfxPrintingHint, &rHint );
+ if ( &rBC != m_pObjectShell
+ || !pPrintHint
+ || pPrintHint->GetWhich() == -2 ) // -2 : CancelPrintJob
+ return;
+
+ if ( pPrintHint->GetWhich() == com::sun::star::view::PrintableState_JOB_STARTED )
{
- SfxPrintingHint* pPrintHint = PTR_CAST( SfxPrintingHint, &rHint );
- if ( pPrintHint )
- {
- if ( pPrintHint->GetWhich() == com::sun::star::view::PrintableState_JOB_STARTED )
- {
- if ( !m_xPrintJob.is() )
- m_xPrintJob = new SfxPrintJob_Impl( this );
- m_aPrintOptions = pPrintHint->GetOptions();
- }
- else if ( pPrintHint->GetWhich() != -2 ) // -2 : CancelPrintJob
- {
- view::PrintJobEvent aEvent;
- aEvent.Source = m_xPrintJob;
- aEvent.State = (com::sun::star::view::PrintableState) pPrintHint->GetWhich();
- ::cppu::OInterfaceContainerHelper* pContainer = m_aInterfaceContainer.getContainer( ::getCppuType( ( const uno::Reference< view::XPrintJobListener >*) NULL ) );
- if ( pContainer!=NULL )
- {
- ::cppu::OInterfaceIteratorHelper pIterator(*pContainer);
- while (pIterator.hasMoreElements())
- ((view::XPrintJobListener*)pIterator.next())->printJobEvent( aEvent );
- }
- }
- }
+ if ( !m_xPrintJob.is() )
+ m_xPrintJob = new SfxPrintJob_Impl( this );
+ m_aPrintOptions = pPrintHint->GetOptions();
}
+
+ ::cppu::OInterfaceContainerHelper* pContainer = m_aInterfaceContainer.getContainer(
+ ::getCppuType( ( const uno::Reference< view::XPrintJobListener >*) NULL ) );
+ if ( !pContainer )
+ return;
+
+ view::PrintJobEvent aEvent;
+ aEvent.Source = m_xPrintJob;
+ aEvent.State = (com::sun::star::view::PrintableState) pPrintHint->GetWhich();
+
+ ::cppu::OInterfaceIteratorHelper pIterator(*pContainer);
+ while (pIterator.hasMoreElements())
+ ((view::XPrintJobListener*)pIterator.next())->printJobEvent( aEvent );
}
void SAL_CALL SfxPrintHelper::addPrintJobListener( const ::com::sun::star::uno::Reference< ::com::sun::star::view::XPrintJobListener >& xListener ) throw (::com::sun::star::uno::RuntimeException)
More information about the Libreoffice-commits
mailing list