tdf#148669: do not try to transform tail to unit rectangle
commite44f71dd3439cd1c473b2e32516e33986de042f3
authorMike Kaganski <mike.kaganski@collabora.com>
Wed, 20 Apr 2022 14:36:44 +0000 (20 17:36 +0300)
committerMike Kaganski <mike.kaganski@collabora.com>
Wed, 20 Apr 2022 17:25:19 +0000 (20 19:25 +0200)
treeb8704feedb695f56fc531f2d0711abdea642b7bf
parent2f726fa41cbd249f2fb30222b29d5f30bce52e6e
tdf#148669: do not try to transform tail to unit rectangle

... just to transform it back when it's used.

The problem was that the transform had zero vertical scale; thus
it couldn't be inverted. The unchanged matrix was used both in the
SdrCaptionPrimitive2D constructor, and in its create2DDecomposition,
thus scaling the X coordinate up twice. The result, which depends
on the original value of X, was huge for comments attached to cells
with large column numbers. Trying to convert such coordinate from
pixels to logic units exceeded 64-bit integer range.

Avoiding the transformations back and forth is possible, because
the transform is constant in the object. This also avoids unneeded
overhead.

There is an open question why there was a need in the calculations
for the XLSX file. The problem doesn't happen with ODS, so likely
there is a calculation of the draw page size in some circumstances
that may be avoided.

Change-Id: Iccbe77936ec1078daf6b05b0b2d44a6fa3536c4f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133217
Tested-by: Mike Kaganski <mike.kaganski@collabora.com>
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
svx/source/sdr/primitive2d/sdrcaptionprimitive2d.cxx