diff options
author | Xisco Fauli <xiscofauli@libreoffice.org> | 2023-07-10 11:52:30 +0200 |
---|---|---|
committer | Xisco Fauli <xiscofauli@libreoffice.org> | 2023-07-10 13:52:56 +0200 |
commit | fa61e8b220aa1f34b022b9af485f0209b2cb25d1 (patch) | |
tree | 5f91a5b0f214633895454452368dde057395c75d /svgio/source | |
parent | f8c15850dbfaa46605e1e353ae1f49e69184e8a1 (diff) |
tdf#99562: Do not ignore last column from matrix
Change-Id: I1dff65963e2c414d1771a1592159930150c513e0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154241
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'svgio/source')
-rw-r--r-- | svgio/source/svgreader/svgfecolormatrixnode.cxx | 4 | ||||
-rw-r--r-- | svgio/source/svgreader/svgtools.cxx | 26 |
2 files changed, 9 insertions, 21 deletions
diff --git a/svgio/source/svgreader/svgfecolormatrixnode.cxx b/svgio/source/svgreader/svgfecolormatrixnode.cxx index 0fed49ea6ca2..d08c5ea44280 100644 --- a/svgio/source/svgreader/svgfecolormatrixnode.cxx +++ b/svgio/source/svgreader/svgfecolormatrixnode.cxx @@ -105,11 +105,11 @@ void SvgFeColorMatrixNode::apply(drawinglayer::primitive2d::Primitive2DContainer } else if (maType == ColorType::Matrix) { - basegfx::B3DHomMatrix aMatrix = readFilterMatrix(maValuesContent, *this); + std::vector<double> aVector = readFilterMatrix(maValuesContent, *this); const drawinglayer::primitive2d::Primitive2DReference xRef( new drawinglayer::primitive2d::ModifiedColorPrimitive2D( - std::move(rTarget), std::make_shared<basegfx::BColorModifier_matrix>(aMatrix))); + std::move(rTarget), std::make_shared<basegfx::BColorModifier_matrix>(aVector))); rTarget = drawinglayer::primitive2d::Primitive2DContainer{ xRef }; } } diff --git a/svgio/source/svgreader/svgtools.cxx b/svgio/source/svgreader/svgtools.cxx index f7bc5b951f97..ce8b4f99bd62 100644 --- a/svgio/source/svgreader/svgtools.cxx +++ b/svgio/source/svgreader/svgtools.cxx @@ -846,9 +846,9 @@ namespace svgio::svgreader return basegfx::B2DRange(); } - basegfx::B3DHomMatrix readFilterMatrix(std::u16string_view rCandidate, InfoProvider const & rInfoProvider) + std::vector<double> readFilterMatrix(std::u16string_view rCandidate, InfoProvider const & rInfoProvider) { - basegfx::B3DHomMatrix aMatrix; + std::vector<double> aVector; const sal_Int32 nLen(rCandidate.size()); sal_Int32 nPos(0); @@ -856,28 +856,16 @@ namespace svgio::svgreader SvgNumber aVal; - // create a 4x4 matrix from the list of 20 matrix values. - for (sal_uInt16 nRow = 0; nRow < 4; ++nRow) + while (nPos < nLen) { - for (sal_uInt16 nColumn = 0; nColumn < 5; ++nColumn) + if(readNumberAndUnit(rCandidate, nPos, aVal, nLen)) { - // return earlier if there are not enough values - if (nPos >= nLen) - { - return basegfx::B3DHomMatrix(); - } - - if(readNumberAndUnit(rCandidate, nPos, aVal, nLen)) - { - // ignore the last column - if (nColumn < 4) - aMatrix.set(nRow, nColumn, aVal.solve(rInfoProvider)); - skip_char(rCandidate, ' ', ',', nPos, nLen); - } + aVector.push_back(aVal.solve(rInfoProvider)); + skip_char(rCandidate, ' ', ',', nPos, nLen); } } - return aMatrix; + return aVector; } basegfx::B2DHomMatrix readTransform(std::u16string_view rCandidate, InfoProvider const & rInfoProvider) |