Hello community,

here is the log from the commit of package libreoffice for openSUSE:Factory 
checked in at 2015-12-13 11:58:35
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/libreoffice (Old)
 and      /work/SRC/openSUSE:Factory/.libreoffice.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "libreoffice"

Changes:
--------
--- /work/SRC/openSUSE:Factory/libreoffice/libreoffice.changes  2015-11-11 
10:29:37.000000000 +0100
+++ /work/SRC/openSUSE:Factory/.libreoffice.new/libreoffice.changes     
2015-12-13 11:58:36.000000000 +0100
@@ -1,0 +2,6 @@
+Tue Dec  1 13:25:35 UTC 2015 - [email protected]
+
+- bnc#954345 - LO-L3: Insert-->Image-->Insert as Link hangs writer
+  * bnc-954345.diff
+
+-------------------------------------------------------------------

New:
----
  bnc-954345.diff

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ libreoffice.spec ++++++
--- /var/tmp/diff_new_pack.a9GFue/_old  2015-12-13 11:59:00.000000000 +0100
+++ /var/tmp/diff_new_pack.a9GFue/_new  2015-12-13 11:59:00.000000000 +0100
@@ -175,6 +175,8 @@
 Patch11:        bnc-679938.diff
 # PATCH-FIX-UPSTREAM: taken from Master to fix flaky test
 Patch12:        use-long-for-test-comparsion.patch
+# bnc#954345 - LO-L3: Insert-->Image-->Insert as Link hangs writer
+Patch13:        bnc-954345.diff
 # try to save space by using hardlinks
 Patch990:       install-with-hardlinks.diff
 BuildRequires:  %{name}-share-linker
@@ -1005,6 +1007,7 @@
 %patch10 -p1
 %patch11 -p1
 %patch12 -p1
+%patch13 -p1
 %patch990 -p1
 # 256x256 icons
 tar -xjf %{SOURCE20}















++++++ bnc-954345.diff ++++++
>From 611be3d78d45c46c942b88e1149dfc428070fc71 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?L=C3=A1szl=C3=B3=20N=C3=A9meth?=
 <[email protected]>
Date: Fri, 27 Nov 2015 21:59:30 +0100
Subject: [PATCH] tdf#95614 fix freezing with linked graphic

When an unloaded linked picture comes into the visible view
(including repainting a page), SwNoTextFrm::PaintPicture()
starts a thread to load it in the background using the
TriggerAsyncRetrieveInputStream() method of the graphic node.

To avoid to start a second thread on the same graphic node,
TriggerAsyncRetrieveInputStream() checks mpThreadConsumer,
the graphic node member variable for the possible thread object.

The problem is that when the thread finished and
SwGrfNode::UpdateLinkWithInputStream() reset mpThreadConsumer,
the graphic object of the graphic node is still in unloaded
state (its type is GRAPHIC_DEFAULT or GRAPHIC_NONE instead of
GRAPHIC_BITMAP or GRAPHIC_GDIMETAFILE) for a while, because
its modification is solved asynchronously after several
SvFileObject::GetData() calls. In the intermediate state
of the graphic object, with the high priority repaints of
the new scheduler, PaintPicture() could start new thread
to load the image again.

Using the new member variable SwGrfNode::mbUpdateLinkInProgress,
this patch will prevent the graphic node to start newer thread
unnecessarily.

Change-Id: I9433f0fa4613294103a00a3955fc2f35d8863b59
---
 sw/inc/ndgrf.hxx                 |  3 +++
 sw/source/core/doc/notxtfrm.cxx  | 15 ++++++++++-----
 sw/source/core/graphic/ndgrf.cxx |  7 +++++--
 3 files changed, 18 insertions(+), 7 deletions(-)

diff --git a/sw/inc/ndgrf.hxx b/sw/inc/ndgrf.hxx
index 668c5f5..e7b2261 100644
--- a/sw/inc/ndgrf.hxx
+++ b/sw/inc/ndgrf.hxx
@@ -51,6 +51,7 @@ class SW_DLLPUBLIC SwGrfNode: public SwNoTextNode
 
     boost::shared_ptr< SwAsyncRetrieveInputStreamThreadConsumer > 
mpThreadConsumer;
     bool mbLinkedInputStreamReady;
+    bool mbUpdateLinkInProgress;
     com::sun::star::uno::Reference<com::sun::star::io::XInputStream> 
mxInputStream;
     bool mbIsStreamReadOnly;
 
@@ -198,6 +199,8 @@ public:
 
     boost::weak_ptr< SwAsyncRetrieveInputStreamThreadConsumer > 
GetThreadConsumer() { return mpThreadConsumer;}
     bool IsLinkedInputStreamReady() const { return mbLinkedInputStreamReady;}
+    bool IsUpdateLinkInProgress() const { return mbUpdateLinkInProgress;}
+    void SetUpdateLinkInProgress(bool b) { mbUpdateLinkInProgress = b; }
     void TriggerAsyncRetrieveInputStream();
     void ApplyInputStream(
         com::sun::star::uno::Reference<com::sun::star::io::XInputStream> 
xInputStream,
diff --git a/sw/source/core/doc/notxtfrm.cxx b/sw/source/core/doc/notxtfrm.cxx
index 02a815b..d943e6d 100644
--- a/sw/source/core/doc/notxtfrm.cxx
+++ b/sw/source/core/doc/notxtfrm.cxx
@@ -897,10 +897,11 @@ void SwNoTextFrm::PaintPicture( vcl::RenderContext* pOut, 
const SwRect &rGrfArea
             {
                 Size aTmpSz;
                 ::sfx2::SvLinkSource* pGrfObj = pGrfNd->GetLink()->GetObj();
-                if( !pGrfObj ||
-                    !pGrfObj->IsDataComplete() ||
-                    !(aTmpSz = pGrfNd->GetTwipSize()).Width() ||
-                    !aTmpSz.Height() || !pGrfNd->GetAutoFormatLvl() )
+                if ( ( !pGrfObj ||
+                       !pGrfObj->IsDataComplete() ||
+                       !(aTmpSz = pGrfNd->GetTwipSize()).Width() ||
+                       !aTmpSz.Height() || !pGrfNd->GetAutoFormatLvl() ) &&
+                    !pGrfNd->IsUpdateLinkInProgress() )
                 {
                     pGrfNd->TriggerAsyncRetrieveInputStream(); // #i73788#
                 }
@@ -909,9 +910,13 @@ void SwNoTextFrm::PaintPicture( vcl::RenderContext* pOut, 
const SwRect &rGrfArea
                     GetRealURL( *pGrfNd, aText );
                 ::lcl_PaintReplacement( aAlignedGrfArea, aText, *pShell, this, 
false );
                 bContinue = false;
+            } else if ( rGrfObj.GetType() != GRAPHIC_DEFAULT &&
+                      rGrfObj.GetType() != GRAPHIC_NONE &&
+                      pGrfNd->IsUpdateLinkInProgress() )
+            {
+                pGrfNd->SetUpdateLinkInProgress( false );
             }
         }
-
         if( bContinue )
         {
             if( rGrfObj.GetGraphic().IsSupportedGraphic())
diff --git a/sw/source/core/graphic/ndgrf.cxx b/sw/source/core/graphic/ndgrf.cxx
index 5c2867e..dbbe379 100644
--- a/sw/source/core/graphic/ndgrf.cxx
+++ b/sw/source/core/graphic/ndgrf.cxx
@@ -71,6 +71,7 @@ SwGrfNode::SwGrfNode(
     mpReplacementGraphic(0),
     // #i73788#
     mbLinkedInputStreamReady( false ),
+    mbUpdateLinkInProgress( false ),
     mbIsStreamReadOnly( false )
 {
     maGrfObj.SetSwapStreamHdl( LINK(this, SwGrfNode, SwapGraphic) );
@@ -89,6 +90,7 @@ SwGrfNode::SwGrfNode( const SwNodeIndex & rWhere,
     mpReplacementGraphic(0),
     // #i73788#
     mbLinkedInputStreamReady( false ),
+    mbUpdateLinkInProgress( false ),
     mbIsStreamReadOnly( false )
 {
     maGrfObj.SetSwapStreamHdl( LINK(this, SwGrfNode, SwapGraphic) );
@@ -112,6 +114,7 @@ SwGrfNode::SwGrfNode( const SwNodeIndex & rWhere,
     mpReplacementGraphic(0),
     // #i73788#
     mbLinkedInputStreamReady( false ),
+    mbUpdateLinkInProgress( false ),
     mbIsStreamReadOnly( false )
 {
     maGrfObj.SetSwapStreamHdl( LINK(this, SwGrfNode, SwapGraphic) );
@@ -521,7 +524,6 @@ bool SwGrfNode::SwapIn( bool bWaitForData )
     bool bRet = false;
     bInSwapIn = true;
     SwBaseLink* pLink = static_cast<SwBaseLink*>((::sfx2::SvBaseLink*) 
refLink);
-
     if( pLink )
     {
         if( GRAPHIC_NONE == maGrfObj.GetType() ||
@@ -1089,7 +1091,6 @@ void SwGrfNode::TriggerAsyncRetrieveInputStream()
         OSL_FAIL( "<SwGrfNode::TriggerAsyncLoad()> - Method is misused. Method 
call is only valid for graphic nodes, which refer a linked graphic file" );
         return;
     }
-
     if ( mpThreadConsumer.get() == 0 )
     {
         mpThreadConsumer.reset( new SwAsyncRetrieveInputStreamThreadConsumer( 
*this ) );
@@ -1104,6 +1105,7 @@ void SwGrfNode::TriggerAsyncRetrieveInputStream()
         }
         mpThreadConsumer->CreateThread( sGrfNm, sReferer );
     }
+
 }
 
 
@@ -1137,6 +1139,7 @@ void SwGrfNode::UpdateLinkWithInputStream()
         // #i88291#
         mxInputStream.clear();
         GetLink()->clearStreamToLoadFrom();
+        mbUpdateLinkInProgress = true;
         mbLinkedInputStreamReady = false;
         mpThreadConsumer.reset();
     }
-- 
2.1.4







Reply via email to