fdo#68211: Fix for "General input/output error" while opening file
Description: Docx containing floating table with formula was giving "General input/output error" while opening in LibreOffice. Reason being within xLoader->filter() it was calling EmbeddedObjectContainer::RemoveEmbeddedObject() with bClose value as sal_True(default value in function declaration) and hence it was removing embedded object from container and also it was closing it.Fix includes passing this bClose value as sal_false (which means remove object from container but don't close it.) verified code changes for various floating table docx and normal docx containing tables and formulas. Conflicts: sw/qa/extras/ooxmlexport/ooxmlexport.cxx Reviewed on: https://gerrit.libreoffice.org/7009 Change-Id: I9c2d3f8c4099f9f753b2a1b027f9072cd4effeb5
This commit is contained in:
committed by
Miklos Vajna
parent
8c5b4bb03c
commit
bee397a1e3
BIN
sw/qa/extras/ooxmlexport/data/floatingtbl_with_formula.docx
Normal file
BIN
sw/qa/extras/ooxmlexport/data/floatingtbl_with_formula.docx
Normal file
Binary file not shown.
@@ -2136,6 +2136,15 @@ DECLARE_OOXMLEXPORT_TEST(testCrashWhileSave, "testCrashWhileSave.docx")
|
||||
CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:ftr/w:tbl/w:tr/w:tc[1]/w:p[1]/w:pPr/w:pStyle", "val").match("Normal"));
|
||||
}
|
||||
|
||||
DECLARE_OOXMLEXPORT_TEST(testFileOpenInputOutputError,"floatingtbl_with_formula.docx")
|
||||
{
|
||||
// Docx containing Floating table with formula was giving "General input/output error" while opening in LibreOffice
|
||||
xmlDocPtr pXmlDoc = parseExport("word/document.xml");
|
||||
if (!pXmlDoc)
|
||||
return;
|
||||
assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:pPr/w:pStyle", "val", "Normal");
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
CPPUNIT_PLUGIN_IMPLEMENT();
|
||||
|
@@ -715,10 +715,11 @@ SwOLEObj::~SwOLEObj()
|
||||
// successful closing of the object will automatically clear the reference then
|
||||
xOLERef.Lock(sal_False);
|
||||
|
||||
// Always remove object from conteiner it is connected to
|
||||
// Always remove object from container it is connected to
|
||||
try
|
||||
{
|
||||
pCnt->RemoveEmbeddedObject( aName );
|
||||
// remove object from container but don't close it
|
||||
pCnt->RemoveEmbeddedObject( aName, sal_False);
|
||||
}
|
||||
catch ( uno::Exception& )
|
||||
{
|
||||
|
Reference in New Issue
Block a user