From e88ee8aa307ecec1cc22cda56b97dcfd8b838ce8 Mon Sep 17 00:00:00 2001 From: Miklos Vajna Date: Tue, 4 Mar 2014 14:47:13 +0100 Subject: [PATCH] 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 --- sw/qa/extras/ww8import/data/bnc821208.doc | Bin 0 -> 30208 bytes sw/qa/extras/ww8import/ww8import.cxx | 9 +++++++++ sw/source/filter/ww8/ww8par2.cxx | 5 +++++ 3 files changed, 14 insertions(+) create mode 100755 sw/qa/extras/ww8import/data/bnc821208.doc diff --git a/sw/qa/extras/ww8import/data/bnc821208.doc b/sw/qa/extras/ww8import/data/bnc821208.doc new file mode 100755 index 0000000000000000000000000000000000000000..d89d711f38be03ed587163710f62027c989989d9 GIT binary patch literal 30208 zcmeHQ2V4|Mv#(tiSYQbvAOh-2Pz)p`84yuaLnZVx~ICkx@Rc9Q1AA4 zJIwBYoa+Q?@TpP@G-Tp=cuioO0f0MRQ20}2WhEO4fR`%wA0&Z~SXKvYJT-&>p^l(7 z*F*>rS_o=i9rQ&AU4$M&AAwx}>LCmf^$|u0V}uE!0m2l~5MhQeM_3>lAsQo^AjF8K z2up+&!WvmOv0l z@h=tIq8lWlpA2JBa zqL^}gPN6(xhKz_6^0$1aFFiN4&0ibSmM}t~ z=dCYO>jW$X$-XDnKAMpU#iT+UUMGH~V768H)3aOK{F@WMs`@|MSO{tvT1Z}Dc$m$H zy@LA364O41svQ+CbW-^*NV zA+e$(|2I-I=)UHY2I3qijmj!IS)WEOH&j`q(YjXo-2FAEMvSm30i@EISd`O4qt;+6TtSJrX-IG?LGmxjUv z@DU$~bfn?6stP6VQ-0KilNj|cU<0Bhan`^Fq%J>oAAT0M595!CohG8w!EO2BK za&q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`Z7qi5$!*Hl6OG{CnjxW^Jdje#Iym%K7Yw*K-A+&0~^E$O|YrH{+ zspvjco1UBu1Z@n@L6BgUAxJrIL(pdJ0fZsq6oMw$j}cVFmk8Q8C1%7^gg$M28lg|R z(gOYZ=v$*tC8VaLV`E&K$X^pre>%JvZyza5O<>YeIYuSKjfj_~RMS#Z6Rj!2FD@ck znj(!(6$eB|$3;Ym`%9A}F}^bbx*xM5uQUCWdXA;9`p8~W-LYtl4A5hI*)YYaoJs;J z38*BXl7LDADha40ppt+}0xAipB%qRjN&^255>UtQr+oh9?Ye!B+8tNsvU^&!sS{%* zq6I!W9+06h0l(7{fW|)D-l?NA{2TdG7IAgV=l^T+ui1b2SI=F|u{SqZxD@R_t>0~@ zcEim##&$z?j#vcQYmyLT|CxXwgH_haik6j3| z1CgDGvkNJ*_sH5?I6DjH6D4Q$R^~Ux%!x12Fz;puO2>`5lQ=>mPLzlr$44cmjF6^@ z@om_5gBdT9;Txxt&wY7(f^}jPNYE*SBCQ~_;1XL1G zNkAn5l>}50P)R@~0hI()5>QD%B>|NL{%s^cYhl&@$CI^S{j;ul*!pUCD2Hk--zl48 wgu?SN;&yI!_&u<;VsB|gS^|FKi#gWg*O$)DU=+jWWxF3o$}?1j|Lr93UyxUFC;$Ke literal 0 HcmV?d00001 diff --git a/sw/qa/extras/ww8import/ww8import.cxx b/sw/qa/extras/ww8import/ww8import.cxx index 0c3e1fcb26e9..cc107e041ead 100644 --- a/sw/qa/extras/ww8import/ww8import.cxx +++ b/sw/qa/extras/ww8import/ww8import.cxx @@ -234,6 +234,15 @@ DECLARE_WW8IMPORT_TEST(testListNolevel, "list-nolevel.doc") CPPUNIT_ASSERT_EQUAL(OUString("1."), aText); } +DECLARE_WW8IMPORT_TEST(testBnc821208, "bnc821208.doc") +{ + // WW8Num1z0 earned a Symbol font, turning numbers into rectangles. + uno::Reference 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 CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/sw/source/filter/ww8/ww8par2.cxx b/sw/source/filter/ww8/ww8par2.cxx index c5ac5b875b9a..4d8964922995 100644 --- a/sw/source/filter/ww8/ww8par2.cxx +++ b/sw/source/filter/ww8/ww8par2.cxx @@ -3736,6 +3736,11 @@ bool WW8RStyle::PrepareStyle(SwWW8StyInf &rSI, ww::sti eSti, sal_uInt16 nThisSty } 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; rSI.bImportSkipped = !bImport;