[Libreoffice-commits] core.git: 2 commits - sw/qa sw/source vcl/source

Miklos Vajna vmiklos at collabora.co.uk
Mon Aug 17 00:14:10 PDT 2015


 sw/qa/core/data/ooxml/pass/tdf93284.docx |binary
 sw/source/core/bastyp/calc.cxx           |    4 ++--
 sw/source/core/bastyp/init.cxx           |    4 ++--
 vcl/source/filter/wmf/winmtf.cxx         |    6 +++---
 4 files changed, 7 insertions(+), 7 deletions(-)

New commits:
commit 047ebb1dadcc0219a268455f74fc03a23aa3d86d
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Mon Aug 17 09:13:12 2015 +0200

    tdf#93284 vcl: fix VirtualDevice leaks in the WMF filter
    
    We attempted to have 8884 VirtualDevices in parallel. This number is now
    12 after fixing the leaks.
    
    The original bugdoc has 135 images, 76 is enough to make Writer on
    Windows crash. The minimized document has the same WMF data for all the
    images, but still duplicated inside the ZIP container, so we trigger the
    resource limit, but the document is still just 99K.
    
    Change-Id: I4c6b3853eaf688302323daf67ff7b62dd64fc412

diff --git a/sw/qa/core/data/ooxml/pass/tdf93284.docx b/sw/qa/core/data/ooxml/pass/tdf93284.docx
new file mode 100755
index 0000000..aedc026
Binary files /dev/null and b/sw/qa/core/data/ooxml/pass/tdf93284.docx differ
diff --git a/vcl/source/filter/wmf/winmtf.cxx b/vcl/source/filter/wmf/winmtf.cxx
index 74a0774..a768b32 100644
--- a/vcl/source/filter/wmf/winmtf.cxx
+++ b/vcl/source/filter/wmf/winmtf.cxx
@@ -236,7 +236,7 @@ WinMtfFontStyle::WinMtfFontStyle( LOGFONTW& rFont )
     {
         // #i117968# VirtualDevice is not thread safe, but filter is used in multithreading
         SolarMutexGuard aGuard;
-        VclPtrInstance< VirtualDevice > pVDev;
+        ScopedVclPtrInstance< VirtualDevice > pVDev;
         // converting the cell height into a font height
         aFont.SetSize( aFontSize );
         pVDev->SetFont( aFont );
@@ -1451,7 +1451,7 @@ void WinMtfOutput::DrawText( Point& rPosition, OUString& rText, long* pDXArry, b
     {
         // #i117968# VirtualDevice is not thread safe, but filter is used in multithreading
         SolarMutexGuard aGuard;
-        VclPtrInstance< VirtualDevice > pVDev;
+        ScopedVclPtrInstance< VirtualDevice > pVDev;
         sal_Int32 nTextWidth;
         pVDev->SetMapMode( MapMode( MAP_100TH_MM ) );
         pVDev->SetFont( maFont );
@@ -1499,7 +1499,7 @@ void WinMtfOutput::DrawText( Point& rPosition, OUString& rText, long* pDXArry, b
         {
             // #i117968# VirtualDevice is not thread safe, but filter is used in multithreading
             SolarMutexGuard aGuard;
-            VclPtrInstance< VirtualDevice > pVDev;
+            ScopedVclPtrInstance< VirtualDevice > pVDev;
             pDX = new long[ rText.getLength() ];
             pVDev->SetMapMode( MAP_100TH_MM );
             pVDev->SetFont( maLatestFont );
commit 42fc4f102bc848cf2d41ce33788c802af099b4d3
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Mon Aug 17 09:03:49 2015 +0200

    sw: use std::unique_ptr<> in bastyp
    
    Change-Id: I64909a408ff1c3537790e09e9b96f1ef467f96bd

diff --git a/sw/source/core/bastyp/calc.cxx b/sw/source/core/bastyp/calc.cxx
index 1b05744..db9680a 100644
--- a/sw/source/core/bastyp/calc.cxx
+++ b/sw/source/core/bastyp/calc.cxx
@@ -23,6 +23,7 @@
 #include <cctype>
 #include <cfloat>
 #include <climits>
+#include <memory>
 #include <comphelper/processfactory.hxx>
 #include <comphelper/string.hxx>
 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
@@ -50,7 +51,6 @@
 #include <unotools/useroptions.hxx>
 #include <usrfld.hxx>
 #include <viewsh.hxx>
-#include <boost/scoped_ptr.hpp>
 
 using namespace ::com::sun::star;
 
@@ -1526,7 +1526,7 @@ bool SwCalc::Str2Double( const OUString& rCommand, sal_Int32& rCommandPos,
                          double& rVal, SwDoc* const pDoc )
 {
     const SvtSysLocale aSysLocale;
-    boost::scoped_ptr<const LocaleDataWrapper> pLclD;
+    std::unique_ptr<const LocaleDataWrapper> pLclD;
     if( pDoc )
     {
         LanguageType eLang = GetDocAppScriptLang( *pDoc );
diff --git a/sw/source/core/bastyp/init.cxx b/sw/source/core/bastyp/init.cxx
index 7439d30..1d3962a 100644
--- a/sw/source/core/bastyp/init.cxx
+++ b/sw/source/core/bastyp/init.cxx
@@ -17,8 +17,8 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
+#include <memory>
 #include <acmplwrd.hxx>
-#include <boost/scoped_ptr.hpp>
 #include <breakit.hxx>
 #include <cellatr.hxx>
 #include <checkit.hxx>
@@ -892,7 +892,7 @@ namespace
     class TransWrp
     {
     private:
-        boost::scoped_ptr< ::utl::TransliterationWrapper > xTransWrp;
+        std::unique_ptr<utl::TransliterationWrapper> xTransWrp;
     public:
         TransWrp()
         {


More information about the Libreoffice-commits mailing list