summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--xmlsecurity/inc/xmlsecurity/macrosecurity.hxx12
-rw-r--r--xmlsecurity/source/dialogs/macrosecurity.cxx77
2 files changed, 40 insertions, 49 deletions
diff --git a/xmlsecurity/inc/xmlsecurity/macrosecurity.hxx b/xmlsecurity/inc/xmlsecurity/macrosecurity.hxx
index 8a330f82c73a..659b60cc2eff 100644
--- a/xmlsecurity/inc/xmlsecurity/macrosecurity.hxx
+++ b/xmlsecurity/inc/xmlsecurity/macrosecurity.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: macrosecurity.hxx,v $
*
- * $Revision: 1.9 $
+ * $Revision: 1.10 $
*
- * last change: $Author: mt $ $Date: 2004-07-28 09:12:08 $
+ * last change: $Author: mt $ $Date: 2004-08-04 06:13:56 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -142,12 +142,14 @@ private:
RadioButton maMediumRB;
RadioButton maLowRB;
- RadioButton* GetRadioButton( USHORT _nLevel );
- USHORT GetLevel( void ) const;
+ USHORT mnCurLevel;
+
+protected:
+ DECL_LINK( RadioButtonHdl, RadioButton* );
+
public:
MacroSecurityLevelTP( Window* pParent, MacroSecurity* _pDlg );
- virtual void ActivatePage();
virtual void ClosePage( void );
};
diff --git a/xmlsecurity/source/dialogs/macrosecurity.cxx b/xmlsecurity/source/dialogs/macrosecurity.cxx
index 00065052ff74..8bebd3e1718c 100644
--- a/xmlsecurity/source/dialogs/macrosecurity.cxx
+++ b/xmlsecurity/source/dialogs/macrosecurity.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: macrosecurity.cxx,v $
*
- * $Revision: 1.16 $
+ * $Revision: 1.17 $
*
- * last change: $Author: mt $ $Date: 2004-07-28 09:12:09 $
+ * last change: $Author: mt $ $Date: 2004-08-04 06:13:56 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -156,40 +156,6 @@ MacroSecurityTP::MacroSecurityTP( Window* _pParent, const ResId& _rResId, MacroS
{
}
-
-RadioButton* MacroSecurityLevelTP::GetRadioButton( USHORT _nLevel )
-{
- RadioButton* pRet;
- switch( _nLevel )
- {
- case 3: pRet = &maVeryHighRB; break;
- case 2: pRet = &maHighRB; break;
- case 1: pRet = &maMediumRB; break;
- case 0: pRet = &maLowRB; break;
- default: pRet = NULL;
- }
-
- return pRet;
-}
-
-USHORT MacroSecurityLevelTP::GetLevel( void ) const
-{
- USHORT nRet;
-
- if( maVeryHighRB.IsChecked() )
- nRet = 3;
- else if( maHighRB.IsChecked() )
- nRet = 2;
- else if( maMediumRB.IsChecked() )
- nRet = 1;
- else if( maLowRB.IsChecked() )
- nRet = 0;
- else
- nRet = 0xFFFF;
-
- return nRet;
-}
-
MacroSecurityLevelTP::MacroSecurityLevelTP( Window* _pParent, MacroSecurity* _pDlg )
:MacroSecurityTP ( _pParent, XMLSEC_RES( RID_XMLSECTP_SECLEVEL ), _pDlg )
,maSecLevelFL ( this, ResId( FL_SECLEVEL ) )
@@ -199,22 +165,45 @@ MacroSecurityLevelTP::MacroSecurityLevelTP( Window* _pParent, MacroSecurity* _pD
,maLowRB ( this, ResId( RB_LOW ) )
{
FreeResource();
+
+ maLowRB.SetClickHdl( LINK( this, MacroSecurityLevelTP, RadioButtonHdl ) );
+ maMediumRB.SetClickHdl( LINK( this, MacroSecurityLevelTP, RadioButtonHdl ) );
+ maHighRB.SetClickHdl( LINK( this, MacroSecurityLevelTP, RadioButtonHdl ) );
+ maVeryHighRB.SetClickHdl( LINK( this, MacroSecurityLevelTP, RadioButtonHdl ) );
+
+ mnCurLevel = (USHORT) mpDlg->maSecOptions.GetMacroSecurityLevel();
+
+ switch( mnCurLevel )
+ {
+ case 3: maVeryHighRB.Check(); break;
+ case 2: maHighRB.Check(); break;
+ case 1: maMediumRB.Check(); break;
+ case 0: maLowRB.Check(); break;
+ }
}
-void MacroSecurityLevelTP::ActivatePage()
+IMPL_LINK( MacroSecurityLevelTP, RadioButtonHdl, RadioButton*, EMTYARG )
{
- mpDlg->EnableReset();
+ USHORT nNewLevel = 0;
+ if( maVeryHighRB.IsChecked() )
+ nNewLevel = 3;
+ else if( maHighRB.IsChecked() )
+ nNewLevel = 2;
+ else if( maMediumRB.IsChecked() )
+ nNewLevel = 1;
+
+ if ( nNewLevel != mnCurLevel )
+ {
+ mnCurLevel = nNewLevel;
+ mpDlg->EnableReset();
+ }
- RadioButton* pRB = GetRadioButton( USHORT( mpDlg->maSecOptions.GetMacroSecurityLevel() ) );
- if( pRB )
- pRB->Check();
+ return 0;
}
void MacroSecurityLevelTP::ClosePage( void )
{
- USHORT nLevel = GetLevel();
- if( nLevel <= 3 )
- mpDlg->maSecOptions.SetMacroSecurityLevel( nLevel );
+ mpDlg->maSecOptions.SetMacroSecurityLevel( mnCurLevel );
}
void MacroSecurityTrustedSourcesTP::ImplCheckButtons()