summaryrefslogtreecommitdiff
path: root/sw/source/filter/ww8/docxattributeoutput.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sw/source/filter/ww8/docxattributeoutput.cxx')
-rw-r--r--sw/source/filter/ww8/docxattributeoutput.cxx5
1 files changed, 4 insertions, 1 deletions
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx
index a66ab0b35472..e5ce36a58bb8 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -6566,8 +6566,11 @@ void DocxAttributeOutput::CharTwoLines( const SvxTwoLinesItem& rTwoLines )
void DocxAttributeOutput::CharScaleWidth( const SvxCharScaleWidthItem& rScaleWidth )
{
+ // Clamp CharScaleWidth to OOXML limits ([1..600])
+ const sal_Int16 nScaleWidth( std::max<sal_Int16>( 1,
+ std::min<sal_Int16>( rScaleWidth.GetValue(), 600 ) ) );
m_pSerializer->singleElementNS( XML_w, XML_w,
- FSNS( XML_w, XML_val ), OString::number( rScaleWidth.GetValue() ).getStr(), FSEND );
+ FSNS( XML_w, XML_val ), OString::number( nScaleWidth ).getStr(), FSEND );
}
void DocxAttributeOutput::CharRelief( const SvxCharReliefItem& rRelief )