incubator-ooo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From o..@apache.org
Subject svn commit: r1346776 - /incubator/ooo/branches/AOO34/main/sw/source/ui/uno/unotxvw.cxx
Date Wed, 06 Jun 2012 08:29:45 GMT
Author: orw
Date: Wed Jun  6 08:29:44 2012
New Revision: 1346776

URL: http://svn.apache.org/viewvc?rev=1346776&view=rev
Log:
#119189# - method <SwXTextView::NotifySelChanged()> - do not destroy temporary document,
if an action is pending

Found by: sorath <torohov_s_a@mail.ru>

Modified:
    incubator/ooo/branches/AOO34/main/sw/source/ui/uno/unotxvw.cxx

Modified: incubator/ooo/branches/AOO34/main/sw/source/ui/uno/unotxvw.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/AOO34/main/sw/source/ui/uno/unotxvw.cxx?rev=1346776&r1=1346775&r2=1346776&view=diff
==============================================================================
--- incubator/ooo/branches/AOO34/main/sw/source/ui/uno/unotxvw.cxx (original)
+++ incubator/ooo/branches/AOO34/main/sw/source/ui/uno/unotxvw.cxx Wed Jun  6 08:29:44 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;



Mime
View raw message