[Libreoffice-commits] core.git: editeng/source include/editeng sw/source

Caolán McNamara caolanm at redhat.com
Fri Nov 11 15:19:48 UTC 2016


 editeng/source/items/frmitems.cxx  |   20 ++++++--------------
 include/editeng/brushitem.hxx      |    2 --
 sw/source/core/layout/paintfrm.cxx |    7 -------
 3 files changed, 6 insertions(+), 23 deletions(-)

New commits:
commit bc09385ce297219f1976a9ca41a0b30902b9326d
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri Nov 11 11:23:17 2016 +0000

    the pStream member makes no sense at all
    
    maybe the PurgeMedia call in sw was meant to be a PurgeGraphic
    call originally
    
    (PurgeGraphic since removed by...
    commit a22ac2c218870033822120bf0b0d6cfde6ce799f
    Author: Caolán McNamara <caolanm at redhat.com>
    Date:   Thu Jul 14 22:06:29 2011 +0100
    
        callcatcher: remove unused methods)
    
    PurgeMedia releasing the stream makes no difference to the only place its used
    which is SvxBrushItem::GetGraphicObject which makes a new one every time
    anyway.
    
    the SvxBrushItem assignment operator doesn't change the stream
    member of the pImpl which looks utterly nuts, so its a good thing
    the stream is not reused
    
    Change-Id: Ie0dee22a6640a6916908fcddbc3541ba85034217

diff --git a/editeng/source/items/frmitems.cxx b/editeng/source/items/frmitems.cxx
index a6618ea..c71b754 100644
--- a/editeng/source/items/frmitems.cxx
+++ b/editeng/source/items/frmitems.cxx
@@ -3267,8 +3267,6 @@ public:
     std::unique_ptr<GraphicObject> xGraphicObject;
     sal_Int8        nGraphicTransparency; //contains a percentage value which is
                                           //copied to the GraphicObject when necessary
-    std::unique_ptr<SvStream> xStream;
-
     explicit SvxBrushItem_Impl(GraphicObject* p)
         : xGraphicObject(p)
         , nGraphicTransparency(0)
@@ -3838,11 +3836,6 @@ SvStream& SvxBrushItem::Store( SvStream& rStream , sal_uInt16 /*nItemVersion*/ )
     return rStream;
 }
 
-void SvxBrushItem::PurgeMedium() const
-{
-    pImpl->xStream.reset();
-}
-
 const GraphicObject* SvxBrushItem::GetGraphicObject(OUString const & referer) const
 {
     if (bLoadAgain && !maStrLink.isEmpty() && !pImpl->xGraphicObject)
@@ -3857,12 +3850,11 @@ const GraphicObject* SvxBrushItem::GetGraphicObject(OUString const & referer) co
         bool bGraphicLoaded = false;
 
         // try to create stream directly from given URL
-        pImpl->xStream.reset(utl::UcbStreamHelper::CreateStream(maStrLink, StreamMode::STD_READ));
-
+        std::unique_ptr<SvStream> xStream(utl::UcbStreamHelper::CreateStream(maStrLink, StreamMode::STD_READ));
         // tdf#94088 if we have a stream, try to load it directly as graphic
-        if (pImpl->xStream && !pImpl->xStream->GetError())
+        if (xStream && !xStream->GetError())
         {
-            if (GRFILTER_OK == GraphicFilter::GetGraphicFilter().ImportGraphic(aGraphic, maStrLink, *pImpl->xStream,
+            if (GRFILTER_OK == GraphicFilter::GetGraphicFilter().ImportGraphic(aGraphic, maStrLink, *xStream,
                 GRFILTER_FORMAT_DONTKNOW, nullptr, GraphicFilterImportFlags::DontSetLogsizeForJpeg))
             {
                 bGraphicLoaded = true;
@@ -3877,10 +3869,10 @@ const GraphicObject* SvxBrushItem::GetGraphicObject(OUString const & referer) co
 
             if( INetProtocol::Data == aGraphicURL.GetProtocol() )
             {
-                std::unique_ptr<SvMemoryStream> const xStream(aGraphicURL.getData());
-                if (xStream)
+                std::unique_ptr<SvMemoryStream> const xMemStream(aGraphicURL.getData());
+                if (xMemStream)
                 {
-                    if (GRFILTER_OK == GraphicFilter::GetGraphicFilter().ImportGraphic(aGraphic, "", *xStream))
+                    if (GRFILTER_OK == GraphicFilter::GetGraphicFilter().ImportGraphic(aGraphic, "", *xMemStream))
                     {
                         bGraphicLoaded = true;
 
diff --git a/include/editeng/brushitem.hxx b/include/editeng/brushitem.hxx
index cbdb89c..1535909 100644
--- a/include/editeng/brushitem.hxx
+++ b/include/editeng/brushitem.hxx
@@ -97,8 +97,6 @@ public:
 
     SvxGraphicPosition  GetGraphicPos() const       { return eGraphicPos; }
 
-    void                PurgeMedium() const;
-
     sal_Int32               GetShadingValue() const     { return nShadingValue; }
     const Graphic*          GetGraphic(OUString const & referer = OUString()/*TODO*/) const;
     const GraphicObject*    GetGraphicObject(OUString const & referer = OUString()/*TODO*/) const;
diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx
index ea91cec..ba8fdc9 100644
--- a/sw/source/core/layout/paintfrm.cxx
+++ b/sw/source/core/layout/paintfrm.cxx
@@ -1980,13 +1980,6 @@ void DrawGraphic(
     {
         if( rSh.GetViewOptions()->IsGraphic() )
         {
-            // load graphic directly in PDF import
-            // #i68953# - also during print load graphic directly.
-            if ( (rSh).GetViewOptions()->IsPDFExport() ||
-                 rSh.GetOut()->GetOutDevType() == OUTDEV_PRINTER )
-            {
-                pBrush->PurgeMedium();
-            }
             OUString referer;
             SfxObjectShell * sh = rSh.GetDoc()->GetPersist();
             if (sh != nullptr && sh->HasName()) {


More information about the Libreoffice-commits mailing list