[Libreoffice-commits] core.git: 2 commits - package/source sfx2/source sw/source

Michael Stahl mstahl at redhat.com
Thu Jun 23 20:43:07 UTC 2016


 package/source/zipapi/ZipOutputStream.cxx |   10 +++++-----
 sfx2/source/doc/docfile.cxx               |    6 +++---
 sw/source/core/layout/pagechg.cxx         |    4 +++-
 3 files changed, 11 insertions(+), 9 deletions(-)

New commits:
commit e7d8cb3ec22906d5d45ba65e0a0cfccd68d202e8
Author: Michael Stahl <mstahl at redhat.com>
Date:   Thu Jun 23 22:17:49 2016 +0200

    sw: fix STL asserts in lcl_MoveAllLowerObjs *again*
    
    Comment added in cf91483690291272f48ff95c1aebd165da8ae4f0 evidently
    insufficient.
    
    (regression from b415494bf0468b74318b61f114e2ff4ae68c00ee)
    
    Change-Id: I9a017aefc3a77b0760fcdc3b8e43ff7c6ac516ac

diff --git a/sw/source/core/layout/pagechg.cxx b/sw/source/core/layout/pagechg.cxx
index c722da9..7ea39752 100644
--- a/sw/source/core/layout/pagechg.cxx
+++ b/sw/source/core/layout/pagechg.cxx
@@ -1763,8 +1763,10 @@ static void lcl_MoveAllLowerObjs( SwFrame* pFrame, const Point& rOffset )
 
     // note: pSortedObj elements may be removed and inserted from
     // MoveObjectIfActive(), invalidating iterators
-    for (SwAnchoredObject* pAnchoredObj : *pSortedObj)
+    // DO NOT CONVERT THIS TO A C++11 FOR LOOP, IT DID NOT WORK THE LAST 2 TIMES
+    for (size_t i = 0; i < pSortedObj->size(); ++i)
     {
+        SwAnchoredObject *const pAnchoredObj = (*pSortedObj)[i];
         const SwFrameFormat& rObjFormat = pAnchoredObj->GetFrameFormat();
         const SwFormatAnchor& rAnchor = rObjFormat.GetAnchor();
 
commit 9084c11fb472f2024e609770ce922c911227e7a8
Author: Michael Stahl <mstahl at redhat.com>
Date:   Thu Jun 23 22:02:04 2016 +0200

    sfx2: exception on storage commit is an error (related: tdf#91807)
    
    For no good or obvious reason, SfxMedium::StorageCommit_Impl() swallows
    embed::UseBackupException if there is a pTempFile, which (as the comment
    claims) is "always now".  This results in the temp file actually being
    copied to the user-visible file and the SaveAs "succeeding", when it
    clearly did not.
    
    Also move the exception throwing to the end of ZipOutputStream::finish()
    to avoid more memory leaks.
    
    Change-Id: I448cc43291754ef20adfa6b65916282fcc365a11

diff --git a/package/source/zipapi/ZipOutputStream.cxx b/package/source/zipapi/ZipOutputStream.cxx
index 2daff01..41f78b4 100644
--- a/package/source/zipapi/ZipOutputStream.cxx
+++ b/package/source/zipapi/ZipOutputStream.cxx
@@ -183,11 +183,6 @@ void ZipOutputStream::finish()
     // consume all processed entries
     consumeAllScheduledThreadEntries();
 
-    if (m_aDeflateException.hasValue())
-    {   // throw once all threads are finished and m_aEntries can be released
-        ::cppu::throwException(m_aDeflateException);
-    }
-
     sal_Int32 nOffset= static_cast < sal_Int32 > (m_aChucker.GetPosition());
     for (ZipEntry* p : m_aZipList)
     {
@@ -197,6 +192,11 @@ void ZipOutputStream::finish()
     writeEND( nOffset, static_cast < sal_Int32 > (m_aChucker.GetPosition()) - nOffset);
     m_xStream->flush();
     m_aZipList.clear();
+
+    if (m_aDeflateException.hasValue())
+    {   // throw once all threads are finished and m_aEntries can be released
+        ::cppu::throwException(m_aDeflateException);
+    }
 }
 
 const css::uno::Reference< css::io::XOutputStream >& ZipOutputStream::getStream()
diff --git a/sfx2/source/doc/docfile.cxx b/sfx2/source/doc/docfile.cxx
index b64e8d3..c4ce871 100644
--- a/sfx2/source/doc/docfile.cxx
+++ b/sfx2/source/doc/docfile.cxx
@@ -1625,10 +1625,10 @@ bool SfxMedium::StorageCommit_Impl()
                                 OSL_ENSURE( !pImpl->m_aName.isEmpty(), "The exception _must_ contain the temporary URL!\n" );
                             }
                         }
-
-                        if ( !GetError() )
-                            SetError( ERRCODE_IO_GENERAL, OSL_LOG_PREFIX );
                     }
+
+                    if (!GetError())
+                        SetError( ERRCODE_IO_GENERAL, OSL_LOG_PREFIX );
                 }
                 catch ( const uno::Exception& )
                 {


More information about the Libreoffice-commits mailing list