diff options
-rw-r--r-- | sw/source/filter/html/svxcss1.cxx | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/sw/source/filter/html/svxcss1.cxx b/sw/source/filter/html/svxcss1.cxx index d92d5ea572b6..3ed3a1505135 100644 --- a/sw/source/filter/html/svxcss1.cxx +++ b/sw/source/filter/html/svxcss1.cxx @@ -19,6 +19,7 @@ #include <sal/config.h> +#include <algorithm> #include <cmath> #include <memory> #include <stdlib.h> @@ -2866,9 +2867,7 @@ static void ParseCSS1_length( const CSS1Expression *pExpr, break; case CSS1_PERCENTAGE: - rLength = static_cast<tools::Long>(pExpr->GetNumber()); - if( rLength > 100 ) - rLength = 100; + rLength = static_cast<tools::Long>(std::min(pExpr->GetNumber(), 100.0)); rLengthType = SVX_CSS1_LTYPE_PERCENTAGE; break; |