[Libreoffice-commits] .: 5 commits - fpicker/source sfx2/source

David Tardon dtardon at kemper.freedesktop.org
Thu May 12 05:33:57 PDT 2011


 fpicker/source/office/fpsmartcontent.cxx |   18 ++++++++++++++----
 sfx2/source/appl/lnkbase2.cxx            |    2 ++
 sfx2/source/bastyp/bitset.cxx            |    4 ++--
 sfx2/source/bastyp/fltfnc.cxx            |    1 +
 4 files changed, 19 insertions(+), 6 deletions(-)

New commits:
commit 27866e1a7c5d58f9516ff5a2b25e108f171adbd1
Author: David Tardon <dtardon at redhat.com>
Date:   Thu May 12 14:18:45 2011 +0200

    fix array overflow

diff --git a/sfx2/source/bastyp/bitset.cxx b/sfx2/source/bastyp/bitset.cxx
index 5b5ad21..ef08bb5 100644
--- a/sfx2/source/bastyp/bitset.cxx
+++ b/sfx2/source/bastyp/bitset.cxx
@@ -228,8 +228,8 @@ BitSet& BitSet::operator=( sal_uInt16 nBit )
     sal_uIntPtr nBitVal = 1L << (nBit % 32);
     nCount = 1;
 
-    pBitmap = new sal_uIntPtr[nBlocks];
-    memset( pBitmap + nBlocks, 0, 4 * nBlocks );
+    pBitmap = new sal_uIntPtr[nBlocks + 1];
+    memset( pBitmap, 0, 4 * (nBlocks + 1) );
 
     *(pBitmap+nBlocks) = nBitVal;
 
commit a7aaa5b01a00a59c22c970a4447005f12b6fa7bb
Author: David Tardon <dtardon at redhat.com>
Date:   Thu May 12 11:47:18 2011 +0200

    do not leak memory

diff --git a/sfx2/source/bastyp/fltfnc.cxx b/sfx2/source/bastyp/fltfnc.cxx
index 356a58c..4e87ea6 100644
--- a/sfx2/source/bastyp/fltfnc.cxx
+++ b/sfx2/source/bastyp/fltfnc.cxx
@@ -188,6 +188,7 @@ SfxFilterContainer::SfxFilterContainer( const String& rName )
 
 SfxFilterContainer::~SfxFilterContainer()
 {
+    delete pImpl;
 }
 
 //----------------------------------------------------------------
commit 8b90990093b86cf808d01d1f1271067bc2e626c0
Author: David Tardon <dtardon at redhat.com>
Date:   Thu May 12 10:45:38 2011 +0200

    do not leak memory

diff --git a/sfx2/source/appl/lnkbase2.cxx b/sfx2/source/appl/lnkbase2.cxx
index 2123de6..694917e 100644
--- a/sfx2/source/appl/lnkbase2.cxx
+++ b/sfx2/source/appl/lnkbase2.cxx
@@ -160,6 +160,7 @@ SvBaseLink::SvBaseLink( sal_uInt16 nUpdateMode, sal_uIntPtr nContentType )
 //--------------------------------------------------------------------------
 
 SvBaseLink::SvBaseLink( const String& rLinkName, sal_uInt16 nObjectType, SvLinkSource* pObj )
+    : pImpl(0)
 {
     bVisible = bSynchron = bUseCache = sal_True;
     bWasLastEditOK = sal_False;
@@ -209,6 +210,7 @@ SvBaseLink::~SvBaseLink()
     }
 
     delete pImplData;
+    delete pImpl;
 }
 
 IMPL_LINK( SvBaseLink, EndEditHdl, String*, _pNewName )
commit 1c645ba50606202ea9d404b48fcfdd3ac47502c1
Author: David Tardon <dtardon at redhat.com>
Date:   Thu May 12 08:05:42 2011 +0200

    do not leak memory

diff --git a/fpicker/source/office/fpsmartcontent.cxx b/fpicker/source/office/fpsmartcontent.cxx
index 710fb11..200577f 100644
--- a/fpicker/source/office/fpsmartcontent.cxx
+++ b/fpicker/source/office/fpsmartcontent.cxx
@@ -76,8 +76,18 @@ namespace svt
     //--------------------------------------------------------------------
     SmartContent::~SmartContent()
     {
-        //Do not delete the content. Because the content will be used by the cache.
-        //DELETEZ( m_pContent );
+        /* This destructor originally contained the following blurb: "Do
+           not delete the content. Because the content will be used by
+           the cache." This is just plain silly, because it relies on
+           the provider caching created contents (which is done by
+           ucbhelper::ContentProviderImplHelper, but we do not actually
+           expect all providers to use that, right?) Otherwise we are
+           just leaking memory.
+
+           TODO: If there is real need for caching the content, it must
+           be done here.
+        */
+        delete m_pContent;
     }
 
     //--------------------------------------------------------------------
commit 33febd5bc6c194aca62188a424dec073c84d0107
Author: David Tardon <dtardon at redhat.com>
Date:   Thu May 12 07:29:47 2011 +0200

    use rtl::OUString

diff --git a/fpicker/source/office/fpsmartcontent.cxx b/fpicker/source/office/fpsmartcontent.cxx
index 5b33754..710fb11 100644
--- a/fpicker/source/office/fpsmartcontent.cxx
+++ b/fpicker/source/office/fpsmartcontent.cxx
@@ -254,8 +254,8 @@ namespace svt
                 Reference< XContent > xParent( xChild->getParent(), UNO_QUERY );
                 if ( xParent.is() )
                 {
-                    String aParentURL = String( xParent->getIdentifier()->getContentIdentifier() );
-                    bRet = ( aParentURL.Len() > 0 && aParentURL != (String)(m_pContent->getURL()) );
+                    const ::rtl::OUString aParentURL( xParent->getIdentifier()->getContentIdentifier() );
+                    bRet = ( !aParentURL.isEmpty() && aParentURL != m_pContent->getURL() );
 
                     // now we're definately valid
                     m_eState = VALID;


More information about the Libreoffice-commits mailing list