From a4e3055818f7d5b22cd1c5577fc17ebbe4d38f96 Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Fri, 14 Sep 2012 11:56:16 +0200 Subject: 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/620 Reviewed-by: Fridrich Strba Tested-by: Fridrich Strba --- xmloff/source/style/chrhghdl.cxx | 2 ++ 1 file changed, 2 insertions(+) (limited to 'xmloff') diff --git a/xmloff/source/style/chrhghdl.cxx b/xmloff/source/style/chrhghdl.cxx index 584acf928064..b5caa8997d40 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(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(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')); -- cgit v1.2.3