From 210f2345c2eea2c52b673e2327a2ed096d9a888a Mon Sep 17 00:00:00 2001 From: Xisco Fauli Date: Thu, 29 Jun 2023 17:42:19 +0200 Subject: svgio: simplify code Change-Id: I18c4179c36c052cc0ed5b416125e72d542cb7407 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153749 Tested-by: Jenkins Reviewed-by: Xisco Fauli --- svgio/inc/svgimagenode.hxx | 1 - svgio/inc/svgtools.hxx | 2 +- svgio/source/svgreader/svgimagenode.cxx | 4 ++-- svgio/source/svgreader/svgtools.cxx | 9 ++++----- 4 files changed, 7 insertions(+), 9 deletions(-) (limited to 'svgio') 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)); -- cgit