summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
Diffstat (limited to 'sw')
-rw-r--r--sw/inc/viewsh.hxx5
-rw-r--r--sw/source/core/inc/fntcache.hxx1
-rw-r--r--sw/source/core/txtnode/fntcache.cxx7
-rw-r--r--sw/source/core/view/viewsh.cxx4
4 files changed, 9 insertions, 8 deletions
diff --git a/sw/inc/viewsh.hxx b/sw/inc/viewsh.hxx
index e4ee7d609ef6..3df2cd89ee93 100644
--- a/sw/inc/viewsh.hxx
+++ b/sw/inc/viewsh.hxx
@@ -30,6 +30,7 @@
#include <vcl/mapmod.hxx>
#include <vcl/print.hxx>
#include <vcl/vclptr.hxx>
+#include <vcl/lazydelete.hxx>
#include <LibreOfficeKit/LibreOfficeKitTypes.h>
@@ -180,7 +181,7 @@ class SW_DLLPUBLIC SwViewShell : public sw::Ring<SwViewShell>
protected:
static ShellResource* mpShellRes; ///< Resources for the Shell.
- static VclPtr<vcl::Window> mpCareWindow; ///< Avoid this window.
+ static vcl::DeleteOnDeinit< VclPtr<vcl::Window> > mpCareWindow; ///< Avoid this window.
SwRect maVisArea; ///< The modern version of VisArea.
SwDoc *mpDoc; ///< The document; never 0.
@@ -436,7 +437,7 @@ public:
static void SetCareWin( vcl::Window* pNew );
static vcl::Window* GetCareWin(SwViewShell& rVSh)
- { return mpCareWindow ? mpCareWindow.get() : CareChildWin(rVSh); }
+ { return (*mpCareWindow.get()) ? mpCareWindow.get()->get() : CareChildWin(rVSh); }
static vcl::Window* CareChildWin(SwViewShell& rVSh);
inline SfxViewShell *GetSfxViewShell() const { return mpSfxViewShell; }
diff --git a/sw/source/core/inc/fntcache.hxx b/sw/source/core/inc/fntcache.hxx
index 7d5dc0aa16e9..b0117a000fae 100644
--- a/sw/source/core/inc/fntcache.hxx
+++ b/sw/source/core/inc/fntcache.hxx
@@ -78,7 +78,6 @@ class SwFntObj : public SwCacheObj
static long nPixWidth;
static MapMode *pPixMap;
- static VclPtr<OutputDevice> pPixOut;
public:
DECL_FIXEDMEMPOOL_NEWDEL(SwFntObj)
diff --git a/sw/source/core/txtnode/fntcache.cxx b/sw/source/core/txtnode/fntcache.cxx
index b612985c731d..989d6d69c46b 100644
--- a/sw/source/core/txtnode/fntcache.cxx
+++ b/sw/source/core/txtnode/fntcache.cxx
@@ -28,6 +28,7 @@
#include <vcl/metric.hxx>
#include <vcl/window.hxx>
#include <vcl/svapp.hxx>
+#include <vcl/lazydelete.hxx>
#include <com/sun/star/i18n/CharacterIteratorMode.hpp>
#include <com/sun/star/i18n/WordType.hpp>
#include <breakit.hxx>
@@ -68,7 +69,7 @@ Color *pWaveCol = nullptr;
long SwFntObj::nPixWidth;
MapMode* SwFntObj::pPixMap = nullptr;
-VclPtr<OutputDevice> SwFntObj::pPixOut;
+static vcl::DeleteOnDeinit< VclPtr<OutputDevice> > s_pFntObjPixOut( new VclPtr<OutputDevice> );
namespace
{
@@ -889,10 +890,10 @@ void SwFntObj::DrawText( SwDrawTextInfo &rInf )
Point aTextOriginPos( rInf.GetPos() );
if( !bPrt )
{
- if( rInf.GetpOut() != pPixOut || rInf.GetOut().GetMapMode() != *pPixMap )
+ if( rInf.GetpOut() != *s_pFntObjPixOut.get() || rInf.GetOut().GetMapMode() != *pPixMap )
{
*pPixMap = rInf.GetOut().GetMapMode();
- pPixOut = rInf.GetpOut();
+ (*s_pFntObjPixOut.get()) = rInf.GetpOut();
Size aTmp( 1, 1 );
nPixWidth = rInf.GetOut().PixelToLogic( aTmp ).Width();
}
diff --git a/sw/source/core/view/viewsh.cxx b/sw/source/core/view/viewsh.cxx
index bf4152661553..769cd930c369 100644
--- a/sw/source/core/view/viewsh.cxx
+++ b/sw/source/core/view/viewsh.cxx
@@ -88,7 +88,7 @@
bool SwViewShell::mbLstAct = false;
ShellResource *SwViewShell::mpShellRes = nullptr;
-VclPtr<vcl::Window> SwViewShell::mpCareWindow = nullptr;
+vcl::DeleteOnDeinit< VclPtr<vcl::Window> > SwViewShell::mpCareWindow(new VclPtr<vcl::Window>);
bool bInSizeNotify = false;
@@ -2418,7 +2418,7 @@ ShellResource* SwViewShell::GetShellRes()
void SwViewShell::SetCareWin( vcl::Window* pNew )
{
- mpCareWindow = pNew;
+ (*mpCareWindow.get()) = pNew;
}
sal_uInt16 SwViewShell::GetPageCount() const