[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sw/qa sw/source
Bjoern Michaelsen
bjoern.michaelsen at canonical.com
Fri Jul 3 13:59:28 PDT 2015
sw/qa/core/uwriter.cxx | 7 +++++++
sw/source/core/doc/doc.cxx | 4 +---
2 files changed, 8 insertions(+), 3 deletions(-)
New commits:
commit d78b81b379333bd471c670bc9f49304f1d6f030a
Author: Bjoern Michaelsen <bjoern.michaelsen at canonical.com>
Date: Fri Jul 3 22:08:49 2015 +0200
tdf#92308: Dont crash on "File > Send > Email Document"
- crashed due to out-of-range index with empty vector
- kill pruposeless manual index fiddling for good
- add trivial test
Change-Id: Ic224c70f432d2b26718e05aa5a2742461cfb7bec
Reviewed-on: https://gerrit.libreoffice.org/16749
Reviewed-by: Michael Meeks <michael.meeks at collabora.com>
Tested-by: Michael Meeks <michael.meeks at collabora.com>
diff --git a/sw/qa/core/uwriter.cxx b/sw/qa/core/uwriter.cxx
index 966a2aa..6cea3ba 100644
--- a/sw/qa/core/uwriter.cxx
+++ b/sw/qa/core/uwriter.cxx
@@ -109,6 +109,7 @@ public:
void testFormulas();
void testIntrusiveRing();
void testClientModify();
+ void testTdf92308();
CPPUNIT_TEST_SUITE(SwDocTest);
@@ -141,6 +142,7 @@ public:
CPPUNIT_TEST(testFormulas);
CPPUNIT_TEST(testIntrusiveRing);
CPPUNIT_TEST(testClientModify);
+ CPPUNIT_TEST(testTdf92308);
CPPUNIT_TEST_SUITE_END();
private:
@@ -1565,6 +1567,11 @@ void SwDocTest::testClientModify()
CPPUNIT_ASSERT_EQUAL(aClient2.m_nNotifyCount,1);
}
+void SwDocTest::testTdf92308()
+{
+ CPPUNIT_ASSERT_EQUAL(m_pDoc->HasInvisibleContent(), false);
+}
+
void SwDocTest::setUp()
{
BootstrapFixture::setUp();
diff --git a/sw/source/core/doc/doc.cxx b/sw/source/core/doc/doc.cxx
index f1880db..2b82850 100644
--- a/sw/source/core/doc/doc.cxx
+++ b/sw/source/core/doc/doc.cxx
@@ -1453,10 +1453,8 @@ bool SwDoc::HasInvisibleContent() const
}
}
- const SwSectionFormats& rSectFormats = GetSections();
- for( SwSectionFormats::size_type n = rSectFormats.size()-1; n; --n )
+ for(auto pSectFormat : GetSections())
{
- SwSectionFormat* pSectFormat = rSectFormats[ n ];
// don't add sections in Undo/Redo
if( !pSectFormat->IsInNodesArr())
continue;
More information about the Libreoffice-commits
mailing list