[Libreoffice-commits] core.git: drawinglayer/source
Tomaž Vajngerl (via logerrit)
logerrit at kemper.freedesktop.org
Mon Nov 23 07:31:17 UTC 2020
drawinglayer/source/primitive2d/textlayoutdevice.cxx | 18 ++++++++----------
1 file changed, 8 insertions(+), 10 deletions(-)
New commits:
commit e4ee7fed48c540a857c49d2e32384981c9275083
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
AuthorDate: Sun Oct 18 21:59:15 2020 +0200
Commit: Tomaž Vajngerl <quikee at gmail.com>
CommitDate: Mon Nov 23 08:30:33 2020 +0100
simplify namespaces and clean-up for TextLayouterDevice
Move anonymous namespace into drawinglayer::primitive2d and convert
static function into anonymous functions.
Change-Id: Id8ff161a5ec69154f053fadd1178265fa2675139
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106383
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee at gmail.com>
diff --git a/drawinglayer/source/primitive2d/textlayoutdevice.cxx b/drawinglayer/source/primitive2d/textlayoutdevice.cxx
index c842517b3e72..933476b2045a 100644
--- a/drawinglayer/source/primitive2d/textlayoutdevice.cxx
+++ b/drawinglayer/source/primitive2d/textlayoutdevice.cxx
@@ -36,12 +36,14 @@
#include <i18nlangtag/languagetag.hxx>
#include <vcl/svapp.hxx>
-// VDev RevDevice provider
-
+namespace drawinglayer::primitive2d
+{
namespace
{
class ImpTimedRefDev;
+// VDev RevDevice provider
+
//the scoped_timed_RefDev owns an ImpTimeRefDev and releases it on dtor
//or disposing of the default XComponentContext which causes the underlying
//OutputDevice to get released
@@ -130,14 +132,8 @@ void ImpTimedRefDev::releaseVirtualDevice()
Start();
}
}
-} // end of anonymous namespace
-
-// access to one global ImpTimedRefDev incarnation in namespace drawinglayer::primitive
-namespace drawinglayer::primitive2d
-{
-// static methods here
-static VirtualDevice& acquireGlobalVirtualDevice()
+VirtualDevice& acquireGlobalVirtualDevice()
{
scoped_timed_RefDev& rStdRefDevice = the_scoped_timed_RefDev::get();
@@ -147,7 +143,7 @@ static VirtualDevice& acquireGlobalVirtualDevice()
return rStdRefDevice->acquireVirtualDevice();
}
-static void releaseGlobalVirtualDevice()
+void releaseGlobalVirtualDevice()
{
scoped_timed_RefDev& rStdRefDevice = the_scoped_timed_RefDev::get();
@@ -156,6 +152,8 @@ static void releaseGlobalVirtualDevice()
rStdRefDevice->releaseVirtualDevice();
}
+} // end of anonymous namespace
+
TextLayouterDevice::TextLayouterDevice()
: maSolarGuard()
, mrDevice(acquireGlobalVirtualDevice())
More information about the Libreoffice-commits
mailing list