Kaydet (Commit) 660d761b authored tarafından Miklos Vajna's avatar Miklos Vajna

fdo#70812 writerfilter: check for nullptr after dynamic_cast

Happens when we set "no number" in the default para style, which is
already the case for Writer anyway.

Change-Id: I3b262e633e52e4aae039c55d6edb744e36f0f354
üst 1b20921a
...@@ -1562,6 +1562,12 @@ DECLARE_OOXML_TEST(testCp1000015, "cp1000015.odt") ...@@ -1562,6 +1562,12 @@ DECLARE_OOXML_TEST(testCp1000015, "cp1000015.odt")
getParagraph(2, "http://www.google.com/"); getParagraph(2, "http://www.google.com/");
} }
DECLARE_OOXML_TEST(testFdo70812, "fdo70812.docx")
{
// Import just crashed.
getParagraph(1, "Sample pages document.");
}
#endif #endif
CPPUNIT_PLUGIN_IMPLEMENT(); CPPUNIT_PLUGIN_IMPLEMENT();
......
...@@ -1635,7 +1635,8 @@ void DomainMapper::sprmWithProps( Sprm& rSprm, PropertyMapPtr rContext, SprmType ...@@ -1635,7 +1635,8 @@ void DomainMapper::sprmWithProps( Sprm& rSprm, PropertyMapPtr rContext, SprmType
{ {
//style sheets cannot have a numbering rule attached //style sheets cannot have a numbering rule attached
StyleSheetPropertyMap* pStyleSheetPropertyMap = dynamic_cast< StyleSheetPropertyMap* >( rContext.get() ); StyleSheetPropertyMap* pStyleSheetPropertyMap = dynamic_cast< StyleSheetPropertyMap* >( rContext.get() );
pStyleSheetPropertyMap->SetListLevel( (sal_Int16)nIntValue ); if (pStyleSheetPropertyMap)
pStyleSheetPropertyMap->SetListLevel( (sal_Int16)nIntValue );
} }
else else
rContext->Insert( PROP_NUMBERING_LEVEL, uno::makeAny( (sal_Int16)nIntValue )); rContext->Insert( PROP_NUMBERING_LEVEL, uno::makeAny( (sal_Int16)nIntValue ));
...@@ -1649,7 +1650,8 @@ void DomainMapper::sprmWithProps( Sprm& rSprm, PropertyMapPtr rContext, SprmType ...@@ -1649,7 +1650,8 @@ void DomainMapper::sprmWithProps( Sprm& rSprm, PropertyMapPtr rContext, SprmType
{ {
//style sheets cannot have a numbering rule attached //style sheets cannot have a numbering rule attached
StyleSheetPropertyMap* pStyleSheetPropertyMap = dynamic_cast< StyleSheetPropertyMap* >( rContext.get() ); StyleSheetPropertyMap* pStyleSheetPropertyMap = dynamic_cast< StyleSheetPropertyMap* >( rContext.get() );
pStyleSheetPropertyMap->SetListId( nIntValue ); if (pStyleSheetPropertyMap)
pStyleSheetPropertyMap->SetListId( nIntValue );
} }
if( pList.get( ) ) if( pList.get( ) )
{ {
...@@ -1667,7 +1669,8 @@ void DomainMapper::sprmWithProps( Sprm& rSprm, PropertyMapPtr rContext, SprmType ...@@ -1667,7 +1669,8 @@ void DomainMapper::sprmWithProps( Sprm& rSprm, PropertyMapPtr rContext, SprmType
{ {
// set the number id for AbstractNum references // set the number id for AbstractNum references
StyleSheetPropertyMap* pStyleSheetPropertyMap = dynamic_cast< StyleSheetPropertyMap* >( rContext.get() ); StyleSheetPropertyMap* pStyleSheetPropertyMap = dynamic_cast< StyleSheetPropertyMap* >( rContext.get() );
pStyleSheetPropertyMap->SetNumId( nIntValue ); if (pStyleSheetPropertyMap)
pStyleSheetPropertyMap->SetNumId( nIntValue );
} }
else else
{ {
......
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