From 65bea6cbe772ef2ab840d507307396b74e8d031e Mon Sep 17 00:00:00 2001 From: Justin Luth Date: Tue, 17 Mar 2020 15:57:21 +0300 Subject: [PATCH] tdf#118812 writerfilter: overrideTableStyleFontSizeAndJustification Surprisingly, there are NO uses of these compatibility options. Apparently we have a lot of work to do... MS Word finally throws away a goofy exception clause that must have caused them countless grief. And LO finally adds support for that goofy clause now that it should rarely be needed... I modified my previous unit test slightly to increase the difficulty level. A fontsize was changed to 11, and justify was added. Change-Id: I0c4997324e8ee745bac8316a45e837c5de137509 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90625 Tested-by: Jenkins Reviewed-by: Justin Luth Reviewed-by: Miklos Vajna --- .../data/tdf118947_tableStyle.docx | Bin 9530 -> 9461 bytes .../data/tdf118947_tableStyle2.docx | Bin 0 -> 9578 bytes sw/qa/extras/ooxmlexport/ooxmlexport13.cxx | 24 +++++++- .../dmapper/DomainMapperTableHandler.cxx | 27 +++++++-- writerfilter/source/dmapper/SettingsTable.cxx | 57 ++++++++++++++---- writerfilter/source/dmapper/SettingsTable.hxx | 1 + 6 files changed, 90 insertions(+), 19 deletions(-) create mode 100755 sw/qa/extras/ooxmlexport/data/tdf118947_tableStyle2.docx diff --git a/sw/qa/extras/ooxmlexport/data/tdf118947_tableStyle.docx b/sw/qa/extras/ooxmlexport/data/tdf118947_tableStyle.docx index 0b40aab5b95b935acaa6df423f98e98229541ef1..b5c55f6f3b91bda8146d2a1bdd3134172c118624 100644 GIT binary patch delta 6474 zcmaJ`1z42Z)*fP{I~}@H+CwVRU4nEe-5pW`LrEh;w@3&GNH}y!my~pOGcmvKf^rb{j+8**Fmadr!%IP*SvQftqYFpN#>W7yUXCeC#)O=;(jf2@TmoxcP! zNhl8&)Sq^H3K2FmrT+X4DQEuT{GfQ$h?htkDOa5J5dg3~_bxq?2^RAxt=-#lx`r_6l?2ni+-> zYAr>yi1A|eE$FdKobK1Z~){04+m#cP8ZkLwq`CIo_4k`G|&J@?H?QshwiTb z_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>AYbLE#O?Q9RZm)CNHzZ*VY1kE= zsKW-_)neM{W8X?E3y#c1a@%HC7 z2vf)!s>}K#tE_D1&pR2sGveMukhm$R=lI|~n4oXjTHvQz%bL#TrUgd0v5tg^c?68j ze5?6OGaam%=~HidD0guxE!>YLW%@l9 zH77;h_Z1kh_dG^#M*|g?d_)zm=TBZWCWy+Q6~fUh&Y07?>UCW;Dn3gZ{d~}8Qo0en zqKdmqc8fsY|A9Yob;`S=ett??-Y4LAX2MQ9@Gz#kxa6+LSouDaM>iwp^1I^gfQ%kn z@HY=hGYh#ZEL^B7uT{KuS~-Y8q;4Kvbo98Fo1o3rWbNU}k8HvSm+R?EER45ND2?Ru z5}1;FyZ{GFan7*>( zQddI-Kv!%jf0ufd(|uWBSv!av)=q!ES>of42joU^--FGME9F6Z%_Xe<`(y$oPK= z6-E9lcf|AJ@Y>YM{^x%Uh}HZ*w&;ezAHPC~l<5$v2?0QggP;WfKPfCx!BA=GY5tTE TD#GaIDaQkp5v0dxZa)1FqHTgk diff --git a/sw/qa/extras/ooxmlexport/data/tdf118947_tableStyle2.docx b/sw/qa/extras/ooxmlexport/data/tdf118947_tableStyle2.docx new file mode 100755 index 0000000000000000000000000000000000000000..7c0825feba0cf84f030ca838b05276e69a2d5050 GIT binary patch literal 9578 zcmb7~1yohp*T5ej-6`GOrGS*Aba!|2=uSbTK|+x3?iNWwy1OK#JEZ%2s57H8^PicI zweI8c7Uy^OIs5KBM@|yr5gg#*N8iLw?%U0e4@dw$z{SSih)G!q769=&#a1U2bUC@g z1Hc{;A_D;5KIA~dF+c-gKo<$1iIEXL2Mlxv1puJ^Hr&Jp=%}P`U}encYHjt6HS95n z=AQHy)^Qflw zvRP*ZUJY5koAw(Yd=kU?x^g|_W4-zNPBr6V1EhFo^rS*GiWauDqUG5Rnw+d@`yTv# z#2Pc-lZn|hCChMaj>%YjzyK}IHVq|v!r6YNb7q3zlw<~{aAae6YM22@hW;!-mf5t= zNWd(_P?%|xV&G85E-vc5B)z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Lqy9XC}A3Wa2cv{-NraAw#%OQ5Qk)23pbAXob(#^5D%$X@yBBkaZmXrw1hJ)w*A7@RGF! zj=_GlviY009LgXoBL+1Y&_S!EDFoUb2IYUcN^Z8s4%+|bEo)-?fNc*M;M*(YsJbBR z5BY^5t(lR=p-NX^ovFUcU9~*zI|tk(7|NIw$}gp}jn)?&Oby(aHB=cj1qJauNv_;v zjh394Cx_sU_}umvf)T{sva}B6f)LZO5zES;Vx%AStL;^wIAppqQEYQ5!5yP~bjU#{ zQ2114PMI}IWC8UxcdFs-Ggoj~?Lyv9wudk|8l1hUlQ;F^(XAQXgo&Mr$}pH&RT`*M zYokd-vHKBks_f_d9q=mJ5d{g!$KNi3anIA0QL01Cs8P7fW4iPxi-{(tKgOgxUU>>_ z|GKgo_v~txAvYZ?%0;K%Q@0@YG^G|_3=i7%4kP@4g~zgsMmSdLSpxE@4~yOhd{RMD zkL39;5+sq1GyDwK>UIItpNxEJ~ROT z7Wjv{er^B#EGGcz7vRs$z<*lT{~{|Y==tB4;5X0v-(>x@sQg)0m0y8BS4ltI@;{0E zeKr1CbN&2;1k4{I|IAia0%8BA`uf?t{@kdA{Y7iXplAG^c6`JA2c7+zeEuxuQ=Ff0 zzo(-AKKH+7LqAimaet!zksJLJ_V3>Us9)!f5BNRwf>{4y;=cyopG9ON_>J|S_5CpC jUt`nHKz%~M-$$zdHET%F0jLK{L;=Wy0v!bL!(aagz^A1r literal 0 HcmV?d00001 diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx index 48e6788b2687..3f217e35d96c 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx @@ -334,7 +334,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf118947_tableStyle, "tdf118947_tableStyle.docx") uno::Reference xParaEnum = xParaEnumAccess->createEnumeration(); uno::Reference xPara(xParaEnum->nextElement(), uno::UNO_QUERY); CPPUNIT_ASSERT_EQUAL(OUString("Table grid settings set line-spacing to 250% instead of single-spacing, which is set as a document default."), xPara->getString()); - CPPUNIT_ASSERT_EQUAL_MESSAGE("TextBody has 10pt font size", 10.f, getProperty(xPara, "CharHeight")); + CPPUNIT_ASSERT_EQUAL_MESSAGE("TextBody has 10pt font size", 11.f, getProperty(xPara, "CharHeight")); CPPUNIT_ASSERT_EQUAL_MESSAGE("TextBody has 1pt space below paragraph", sal_Int32(35), getProperty(xPara, "ParaBottomMargin")); CPPUNIT_ASSERT_EQUAL_MESSAGE("Table has 10pt space above paragraph", sal_Int32(353), getProperty(xPara, "ParaTopMargin")); CPPUNIT_ASSERT_EQUAL_MESSAGE("Table style sets 0 right margin", sal_Int32(0), getProperty(xPara, "ParaRightMargin")); @@ -342,11 +342,12 @@ DECLARE_OOXMLEXPORT_TEST(testTdf118947_tableStyle, "tdf118947_tableStyle.docx") // table-style based paragraph background color CPPUNIT_ASSERT_EQUAL_MESSAGE("Missing paragraph background color in cell A1", sal_Int32(0xCCFFCC), getProperty(xPara, "ParaBackColor")); + // This cell is affected by compatSetting overrideTableStyleFontSizeAndJustification=0 (the default value) xCell.set(xTable->getCellByName("A2"), uno::UNO_QUERY); xParaEnumAccess.set(xCell->getText(), uno::UNO_QUERY); xParaEnum = xParaEnumAccess->createEnumeration(); xPara.set(xParaEnum->nextElement(), uno::UNO_QUERY); - CPPUNIT_ASSERT_EQUAL(OUString("Notice that this is 8pt font in compatibility mode."), xPara->getString()); + CPPUNIT_ASSERT_EQUAL(OUString("Notice that this is 8pt font, right aligned in compatibility mode."), xPara->getString()); // Even though not specified, Table-Style distributes the properties in DocDefault. DocDefault fontsize is 8pt. CPPUNIT_ASSERT_EQUAL_MESSAGE("Compat mode has 8pt font size", 8.f, getProperty(getRun(xPara,1), "CharHeight")); CPPUNIT_ASSERT_EQUAL_MESSAGE("Normal has 0pt space below paragraph", sal_Int32(0), getProperty(xPara, "ParaBottomMargin")); @@ -354,6 +355,25 @@ DECLARE_OOXMLEXPORT_TEST(testTdf118947_tableStyle, "tdf118947_tableStyle.docx") CPPUNIT_ASSERT_EQUAL_MESSAGE("Table style sets 0 right margin", sal_Int32(0), getProperty(xPara, "ParaRightMargin")); CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE("Table sets 2.5 line-spacing", sal_Int16(250), getProperty(xPara, "ParaLineSpacing").Height, 1); CPPUNIT_ASSERT_EQUAL_MESSAGE("Paragraph background color in cell A2", sal_Int32(-1), getProperty(xPara, "ParaBackColor")); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Compat mode overrides left adjust", style::ParagraphAdjust_RIGHT, + static_cast(getProperty(xPara, "ParaAdjust"))); +} + +DECLARE_OOXMLEXPORT_TEST(testTdf118947_tableStyle2, "tdf118947_tableStyle2.docx") +{ + uno::Reference xTable(getParagraphOrTable(1), uno::UNO_QUERY); + // This cell is affected by compatSetting overrideTableStyleFontSizeAndJustification=1 (no goofy exception) + uno::Reference xCell(xTable->getCellByName("A2"), uno::UNO_QUERY); + uno::Reference xParaEnumAccess(xCell->getText(), uno::UNO_QUERY); + uno::Reference xParaEnum = xParaEnumAccess->createEnumeration(); + uno::Reference xPara(xParaEnum->nextElement(), uno::UNO_QUERY); + + CPPUNIT_ASSERT_EQUAL(OUString("Notice that this is 12pt font, left aligned in non-compatibility mode."), xPara->getString()); + // Even though not specified, Table-Style tries to distribute the properties in DocDefault. DocDefault fontsize is 8pt. + // However, this is overridden by the default style's specified fontsize of 12 and left justify. + CPPUNIT_ASSERT_EQUAL_MESSAGE("Non-Compat mode has 12pt font size", 12.f, getProperty(getRun(xPara,1), "CharHeight")); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Non-Compat mode keeps the style's left adjust", style::ParagraphAdjust_LEFT, + static_cast(getProperty(xPara, "ParaAdjust"))); } DECLARE_OOXMLEXPORT_TEST(tdf123912_protectedForm, "tdf123912_protectedForm.odt") diff --git a/writerfilter/source/dmapper/DomainMapperTableHandler.cxx b/writerfilter/source/dmapper/DomainMapperTableHandler.cxx index 0e5a0cfdfd61..b5a737d626b7 100644 --- a/writerfilter/source/dmapper/DomainMapperTableHandler.cxx +++ b/writerfilter/source/dmapper/DomainMapperTableHandler.cxx @@ -19,6 +19,7 @@ #include "DomainMapperTableHandler.hxx" #include "DomainMapper_Impl.hxx" #include "StyleSheetTable.hxx" +#include #include #include #include @@ -1119,11 +1120,29 @@ void DomainMapperTableHandler::ApplyParagraphPropertiesFromTableStyle(TableParag rParaProp.m_rPropertySet->getPropertyValue("ParaStyleName") >>= sParaStyleName; StyleSheetEntryPtr pEntry = m_rDMapper_Impl.GetStyleSheetTable()->FindStyleSheetByConvertedStyleName(sParaStyleName); uno::Any aParaStyle = m_rDMapper_Impl.GetPropertyFromStyleSheet(eId, pEntry, true, true, &bDocDefault); + // A very strange compatibility rule says that the DEFAULT style's specified fontsize of 11 or 12 + // or a specified left justify will always be overridden by the table-style. + // Normally this rule is applied, so always do this unless a compatSetting indicates otherwise. + bool bCompatOverride = false; + if ( (eId == PROP_CHAR_HEIGHT || eId == PROP_PARA_ADJUST) && sParaStyleName == m_rDMapper_Impl.GetDefaultParaStyleName() ) + { + if ( eId == PROP_CHAR_HEIGHT ) + bCompatOverride = aParaStyle == uno::Any(double(11)) || aParaStyle == uno::Any(double(12)); + else if ( eId == PROP_PARA_ADJUST ) + { + style::ParagraphAdjust eAdjust(style::ParagraphAdjust_CENTER); + aParaStyle >>= eAdjust; + bCompatOverride = eAdjust == style::ParagraphAdjust_LEFT; + } + + // The wording is confusing here. Normally, the paragraph style DOES override the table-style. + // But for these two special situations, do not override the table-style. So the default is false. + // If false, then "CompatOverride" the normal behaviour, and apply the table-style's value. + bCompatOverride &= !m_rDMapper_Impl.GetSettingsTable()->GetCompatSettingValue("overrideTableStyleFontSizeAndJustification"); + } + // use table style when no paragraph style setting or a docDefault value is applied instead of it - if ( aParaStyle == uno::Any() || bDocDefault || - // set default behaviour of MSO ("overrideTableStyleFontSizeAndJustification" exception): - // if Normal style defines 11 pt or 12 pt font heights, table style overrides its font size - (eId == PROP_CHAR_HEIGHT && sParaStyleName == "Standard" && (aParaStyle == uno::Any(double(11)) || aParaStyle == uno::Any(double(12))))) try + if ( aParaStyle == uno::Any() || bDocDefault || bCompatOverride ) try { // check property state of paragraph uno::Reference xParagraph( diff --git a/writerfilter/source/dmapper/SettingsTable.cxx b/writerfilter/source/dmapper/SettingsTable.cxx index 824c627f436c..e8a921ff0934 100644 --- a/writerfilter/source/dmapper/SettingsTable.cxx +++ b/writerfilter/source/dmapper/SettingsTable.cxx @@ -767,6 +767,36 @@ void SettingsTable::ApplyProperties(uno::Reference const& x } } +bool SettingsTable::GetCompatSettingValue( const OUString& sCompatName ) const +{ + bool bRet = false; + for (const auto& rProp : m_pImpl->m_aCompatSettings) + { + if (rProp.Name == "compatSetting") //always true + { + css::uno::Sequence aCurrentCompatSettings; + rProp.Value >>= aCurrentCompatSettings; + + OUString sName; + aCurrentCompatSettings[0].Value >>= sName; + if ( sName != sCompatName ) + continue; + + OUString sUri; + aCurrentCompatSettings[1].Value >>= sUri; + if ( sUri != "http://schemas.microsoft.com/office/word" ) + continue; + + OUString sVal; + aCurrentCompatSettings[2].Value >>= sVal; + // if repeated, what happens? Last one wins + bRet = sVal.toBoolean(); + } + } + + return bRet; +} + //Keep this function in-sync with the one in sw/.../docxattributeoutput.cxx sal_Int32 SettingsTable::GetWordCompatibilityMode() const { @@ -775,26 +805,27 @@ sal_Int32 SettingsTable::GetWordCompatibilityMode() const for (const auto& rProp : m_pImpl->m_aCompatSettings) { - if (rProp.Name == "compatSetting") + if (rProp.Name == "compatSetting") //always true { css::uno::Sequence aCurrentCompatSettings; rProp.Value >>= aCurrentCompatSettings; OUString sName; - OUString sUri; - OUString sVal; - aCurrentCompatSettings[0].Value >>= sName; - aCurrentCompatSettings[1].Value >>= sUri; - aCurrentCompatSettings[2].Value >>= sVal; + if ( sName != "compatibilityMode" ) + continue; - if (sName == "compatibilityMode" && sUri == "http://schemas.microsoft.com/office/word") - { - const sal_Int32 nValidMode = sVal.toInt32(); - // if repeated, highest mode wins in MS Word. 11 is the first valid mode. - if ( nValidMode > 10 && nValidMode > m_pImpl->m_nWordCompatibilityMode ) - m_pImpl->m_nWordCompatibilityMode = nValidMode; - } + OUString sUri; + aCurrentCompatSettings[1].Value >>= sUri; + if ( sUri != "http://schemas.microsoft.com/office/word" ) + continue; + + OUString sVal; + aCurrentCompatSettings[2].Value >>= sVal; + const sal_Int32 nValidMode = sVal.toInt32(); + // if repeated, highest mode wins in MS Word. 11 is the first valid mode. + if ( nValidMode > 10 && nValidMode > m_pImpl->m_nWordCompatibilityMode ) + m_pImpl->m_nWordCompatibilityMode = nValidMode; } } diff --git a/writerfilter/source/dmapper/SettingsTable.hxx b/writerfilter/source/dmapper/SettingsTable.hxx index d8473e423041..3489cf0ac34b 100644 --- a/writerfilter/source/dmapper/SettingsTable.hxx +++ b/writerfilter/source/dmapper/SettingsTable.hxx @@ -87,6 +87,7 @@ class SettingsTable : public LoggedProperties, public LoggedTable void ApplyProperties(css::uno::Reference const& xDoc); + bool GetCompatSettingValue( const OUString& sCompatName ) const; sal_Int32 GetWordCompatibilityMode() const; const OUString & GetCurrentDatabaseDataSource() const;