diff options
author | RĂ¼diger Timm <rt@openoffice.org> | 2004-11-26 13:51:11 +0000 |
---|---|---|
committer | RĂ¼diger Timm <rt@openoffice.org> | 2004-11-26 13:51:11 +0000 |
commit | d4e32f0fe6baab1f9688100f97f7871d27f223a5 (patch) | |
tree | 7bd64e78c733129318e24e51776af51a3998cc56 /xmlsecurity/source/dialogs/certificateviewer.cxx | |
parent | 36096c630826420fa1f6c47875c53b402f8c63a3 (diff) |
INTEGRATION: CWS xmlsec06 (1.14.2); FILE MERGED
2004/10/11 09:44:22 pb 1.14.2.2: fix: #i35107# viewer should display the correct version (0=='V1',1=='V2',...)
2004/10/07 11:24:41 pb 1.14.2.1: fix: #i34729# FromTo only one FixedText
Diffstat (limited to 'xmlsecurity/source/dialogs/certificateviewer.cxx')
-rw-r--r-- | xmlsecurity/source/dialogs/certificateviewer.cxx | 45 |
1 files changed, 19 insertions, 26 deletions
diff --git a/xmlsecurity/source/dialogs/certificateviewer.cxx b/xmlsecurity/source/dialogs/certificateviewer.cxx index 40d802761..621bacac7 100644 --- a/xmlsecurity/source/dialogs/certificateviewer.cxx +++ b/xmlsecurity/source/dialogs/certificateviewer.cxx @@ -2,9 +2,9 @@ * * $RCSfile: certificateviewer.cxx,v $ * - * $Revision: 1.14 $ + * $Revision: 1.15 $ * - * last change: $Author: mt $ $Date: 2004-07-27 11:55:25 $ + * last change: $Author: rt $ $Date: 2004-11-26 14:51:11 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -147,10 +147,7 @@ CertificateViewerGeneralTP::CertificateViewerGeneralTP( Window* _pParent, Certif ,maIssuedToFI ( this, ResId( FI_ISSTO ) ) ,maIssuedByLabelFI ( this, ResId( FI_ISSBYLABEL ) ) ,maIssuedByFI ( this, ResId( FI_ISSBY ) ) - ,maValidFromLabelFI ( this, ResId( FI_VALFROMLABEL ) ) - ,maValidFromFI ( this, ResId( FI_VALFROM ) ) - ,maValidToLabelFI ( this, ResId( FI_VALTOLABEL ) ) - ,maValidToFI ( this, ResId( FI_VALTO ) ) + ,maValidDateFI ( this, ResId( FI_VALIDDATE ) ) ,maKeyImg ( this, ResId( IMG_KEY ) ) ,maHintCorrespPrivKeyFI ( this, ResId( FI_CORRPRIVKEY ) ) { @@ -168,10 +165,7 @@ CertificateViewerGeneralTP::CertificateViewerGeneralTP( Window* _pParent, Certif maIssuedToFI.SetBackground( aBack ); maIssuedByLabelFI.SetBackground( aBack ); maIssuedByFI.SetBackground( aBack ); - maValidFromLabelFI.SetBackground( aBack ); - maValidFromFI.SetBackground( aBack ); - maValidToLabelFI.SetBackground( aBack ); - maValidToFI.SetBackground( aBack ); + maValidDateFI.SetBackground( aBack ); maKeyImg.SetBackground( aBack ); maHintCorrespPrivKeyFI.SetBackground( aBack ); @@ -182,8 +176,7 @@ CertificateViewerGeneralTP::CertificateViewerGeneralTP( Window* _pParent, Certif maHintNotTrustedFI.SetFont( aFnt ); maIssuedToLabelFI.SetFont( aFnt ); maIssuedByLabelFI.SetFont( aFnt ); - maValidFromLabelFI.SetFont( aFnt ); - maValidToLabelFI.SetFont( aFnt ); + maValidDateFI.SetFont( aFnt ); // insert data cssu::Reference< dcss::security::XCertificate > xCert = mpDlg->mxCert; @@ -193,18 +186,16 @@ CertificateViewerGeneralTP::CertificateViewerGeneralTP( Window* _pParent, Certif maIssuedToFI.SetText( XmlSec::GetContentPart( xCert->getSubjectName(), aCN_Id ) ); maIssuedByFI.SetText( XmlSec::GetContentPart( xCert->getIssuerName(), aCN_Id ) ); - DateTime aDateTime; - utl::typeConvert( xCert->getNotBefore(), aDateTime ); - maValidFromFI.SetText( GetSettings().GetUILocaleDataWrapper().getDate( aDateTime.GetDate() ) ); - utl::typeConvert( xCert->getNotAfter(), aDateTime ); - maValidToFI.SetText( GetSettings().GetUILocaleDataWrapper().getDate( aDateTime.GetDate() ) ); - - // recalc positions for date fields according to real size - Point aPos( maValidFromLabelFI.GetPosPixel() ); - AdjustPosAndSize( maValidFromLabelFI, aPos, 5 ); - AdjustPosAndSize( maValidFromFI, aPos, 5 ); - AdjustPosAndSize( maValidToLabelFI, aPos, 5 ); - AdjustPosAndSize( maValidToFI, aPos, 5 ); + DateTime aDateTimeStart; + DateTime aDateTimeEnd; + utl::typeConvert( xCert->getNotBefore(), aDateTimeStart ); + utl::typeConvert( xCert->getNotAfter(), aDateTimeEnd ); + String sText = maValidDateFI.GetText(); + sText.SearchAndReplace( String::CreateFromAscii( "%SDATE%" ), + GetSettings().GetUILocaleDataWrapper().getDate( aDateTimeStart.GetDate() ) ); + sText.SearchAndReplace( String::CreateFromAscii( "%EDATE%" ), + GetSettings().GetUILocaleDataWrapper().getDate( aDateTimeEnd.GetDate() ) ); + maValidDateFI.SetText( sText ); // adjust position of fixed text depending on image sizes ShrinkToFit( maCertImg ); @@ -287,8 +278,10 @@ CertificateViewerDetailsTP::CertificateViewerDetailsTP( Window* _pParent, Certif const char* pHexSep = " "; String aLBEntry; String aDetails; + // --> PB 2004-10-11 #i35107# - 0 == "V1", 1 == "V2", ..., n = "V(n+1)" aLBEntry = String::CreateFromAscii( "V" ); - aLBEntry += String::CreateFromInt32( xCert->getVersion() ); + aLBEntry += String::CreateFromInt32( xCert->getVersion() + 1 ); + // <-- InsertElement( String( ResId( STR_VERSION ) ), aLBEntry, aLBEntry ); Sequence< sal_Int8 > aSeq = xCert->getSerialNumber(); aLBEntry = XmlSec::GetHexString( aSeq, pHexSep ); @@ -385,7 +378,7 @@ struct CertPath_UserData { cssu::Reference< dcss::security::XCertificate > mxCert; String maStatus; - + CertPath_UserData( cssu::Reference< dcss::security::XCertificate > xCert ) { mxCert = xCert; } }; |