summaryrefslogtreecommitdiff
path: root/xmloff
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2012-09-14 11:56:16 +0200
committerMiklos Vajna <vmiklos@suse.cz>2012-09-17 07:55:37 +0000
commit93d781b42c9596fddedc863ecc0740a7a84c072a (patch)
tree456a741942c7478a290c3b9080f02c849ef1ea79 /xmloff
parent9c4d8242ef1d89f5217e092c6a23d95867f1270f (diff)
fdo#49876: ODF export: do not export font-size="0pt"
This is invalid, font size must be positive. Change-Id: I2425d7c596ca9c7c80c0d24c44cdd9ec1ac1dd80 (cherry picked from commit c9699f82edf67a55f4cfdd885fa779b13d816c87) Reviewed-on: https://gerrit.libreoffice.org/617 Reviewed-by: Miklos Vajna <vmiklos@suse.cz> Tested-by: Miklos Vajna <vmiklos@suse.cz>
Diffstat (limited to 'xmloff')
-rw-r--r--xmloff/source/style/chrhghdl.cxx2
1 files changed, 2 insertions, 0 deletions
diff --git a/xmloff/source/style/chrhghdl.cxx b/xmloff/source/style/chrhghdl.cxx
index 8b8f842ec7f7..0a607efd1bd9 100644
--- a/xmloff/source/style/chrhghdl.cxx
+++ b/xmloff/source/style/chrhghdl.cxx
@@ -67,6 +67,7 @@ sal_Bool XMLCharHeightHdl::importXML( const OUString& rStrImpValue, uno::Any& rV
if (::sax::Converter::convertDouble(fSize, rStrImpValue,
eSrcUnit, util::MeasureUnit::POINT))
{
+ fSize = ::std::max<double>(fSize, 1.0); // fdo#49876: 0pt is invalid
rValue <<= (float)fSize;
return sal_True;
}
@@ -82,6 +83,7 @@ sal_Bool XMLCharHeightHdl::exportXML( OUString& rStrExpValue, const uno::Any& rV
float fSize = 0;
if( rValue >>= fSize )
{
+ fSize = ::std::max<float>(fSize, 1.0f); // fdo#49876: 0pt is invalid
::sax::Converter::convertDouble(aOut, (double)fSize, true,
util::MeasureUnit::POINT, util::MeasureUnit::POINT);
aOut.append( sal_Unicode('p'));