Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
990577d0
Kaydet (Commit)
990577d0
authored
May 11, 2011
tarafından
Caolán McNamara
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
config leak: gracefully handle exit before release timer is called
üst
45047982
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
25 deletions
+36
-25
textlayoutdevice.cxx
drawinglayer/source/primitive2d/textlayoutdevice.cxx
+36
-25
No files found.
drawinglayer/source/primitive2d/textlayoutdevice.cxx
Dosyayı görüntüle @
990577d0
...
...
@@ -30,6 +30,8 @@
#include "precompiled_drawinglayer.hxx"
#include <drawinglayer/primitive2d/textlayoutdevice.hxx>
#include <comphelper/processfactory.hxx>
#include <comphelper/scoped_disposing_ptr.hxx>
#include <vcl/timer.hxx>
#include <vcl/virdev.hxx>
#include <vcl/font.hxx>
...
...
@@ -43,14 +45,33 @@
namespace
{
class
ImpTimedRefDev
;
//the scoped_timed_RefDev owns a ImpTimeRefDev and releases it on dtor
//or disposing of the default XComponentContext which causes the underlying
//OutputDevice to get released
//
//The ImpTimerRefDev itself, if the timeout ever gets hit, will call
//reset on the scoped_timed_RefDev to release the ImpTimerRefDev early
//if its unused for a few minutes
class
scoped_timed_RefDev
:
public
comphelper
::
scoped_disposing_ptr
<
ImpTimedRefDev
>
{
public
:
scoped_timed_RefDev
()
:
comphelper
::
scoped_disposing_ptr
<
ImpTimedRefDev
>
((
::
com
::
sun
::
star
::
uno
::
Reference
<
com
::
sun
::
star
::
lang
::
XComponent
>
(
::
comphelper
::
getProcessComponentContext
(),
::
com
::
sun
::
star
::
uno
::
UNO_QUERY_THROW
)))
{
}
};
class
the_scoped_timed_RefDev
:
public
rtl
::
Static
<
scoped_timed_RefDev
,
the_scoped_timed_RefDev
>
{};
class
ImpTimedRefDev
:
public
Timer
{
ImpTimedRefDev
**
mppStaticPointerOn
Me
;
scoped_timed_RefDev
&
mrOwnerOf
Me
;
VirtualDevice
*
mpVirDev
;
sal_uInt32
mnUseCount
;
public
:
ImpTimedRefDev
(
ImpTimedRefDev
**
ppStaticPointerOn
Me
);
ImpTimedRefDev
(
scoped_timed_RefDev
&
rOwnerof
Me
);
~
ImpTimedRefDev
();
virtual
void
Timeout
();
...
...
@@ -58,8 +79,8 @@ namespace
void
releaseVirtualDevice
();
};
ImpTimedRefDev
::
ImpTimedRefDev
(
ImpTimedRefDev
**
ppStaticPointerOn
Me
)
:
m
ppStaticPointerOnMe
(
ppStaticPointerOn
Me
),
ImpTimedRefDev
::
ImpTimedRefDev
(
scoped_timed_RefDev
&
rOwnerOf
Me
)
:
m
rOwnerOfMe
(
rOwnerOf
Me
),
mpVirDev
(
0L
),
mnUseCount
(
0L
)
{
...
...
@@ -70,22 +91,13 @@ namespace
ImpTimedRefDev
::~
ImpTimedRefDev
()
{
OSL_ENSURE
(
0L
==
mnUseCount
,
"destruction of a still used ImpTimedRefDev (!)"
);
if
(
mppStaticPointerOnMe
&&
*
mppStaticPointerOnMe
)
{
*
mppStaticPointerOnMe
=
0L
;
}
if
(
mpVirDev
)
{
delete
mpVirDev
;
}
delete
mpVirDev
;
}
void
ImpTimedRefDev
::
Timeout
()
{
// for obvious reasons, do not call anything after this
delete
(
this
);
mrOwnerOfMe
.
reset
(
);
}
VirtualDevice
&
ImpTimedRefDev
::
acquireVirtualDevice
()
...
...
@@ -125,24 +137,23 @@ namespace drawinglayer
{
namespace
primitive2d
{
// static pointer here
static
ImpTimedRefDev
*
pImpGlobalRefDev
=
0L
;
// static methods here
VirtualDevice
&
acquireGlobalVirtualDevice
()
{
if
(
!
pImpGlobalRefDev
)
{
pImpGlobalRefDev
=
new
ImpTimedRefDev
(
&
pImpGlobalRefDev
);
}
scoped_timed_RefDev
&
rStdRefDevice
=
the_scoped_timed_RefDev
::
get
();
return
pImpGlobalRefDev
->
acquireVirtualDevice
();
if
(
!
rStdRefDevice
)
rStdRefDevice
.
reset
(
new
ImpTimedRefDev
(
rStdRefDevice
));
return
rStdRefDevice
->
acquireVirtualDevice
();
}
void
releaseGlobalVirtualDevice
()
{
OSL_ENSURE
(
pImpGlobalRefDev
,
"releaseGlobalVirtualDevice() without prior acquireGlobalVirtualDevice() call(!)"
);
pImpGlobalRefDev
->
releaseVirtualDevice
();
scoped_timed_RefDev
&
rStdRefDevice
=
the_scoped_timed_RefDev
::
get
();
OSL_ENSURE
(
rStdRefDevice
,
"releaseGlobalVirtualDevice() without prior acquireGlobalVirtualDevice() call(!)"
);
rStdRefDevice
->
releaseVirtualDevice
();
}
TextLayouterDevice
::
TextLayouterDevice
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment