include/xmloff/xmlimp.hxx | 7 +++++++ xmloff/source/draw/XMLGraphicsDefaultStyle.cxx | 5 +++++ xmloff/source/meta/xmlmetai.cxx | 3 ++- 3 files changed, 14 insertions(+), 1 deletion(-)
New commits: commit 426077fbea57facf9907cff2431d8f669713d6da Author: Michael Stahl <[email protected]> Date: Wed Apr 16 12:11:39 2014 +0200 fdo#77027: add some comments to prevent such oversights Change-Id: I381c9738bba3e422e01324fa0c781c857db3d360 diff --git a/include/xmloff/xmlimp.hxx b/include/xmloff/xmlimp.hxx index d4a7480..8790f77 100644 --- a/include/xmloff/xmlimp.hxx +++ b/include/xmloff/xmlimp.hxx @@ -430,11 +430,18 @@ public: static const sal_uInt16 OOo_34x = 34; // for AOO, no release overlaps with OOo, so continue OOo version numbers static const sal_uInt16 AOO_40x = 40; + // @ATTENTION: it's not usually ok to use the "4x" "wildcard" in an "==" + // comparison, since that will match unreleased versions too; it is also + // risky to use it in "<" comparison, because it requires checking and + // possibly adapting all such uses when a new value for a more specific + // version is added. static const sal_uInt16 AOO_4x = 41; static const sal_uInt16 LO_flag = 0x100; static const sal_uInt16 LO_3x = 30 | LO_flag; static const sal_uInt16 LO_41x = 41 | LO_flag; static const sal_uInt16 LO_42x = 42 | LO_flag; + /// @ATTENTION: when adding a new value more specific than "4x", grep for + /// all current uses and adapt them!!! static const sal_uInt16 LO_4x = 43 | LO_flag; static const sal_uInt16 ProductVersionUnknown = SAL_MAX_UINT16; diff --git a/xmloff/source/draw/XMLGraphicsDefaultStyle.cxx b/xmloff/source/draw/XMLGraphicsDefaultStyle.cxx index afbe579..9753a3f 100644 --- a/xmloff/source/draw/XMLGraphicsDefaultStyle.cxx +++ b/xmloff/source/draw/XMLGraphicsDefaultStyle.cxx @@ -125,6 +125,11 @@ void XMLGraphicsDefaultStyle::SetDefaults() xDefaults->setPropertyValue("IsFollowingTextFlow", uno::makeAny(true)); } + // NOTE: the only reason why it's legal to check "==" (not "<") against + // arbitrary versions here is that the default value of these attributes + // is not defined by ODF, therefore it is implementation-defined + // (and we of course must not override any attributes that are actually + // in the document, so check for that) bool const bIsAOO4( GetImport().getGeneratorVersion() >= SvXMLImport::AOO_40x && GetImport().getGeneratorVersion() <= SvXMLImport::AOO_4x); commit 5d53cabb52648507086a39e06803624949e4a301 Author: Michael Stahl <[email protected]> Date: Wed Apr 16 12:07:56 2014 +0200 xmloff: we used to call it LOdev back in 4.0 so check that too Change-Id: Icb7a82267d935a3ca28569657f8e8dc0ba240a5f diff --git a/xmloff/source/meta/xmlmetai.cxx b/xmloff/source/meta/xmlmetai.cxx index 17122cb..01117e1 100644 --- a/xmloff/source/meta/xmlmetai.cxx +++ b/xmloff/source/meta/xmlmetai.cxx @@ -268,7 +268,8 @@ void SvXMLMetaDocumentContext::setBuildId(OUString const& i_rBuildId, const uno: OUString rest; if (i_rBuildId.startsWith("LibreOffice/", &rest) || - i_rBuildId.startsWith("LibreOfficeDev/", &rest)) + i_rBuildId.startsWith("LibreOfficeDev/", &rest) || + i_rBuildId.startsWith("LOdev/", &rest)) { OUStringBuffer sNumber; for (sal_Int32 i = 0; i < rest.getLength(); ++i) _______________________________________________ Libreoffice-commits mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
