diff options
author | Xisco Fauli <xiscofauli@libreoffice.org> | 2023-06-29 17:42:19 +0200 |
---|---|---|
committer | Xisco Fauli <xiscofauli@libreoffice.org> | 2023-06-29 21:13:13 +0200 |
commit | 210f2345c2eea2c52b673e2327a2ed096d9a888a (patch) | |
tree | 4a0ff76abda90780df05d1d3df52f820f27427a8 /svgio | |
parent | c48e810f1a856d392b2ffce6b343082406644ab8 (diff) |
svgio: simplify code
Change-Id: I18c4179c36c052cc0ed5b416125e72d542cb7407
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153749
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'svgio')
-rw-r--r-- | svgio/inc/svgimagenode.hxx | 1 | ||||
-rw-r--r-- | svgio/inc/svgtools.hxx | 2 | ||||
-rw-r--r-- | svgio/source/svgreader/svgimagenode.cxx | 4 | ||||
-rw-r--r-- | svgio/source/svgreader/svgtools.cxx | 9 |
4 files changed, 7 insertions, 9 deletions
diff --git a/svgio/inc/svgimagenode.hxx b/svgio/inc/svgimagenode.hxx index 171a863d8fd0..074b659783b3 100644 --- a/svgio/inc/svgimagenode.hxx +++ b/svgio/inc/svgimagenode.hxx @@ -43,7 +43,6 @@ namespace svgio::svgreader OUString maXLink; // internal link OUString maUrl; // external link - OUString maMimeType; // mimetype and OUString maData; // base64 data public: diff --git a/svgio/inc/svgtools.hxx b/svgio/inc/svgtools.hxx index 1bca409001b6..f556ed6cde02 100644 --- a/svgio/inc/svgtools.hxx +++ b/svgio/inc/svgtools.hxx @@ -125,7 +125,7 @@ namespace svgio::svgreader typedef ::std::vector< OUString > SvgStringVector; bool readSvgStringVector(std::u16string_view rCandidate, SvgStringVector& rSvgStringVector); - void readImageLink(const OUString& rCandidate, OUString& rXLink, OUString& rUrl, OUString& rMimeType, OUString& rData); + void readImageLink(const OUString& rCandidate, OUString& rXLink, OUString& rUrl, OUString& rData); OUString consolidateContiguousSpace(const OUString& rCandidate); OUString xmlSpaceHandling(const OUString& rCandidate, bool bIsDefault); diff --git a/svgio/source/svgreader/svgimagenode.cxx b/svgio/source/svgreader/svgimagenode.cxx index d0e821a52092..fa7cbe675a13 100644 --- a/svgio/source/svgreader/svgimagenode.cxx +++ b/svgio/source/svgreader/svgimagenode.cxx @@ -141,7 +141,7 @@ namespace svgio::svgreader if(nLen) { - readImageLink(aContent, maXLink, maUrl, maMimeType, maData); + readImageLink(aContent, maXLink, maUrl, maData); } break; } @@ -204,7 +204,7 @@ namespace svgio::svgreader const basegfx::B2DRange aTarget(fX, fY, fX + fWidth, fY + fHeight); basegfx::B2DRange aViewBox(aTarget); - if(!maMimeType.isEmpty() && !maData.isEmpty()) + if(!maData.isEmpty()) { // use embedded base64 encoded data css::uno::Sequence< sal_Int8 > aPass; diff --git a/svgio/source/svgreader/svgtools.cxx b/svgio/source/svgreader/svgtools.cxx index c45f4c5e9c61..9539fcf618b9 100644 --- a/svgio/source/svgreader/svgtools.cxx +++ b/svgio/source/svgreader/svgtools.cxx @@ -1354,11 +1354,10 @@ namespace svgio::svgreader return !rSvgStringVector.empty(); } - void readImageLink(const OUString& rCandidate, OUString& rXLink, OUString& rUrl, OUString& rMimeType, OUString& rData) + void readImageLink(const OUString& rCandidate, OUString& rXLink, OUString& rUrl, OUString& rData) { rXLink.clear(); rUrl.clear(); - rMimeType.clear(); rData.clear(); if(!readLocalLink(rCandidate, rXLink)) @@ -1376,11 +1375,11 @@ namespace svgio::svgreader skip_char(rCandidate, ' ', nPos, nLen); copyToLimiter(rCandidate, ';', nPos, aBuffer, nLen); skip_char(rCandidate, ' ', ';', nPos, nLen); - rMimeType = aBuffer.makeStringAndClear(); + const OUString aMimeType = aBuffer.makeStringAndClear(); - if(!rMimeType.isEmpty() && nPos < nLen) + if(!aMimeType.isEmpty() && nPos < nLen) { - if(rMimeType.startsWith("image")) + if(aMimeType.startsWith("image")) { // image data std::u16string_view aData(rCandidate.subView(nPos)); |