Kaydet (Commit) 5a5d948e authored tarafından Miklos Vajna's avatar Miklos Vajna

bnc#821208 DOC import: fix unwanted char background in numbering char style

Word supports formatting the paragraph parker itself, and we import that
as a formatting at a position after the last character (e.g. "foo" will
have that formatting at char pos 3, which is ignored by the layout).

In addition to this hack, commit
1c22545e (Fix issue #i119405: Numbering
text style changed after importing the *.doc, 2012-08-24) added a
SwTxtNode::TryCharSetExpandToNum() hack to Writer core, where in case
such a paragraph marker attribute is set, and the SwTxtNode has a
numbering, then also modify the associated character style as well.

As that commit already noticed, there are attributes which should not be
propagated to that character style. Extend this blacklist to ignore
RES_CHRATR_BACKGROUND as well, as Word does.

Change-Id: Idcb40d37d8688c76fbd61f28428f6e3bc995f799
üst 8f5df0db
This diff was suppressed by a .gitattributes entry.
......@@ -242,6 +242,9 @@ DECLARE_WW8IMPORT_TEST(testBnc821208, "bnc821208.doc")
beans::PropertyState ePropertyState = xPropertyState->getPropertyState("CharFontName");
// This was beans::PropertyState_DIRECT_VALUE.
CPPUNIT_ASSERT_EQUAL(beans::PropertyState_DEFAULT_VALUE, ePropertyState);
// Background of the numbering itself should have been the default, was yellow (0xffff00).
CPPUNIT_ASSERT_EQUAL(sal_Int32(-1), getProperty<sal_Int32>(xPropertyState, "CharBackColor"));
}
DECLARE_WW8IMPORT_TEST(testCp1000044, "cp1000044.doc")
......
......@@ -1784,7 +1784,7 @@ void SwTxtNode::DelSoftHyph( const sal_Int32 nStt, const sal_Int32 nEnd )
//In MS Word, the font underline setting of the paragraph end position wont affect the formatting of numbering, so we ignore it
bool lcl_IsIgnoredCharFmtForNumbering(const sal_uInt16 nWhich)
{
return (nWhich == RES_CHRATR_UNDERLINE);
return (nWhich == RES_CHRATR_UNDERLINE || nWhich == RES_CHRATR_BACKGROUND);
}
//In MS Word, following properties of the paragraph end position wont affect the formatting of bullets, so we ignore them:
......
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