diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-11-22 11:26:08 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-11-22 11:54:12 +0100 |
commit | 1ae61b0ac4187b2938647f3ca0289a070a5dc7d2 (patch) | |
tree | 9461c0532919f4fe61f3e0e3fa8556e954244fbd /svtools/source/contnr/ivctrl.cxx | |
parent | 04bb9549e0a0ee567f3bd48a7707286c5abd631a (diff) |
loplugin:flatten in svtools
almost completely automatically rewritten, only had to tweak
the indentation on a couple of lines.
Change-Id: Ieec92e5b602d180d7ec556e3421ce3c835c1f646
Reviewed-on: https://gerrit.libreoffice.org/45072
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'svtools/source/contnr/ivctrl.cxx')
-rw-r--r-- | svtools/source/contnr/ivctrl.cxx | 80 |
1 files changed, 40 insertions, 40 deletions
diff --git a/svtools/source/contnr/ivctrl.cxx b/svtools/source/contnr/ivctrl.cxx index 31310df0313b..247442ce9165 100644 --- a/svtools/source/contnr/ivctrl.cxx +++ b/svtools/source/contnr/ivctrl.cxx @@ -330,54 +330,54 @@ void SvtIconChoiceCtrl::DataChanged( const DataChangedEvent& rDCEvt ) void SvtIconChoiceCtrl::SetBackground( const Wallpaper& rPaper ) { - if( rPaper != GetBackground() ) + if( rPaper == GetBackground() ) + return; + + const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings(); + // if it is the default (empty) wallpaper + if( rPaper.GetStyle() == WallpaperStyle::NONE && rPaper.GetColor() == COL_TRANSPARENT && + !rPaper.IsBitmap() && !rPaper.IsGradient() && !rPaper.IsRect()) { - const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings(); - // if it is the default (empty) wallpaper - if( rPaper.GetStyle() == WallpaperStyle::NONE && rPaper.GetColor() == COL_TRANSPARENT && - !rPaper.IsBitmap() && !rPaper.IsGradient() && !rPaper.IsRect()) + Control::SetBackground( rStyleSettings.GetFieldColor() ); + } + else + { + Wallpaper aBackground( rPaper ); + // HACK, as background might be transparent! + if( !aBackground.IsBitmap() ) + aBackground.SetStyle( WallpaperStyle::Tile ); + + WallpaperStyle eStyle = aBackground.GetStyle(); + Color aBack( aBackground.GetColor()); + Color aTrans( COL_TRANSPARENT ); + if( aBack == aTrans && + (!aBackground.IsBitmap() || + aBackground.GetBitmap().IsTransparent() || + (eStyle != WallpaperStyle::Tile && eStyle != WallpaperStyle::Scale)) ) { - Control::SetBackground( rStyleSettings.GetFieldColor() ); + aBackground.SetColor( rStyleSettings.GetFieldColor() ); + } + if( aBackground.IsScrollable() ) + { + tools::Rectangle aRect; + aRect.SetSize( Size(32765, 32765) ); + aBackground.SetRect( aRect ); } else { - Wallpaper aBackground( rPaper ); - // HACK, as background might be transparent! - if( !aBackground.IsBitmap() ) - aBackground.SetStyle( WallpaperStyle::Tile ); - - WallpaperStyle eStyle = aBackground.GetStyle(); - Color aBack( aBackground.GetColor()); - Color aTrans( COL_TRANSPARENT ); - if( aBack == aTrans && - (!aBackground.IsBitmap() || - aBackground.GetBitmap().IsTransparent() || - (eStyle != WallpaperStyle::Tile && eStyle != WallpaperStyle::Scale)) ) - { - aBackground.SetColor( rStyleSettings.GetFieldColor() ); - } - if( aBackground.IsScrollable() ) - { - tools::Rectangle aRect; - aRect.SetSize( Size(32765, 32765) ); - aBackground.SetRect( aRect ); - } - else - { - tools::Rectangle aRect( _pImpl->GetOutputRect() ); - aBackground.SetRect( aRect ); - } - Control::SetBackground( aBackground ); + tools::Rectangle aRect( _pImpl->GetOutputRect() ); + aBackground.SetRect( aRect ); } + Control::SetBackground( aBackground ); + } - // If text colors are attributed "hard," don't use automatism to select - // a readable text color. - vcl::Font aFont( GetFont() ); - aFont.SetColor( rStyleSettings.GetFieldTextColor() ); - SetFont( aFont ); + // If text colors are attributed "hard," don't use automatism to select + // a readable text color. + vcl::Font aFont( GetFont() ); + aFont.SetColor( rStyleSettings.GetFieldTextColor() ); + SetFont( aFont ); - Invalidate(InvalidateFlags::NoChildren); - } + Invalidate(InvalidateFlags::NoChildren); } void SvtIconChoiceCtrl::RequestHelp( const HelpEvent& rHEvt ) |