include/svx/svdograf.hxx                                   |    1 
 officecfg/Configuration_officecfg.mk                       |    1 
 officecfg/registry/data/org/openoffice/Office/Common.xcu   |    7 +++
 officecfg/registry/schema/org/openoffice/Office/Common.xcs |    2 
 postprocess/CustomTarget_registry.mk                       |    5 ++
 svx/source/svdraw/svdograf.cxx                             |   30 +++++++++++++
 sw/inc/ndgrf.hxx                                           |    1 
 sw/source/core/graphic/ndgrf.cxx                           |   26 +++++++++++
 vcl/unx/generic/app/sm.cxx                                 |    2 
 xmloff/source/draw/shapeexport.cxx                         |   11 +++-
 10 files changed, 80 insertions(+), 6 deletions(-)

New commits:
commit 55baf61c08630e0c09a87d99519211467818ef8c
Author: Michael Stahl <mst...@redhat.com>
Date:   Fri Jul 14 15:31:20 2017 +0200

    officecfg: increase GraphicManager/TotalCacheSize again for 64-bit
    
    There's a bit of a problem with XFillBitmapItem, which contains a
    GraphicObject that can't be swapped because it's a poolable item.
    
    Generally contemptorary hardware has enough RAM that we can easily
    increase the cache size to 400M (effectively there's another factor
    of 2x), but on legacy 32-bit platforms the address space is getting
    scarce, so keep the existing size for those.
    
    Change-Id: I8437f4e8c5421f8ec20e94e4cdf64f867d7760ca

diff --git a/officecfg/Configuration_officecfg.mk 
b/officecfg/Configuration_officecfg.mk
index b157784df702..ccaa35aea0a9 100644
--- a/officecfg/Configuration_officecfg.mk
+++ b/officecfg/Configuration_officecfg.mk
@@ -84,6 +84,7 @@ $(eval $(call 
gb_Configuration_add_spool_modules,registry,officecfg/registry/dat
        org/openoffice/Office/Common-macosx.xcu \
        org/openoffice/Office/Common-wnt.xcu \
        org/openoffice/Office/Common-UseOOoFileDialogs.xcu \
+       org/openoffice/Office/Common-32bit.xcu \
        org/openoffice/Office/Jobs-impress.xcu \
        org/openoffice/Office/Linguistic-ForceDefaultLanguage.xcu \
        org/openoffice/Office/ProtocolHandler-impress.xcu \
diff --git a/officecfg/registry/data/org/openoffice/Office/Common.xcu 
b/officecfg/registry/data/org/openoffice/Office/Common.xcu
index eef41786feed..f84bd1a8eeb6 100644
--- a/officecfg/registry/data/org/openoffice/Office/Common.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/Common.xcu
@@ -506,6 +506,13 @@
       </prop>
     </node>
   </node>
+  <node oor:name="Cache">
+    <node oor:name="GraphicManager">
+      <prop oor:name="TotalCacheSize" oor:type="xs:int">
+        <value install:module="32bit">200000000</value>
+      </prop>
+    </node>
+  </node>
   <node oor:name="Path">
     <node oor:name="Current">
       <prop oor:name="Temp" oor:type="xs:string">
diff --git a/officecfg/registry/schema/org/openoffice/Office/Common.xcs 
b/officecfg/registry/schema/org/openoffice/Office/Common.xcs
index bfcefe2ec38b..5e146982cfaf 100644
--- a/officecfg/registry/schema/org/openoffice/Office/Common.xcs
+++ b/officecfg/registry/schema/org/openoffice/Office/Common.xcs
@@ -1495,7 +1495,7 @@
             objects.</desc>
             <label>Total Image Cache Size</label>
           </info>
-          <value>200000000</value>
+          <value>400000000</value>
         </prop>
         <prop oor:name="ObjectCacheSize" oor:type="xs:int" 
oor:nillable="false">
           <info>
diff --git a/postprocess/CustomTarget_registry.mk 
b/postprocess/CustomTarget_registry.mk
index 294f9de9400f..87792b6f062e 100644
--- a/postprocess/CustomTarget_registry.mk
+++ b/postprocess/CustomTarget_registry.mk
@@ -351,6 +351,11 @@ else
 postprocess_FILES_main += 
$(postprocess_MOD)/org/openoffice/Office/Paths-internallibexttextcatdata.xcu
 endif
 
+ifneq ($(filter $(CPUNAME),POWERPC INTEL ARM HPPA GODSON M68K SPARC S390),)
+postprocess_FILES_main += \
+       $(postprocess_MOD)/org/openoffice/Office/Common-32bit.xcu
+endif
+
 postprocess_DEPS_math := main
 postprocess_FILES_math := \
        $(postprocess_XCS)/Office/UI/MathCommands.xcs \
commit a03a0cfb1e41c357950a40623c2f8b6f5507e97d
Author: Michael Stahl <mst...@redhat.com>
Date:   Fri Jul 14 14:32:22 2017 +0200

    sw: make SwGrfNode::mpReplacementGraphic swappable
    
    Same as previous commit, but for sw.
    
    Change-Id: Id678de3f512204437e37aaedf24e24aff7a9e592

diff --git a/sw/inc/ndgrf.hxx b/sw/inc/ndgrf.hxx
index 9b1faeff2999..d80d77d4db27 100644
--- a/sw/inc/ndgrf.hxx
+++ b/sw/inc/ndgrf.hxx
@@ -71,6 +71,7 @@ class SW_DLLPUBLIC SwGrfNode: public SwNoTextNode
     bool ImportGraphic( SvStream& rStrm );
 
     DECL_LINK( SwapGraphic, const GraphicObject*, SvStream* );
+    DECL_LINK( SwapReplacement, const GraphicObject*, SvStream* );
 
     /** helper method to determine stream for the embedded graphic.
 
diff --git a/sw/source/core/graphic/ndgrf.cxx b/sw/source/core/graphic/ndgrf.cxx
index 49052dfa0e23..6976b4510a04 100644
--- a/sw/source/core/graphic/ndgrf.cxx
+++ b/sw/source/core/graphic/ndgrf.cxx
@@ -401,8 +401,15 @@ const GraphicObject* SwGrfNode::GetReplacementGrfObj() 
const
             const_cast< SwGrfNode* >(this)->mpReplacementGraphic = new 
GraphicObject(rSvgDataPtr->getReplacement());
         }
         else if (GetGrfObj().GetGraphic().getPdfData().hasElements())
+        {
             // This returns the bitmap, without the pdf data.
             const_cast<SwGrfNode*>(this)->mpReplacementGraphic = new 
GraphicObject(GetGrfObj().GetGraphic().GetBitmapEx());
+        }
+        if (mpReplacementGraphic)
+        {
+            mpReplacementGraphic->SetSwapStreamHdl(
+                LINK(const_cast<SwGrfNode*>(this), SwGrfNode, 
SwapReplacement));
+        }
     }
 
     return mpReplacementGraphic;
@@ -953,6 +960,25 @@ SwContentNode* SwGrfNode::MakeCopy( SwDoc* pDoc, const 
SwNodeIndex& rIdx ) const
     return pGrfNd;
 }
 
+IMPL_LINK(SwGrfNode, SwapReplacement, const GraphicObject*, pGrfObj, SvStream*)
+{
+    // replacement image is always swapped
+    if (pGrfObj->IsInSwapOut())
+    {
+        return GRFMGR_AUTOSWAPSTREAM_TEMP;
+    }
+    else if (pGrfObj->IsInSwapIn())
+    {
+        return GRFMGR_AUTOSWAPSTREAM_TEMP;
+    }
+    else
+    {
+        assert(!"why is swap handler being called?");
+    }
+
+    return GRFMGR_AUTOSWAPSTREAM_NONE;
+}
+
 IMPL_LINK( SwGrfNode, SwapGraphic, const GraphicObject*, pGrfObj, SvStream* )
 {
     SvStream* pRet;
commit c96e3e226fe4eb8f25c54cce4d653d12eda63ce2
Author: Michael Stahl <mst...@redhat.com>
Date:   Wed Jul 12 15:14:48 2017 +0200

    svx: make SdrGrafObj::mpReplacementGraphic swappable
    
    These GraphicObjects clog up the GraphicManager cache so it's
    effectively useless.
    
    Round-tripping the ML bugdoc, this doesn't provide much of a
    speed-up by itself, but together with the previous fix it goes from
    3:00 to 1:30 (in an optimized build).
    
    Change-Id: If52e176c790b94ffef9984be53376a34345b06e3

diff --git a/include/svx/svdograf.hxx b/include/svx/svdograf.hxx
index dcf170099ea4..e86673b74899 100644
--- a/include/svx/svdograf.hxx
+++ b/include/svx/svdograf.hxx
@@ -112,6 +112,7 @@ private:
     bool                    ImpUpdateGraphicLink( bool bAsynchron = true ) 
const;
     void                    ImpSetLinkedGraphic( const Graphic& rGraphic );
                             DECL_LINK( ImpSwapHdl, const GraphicObject*, 
SvStream* );
+                            DECL_LINK( ReplacementSwapHdl, const 
GraphicObject*, SvStream* );
     void onGraphicChanged();
     GDIMetaFile             GetMetaFile(GraphicType &rGraphicType) const;
 
diff --git a/svx/source/svdraw/svdograf.cxx b/svx/source/svdraw/svdograf.cxx
index 59c5a57e9125..d0f042ca0b71 100644
--- a/svx/source/svdraw/svdograf.cxx
+++ b/svx/source/svdraw/svdograf.cxx
@@ -439,8 +439,15 @@ const GraphicObject* 
SdrGrafObj::GetReplacementGraphicObject() const
             const_cast< SdrGrafObj* >(this)->mpReplacementGraphic = new 
GraphicObject(rSvgDataPtr->getReplacement());
         }
         else if (pGraphic->GetGraphic().getPdfData().hasElements())
+        {
             // Replacement graphic for bitmap + PDF is just the bitmap.
             const_cast<SdrGrafObj*>(this)->mpReplacementGraphic = new 
GraphicObject(pGraphic->GetGraphic().GetBitmapEx());
+        }
+        if (mpReplacementGraphic)
+        {
+            mpReplacementGraphic->SetSwapStreamHdl(
+                LINK(const_cast<SdrGrafObj*>(this), SdrGrafObj, 
ReplacementSwapHdl));
+        }
     }
 
     return mpReplacementGraphic;
@@ -1279,6 +1286,29 @@ void SdrGrafObj::AdjustToMaxRect( const 
tools::Rectangle& rMaxRect, bool bShrink
     }
 }
 
+IMPL_LINK(SdrGrafObj, ReplacementSwapHdl, const GraphicObject*, pO, SvStream*)
+{
+    // replacement image is always swapped
+    if (pO->IsInSwapOut())
+    {
+        SdrSwapGraphicsMode const nSwapMode(pModel->GetSwapGraphicsMode());
+        if (nSwapMode & SdrSwapGraphicsMode::TEMP)
+        {
+            return GRFMGR_AUTOSWAPSTREAM_TEMP;
+        }
+    }
+    else if (pO->IsInSwapIn())
+    {
+        return GRFMGR_AUTOSWAPSTREAM_TEMP;
+    }
+    else
+    {
+        assert(!"why is swap handler being called?");
+    }
+
+    return GRFMGR_AUTOSWAPSTREAM_NONE;
+}
+
 IMPL_LINK( SdrGrafObj, ImpSwapHdl, const GraphicObject*, pO, SvStream* )
 {
     SvStream* pRet = GRFMGR_AUTOSWAPSTREAM_NONE;
commit b3992ddcd13082a934246b717ae22f57394e6533
Author: Michael Stahl <mst...@redhat.com>
Date:   Thu Jul 13 21:58:48 2017 +0200

    xmloff: ODF export: fix redundant setting of GraphicStreamURL swapping
    
    XMLShapeExport::ImpExportGraphicObjectShape() unnecessarily swaps out
    the GraphicObject by calling setPropertyValue("GraphicStreamURL")
    even if the URL didn't actually change from what was retrieved
    just a couple lines earlier, incidentally swapping it in too.
    
    Well actually it isn't really swapped out, it's marked as auto-swapped,
    but nevertheless on getting the "ReplacementGraphicURL" property
    its Graphic will be replaced by swapping it in again.
    
    So don't do that, then it's only swapped in once.
    
    This speeds up round-tripping the ML bugdoc from 3:20 to 3:00.
    
    Change-Id: I65a211a0c225444c06d5516df9c6716360be46c0

diff --git a/xmloff/source/draw/shapeexport.cxx 
b/xmloff/source/draw/shapeexport.cxx
index e49451f686e8..c288640a68fa 100644
--- a/xmloff/source/draw/shapeexport.cxx
+++ b/xmloff/source/draw/shapeexport.cxx
@@ -2311,17 +2311,20 @@ void XMLShapeExport::ImpExportGraphicObjectShape(
                     // apply possible changed stream URL to embedded image 
object
                     if ( bIsEmbeddedImageWithExistingStreamInPackage )
                     {
-                        aStreamURL = sPackageURL;
+                        OUString newStreamURL = sPackageURL;
                         if ( aStr[0] == '#' )
                         {
-                            aStreamURL += aStr.copy( 1, aStr.getLength() - 1 );
+                            newStreamURL += aStr.copy( 1, aStr.getLength() - 1 
);
                         }
                         else
                         {
-                            aStreamURL += aStr;
+                            newStreamURL += aStr;
                         }
 
-                        xPropSet->setPropertyValue( "GraphicStreamURL", 
uno::Any(aStreamURL) );
+                        if (newStreamURL != aStreamURL)
+                        {
+                            xPropSet->setPropertyValue("GraphicStreamURL", 
uno::Any(newStreamURL));
+                        }
                     }
 
                     mrExport.AddAttribute(XML_NAMESPACE_XLINK, XML_TYPE, 
XML_SIMPLE );
commit c356884319f254fdd944376fe2f841532dc36433
Author: Michael Stahl <mst...@redhat.com>
Date:   Thu Jul 13 15:41:02 2017 +0200

    vcl: fix -Werror=format (32-bit GCC)
    
    Change-Id: Ia7afb5b9750704797ff8030688d0531c27d80836

diff --git a/vcl/unx/generic/app/sm.cxx b/vcl/unx/generic/app/sm.cxx
index be572f29a7c6..b86435fbaf73 100644
--- a/vcl/unx/generic/app/sm.cxx
+++ b/vcl/unx/generic/app/sm.cxx
@@ -358,7 +358,7 @@ void SessionManagerClient::SaveYourselfProc(
                                                  (interact_style == 
SmInteractStyleErrors) ? "SmInteractStyleErrors" :
                                                                                
              "SmInteractStyleAny"));
     char num[100];
-    snprintf(num, sizeof(num), "_%d_%d", now.Seconds, (now.Nanosec / 1000));
+    snprintf(num, sizeof(num), "_%" SAL_PRIuUINT32 "_%" SAL_PRIuUINT32, 
now.Seconds, (now.Nanosec / 1001));
     m_aTimeID = OString(num);
 
     BuildSmPropertyList();
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to