summaryrefslogtreecommitdiff
path: root/vcl/source
diff options
context:
space:
mode:
authorJan Holesovsky <kendy@suse.cz>2013-01-04 21:07:57 +0100
committerPetr Mladek <pmladek@suse.cz>2013-01-08 16:12:46 +0100
commitcece3121947fe7fe01707f73a4aaaa6ddcde1761 (patch)
tree644247d8fe0d289b8826dfcbf6ae5f69a37df2cc /vcl/source
parent26badd06cddc8e990b95eee4c0077b84e8200484 (diff)
Personas: Fix copy constructor + always reference the Application settings
...to avoid reading the bitmaps more than once. Change-Id: I7577f5df96a5a28f1ac1f800867af5eee298663e Signed-off-by: Cor Nouws <oolst@nouenoff.nl> Signed-off-by: Olivier Hallot <olivier.hallot@documentfoundation.org> Signed-off-by: Adolfo Jayme Barrientos <fitoschido@ubuntu.com> Signed-off-by: Michael Meeks <michael.meeks@suse.com>
Diffstat (limited to 'vcl/source')
-rw-r--r--vcl/source/app/settings.cxx4
-rw-r--r--vcl/source/window/dockingarea.cxx4
-rw-r--r--vcl/source/window/menu.cxx8
3 files changed, 8 insertions, 8 deletions
diff --git a/vcl/source/app/settings.cxx b/vcl/source/app/settings.cxx
index abaff95fb5b7..17d523db7513 100644
--- a/vcl/source/app/settings.cxx
+++ b/vcl/source/app/settings.cxx
@@ -305,8 +305,8 @@ ImplStyleData::ImplStyleData( const ImplStyleData& rData ) :
maDialogStyle( rData.maDialogStyle ),
maFrameStyle( rData.maFrameStyle ),
maPersonaHeaderFooter( rData.maPersonaHeaderFooter ),
- mpPersonaHeaderBitmap( NULL ),
- mpPersonaFooterBitmap( NULL )
+ mpPersonaHeaderBitmap( rData.mpPersonaHeaderBitmap? new BitmapEx( *rData.mpPersonaHeaderBitmap ): NULL ),
+ mpPersonaFooterBitmap( rData.mpPersonaFooterBitmap? new BitmapEx( *rData.mpPersonaFooterBitmap ): NULL )
{
mnRefCount = 1;
mnBorderSize = rData.mnBorderSize;
diff --git a/vcl/source/window/dockingarea.cxx b/vcl/source/window/dockingarea.cxx
index 81f67db697b0..7d97dd9c8fa2 100644
--- a/vcl/source/window/dockingarea.cxx
+++ b/vcl/source/window/dockingarea.cxx
@@ -50,7 +50,7 @@ DockingAreaWindow::ImplData::~ImplData()
static void ImplInitBackground( DockingAreaWindow* pThis )
{
- const BitmapEx* pPersonaBitmap = pThis->GetSettings().GetStyleSettings().GetPersonaHeader();
+ const BitmapEx* pPersonaBitmap = Application::GetSettings().GetStyleSettings().GetPersonaHeader();
if ( pPersonaBitmap != NULL && pThis->GetAlign() == WINDOWALIGN_TOP )
{
Wallpaper aWallpaper( *pPersonaBitmap );
@@ -174,7 +174,7 @@ void DockingAreaWindow::Paint( const Rectangle& )
}
ControlState nState = CTRL_STATE_ENABLED;
- if ( GetAlign() == WINDOWALIGN_TOP && GetSettings().GetStyleSettings().GetPersonaHeader() )
+ if ( GetAlign() == WINDOWALIGN_TOP && Application::GetSettings().GetStyleSettings().GetPersonaHeader() )
Erase();
else if ( !ImplGetSVData()->maNWFData.mbDockingAreaSeparateTB )
{
diff --git a/vcl/source/window/menu.cxx b/vcl/source/window/menu.cxx
index 64fe254e929c..5fe08d186b06 100644
--- a/vcl/source/window/menu.cxx
+++ b/vcl/source/window/menu.cxx
@@ -3856,7 +3856,7 @@ static void ImplInitMenuWindow( Window* pWin, sal_Bool bFont, sal_Bool bMenuBar
pWin->SetPointFont( rStyleSettings.GetMenuFont() );
if( bMenuBar )
{
- const BitmapEx* pPersonaBitmap = rStyleSettings.GetPersonaHeader();
+ const BitmapEx* pPersonaBitmap = Application::GetSettings().GetStyleSettings().GetPersonaHeader();
if ( pPersonaBitmap != NULL )
{
Wallpaper aWallpaper( *pPersonaBitmap );
@@ -5503,7 +5503,7 @@ void MenuBarWindow::HighlightItem( sal_uInt16 nPos, sal_Bool bHighlight )
MenubarValue aControlValue;
aControlValue.maTopDockingAreaHeight = ImplGetTopDockingAreaHeight( this );
- if ( GetSettings().GetStyleSettings().GetPersonaHeader() )
+ if ( Application::GetSettings().GetStyleSettings().GetPersonaHeader() )
Erase();
else
{
@@ -5539,7 +5539,7 @@ void MenuBarWindow::HighlightItem( sal_uInt16 nPos, sal_Bool bHighlight )
MenubarValue aMenubarValue;
aMenubarValue.maTopDockingAreaHeight = ImplGetTopDockingAreaHeight( this );
- if ( GetSettings().GetStyleSettings().GetPersonaHeader() )
+ if ( Application::GetSettings().GetStyleSettings().GetPersonaHeader() )
Erase( aRect );
else
{
@@ -5775,7 +5775,7 @@ void MenuBarWindow::Paint( const Rectangle& )
MenubarValue aMenubarValue;
aMenubarValue.maTopDockingAreaHeight = ImplGetTopDockingAreaHeight( this );
- if ( GetSettings().GetStyleSettings().GetPersonaHeader() )
+ if ( Application::GetSettings().GetStyleSettings().GetPersonaHeader() )
Erase();
else
{