[Libreoffice-commits] core.git: vcl/inc vcl/source
Tomaž Vajngerl (via logerrit)
logerrit at kemper.freedesktop.org
Sun Apr 26 19:38:41 UTC 2020
vcl/inc/impgraph.hxx | 2 +-
vcl/source/gdi/impgraph.cxx | 27 ++++++++++++++++++---------
2 files changed, 19 insertions(+), 10 deletions(-)
New commits:
commit c78a95124877387abf85a8637f50c1bfce24c22e
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
AuthorDate: Mon Apr 20 22:17:01 2020 +0200
Commit: Tomaž Vajngerl <quikee at gmail.com>
CommitDate: Sun Apr 26 21:38:07 2020 +0200
ImpGraphic: encapsulate members of ImpSwapFile
Change-Id: I882d30f2f27149c865160b3fa68fa974701cea71
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92921
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee at gmail.com>
diff --git a/vcl/inc/impgraph.hxx b/vcl/inc/impgraph.hxx
index 0653c82d4bae..6ba07295f9a3 100644
--- a/vcl/inc/impgraph.hxx
+++ b/vcl/inc/impgraph.hxx
@@ -43,7 +43,7 @@ struct ImpSwapInfo
class OutputDevice;
class GfxLink;
-struct ImpSwapFile;
+class ImpSwapFile;
class GraphicConversionParameters;
class ImpGraphic;
diff --git a/vcl/source/gdi/impgraph.cxx b/vcl/source/gdi/impgraph.cxx
index d4634f1c58ca..9eb42fec39e8 100644
--- a/vcl/source/gdi/impgraph.cxx
+++ b/vcl/source/gdi/impgraph.cxx
@@ -67,21 +67,32 @@ constexpr sal_uInt32 constPdfMagic((sal_uInt32('s') << 24) | (sal_uInt32('v') <<
using namespace com::sun::star;
-struct ImpSwapFile
+class ImpSwapFile
{
- INetURLObject aSwapURL;
+private:
+ INetURLObject maSwapURL;
OUString maOriginURL;
+public:
+ ImpSwapFile(INetURLObject const & aSwapURL, OUString const & rOriginURL)
+ : maSwapURL(aSwapURL)
+ , maOriginURL(rOriginURL)
+ {
+ }
+
~ImpSwapFile() COVERITY_NOEXCEPT_FALSE
{
- utl::UCBContentHelper::Kill(aSwapURL.GetMainURL(INetURLObject::DecodeMechanism::NONE));
+ utl::UCBContentHelper::Kill(maSwapURL.GetMainURL(INetURLObject::DecodeMechanism::NONE));
}
+
+ INetURLObject getSwapURL() { return maSwapURL; }
+ OUString const & getOriginURL() { return maOriginURL; }
};
OUString ImpGraphic::getSwapFileURL()
{
if (mpSwapFile)
- return mpSwapFile->aSwapURL.GetMainURL(INetURLObject::DecodeMechanism::NONE);
+ return mpSwapFile->getSwapURL().GetMainURL(INetURLObject::DecodeMechanism::NONE);
return OUString();
}
@@ -1344,9 +1355,7 @@ bool ImpGraphic::swapOut()
bool bRet = swapOutToStream( xOStm.get() );
if( bRet )
{
- mpSwapFile.reset(new ImpSwapFile, o3tl::default_delete<ImpSwapFile>());
- mpSwapFile->aSwapURL = aTmpURL;
- mpSwapFile->maOriginURL = getOriginURL();
+ mpSwapFile.reset(new ImpSwapFile(aTmpURL, getOriginURL()), o3tl::default_delete<ImpSwapFile>());
}
else
{
@@ -1436,7 +1445,7 @@ bool ImpGraphic::swapIn()
OUString aSwapURL;
if( mpSwapFile )
- aSwapURL = mpSwapFile->aSwapURL.GetMainURL( INetURLObject::DecodeMechanism::NONE );
+ aSwapURL = mpSwapFile->getSwapURL().GetMainURL( INetURLObject::DecodeMechanism::NONE );
if( !aSwapURL.isEmpty() )
{
@@ -1457,7 +1466,7 @@ bool ImpGraphic::swapIn()
bRet = swapInFromStream(xIStm.get());
xIStm.reset();
if (mpSwapFile)
- setOriginURL(mpSwapFile->maOriginURL);
+ setOriginURL(mpSwapFile->getOriginURL());
mpSwapFile.reset();
}
}
More information about the Libreoffice-commits
mailing list