summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuboš Luňák <l.lunak@collabora.com>2014-03-12 13:45:36 +0100
committerMiklos Vajna <vmiklos@collabora.co.uk>2014-03-12 14:58:29 +0100
commit01acca76d62fbf6bebc24ef72f3c5b93dcd41b85 (patch)
tree25efa6349419bba2e9a8208c6532a1bd322142cd
parent5c639f52f06e945de7f3972d5a236ee02356ca8e (diff)
ignore large twips values like MSO does (cp#1000043)
(cherry picked from commit 10b4da63e3143108ba75891e9e98fdaa2f7953ab) Reviewed on: https://gerrit.libreoffice.org/8550 Change-Id: Ib304245b6ae64c15cfb6c999580f73e5e228c440
-rw-r--r--writerfilter/source/dmapper/ConversionHelper.cxx7
1 files changed, 5 insertions, 2 deletions
diff --git a/writerfilter/source/dmapper/ConversionHelper.cxx b/writerfilter/source/dmapper/ConversionHelper.cxx
index e6eadf340c8d..d6dba130cda3 100644
--- a/writerfilter/source/dmapper/ConversionHelper.cxx
+++ b/writerfilter/source/dmapper/ConversionHelper.cxx
@@ -36,8 +36,6 @@ namespace writerfilter {
namespace dmapper{
namespace ConversionHelper{
-#define TWIP_TO_MM100(TWIP) ((TWIP) >= 0 ? (((TWIP)*127L+36L)/72L) : (((TWIP)*127L-36L)/72L))
-
sal_Int32 MakeBorderLine( sal_Int32 nSprmValue, table::BorderLine2& rToFill )
{
//TODO: Lines are always solid
@@ -231,6 +229,11 @@ OUString ConvertMSFormatStringToSO(
sal_Int32 convertTwipToMM100(sal_Int32 _t)
{
+ // It appears that MSO handles large twip values specially, probably legacy 16bit handling,
+ // anything that's bigger than 32767 appears to be simply ignored.
+ if( _t >= 0x8000 )
+ return 0;
+#define TWIP_TO_MM100(TWIP) ((TWIP) >= 0 ? (((TWIP)*127L+36L)/72L) : (((TWIP)*127L-36L)/72L))
return TWIP_TO_MM100( _t );
}