summaryrefslogtreecommitdiff
path: root/svgio/source
diff options
context:
space:
mode:
Diffstat (limited to 'svgio/source')
-rw-r--r--svgio/source/svgreader/svgfecolormatrixnode.cxx4
-rw-r--r--svgio/source/svgreader/svgtools.cxx26
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)