Kaydet (Commit) 5e44328c authored tarafından Tushar Bende's avatar Tushar Bende Kaydeden (comit) Miklos Vajna

fdo#72775 : LibreOffice hang while opening some documents

Description: There was a problem for some documents, when opened in LibreOffice
there was continuous increase in page numbers.And this was the reason for LO getting hang.

The wrap property "NS_ooxml::LN_Value_wordprocessingml_ST_Wrap_auto" was not handled in DomainMapper::lcl_attribute() and hence paragraph's wrap property was getting set to
"text::WrapTextMode_NONE" this was the reason for increasing number of pages while opening doc in LO.

added condition to handle NS_ooxml::LN_Value_wordprocessingml_ST_Wrap_auto.

*added test case to verify that the document is opening properly and checking it's page count.

Conflicts:
	sw/qa/extras/ooxmlimport/ooxmlimport.cxx

Reviewed on:
	https://gerrit.libreoffice.org/8632

Change-Id: Id24ebc8409e7fd53915e5130beb9ad6f8bb8571f
üst afe84a3d
......@@ -1976,6 +1976,13 @@ DECLARE_OOXMLIMPORT_TEST(testSmartartStrict, "strict-smartart.docx")
CPPUNIT_ASSERT_EQUAL(sal_Int32(6), xGroup->getCount()); // 3 ellipses + 3 arrows
}
DECLARE_OOXMLIMPORT_TEST(testLibreOfficeHang, "frame-wrap-auto.docx")
{
// fdo#72775
// This was text::WrapTextMode_NONE.
CPPUNIT_ASSERT_EQUAL(text::WrapTextMode_DYNAMIC, getProperty<text::WrapTextMode>(getShape(1), "Surround"));
}
DECLARE_OOXMLIMPORT_TEST(testI124106, "i124106.docx")
{
// This was 2.
......
......@@ -733,12 +733,16 @@ void DomainMapper::lcl_attribute(Id nName, Value & val)
break;
case NS_ooxml::LN_CT_FramePr_wrap:
{
//should be either LN_Value_wordprocessingml_ST_Wrap_notBeside or LN_Value_wordprocessingml_ST_Wrap_around
//should be either LN_Value_wordprocessingml_ST_Wrap_notBeside or LN_Value_wordprocessingml_ST_Wrap_around or LN_Value_wordprocessingml_ST_Wrap_auto
OSL_ENSURE( sal::static_int_cast<Id>(nIntValue) == NS_ooxml::LN_Value_wordprocessingml_ST_Wrap_around ||
sal::static_int_cast<Id>(nIntValue) == NS_ooxml::LN_Value_wordprocessingml_ST_Wrap_notBeside,
"wrap not around or not_Beside?");
pParaProperties->SetWrap(sal::static_int_cast<Id>(nIntValue) == NS_ooxml::LN_Value_wordprocessingml_ST_Wrap_around ?
text::WrapTextMode_DYNAMIC : text::WrapTextMode_NONE );
sal::static_int_cast<Id>(nIntValue) == NS_ooxml::LN_Value_wordprocessingml_ST_Wrap_notBeside ||
sal::static_int_cast<Id>(nIntValue) == NS_ooxml::LN_Value_wordprocessingml_ST_Wrap_auto,
"wrap not around, not_Beside or auto?");
if( sal::static_int_cast<Id>(nIntValue) == NS_ooxml::LN_Value_wordprocessingml_ST_Wrap_around ||
sal::static_int_cast<Id>(nIntValue) == NS_ooxml::LN_Value_wordprocessingml_ST_Wrap_auto )
pParaProperties->SetWrap ( text::WrapTextMode_DYNAMIC ) ;
else
pParaProperties->SetWrap ( text::WrapTextMode_NONE ) ;
}
break;
case NS_ooxml::LN_CT_FramePr_w:
......
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