summaryrefslogtreecommitdiffstats
path: root/cui
diff options
context:
space:
mode:
authorJan Holesovsky <kendy@suse.cz>2012-07-13 15:36:28 +0200
committerCaolán McNamara <caolanm@redhat.com>2012-07-13 20:34:31 +0100
commit1d5c3861ba788042eecef7610f58956cdf56cb83 (patch)
tree3e1eaec1830d87014411a17f1bebc006c632547b /cui
parentfix a crash with empty string (diff)
downloadcore-1d5c3861ba788042eecef7610f58956cdf56cb83.tar.gz
core-1d5c3861ba788042eecef7610f58956cdf56cb83.zip
Fix the About dialog rendering when librsvg is not available / functional.
Change-Id: Ib460f3cbf44114ef74065168b218daca51f2f0e9 (cherry picked from commit debfb21c927e39ab18aafb1895f343840967e16a) Signed-off-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'cui')
-rw-r--r--cui/source/dialogs/about.cxx21
-rw-r--r--cui/source/dialogs/about.src3
2 files changed, 13 insertions, 11 deletions
diff --git a/cui/source/dialogs/about.cxx b/cui/source/dialogs/about.cxx
index 21e4592376bb..eff0e6bdf458 100644
--- a/cui/source/dialogs/about.cxx
+++ b/cui/source/dialogs/about.cxx
@@ -73,7 +73,7 @@ AboutDialog::AboutDialog( Window* pParent, const ResId& rId) :
aDescriptionText ( this, ResId( ABOUT_DESCRIPTION_TEXT, *rId.GetResMgr() ) ),
aCopyrightText ( this, ResId( ABOUT_COPYRIGHT_TEXT, *rId.GetResMgr() ) ),
aCopyrightTextShadow ( this, ResId( ABOUT_COPYRIGHT_TEXT, *rId.GetResMgr() ) ),
- aLogoImage ( this, ResId( ABOUT_IMAGE_LOGO, *rId.GetResMgr() ) ),
+ aLogoImage ( this ),
aCreditsButton ( this, ResId( ABOUT_BTN_CREDITS, *rId.GetResMgr() ) ),
aWebsiteButton ( this, ResId( ABOUT_BTN_WEBSITE, *rId.GetResMgr() ) ),
aCancelButton ( this, ResId( ABOUT_BTN_CANCEL, *rId.GetResMgr() ) ),
@@ -213,15 +213,20 @@ void AboutDialog::LayoutControls()
Size aDialogSize ( aIdealTextWidth + aDialogBorder * 2, 0);
// Render and Position Logo
+ Size aLogoSize( aIdealTextWidth, aIdealTextWidth / 20 );
+ Point aLogoPos( aDialogBorder, aDialogBorder );
+
vcl::RenderGraphicRasterizer aRasterizerLogo = Application::LoadBrandSVG("flat_logo");
- float aLogoWidthHeightRatio = (float)aRasterizerLogo.GetDefaultSizePixel().Width() /
- (float)aRasterizerLogo.GetDefaultSizePixel().Height();
+ if ( !aRasterizerLogo.GetRenderGraphic().IsEmpty() &&
+ aRasterizerLogo.GetDefaultSizePixel().Width() > 0 && aRasterizerLogo.GetDefaultSizePixel().Height() > 0 )
+ {
+ const float aLogoWidthHeightRatio = (float)aRasterizerLogo.GetDefaultSizePixel().Width() / (float)aRasterizerLogo.GetDefaultSizePixel().Height();
+ aLogoSize = Size( aIdealTextWidth, aIdealTextWidth / aLogoWidthHeightRatio );
- Size aLogoSize( aIdealTextWidth, aIdealTextWidth / aLogoWidthHeightRatio );
- Point aLogoPos( aDialogBorder, aDialogBorder );
- aLogoBitmap = aRasterizerLogo.Rasterize( aLogoSize );
- aLogoImage.SetImage( Image( aLogoBitmap ) );
- aLogoImage.SetPosSizePixel( aLogoPos, aLogoSize );
+ aLogoBitmap = aRasterizerLogo.Rasterize( aLogoSize );
+ aLogoImage.SetImage( Image( aLogoBitmap ) );
+ aLogoImage.SetPosSizePixel( aLogoPos, aLogoSize );
+ }
// Position version text
sal_Int32 aLogoVersionSpacing = aLogoSize.Height() * 0.15;
diff --git a/cui/source/dialogs/about.src b/cui/source/dialogs/about.src
index ab853c665a46..37938644f83a 100644
--- a/cui/source/dialogs/about.src
+++ b/cui/source/dialogs/about.src
@@ -114,7 +114,4 @@ ModalDialog RID_DEFAULTABOUT
DefButton = TRUE ;
Text [ en-US ] = "~Close";
};
- FixedImage ABOUT_IMAGE_LOGO
- {
- };
};