diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2016-06-14 08:44:06 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2016-06-14 08:18:13 +0000 |
commit | c3acc06230169f141930945ebbff43b1a88dfdee (patch) | |
tree | 547be2e8aadc0ad490ec41f797e602d231a5347a /sw | |
parent | 656513d15116a3c6feeadc6a3353a304e0b3ef2b (diff) |
Related: tdf#91684 RTF import: fix scaling of group shape children
It was assumed that the child size is in twips, but it's in relative
coordinates.
Change-Id: I51352180c2e61a70b1a34faad5d73f96121168a8
Reviewed-on: https://gerrit.libreoffice.org/26240
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Jenkins <ci@libreoffice.org>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/qa/extras/rtfimport/data/tdf91684.rtf | 460 | ||||
-rw-r--r-- | sw/qa/extras/rtfimport/rtfimport.cxx | 7 |
2 files changed, 467 insertions, 0 deletions
diff --git a/sw/qa/extras/rtfimport/data/tdf91684.rtf b/sw/qa/extras/rtfimport/data/tdf91684.rtf new file mode 100644 index 000000000000..4ec9e2632621 --- /dev/null +++ b/sw/qa/extras/rtfimport/data/tdf91684.rtf @@ -0,0 +1,460 @@ +{\rtf1\adeflang1025\ansi\ansicpg1252\uc1\adeff31507\deff0\stshfdbch31506\stshfloch31506\stshfhich31506\stshfbi31507\deflang1033\deflangfe1033\themelang1033\themelangfe0\themelangcs0 +\pard\plain \ltrpar\ql \li0\ri0\sa160\sl259\slmult1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af31507\afs22\alang1025 \ltrch\fcs0 \f31506\fs22\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 +{\field\fldedit\fldlock +{\*\fldinst +{\rtlch\fcs1 \af31507 \ltrch\fcs0 \insrsid8943332 SHAPE \\* MERGEFORMAT } +} +{\fldrslt +{\rtlch\fcs1 \af31507 \ltrch\fcs0 \lang1024\langfe1024\noproof\insrsid8943332 +{\shpgrp +{\*\shpinst\shpleft0\shptop0\shpright780\shpbottom759\shpfhdr0\shpbxcolumn\shpbxignore\shpbypara\shpbyignore\shpwr3\shpwrk0\shpfblwtxt0\shpz0\shplockanchor\shplid1026 +{\sp +{\sn groupLeft} +{\sv 8754} +} +{\sp +{\sn groupTop} +{\sv 11945} +} +{\sp +{\sn groupRight} +{\sv 11634} +} +{\sp +{\sn groupBottom} +{\sv 14804} +} +{\sp +{\sn rotation} +{\sv 0} +} +{\sp +{\sn fLockAgainstUngrouping} +{\sv 0} +} +{\sp +{\sn fLockRotation} +{\sv 0} +} +{\sp +{\sn fLockAspectRatio} +{\sv 0} +} +{\sp +{\sn fLockPosition} +{\sv 0} +} +{\sp +{\sn fLockAgainstSelect} +{\sv 0} +} +{\sp +{\sn fLockAgainstGrouping} +{\sv 0} +} +{\sp +{\sn wzName} +{\sv Group +450} +} +{\sp +{\sn lidRegroup} +{\sv 0} +} +{\sp +{\sn posh} +{\sv 0} +} +{\sp +{\sn posrelh} +{\sv 3} +} +{\sp +{\sn posv} +{\sv 0} +} +{\sp +{\sn posrelv} +{\sv 3} +} +{\sp +{\sn dhgt} +{\sv 0} +} +{\sp +{\sn fAllowOverlap} +{\sv 1} +} +{\sp +{\sn fBehindDocument} +{\sv 0} +} +{\sp +{\sn fHidden} +{\sv 0} +} +{\sp +{\sn fPseudoInline} +{\sv 1} +} +{\sp +{\sn pctHorizPos} +{\sv -10001} +} +{\sp +{\sn pctVertPos} +{\sv -10001} +} +{\sp +{\sn fLayoutInCell} +{\sv 1} +} +{\sp +{\sn fLockPosition} +{\sv 1} +} +{\sp +{\sn fLockRotation} +{\sv 1} +} +{\shp +{\*\shpinst\shplid1027 +{\sp +{\sn relLeft} +{\sv 10194} +} +{\sp +{\sn relTop} +{\sv 11945} +} +{\sp +{\sn relRight} +{\sv 11634} +} +{\sp +{\sn relBottom} +{\sv 13385} +} +{\sp +{\sn shapeType} +{\sv 1} +} +{\sp +{\sn anchorText} +{\sv 1} +} +{\sp +{\sn fRotateText} +{\sv 0} +} +{\sp +{\sn fFitShapeToText} +{\sv 0} +} +{\sp +{\sn fillColor} +{\sv 12566463} +} +{\sp +{\sn fillOpacity} +{\sv 32896} +} +{\sp +{\sn fFilled} +{\sv 1} +} +{\sp +{\sn lineColor} +{\sv 16777215} +} +{\sp +{\sn lineWidth} +{\sv 12700} +} +{\sp +{\sn wzName} +{\sv Rectangle 451} +} +} +} +{\shp +{\*\shpinst\shplid1028 +{\sp +{\sn relLeft} +{\sv 10194} +} +{\sp +{\sn relTop} +{\sv 13364} +} +{\sp +{\sn relRight} +{\sv 11634} +} +{\sp +{\sn relBottom} +{\sv 14804} +} +{\sp +{\sn shapeType} +{\sv 1} +} +{\sp +{\sn fLockRotation} +{\sv 0} +} +{\sp +{\sn fLockAspectRatio} +{\sv 0} +} +{\sp +{\sn fLockPosition} +{\sv 0} +} +{\sp +{\sn fLockAgainstSelect} +{\sv 0} +} +{\sp +{\sn fLockVerticies} +{\sv 0} +} +{\sp +{\sn fLockText} +{\sv 0} +} +{\sp +{\sn fLockAdjustHandles} +{\sv 0} +} +{\sp +{\sn fLockAgainstGrouping} +{\sv 0} +} +{\sp +{\sn anchorText} +{\sv 1} +} +{\sp +{\sn fRotateText} +{\sv 0} +} +{\sp +{\sn fFitShapeToText} +{\sv 0} +} +{\sp +{\sn fillColor} +{\sv 3243501} +} +{\sp +{\sn fFilled} +{\sv 1} +} +{\sp +{\sn lineColor} +{\sv 16777215} +} +{\sp +{\sn lineWidth} +{\sv 12700} +} +{\sp +{\sn fArrowheadsOK} +{\sv 0} +} +{\sp +{\sn fLine} +{\sv 1} +} +{\sp +{\sn shadowColor} +{\sv 14211288} +} +{\sp +{\sn shadowOffsetX} +{\sv 38100} +} +{\sp +{\sn shadowOffsetY} +{\sv 38100} +} +{\sp +{\sn fShadow} +{\sv 0} +} +{\sp +{\sn fshadowObscured} +{\sv 0} +} +{\sp +{\sn fLockShapeType} +{\sv 0} +} +{\sp +{\sn wzName} +{\sv Rectangle 452} +} +{\sp +{\sn dhgt} +{\sv 251659264} +} +{\sp +{\sn fHidden} +{\sv 0} +} +{\sp +{\sn fLayoutInCell} +{\sv 1} +} +} +} +{\shp +{\*\shpinst\shplid1029 +{\sp +{\sn relLeft} +{\sv 8754} +} +{\sp +{\sn relTop} +{\sv 13364} +} +{\sp +{\sn relRight} +{\sv 10194} +} +{\sp +{\sn relBottom} +{\sv 14804} +} +{\sp +{\sn shapeType} +{\sv 1} +} +{\sp +{\sn fLockRotation} +{\sv 0} +} +{\sp +{\sn fLockAspectRatio} +{\sv 0} +} +{\sp +{\sn fLockPosition} +{\sv 0} +} +{\sp +{\sn fLockAgainstSelect} +{\sv 0} +} +{\sp +{\sn fLockVerticies} +{\sv 0} +} +{\sp +{\sn fLockText} +{\sv 0} +} +{\sp +{\sn fLockAdjustHandles} +{\sv 0} +} +{\sp +{\sn fLockAgainstGrouping} +{\sv 0} +} +{\sp +{\sn anchorText} +{\sv 1} +} +{\sp +{\sn fRotateText} +{\sv 0} +} +{\sp +{\sn fFitShapeToText} +{\sv 0} +} +{\sp +{\sn fillColor} +{\sv 12566463} +} +{\sp +{\sn fillOpacity} +{\sv 32896} +} +{\sp +{\sn fFilled} +{\sv 1} +} +{\sp +{\sn lineColor} +{\sv 16777215} +} +{\sp +{\sn lineWidth} +{\sv 12700} +} +{\sp +{\sn fArrowheadsOK} +{\sv 0} +} +{\sp +{\sn fLine} +{\sv 1} +} +{\sp +{\sn shadowColor} +{\sv 14211288} +} +{\sp +{\sn shadowOffsetX} +{\sv 38100} +} +{\sp +{\sn shadowOffsetY} +{\sv 38100} +} +{\sp +{\sn fShadow} +{\sv 0} +} +{\sp +{\sn fshadowObscured} +{\sv 0} +} +{\sp +{\sn fLockShapeType} +{\sv 0} +} +{\sp +{\sn wzName} +{\sv Rectangle 453} +} +{\sp +{\sn dhgt} +{\sv 251659264} +} +{\sp +{\sn fHidden} +{\sv 0} +} +{\sp +{\sn fLayoutInCell} +{\sv 1} +} +} +} +} +{\shprslt +{\*\do\dobxcolumn\dobypara\dodhgt8192\dpgroup\dpcount4\dpx0\dpy0\dpxsize780\dpysize759 +\dprect\dpx0\dpy377\dpxsize390\dpysize382\dpfillfgcr255\dpfillfgcg255\dpfillfgcb255\dpfillbgcr108\dpfillbgcg9\dpfillbgcb0\dpfillpat1\dplinew20\dplinecor255\dplinecog255\dplinecob255\dprect\dpx0\dpy0\dpxsize390\dpysize382 +\dpfillfgcr255\dpfillfgcg255\dpfillfgcb255\dpfillbgcr133\dpfillbgcg12\dpfillbgcb0\dpfillpat1\dplinew20\dplinecor255\dplinecog255\dplinecob255\dprect\dpx390\dpy0\dpxsize390\dpysize382 +\dpfillfgcr255\dpfillfgcg255\dpfillfgcb255\dpfillbgcr108\dpfillbgcg9\dpfillbgcb0\dpfillpat1\dplinew20\dplinecor255\dplinecog255\dplinecob255\dpendgroup\dpx0\dpy0\dpxsize0\dpysize0} +} +} +} +} +} +\par +} diff --git a/sw/qa/extras/rtfimport/rtfimport.cxx b/sw/qa/extras/rtfimport/rtfimport.cxx index 17445cd32d38..6bc62c7c4ee9 100644 --- a/sw/qa/extras/rtfimport/rtfimport.cxx +++ b/sw/qa/extras/rtfimport/rtfimport.cxx @@ -2634,6 +2634,13 @@ DECLARE_RTFIMPORT_TEST(testTdf50821, "tdf50821.rtf") CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(191), getProperty<sal_Int32>(xCell, "LeftBorderDistance")); } +DECLARE_RTFIMPORT_TEST(testTdf91684, "tdf91684.rtf") +{ + // Scaling of the group shape children were incorrect, this was 3203. + // (Unit was assumed to be twips, but it was relative coordinates.) + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(1337), getShape(1)->getSize().Height); +} + CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |