[Libreoffice-commits] core.git: Branch 'feature/image_rework' - 2 commits - sw/inc sw/source

Zolnai Tamás tamas.zolnai at collabora.com
Sun Nov 2 07:56:57 PST 2014


 sw/inc/ndgrf.hxx                   |    3 +++
 sw/source/core/doc/notxtfrm.cxx    |    2 --
 sw/source/core/graphic/ndgrf.cxx   |   14 +-------------
 sw/source/filter/html/htmlgrin.cxx |   10 ----------
 4 files changed, 4 insertions(+), 25 deletions(-)

New commits:
commit 6f425bd88b823cf7633552d24a3eb69eeb9c33f8
Author: Zolnai Tamás <tamas.zolnai at collabora.com>
Date:   Sun Nov 2 11:47:04 2014 +0100

    Remove some useless swapping call inside SwGrfNode
    
    Change-Id: I4cd2677197c7a6cff71e2966c2b2dd2285032c07

diff --git a/sw/source/core/graphic/ndgrf.cxx b/sw/source/core/graphic/ndgrf.cxx
index 9973837..47c2740 100644
--- a/sw/source/core/graphic/ndgrf.cxx
+++ b/sw/source/core/graphic/ndgrf.cxx
@@ -341,7 +341,6 @@ void SwGrfNode::onGraphicChanged()
 
     if(pFlyFmt)
     {
-        const bool bWasSwappedOut = GetGrfObj().IsSwappedOut();
         OUString aName;
         OUString aTitle;
         OUString aDesc;
@@ -382,11 +381,6 @@ void SwGrfNode::onGraphicChanged()
         {
             SetDescription(aDesc);
         }
-
-        if (bWasSwappedOut)
-        {
-            SwapOut();
-        }
     }
 }
 
@@ -675,10 +669,6 @@ bool SwGrfNode::SavePersistentData()
         return true;
     }
 
-    // swap in first if already in storage
-    if( HasEmbeddedStreamName() && !SwapIn() )
-        return false;
-
     // #i44367#
     // Do not delete graphic file in storage, because the graphic file could
     // be referenced by other graphic nodes.
@@ -997,9 +987,7 @@ SwCntntNode* SwGrfNode::MakeCopy( SwDoc* pDoc, const SwNodeIndex& rIdx ) const
     }
     else
     {
-        if( maGrfObj.IsSwappedOut() )
-            const_cast<SwGrfNode*>(this)->SwapIn();
-        aTmpGrf = maGrfObj.GetGraphic();
+        aTmpGrf = GetGrf();
     }
 
     const sfx2::LinkManager& rMgr = getIDocumentLinksAdministration()->GetLinkManager();
commit c56e2e804acac67ad02b9454c6aa748ef2117201
Author: Zolnai Tamás <tamas.zolnai at collabora.com>
Date:   Sun Nov 2 11:36:49 2014 +0100

    Make SwGrfNode swapping methods private
    
    Change-Id: Ide3043f2f245c097a7b4c07ba2e0713510296b3e

diff --git a/sw/inc/ndgrf.hxx b/sw/inc/ndgrf.hxx
index 5a2dcbd..f8f9e46 100644
--- a/sw/inc/ndgrf.hxx
+++ b/sw/inc/ndgrf.hxx
@@ -169,10 +169,13 @@ public:
                  const Graphic* pGraphic = 0,
                  const GraphicObject* pGrfObj = 0,
                  bool bModify = true );
+private:
     /// Loading of graphic immediately before displaying.
     bool SwapIn( bool bWaitForData = false );
     /// Remove graphic in order to free memory.
     bool SwapOut();
+
+public:
     bool HasEmbeddedStreamName() const { return maGrfObj.HasUserData(); }
     /// applying new stream name for embedded graphic - needed as saving the document might change this stream name
     void ApplyNewEmbeddedStreamName(const OUString& r)
diff --git a/sw/source/core/doc/notxtfrm.cxx b/sw/source/core/doc/notxtfrm.cxx
index 612b785..9f45a32 100644
--- a/sw/source/core/doc/notxtfrm.cxx
+++ b/sw/source/core/doc/notxtfrm.cxx
@@ -599,8 +599,6 @@ void SwNoTxtFrm::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew )
                         }
                     } while( pVSh != (pSh = (SwViewShell*)pSh->GetNext() ));
                 }
-                else
-                    pNd->SwapIn();
             }
         }
         break;
diff --git a/sw/source/filter/html/htmlgrin.cxx b/sw/source/filter/html/htmlgrin.cxx
index 83db824..5755bcd 100644
--- a/sw/source/filter/html/htmlgrin.cxx
+++ b/sw/source/filter/html/htmlgrin.cxx
@@ -563,7 +563,6 @@ IMAGE_SETEVENT:
     Size aGrfSz( 0, 0 );
     bool bSetTwipSize = true;       // Twip-Size am Node setzen?
     bool bChangeFrmSize = false;    // Frame-Format nachtraeglich anpassen?
-    bool bRequestGrfNow = false;
     bool bSetScaleImageMap = false;
     sal_uInt8 nPrcWidth = 0, nPrcHeight = 0;
 
@@ -575,7 +574,6 @@ IMAGE_SETEVENT:
         // Tabelle layoutet wird.
         if( pTable!=0 && !nWidth )
         {
-            bRequestGrfNow = true;
             IncGrfsThatResizeTable();
         }
 
@@ -799,14 +797,6 @@ IMAGE_SETEVENT:
     if( !aMacroItem.GetMacroTable().empty() )
         pFlyFmt->SetFmtAttr( aMacroItem );
 
-    // Wenn die Grafik gleich angeforder wird, muss dies geschehen,
-    // nachdem das Format vollstaendig aufgebaut ist, weil es evtl.
-    // gleich (synchron) angepasst wird (war bug #40983#)
-    if (bRequestGrfNow && pGrfNd)
-    {
-        pGrfNd->SwapIn();
-    }
-
     // Ggf. Frames anlegen und Auto-gebundenen Rahmen registrieren
     RegisterFlyFrm( pFlyFmt );
 


More information about the Libreoffice-commits mailing list