summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/vcl/gfxlink.hxx5
-rw-r--r--vcl/source/gdi/gfxlink.cxx23
2 files changed, 10 insertions, 18 deletions
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() )