summaryrefslogtreecommitdiff
path: root/writerfilter
diff options
context:
space:
mode:
authorAron Budea <aron.budea@collabora.com>2017-02-16 19:36:54 +0100
committerAndras Timar <andras.timar@collabora.com>2017-02-24 12:24:43 +0100
commit8a8cd0986633b78b4f240285ac803f45d00da4b3 (patch)
tree6dbdaf7954fa85c9dfca02a6ed13e9dcd4f47fff /writerfilter
parent75cd5b0a5d9e088df4510a070794fcae6c5a7477 (diff)
tdf#106001: Treat CharScaleWidth outliers as 100 in DOCX import
Spec limit is [1..600], sometimes documents contain 0, which, similar to other values outside the limit should be treated as 100. Change-Id: I04aec25b638762392de3f9881cd72588f2753e71 Reviewed-on: https://gerrit.libreoffice.org/34341 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> (cherry picked from commit 6e3a84023b46f6be632b43d2f5713d8d4bb2ba62) Reviewed-on: https://gerrit.libreoffice.org/34368 (cherry picked from commit 06c81a3e61e2d5743ffd8a50d85e5ecee989e46b)
Diffstat (limited to 'writerfilter')
-rw-r--r--writerfilter/source/dmapper/DomainMapper.cxx13
1 files changed, 11 insertions, 2 deletions
diff --git a/writerfilter/source/dmapper/DomainMapper.cxx b/writerfilter/source/dmapper/DomainMapper.cxx
index 823640c8e15c..fe7b9a97b0b4 100644
--- a/writerfilter/source/dmapper/DomainMapper.cxx
+++ b/writerfilter/source/dmapper/DomainMapper.cxx
@@ -1694,8 +1694,17 @@ void DomainMapper::sprmWithProps( Sprm& rSprm, const PropertyMapPtr& rContext )
rContext->Insert(PROP_CHAR_AUTO_KERNING, uno::makeAny( nIntValue != 0 ) );
break;
case NS_ooxml::LN_EG_RPrBase_w:
- rContext->Insert(PROP_CHAR_SCALE_WIDTH,
- uno::makeAny( sal_Int16(nIntValue) ));
+ // ST_TextScale must fall between 1% and 600% according to spec, otherwise resets to 100% according to experience
+ if ((1 <= nIntValue) && (nIntValue <= 600))
+ {
+ rContext->Insert(PROP_CHAR_SCALE_WIDTH,
+ uno::makeAny( sal_Int16(nIntValue) ));
+ }
+ else
+ {
+ rContext->Insert(PROP_CHAR_SCALE_WIDTH,
+ uno::makeAny( sal_Int16(100) ));
+ }
break;
case NS_ooxml::LN_EG_RPrBase_imprint:
// FontRelief: NONE, EMBOSSED, ENGRAVED