[Libreoffice-commits] core.git: Branch 'libreoffice-4-1' - sw/qa sw/source

Miklos Vajna vmiklos at collabora.co.uk
Fri Apr 4 07:57:16 PDT 2014


 sw/qa/extras/ww8import/data/bnc821208.doc |binary
 sw/qa/extras/ww8import/ww8import.cxx      |    3 +++
 sw/source/core/txtnode/thints.cxx         |    2 +-
 3 files changed, 4 insertions(+), 1 deletion(-)

New commits:
commit 31023bf702f352a62f779b22ab4523538a159066
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Thu Apr 3 17:40:05 2014 +0200

    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
    1c22545edf9085b9f2656ca92781158b6b123db3 (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
    (cherry picked from commit 5a5d948e230dfea61108452579b68da75706cad4)
    Reviewed-on: https://gerrit.libreoffice.org/8828
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/sw/qa/extras/ww8import/data/bnc821208.doc b/sw/qa/extras/ww8import/data/bnc821208.doc
index d89d711..cfe7680 100755
Binary files a/sw/qa/extras/ww8import/data/bnc821208.doc and b/sw/qa/extras/ww8import/data/bnc821208.doc differ
diff --git a/sw/qa/extras/ww8import/ww8import.cxx b/sw/qa/extras/ww8import/ww8import.cxx
index 4fd9d21..2c36f9b 100644
--- a/sw/qa/extras/ww8import/ww8import.cxx
+++ b/sw/qa/extras/ww8import/ww8import.cxx
@@ -274,6 +274,9 @@ void Test::testBnc821208()
     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"));
 }
 
 CPPUNIT_TEST_SUITE_REGISTRATION(Test);
diff --git a/sw/source/core/txtnode/thints.cxx b/sw/source/core/txtnode/thints.cxx
index 34dac0a..38461ef 100644
--- a/sw/source/core/txtnode/thints.cxx
+++ b/sw/source/core/txtnode/thints.cxx
@@ -1612,7 +1612,7 @@ void SwTxtNode::DelSoftHyph( const xub_StrLen nStt, const xub_StrLen 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:


More information about the Libreoffice-commits mailing list