12ee96f1cSAndrew Rist /************************************************************** 2cdf0e10cSrcweir * 32ee96f1cSAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 42ee96f1cSAndrew Rist * or more contributor license agreements. See the NOTICE file 52ee96f1cSAndrew Rist * distributed with this work for additional information 62ee96f1cSAndrew Rist * regarding copyright ownership. The ASF licenses this file 72ee96f1cSAndrew Rist * to you under the Apache License, Version 2.0 (the 82ee96f1cSAndrew Rist * "License"); you may not use this file except in compliance 92ee96f1cSAndrew Rist * with the License. You may obtain a copy of the License at 10cdf0e10cSrcweir * 112ee96f1cSAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12cdf0e10cSrcweir * 132ee96f1cSAndrew Rist * Unless required by applicable law or agreed to in writing, 142ee96f1cSAndrew Rist * software distributed under the License is distributed on an 152ee96f1cSAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 162ee96f1cSAndrew Rist * KIND, either express or implied. See the License for the 172ee96f1cSAndrew Rist * specific language governing permissions and limitations 182ee96f1cSAndrew Rist * under the License. 19cdf0e10cSrcweir * 202ee96f1cSAndrew Rist *************************************************************/ 212ee96f1cSAndrew Rist 222ee96f1cSAndrew Rist 23cdf0e10cSrcweir 24cdf0e10cSrcweir // MARKER(update_precomp.py): autogen include statement, do not remove 25cdf0e10cSrcweir #include "precompiled_cui.hxx" 26cdf0e10cSrcweir 27cdf0e10cSrcweir // include --------------------------------------------------------------- 28cdf0e10cSrcweir 29cdf0e10cSrcweir #include <vcl/svapp.hxx> 30cdf0e10cSrcweir #include <vcl/msgbox.hxx> 31cdf0e10cSrcweir #include <tools/stream.hxx> 32cdf0e10cSrcweir #include <tools/urlobj.hxx> 33cdf0e10cSrcweir #include <rtl/bootstrap.hxx> 34cdf0e10cSrcweir #include <unotools/configmgr.hxx> 35cdf0e10cSrcweir #include <unotools/bootstrap.hxx> 36cdf0e10cSrcweir #include <com/sun/star/uno/Any.h> 37cdf0e10cSrcweir #include <vcl/graph.hxx> 38cdf0e10cSrcweir #include <svtools/filter.hxx> 39cdf0e10cSrcweir #include <sfx2/sfxuno.hxx> 40cdf0e10cSrcweir #include "about.hxx" 41cdf0e10cSrcweir #include <sfx2/sfxdefs.hxx> 42cdf0e10cSrcweir #include <sfx2/app.hxx> 43cdf0e10cSrcweir #include <sfx2/sfxcommands.h> 44cdf0e10cSrcweir #include "about.hrc" 45cdf0e10cSrcweir #include <dialmgr.hxx> 46cdf0e10cSrcweir #include <svtools/svtools.hrc> 47cdf0e10cSrcweir 48*23c0a6f8SAriel Constenla-Haile #include <comphelper/processfactory.hxx> 49*23c0a6f8SAriel Constenla-Haile #include <com/sun/star/system/XSystemShellExecute.hpp> 50*23c0a6f8SAriel Constenla-Haile #include <com/sun/star/system/SystemShellExecuteFlags.hpp> 51*23c0a6f8SAriel Constenla-Haile 52cdf0e10cSrcweir // defines --------------------------------------------------------------- 53cdf0e10cSrcweir 54a392ac37SAriel Constenla-Haile #define _STRINGIFY(x) #x 55a392ac37SAriel Constenla-Haile #define STRINGIFY(x) _STRINGIFY(x) 56cdf0e10cSrcweir 57*23c0a6f8SAriel Constenla-Haile // ----------------------------------------------------------------------- 58cdf0e10cSrcweir 59*23c0a6f8SAriel Constenla-Haile static void layoutFixedText( FixedText &rControl, const Point& aPos, Size &aSize, const long nTextWidth ) 60a392ac37SAriel Constenla-Haile { 61*23c0a6f8SAriel Constenla-Haile aSize = rControl.GetSizePixel(); 62*23c0a6f8SAriel Constenla-Haile // change the width 63*23c0a6f8SAriel Constenla-Haile aSize.Width() = nTextWidth; 64*23c0a6f8SAriel Constenla-Haile // set Position and Size, to calculate the minimum size 65*23c0a6f8SAriel Constenla-Haile // this will update the Height 66*23c0a6f8SAriel Constenla-Haile rControl.SetPosSizePixel( aPos, aSize ); 67*23c0a6f8SAriel Constenla-Haile aSize = rControl.CalcMinimumSize(); 68*23c0a6f8SAriel Constenla-Haile // update the size with the right Height 69*23c0a6f8SAriel Constenla-Haile rControl.SetSizePixel( aSize ); 70a392ac37SAriel Constenla-Haile } 71cdf0e10cSrcweir 72*23c0a6f8SAriel Constenla-Haile static void layoutEdit( Edit &rControl, const Point& aPos, Size &aSize, const long nTextWidth ) 73*23c0a6f8SAriel Constenla-Haile { 74*23c0a6f8SAriel Constenla-Haile aSize = rControl.GetSizePixel(); 75*23c0a6f8SAriel Constenla-Haile // change the width 76*23c0a6f8SAriel Constenla-Haile aSize.Width() = nTextWidth; 77*23c0a6f8SAriel Constenla-Haile // set Position and Size, to calculate the minimum size 78*23c0a6f8SAriel Constenla-Haile // this will update the Height 79*23c0a6f8SAriel Constenla-Haile rControl.SetPosSizePixel( aPos, aSize ); 80*23c0a6f8SAriel Constenla-Haile aSize = rControl.CalcMinimumSize(); 81*23c0a6f8SAriel Constenla-Haile // update the size with the right Height 82*23c0a6f8SAriel Constenla-Haile rControl.SetSizePixel( aSize ); 83*23c0a6f8SAriel Constenla-Haile } 84cdf0e10cSrcweir 85*23c0a6f8SAriel Constenla-Haile // ----------------------------------------------------------------------- 86cdf0e10cSrcweir 87*23c0a6f8SAriel Constenla-Haile AboutDialog::AboutDialog( Window* pParent, const ResId& rId ) : 88*23c0a6f8SAriel Constenla-Haile SfxModalDialog( pParent, rId ), 89*23c0a6f8SAriel Constenla-Haile maOKButton( this, ResId( RID_CUI_ABOUT_BTN_OK, *rId.GetResMgr() ) ), 90*23c0a6f8SAriel Constenla-Haile maVersionText( this, ResId( RID_CUI_ABOUT_FTXT_VERSION, *rId.GetResMgr() ) ), 91*23c0a6f8SAriel Constenla-Haile maBuildInfoEdit( this, ResId( RID_CUI_ABOUT_FTXT_BUILDDATA, *rId.GetResMgr() ) ), 92*23c0a6f8SAriel Constenla-Haile maCopyrightEdit( this, ResId( RID_CUI_ABOUT_FTXT_COPYRIGHT, *rId.GetResMgr() ) ), 93*23c0a6f8SAriel Constenla-Haile maCreditsLink( this, ResId( RID_CUI_ABOUT_FTXT_WELCOME_LINK, *rId.GetResMgr() ) ), 94*23c0a6f8SAriel Constenla-Haile maCopyrightTextStr( ResId( RID_CUI_ABOUT_STR_COPYRIGHT, *rId.GetResMgr() ) ) 95*23c0a6f8SAriel Constenla-Haile { 96*23c0a6f8SAriel Constenla-Haile // load image from module path 97*23c0a6f8SAriel Constenla-Haile maAppLogo = SfxApplication::GetApplicationLogo(); 98cdf0e10cSrcweir 99*23c0a6f8SAriel Constenla-Haile InitControls(); 100cdf0e10cSrcweir 101*23c0a6f8SAriel Constenla-Haile // set links 102*23c0a6f8SAriel Constenla-Haile maCreditsLink.SetClickHdl( LINK( this, AboutDialog, OpenLinkHdl_Impl ) ); 103cdf0e10cSrcweir 104cdf0e10cSrcweir FreeResource(); 105cdf0e10cSrcweir 106cdf0e10cSrcweir SetHelpId( CMD_SID_ABOUT ); 107cdf0e10cSrcweir } 108cdf0e10cSrcweir 109cdf0e10cSrcweir // ----------------------------------------------------------------------- 110cdf0e10cSrcweir 111cdf0e10cSrcweir AboutDialog::~AboutDialog() 112cdf0e10cSrcweir { 113cdf0e10cSrcweir } 114cdf0e10cSrcweir 115cdf0e10cSrcweir // ----------------------------------------------------------------------- 116cdf0e10cSrcweir 117*23c0a6f8SAriel Constenla-Haile void AboutDialog::InitControls() 118cdf0e10cSrcweir { 119*23c0a6f8SAriel Constenla-Haile // apply font, background et al. 120*23c0a6f8SAriel Constenla-Haile ApplyStyleSettings(); 121*23c0a6f8SAriel Constenla-Haile 122*23c0a6f8SAriel Constenla-Haile // set strings 123*23c0a6f8SAriel Constenla-Haile maCopyrightEdit.SetText( maCopyrightTextStr ); 124*23c0a6f8SAriel Constenla-Haile maBuildInfoEdit.SetText( GetBuildVersionString() ); 125*23c0a6f8SAriel Constenla-Haile maCreditsLink.SetURL( maCreditsLink.GetText() ); 126*23c0a6f8SAriel Constenla-Haile 127*23c0a6f8SAriel Constenla-Haile // determine size and position of the dialog & elements 128*23c0a6f8SAriel Constenla-Haile Size aDlgSize; 129*23c0a6f8SAriel Constenla-Haile LayoutControls( aDlgSize ); 130*23c0a6f8SAriel Constenla-Haile 131*23c0a6f8SAriel Constenla-Haile // Change the width of the dialog 132*23c0a6f8SAriel Constenla-Haile SetOutputSizePixel( aDlgSize ); 133cdf0e10cSrcweir } 134cdf0e10cSrcweir 135cdf0e10cSrcweir // ----------------------------------------------------------------------- 136cdf0e10cSrcweir 137*23c0a6f8SAriel Constenla-Haile void AboutDialog::ApplyStyleSettings() 138cdf0e10cSrcweir { 139*23c0a6f8SAriel Constenla-Haile // Transparenter Font 140*23c0a6f8SAriel Constenla-Haile Font aFont = GetFont(); 141*23c0a6f8SAriel Constenla-Haile aFont.SetTransparent( sal_True ); 142*23c0a6f8SAriel Constenla-Haile SetFont( aFont ); 143*23c0a6f8SAriel Constenla-Haile 144*23c0a6f8SAriel Constenla-Haile // set for background and text the correct system color 145*23c0a6f8SAriel Constenla-Haile const StyleSettings& rSettings = GetSettings().GetStyleSettings(); 146*23c0a6f8SAriel Constenla-Haile Color aWhiteCol( rSettings.GetWindowColor() ); 147*23c0a6f8SAriel Constenla-Haile Wallpaper aWall( aWhiteCol ); 148*23c0a6f8SAriel Constenla-Haile SetBackground( aWall ); 149*23c0a6f8SAriel Constenla-Haile Font aNewFont( maCopyrightEdit.GetFont() ); 150*23c0a6f8SAriel Constenla-Haile aNewFont.SetTransparent( sal_True ); 151*23c0a6f8SAriel Constenla-Haile 152*23c0a6f8SAriel Constenla-Haile maVersionText.SetFont( aNewFont ); 153*23c0a6f8SAriel Constenla-Haile maCopyrightEdit.SetFont( aNewFont ); 154*23c0a6f8SAriel Constenla-Haile 155*23c0a6f8SAriel Constenla-Haile maVersionText.SetBackground(); 156*23c0a6f8SAriel Constenla-Haile maCopyrightEdit.SetBackground(); 157*23c0a6f8SAriel Constenla-Haile maBuildInfoEdit.SetBackground(); 158*23c0a6f8SAriel Constenla-Haile maCreditsLink.SetBackground(); 159*23c0a6f8SAriel Constenla-Haile 160*23c0a6f8SAriel Constenla-Haile Color aTextColor( rSettings.GetWindowTextColor() ); 161*23c0a6f8SAriel Constenla-Haile maVersionText.SetControlForeground( aTextColor ); 162*23c0a6f8SAriel Constenla-Haile maCopyrightEdit.SetControlForeground( aTextColor ); 163*23c0a6f8SAriel Constenla-Haile maBuildInfoEdit.SetControlForeground( aTextColor ); 164*23c0a6f8SAriel Constenla-Haile maCreditsLink.SetControlForeground(); 165*23c0a6f8SAriel Constenla-Haile 166*23c0a6f8SAriel Constenla-Haile Size aSmaller = aNewFont.GetSize(); 167*23c0a6f8SAriel Constenla-Haile aSmaller.Width() = (long) (aSmaller.Width() * 0.75); 168*23c0a6f8SAriel Constenla-Haile aSmaller.Height() = (long) (aSmaller.Height() * 0.75); 169*23c0a6f8SAriel Constenla-Haile aNewFont.SetSize( aSmaller ); 170*23c0a6f8SAriel Constenla-Haile 171*23c0a6f8SAriel Constenla-Haile maBuildInfoEdit.SetFont( aNewFont ); 172*23c0a6f8SAriel Constenla-Haile 173*23c0a6f8SAriel Constenla-Haile // the following is a hack to force the MultiLineEdit update its settings 174*23c0a6f8SAriel Constenla-Haile // in order to reflect the Font 175*23c0a6f8SAriel Constenla-Haile // See 176*23c0a6f8SAriel Constenla-Haile // Window::SetControlFont 177*23c0a6f8SAriel Constenla-Haile // MultiLineEdit::StateChanged 178*23c0a6f8SAriel Constenla-Haile // MultiLineEdit::ImplInitSettings 179*23c0a6f8SAriel Constenla-Haile // TODO Override SetFont in MultiLineEdit and do the following, 180*23c0a6f8SAriel Constenla-Haile // otherwise SetFont has no effect at all! 181*23c0a6f8SAriel Constenla-Haile aSmaller = PixelToLogic( aSmaller, MAP_POINT ); 182*23c0a6f8SAriel Constenla-Haile aNewFont.SetSize( aSmaller ); 183*23c0a6f8SAriel Constenla-Haile maBuildInfoEdit.SetControlFont( aNewFont ); 184*23c0a6f8SAriel Constenla-Haile } 185*23c0a6f8SAriel Constenla-Haile 186*23c0a6f8SAriel Constenla-Haile // ----------------------------------------------------------------------- 187*23c0a6f8SAriel Constenla-Haile 188*23c0a6f8SAriel Constenla-Haile void AboutDialog::LayoutControls( Size& aDlgSize ) 189*23c0a6f8SAriel Constenla-Haile { 190*23c0a6f8SAriel Constenla-Haile Size aAppLogoSiz = maAppLogo.GetSizePixel(); 191*23c0a6f8SAriel Constenla-Haile 192*23c0a6f8SAriel Constenla-Haile aDlgSize = GetOutputSizePixel(); 193*23c0a6f8SAriel Constenla-Haile aDlgSize.Width() = aAppLogoSiz.Width(); 194*23c0a6f8SAriel Constenla-Haile 195*23c0a6f8SAriel Constenla-Haile Size a6Size = maVersionText.LogicToPixel( Size( 6, 6 ), MAP_APPFONT ); 196*23c0a6f8SAriel Constenla-Haile long nY = aAppLogoSiz.Height() + ( a6Size.Height() * 2 ); 197*23c0a6f8SAriel Constenla-Haile long nDlgMargin = a6Size.Width() * 2; 198*23c0a6f8SAriel Constenla-Haile long nCtrlMargin = a6Size.Height() * 2; 199*23c0a6f8SAriel Constenla-Haile long nTextWidth = aDlgSize.Width() - ( nDlgMargin * 2 ); 200*23c0a6f8SAriel Constenla-Haile 201*23c0a6f8SAriel Constenla-Haile Point aPos( nDlgMargin, nY ); 202*23c0a6f8SAriel Constenla-Haile Size aSize; 203*23c0a6f8SAriel Constenla-Haile // layout fixed text control 204*23c0a6f8SAriel Constenla-Haile layoutFixedText( maVersionText, aPos, aSize, nTextWidth ); 205*23c0a6f8SAriel Constenla-Haile // set the next control closer 206*23c0a6f8SAriel Constenla-Haile nY += aSize.Height() + (nCtrlMargin / 2); 207*23c0a6f8SAriel Constenla-Haile 208*23c0a6f8SAriel Constenla-Haile // Multiline edit with Build info 209*23c0a6f8SAriel Constenla-Haile aPos.Y() = nY; 210*23c0a6f8SAriel Constenla-Haile layoutEdit( maBuildInfoEdit, aPos, aSize, nTextWidth ); 211*23c0a6f8SAriel Constenla-Haile nY += aSize.Height() + nCtrlMargin; 212*23c0a6f8SAriel Constenla-Haile 213*23c0a6f8SAriel Constenla-Haile // Multiline edit with Copyright-Text 214*23c0a6f8SAriel Constenla-Haile aPos.Y() = nY; 215*23c0a6f8SAriel Constenla-Haile layoutEdit( maCopyrightEdit, aPos, aSize, nTextWidth ); 216*23c0a6f8SAriel Constenla-Haile // set the next control closer 217*23c0a6f8SAriel Constenla-Haile nY += aSize.Height() + (nCtrlMargin/2); 218*23c0a6f8SAriel Constenla-Haile 219*23c0a6f8SAriel Constenla-Haile // Hyperlink 220*23c0a6f8SAriel Constenla-Haile aPos.Y() = nY; 221*23c0a6f8SAriel Constenla-Haile layoutFixedText( maCreditsLink, aPos, aSize, nTextWidth ); 222*23c0a6f8SAriel Constenla-Haile nY += aSize.Height() + nCtrlMargin; 223*23c0a6f8SAriel Constenla-Haile 224*23c0a6f8SAriel Constenla-Haile // OK-Button-Position (at the bottom and centered) 225*23c0a6f8SAriel Constenla-Haile Size aOKSiz = maOKButton.GetSizePixel(); 226*23c0a6f8SAriel Constenla-Haile Point aOKPnt( ( aDlgSize.Width() - aOKSiz.Width() ) / 2, nY ); 227*23c0a6f8SAriel Constenla-Haile maOKButton.SetPosPixel( aOKPnt ); 228*23c0a6f8SAriel Constenla-Haile 229*23c0a6f8SAriel Constenla-Haile aDlgSize.Height() = aOKPnt.Y() + aOKSiz.Height() + nCtrlMargin; 230*23c0a6f8SAriel Constenla-Haile } 231*23c0a6f8SAriel Constenla-Haile 232*23c0a6f8SAriel Constenla-Haile // ----------------------------------------------------------------------- 233*23c0a6f8SAriel Constenla-Haile 234*23c0a6f8SAriel Constenla-Haile const rtl::OUString AboutDialog::GetBuildId() const 235*23c0a6f8SAriel Constenla-Haile { 236*23c0a6f8SAriel Constenla-Haile rtl::OUString sDefault; 237*23c0a6f8SAriel Constenla-Haile 238*23c0a6f8SAriel Constenla-Haile // Get buildid from version[rc|.ini] 239*23c0a6f8SAriel Constenla-Haile rtl::OUString sBuildId( utl::Bootstrap::getBuildIdData( sDefault ) ); 240*23c0a6f8SAriel Constenla-Haile OSL_ENSURE( sBuildId.getLength() > 0, "No BUILDID in bootstrap file" ); 241*23c0a6f8SAriel Constenla-Haile rtl::OUStringBuffer sBuildIdBuff( sBuildId ); 242*23c0a6f8SAriel Constenla-Haile 243*23c0a6f8SAriel Constenla-Haile // Get ProductSource from version[rc|.ini] 244*23c0a6f8SAriel Constenla-Haile rtl::OUString sProductSource( utl::Bootstrap::getProductSource( sDefault ) ); 245*23c0a6f8SAriel Constenla-Haile OSL_ENSURE( sProductSource.getLength() > 0, "No ProductSource in bootstrap file" ); 246*23c0a6f8SAriel Constenla-Haile 247*23c0a6f8SAriel Constenla-Haile // the product source is something like "AOO340", 248*23c0a6f8SAriel Constenla-Haile // while the build id is something like "340m1(Build:9590)" 249*23c0a6f8SAriel Constenla-Haile // For better readability, strip the duplicate ProductMajor ("340"). 250*23c0a6f8SAriel Constenla-Haile if ( sProductSource.getLength() ) 251*23c0a6f8SAriel Constenla-Haile { 252*23c0a6f8SAriel Constenla-Haile bool bMatchingUPD = 253*23c0a6f8SAriel Constenla-Haile ( sProductSource.getLength() >= 3 ) 254*23c0a6f8SAriel Constenla-Haile && ( sBuildId.getLength() >= 3 ) 255*23c0a6f8SAriel Constenla-Haile && ( sProductSource.copy( sProductSource.getLength() - 3 ) == sBuildId.copy( 0, 3 ) ); 256*23c0a6f8SAriel Constenla-Haile OSL_ENSURE( bMatchingUPD, "BUILDID and ProductSource do not match in their UPD" ); 257*23c0a6f8SAriel Constenla-Haile if ( bMatchingUPD ) 258*23c0a6f8SAriel Constenla-Haile sProductSource = sProductSource.copy( 0, sProductSource.getLength() - 3 ); 259*23c0a6f8SAriel Constenla-Haile 260*23c0a6f8SAriel Constenla-Haile // prepend the product source 261*23c0a6f8SAriel Constenla-Haile sBuildIdBuff.insert( 0, sProductSource ); 262*23c0a6f8SAriel Constenla-Haile } 263*23c0a6f8SAriel Constenla-Haile 264*23c0a6f8SAriel Constenla-Haile return sBuildIdBuff.makeStringAndClear(); 265*23c0a6f8SAriel Constenla-Haile } 266*23c0a6f8SAriel Constenla-Haile 267*23c0a6f8SAriel Constenla-Haile // ----------------------------------------------------------------------- 268*23c0a6f8SAriel Constenla-Haile 269*23c0a6f8SAriel Constenla-Haile const rtl::OUString AboutDialog::GetBuildVersionString() const 270*23c0a6f8SAriel Constenla-Haile { 271*23c0a6f8SAriel Constenla-Haile rtl::OUStringBuffer aBuildString( GetBuildId() ); 272*23c0a6f8SAriel Constenla-Haile rtl::OUString sRevision( utl::Bootstrap::getRevisionInfo() ); 273*23c0a6f8SAriel Constenla-Haile 274*23c0a6f8SAriel Constenla-Haile if ( sRevision.getLength() > 0 ) 275*23c0a6f8SAriel Constenla-Haile { 276*23c0a6f8SAriel Constenla-Haile aBuildString.appendAscii( RTL_CONSTASCII_STRINGPARAM( " - Rev. " ) ); 277*23c0a6f8SAriel Constenla-Haile aBuildString.append( sRevision ); 278*23c0a6f8SAriel Constenla-Haile } 279*23c0a6f8SAriel Constenla-Haile 280*23c0a6f8SAriel Constenla-Haile #ifdef BUILD_VER_STRING 281*23c0a6f8SAriel Constenla-Haile rtl::OUString sBuildVer( RTL_CONSTASCII_USTRINGPARAM( STRINGIFY( BUILD_VER_STRING ) ) ); 282*23c0a6f8SAriel Constenla-Haile if ( sBuildVer.getLength() > 0 ) 283*23c0a6f8SAriel Constenla-Haile { 284*23c0a6f8SAriel Constenla-Haile aBuildString.append( sal_Unicode( '\n' ) ); 285*23c0a6f8SAriel Constenla-Haile aBuildString.append( sBuildVer ); 286*23c0a6f8SAriel Constenla-Haile } 287cdf0e10cSrcweir #endif 288cdf0e10cSrcweir 289*23c0a6f8SAriel Constenla-Haile return aBuildString.makeStringAndClear(); 290cdf0e10cSrcweir } 291cdf0e10cSrcweir 292cdf0e10cSrcweir // ----------------------------------------------------------------------- 293cdf0e10cSrcweir 294cdf0e10cSrcweir sal_Bool AboutDialog::Close() 295cdf0e10cSrcweir { 296cdf0e10cSrcweir EndDialog( RET_OK ); 297cdf0e10cSrcweir return( sal_False ); 298cdf0e10cSrcweir } 299cdf0e10cSrcweir 300cdf0e10cSrcweir // ----------------------------------------------------------------------- 301cdf0e10cSrcweir 302cdf0e10cSrcweir void AboutDialog::Paint( const Rectangle& rRect ) 303cdf0e10cSrcweir { 304cdf0e10cSrcweir SetClipRegion( rRect ); 305*23c0a6f8SAriel Constenla-Haile Point aPos( 0, 0 ); 306*23c0a6f8SAriel Constenla-Haile DrawImage( aPos, maAppLogo ); 307cdf0e10cSrcweir 308cdf0e10cSrcweir return; 309cdf0e10cSrcweir } 310cdf0e10cSrcweir 311*23c0a6f8SAriel Constenla-Haile // ----------------------------------------------------------------------- 312cdf0e10cSrcweir 313*23c0a6f8SAriel Constenla-Haile IMPL_LINK ( AboutDialog, OpenLinkHdl_Impl, svt::FixedHyperlink*, EMPTYARG ) 314cdf0e10cSrcweir { 315*23c0a6f8SAriel Constenla-Haile ::rtl::OUString sURL( maCreditsLink.GetURL() ); 316*23c0a6f8SAriel Constenla-Haile if ( sURL.getLength() > 0 ) 317cdf0e10cSrcweir { 318*23c0a6f8SAriel Constenla-Haile try 319cdf0e10cSrcweir { 320*23c0a6f8SAriel Constenla-Haile com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory > xSMGR = 321*23c0a6f8SAriel Constenla-Haile ::comphelper::getProcessServiceFactory(); 322*23c0a6f8SAriel Constenla-Haile com::sun::star::uno::Reference< com::sun::star::system::XSystemShellExecute > xSystemShell( 323*23c0a6f8SAriel Constenla-Haile xSMGR->createInstance( ::rtl::OUString( 324*23c0a6f8SAriel Constenla-Haile RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.system.SystemShellExecute" ) ) ), 325*23c0a6f8SAriel Constenla-Haile com::sun::star::uno::UNO_QUERY_THROW ); 326*23c0a6f8SAriel Constenla-Haile if ( xSystemShell.is() ) 327*23c0a6f8SAriel Constenla-Haile xSystemShell->execute( sURL, ::rtl::OUString(), com::sun::star::system::SystemShellExecuteFlags::DEFAULTS ); 328cdf0e10cSrcweir } 329*23c0a6f8SAriel Constenla-Haile catch( const com::sun::star::uno::Exception& e ) 330cdf0e10cSrcweir { 331*23c0a6f8SAriel Constenla-Haile OSL_TRACE( "Caught exception: %s\n thread terminated.\n", 332*23c0a6f8SAriel Constenla-Haile rtl::OUStringToOString(e.Message, RTL_TEXTENCODING_UTF8).getStr()); 333cdf0e10cSrcweir } 334cdf0e10cSrcweir } 335*23c0a6f8SAriel Constenla-Haile return 0; 336*23c0a6f8SAriel Constenla-Haile } 337