You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openoffice.apache.org by ar...@apache.org on 2013/02/24 20:23:09 UTC

svn commit: r1449532 - /openoffice/trunk/main/sfx2/source/doc/printhelper.cxx

Author: arielch
Date: Sun Feb 24 19:23:09 2013
New Revision: 1449532

URL: http://svn.apache.org/r1449532
Log:
i114817 - Fix missing css::view::PrintableState_JOB_STARTED notification

Modified:
    openoffice/trunk/main/sfx2/source/doc/printhelper.cxx

Modified: openoffice/trunk/main/sfx2/source/doc/printhelper.cxx
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/sfx2/source/doc/printhelper.cxx?rev=1449532&r1=1449531&r2=1449532&view=diff
==============================================================================
--- openoffice/trunk/main/sfx2/source/doc/printhelper.cxx (original)
+++ openoffice/trunk/main/sfx2/source/doc/printhelper.cxx Sun Feb 24 19:23:09 2013
@@ -785,32 +785,31 @@ void SAL_CALL SfxPrintHelper::print(cons
 
 void IMPL_PrintListener_DataContainer::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
 {
-    if ( &rBC == m_pObjectShell )
-	{
-		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 );
-				}
-			}
-		}
-	}
+    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 )
+    {
+        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)