Kaydet (Commit) 6cadfe0f authored tarafından Bjoern Michaelsen's avatar Bjoern Michaelsen

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
üst 53e70110
......@@ -111,6 +111,7 @@ public:
void testIntrusiveRing();
void testClientModify();
void test64kPageDescs();
void testTdf92308();
CPPUNIT_TEST_SUITE(SwDocTest);
......@@ -144,6 +145,7 @@ public:
CPPUNIT_TEST(testIntrusiveRing);
CPPUNIT_TEST(testClientModify);
CPPUNIT_TEST(test64kPageDescs);
CPPUNIT_TEST(testTdf92308);
CPPUNIT_TEST_SUITE_END();
private:
......@@ -1615,6 +1617,11 @@ void SwDocTest::test64kPageDescs()
CPPUNIT_ASSERT( nPos == 0 );
}
void SwDocTest::testTdf92308()
{
CPPUNIT_ASSERT_EQUAL(m_pDoc->HasInvisibleContent(), false);
}
void SwDocTest::setUp()
{
BootstrapFixture::setUp();
......
......@@ -1450,10 +1450,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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment