include/vcl/gfxlink.hxx | 5 ++--- vcl/source/gdi/gfxlink.cxx | 23 ++++++++--------------- 2 files changed, 10 insertions(+), 18 deletions(-)
New commits: commit 315e585f283e6e4a5f1ac11e7d17a638d04e82b0 Author: Noel Grandin <[email protected]> AuthorDate: Fri Oct 5 12:31:13 2018 +0200 Commit: Noel Grandin <[email protected]> CommitDate: Sat Oct 6 08:18:02 2018 +0200 inline GfxLink::SwapIn only called from one site Change-Id: I2f8cb927df2f4f389c5d1bee19845aed5535663b Reviewed-on: https://gerrit.libreoffice.org/61437 Tested-by: Jenkins Reviewed-by: Noel Grandin <[email protected]> diff --git a/include/vcl/gfxlink.hxx b/include/vcl/gfxlink.hxx index 5df70b8bc53d..38289d465c3b 100644 --- a/include/vcl/gfxlink.hxx +++ b/include/vcl/gfxlink.hxx @@ -67,8 +67,8 @@ private: GfxLinkType meType; sal_uInt32 mnUserId; - std::shared_ptr<sal_uInt8> mpSwapInData; - std::shared_ptr<SwapOutData> mpSwapOutData; + mutable std::shared_ptr<sal_uInt8> mpSwapInData; + mutable std::shared_ptr<SwapOutData> mpSwapOutData; sal_uInt32 mnSwapInDataSize; MapMode maPrefMapMode; @@ -108,7 +108,6 @@ public: bool ExportNative( SvStream& rOStream ) const; void SwapOut(); - void SwapIn(); bool IsSwappedOut() const { return( bool(mpSwapOutData) ); } bool IsEMF() const; // WMF & EMF stored under the same type (NativeWmf) diff --git a/vcl/source/gdi/gfxlink.cxx b/vcl/source/gdi/gfxlink.cxx index 825823926a0d..ed683138b9de 100644 --- a/vcl/source/gdi/gfxlink.cxx +++ b/vcl/source/gdi/gfxlink.cxx @@ -79,8 +79,14 @@ bool GfxLink::IsNative() const const sal_uInt8* GfxLink::GetData() const { if( IsSwappedOut() ) - const_cast<GfxLink*>(this)->SwapIn(); - + { + auto pData = GetSwapInData(); + if (pData) + { + mpSwapInData = pData; + mpSwapOutData.reset(); + } + } return mpSwapInData.get(); } @@ -167,19 +173,6 @@ void GfxLink::SwapOut() } } -void GfxLink::SwapIn() -{ - if( IsSwappedOut() ) - { - auto pData = GetSwapInData(); - if (pData) - { - mpSwapInData = pData; - mpSwapOutData.reset(); - } - } -} - bool GfxLink::ExportNative( SvStream& rOStream ) const { if( GetDataSize() ) _______________________________________________ Libreoffice-commits mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
