incubator-ooo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From o..@apache.org
Subject svn commit: r1346805 - in /incubator/ooo/trunk: ./ main/sw/source/ui/uno/unotxvw.cxx main/vcl/inc/vcl/print.hxx main/vcl/source/gdi/print3.cxx
Date Wed, 06 Jun 2012 09:53:04 GMT
Author: orw
Date: Wed Jun  6 09:53:04 2012
New Revision: 1346805

URL: http://svn.apache.org/viewvc?rev=1346805&view=rev
Log:
#119189# - merge fix from branch AOO34 into trunk

Found by: sorath <torohov_s_a@mail.ru>

Modified:
    incubator/ooo/trunk/   (props changed)
    incubator/ooo/trunk/main/sw/source/ui/uno/unotxvw.cxx
    incubator/ooo/trunk/main/vcl/inc/vcl/print.hxx
    incubator/ooo/trunk/main/vcl/source/gdi/print3.cxx

Propchange: incubator/ooo/trunk/
------------------------------------------------------------------------------
  Merged /incubator/ooo/branches/AOO34:r1346776-1346777

Modified: incubator/ooo/trunk/main/sw/source/ui/uno/unotxvw.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/sw/source/ui/uno/unotxvw.cxx?rev=1346805&r1=1346804&r2=1346805&view=diff
==============================================================================
--- incubator/ooo/trunk/main/sw/source/ui/uno/unotxvw.cxx (original)
+++ incubator/ooo/trunk/main/sw/source/ui/uno/unotxvw.cxx Wed Jun  6 09:53:04 2012
@@ -940,11 +940,22 @@ void SwXTextView::NotifySelChanged()
     DBG_ASSERT( m_pView, "view is missing" );
 
     // destroy temporary document with selected text that is used
-    // in PDF export of (multi-)selections.
+    // in PDF export of (multi-)selections and on print of (multi-)selections
     if (m_pView && m_pView->GetTmpSelectionDoc().Is())
     {
-        m_pView->GetTmpSelectionDoc()->DoClose();
-        m_pView->GetTmpSelectionDoc() = 0;
+        // do not destroy the temporary document, if an action is pending
+        bool bActionPending = false;
+        {
+            SfxObjectShellLock& xDocSh = m_pView->GetTmpSelectionDoc();
+            SwDoc* pDoc = static_cast< SwDocShell* >(&xDocSh)->GetDoc();
+            SwView* pView = pDoc ? pDoc->GetDocShell()->GetView() : 0;
+            bActionPending = pView ? pView->GetWrtShell().ActionPend() : false;
+        }
+        if ( !bActionPending )
+        {
+            m_pView->GetTmpSelectionDoc()->DoClose();
+            m_pView->GetTmpSelectionDoc() = 0;
+        }
     }
 
 	uno::Reference< uno::XInterface >  xInt = (cppu::OWeakObject*)(SfxBaseController*)this;

Modified: incubator/ooo/trunk/main/vcl/inc/vcl/print.hxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/vcl/inc/vcl/print.hxx?rev=1346805&r1=1346804&r2=1346805&view=diff
==============================================================================
--- incubator/ooo/trunk/main/vcl/inc/vcl/print.hxx (original)
+++ incubator/ooo/trunk/main/vcl/inc/vcl/print.hxx Wed Jun  6 09:53:04 2012
@@ -514,6 +514,10 @@ public:
     
     void abortJob();
     
+    // applications (well, sw) depend on a page request with "IsLastPage" = true
+    // to free resources, else they (well, sw) will crash eventually
+    void triggerAppToFreeResources();
+
     bool isShowDialogs() const;
     bool isDirectPrint() const;
     

Modified: incubator/ooo/trunk/main/vcl/source/gdi/print3.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/vcl/source/gdi/print3.cxx?rev=1346805&r1=1346804&r2=1346805&view=diff
==============================================================================
--- incubator/ooo/trunk/main/vcl/source/gdi/print3.cxx (original)
+++ incubator/ooo/trunk/main/vcl/source/gdi/print3.cxx Wed Jun  6 09:53:04 2012
@@ -499,6 +499,9 @@ void Printer::ImplPrintJob( const boost:
                 pController->setValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintCollateAsSingleJobs"
) ),
                                        makeAny( sal_True ) );
             }
+            // applications (well, sw) depend on a page request with "IsLastPage" = true
+            // to free resources, else they (well, sw) will crash eventually
+            i_pController->triggerAppToFreeResources();
         }
         catch( std::bad_alloc& )
         {
@@ -1242,9 +1245,8 @@ void PrinterController::jobFinished( vie
 {
 }
 
-void PrinterController::abortJob()
+void PrinterController::triggerAppToFreeResources()
 {
-    setJobState( view::PrintableState_JOB_ABORTED );
     // applications (well, sw) depend on a page request with "IsLastPage" = true
     // to free resources, else they (well, sw) will crash eventually
     setLastPage( sal_True );
@@ -1254,6 +1256,13 @@ void PrinterController::abortJob()
     getPageFile( 0, aMtf, false );
 }
 
+void PrinterController::abortJob()
+{
+    setJobState( view::PrintableState_JOB_ABORTED );
+
+    triggerAppToFreeResources();
+}
+
 void PrinterController::setLastPage( sal_Bool i_bLastPage )
 {
     mpImplData->mbLastPage = i_bLastPage;



Mime
View raw message