diff options
author | Hans-Joachim Lankenau <hjs@openoffice.org> | 2004-06-25 16:09:38 +0000 |
---|---|---|
committer | Hans-Joachim Lankenau <hjs@openoffice.org> | 2004-06-25 16:09:38 +0000 |
commit | 028b94cd6c4efc763a189efe55d45dbb9451cb3d (patch) | |
tree | be4fcea98cd00f4cd5f6d571155e3d44bcf2a92d /vcl/source/window/split.cxx | |
parent | 7f7fa9133e2250bc8868eb43c1cafccd1bd8db34 (diff) |
INTEGRATION: CWS tune04 (1.11.94); FILE MERGED
2004/06/10 15:29:59 cmc 1.11.94.1: #i29636# turn global objects into local static data protected with swishy double-locked templated template
Diffstat (limited to 'vcl/source/window/split.cxx')
-rw-r--r-- | vcl/source/window/split.cxx | 39 |
1 files changed, 31 insertions, 8 deletions
diff --git a/vcl/source/window/split.cxx b/vcl/source/window/split.cxx index cfb258ad918b..52ad538f68fa 100644 --- a/vcl/source/window/split.cxx +++ b/vcl/source/window/split.cxx @@ -3,9 +3,9 @@ * * $RCSfile: split.cxx,v $ * - * $Revision: 1.11 $ + * $Revision: 1.12 $ * - * last change: $Author: hr $ $Date: 2004-02-03 11:54:27 $ + * last change: $Author: hjs $ $Date: 2004-06-25 17:09:38 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -89,10 +89,33 @@ #ifndef _SV_LINEINFO_HXX #include <lineinfo.hxx> #endif +#ifndef INCLUDED_RTL_INSTANCE_HXX +#include <rtl/instance.hxx> +#endif + +namespace +{ + struct BlackInstance + { + Wallpaper * operator ()() + { + static Wallpaper instance(COL_BLACK); + return &instance; + } + }; + struct WhiteInstance + { + Wallpaper * operator ()() + { + static Wallpaper instance(COL_LIGHTGRAY); + return &instance; + } + }; -static Wallpaper ImplBlackWall( COL_BLACK ); -static Wallpaper ImplWhiteWall( COL_LIGHTGRAY ); + struct ImplBlackWall : public rtl::Static< Wallpaper, ImplBlackWall, BlackInstance > {}; + struct ImplWhiteWall : public rtl::Static< Wallpaper, ImplWhiteWall, WhiteInstance > {}; +} // ======================================================================= @@ -139,9 +162,9 @@ void Splitter::ImplInit( Window* pParent, WinBits nWinStyle ) SetPointer( Pointer( ePointerStyle ) ); if( GetSettings().GetStyleSettings().GetFaceColor().IsDark() ) - SetBackground( ImplWhiteWall ); + SetBackground( ImplWhiteWall::get() ); else - SetBackground( ImplBlackWall ); + SetBackground( ImplBlackWall::get() ); TaskPaneList *pTList = GetSystemWindow()->GetTaskPaneList(); pTList->AddWindow( this ); @@ -774,9 +797,9 @@ void Splitter::DataChanged( const DataChangedEvent& rDCEvt ) if( oldFaceColor.IsDark() != newFaceColor.IsDark() ) { if( newFaceColor.IsDark() ) - SetBackground( ImplWhiteWall ); + SetBackground( ImplWhiteWall::get() ); else - SetBackground( ImplBlackWall ); + SetBackground( ImplBlackWall::get() ); } } } |