bnc#821208 DOC import: don't overwrite WW8Num* character styles
In general we're overwriting styles on import in case we're not pasting. But these WW8Num* character styles are in general not from the document, they are created because Writer needs a character style for each numbering level to handle what's in the DOC file. So, in case there is a character style with the same name as our "character style for numbering" styles, prefer the later ones, as that's intended most likely. Change-Id: I675f867722360aca765bb96b0b43ea47deab9847
This commit is contained in:
parent
c09fc2c695
commit
e88ee8aa30
BIN
sw/qa/extras/ww8import/data/bnc821208.doc
Executable file
BIN
sw/qa/extras/ww8import/data/bnc821208.doc
Executable file
Binary file not shown.
@ -234,6 +234,15 @@ DECLARE_WW8IMPORT_TEST(testListNolevel, "list-nolevel.doc")
|
|||||||
CPPUNIT_ASSERT_EQUAL(OUString("1."), aText);
|
CPPUNIT_ASSERT_EQUAL(OUString("1."), aText);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DECLARE_WW8IMPORT_TEST(testBnc821208, "bnc821208.doc")
|
||||||
|
{
|
||||||
|
// WW8Num1z0 earned a Symbol font, turning numbers into rectangles.
|
||||||
|
uno::Reference<beans::XPropertyState> xPropertyState(getStyles("CharacterStyles")->getByName("WW8Num1z0"), uno::UNO_QUERY);
|
||||||
|
beans::PropertyState ePropertyState = xPropertyState->getPropertyState("CharFontName");
|
||||||
|
// This was beans::PropertyState_DIRECT_VALUE.
|
||||||
|
CPPUNIT_ASSERT_EQUAL(beans::PropertyState_DEFAULT_VALUE, ePropertyState);
|
||||||
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
CPPUNIT_PLUGIN_IMPLEMENT();
|
CPPUNIT_PLUGIN_IMPLEMENT();
|
||||||
|
@ -3736,6 +3736,11 @@ bool WW8RStyle::PrepareStyle(SwWW8StyInf &rSI, ww::sti eSti, sal_uInt16 nThisSty
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool bImport = !bStyExist || pIo->mbNewDoc; // import content ?
|
bool bImport = !bStyExist || pIo->mbNewDoc; // import content ?
|
||||||
|
|
||||||
|
// Do not override character styles the list import code created earlier.
|
||||||
|
if (bImport && bStyExist && rSI.GetOrgWWName().startsWith("WW8Num"))
|
||||||
|
bImport = false;
|
||||||
|
|
||||||
bool bOldNoImp = pIo->bNoAttrImport;
|
bool bOldNoImp = pIo->bNoAttrImport;
|
||||||
rSI.bImportSkipped = !bImport;
|
rSI.bImportSkipped = !bImport;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user