Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
2d153fbe
Kaydet (Commit)
2d153fbe
authored
Tem 20, 2004
tarafından
gt
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
#i20883# + config
üst
c375859d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
111 additions
and
14 deletions
+111
-14
macrosecurity.hxx
xmlsecurity/inc/xmlsecurity/macrosecurity.hxx
+21
-5
macrosecurity.cxx
xmlsecurity/source/dialogs/macrosecurity.cxx
+90
-9
No files found.
xmlsecurity/inc/xmlsecurity/macrosecurity.hxx
Dosyayı görüntüle @
2d153fbe
...
...
@@ -2,9 +2,9 @@
*
* $RCSfile: macrosecurity.hxx,v $
*
* $Revision: 1.
3
$
* $Revision: 1.
4
$
*
* last change: $Author: gt $ $Date: 2004-07-
16 10:26:28
$
* last change: $Author: gt $ $Date: 2004-07-
20 15:43:12
$
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
...
...
@@ -71,6 +71,7 @@
#include <svtools/stdctrl.hxx>
#include <svx/simptabl.hxx>
#include <svtools/svmedit.hxx>
#include <svtools/securityoptions.hxx>
#include <xmlsecurity/documentsignaturehelper.hxx>
#include <xmlsecurity/xmlsignaturehelper.hxx>
...
...
@@ -99,6 +100,8 @@ namespace css = com::sun::star;
namespace
cssu
=
com
::
sun
::
star
::
uno
;
namespace
dcss
=
::
com
::
sun
::
star
;
class
MacroSecurityTP
;
class
MacroSecurity
:
public
TabDialog
{
private
:
...
...
@@ -111,9 +114,14 @@ private:
HelpButton
maHelpBtn
;
PushButton
maResetBtn
;
XMLSignatureHelper
maSignatureHelper
;
cssu
::
Reference
<
dcss
::
xml
::
crypto
::
XSecurityEnvironment
>
mxSecurityEnvironment
;
SignatureInformations
maCurrentSignatureInformations
;
XMLSignatureHelper
maSignatureHelper
;
cssu
::
Reference
<
dcss
::
xml
::
crypto
::
XSecurityEnvironment
>
mxSecurityEnvironment
;
SignatureInformations
maCurrentSignatureInformations
;
SvtSecurityOptions
maSecOptions
;
MacroSecurityTP
*
mpLevelTP
;
MacroSecurityTP
*
mpTrustSrcTP
;
DECL_LINK
(
OkBtnHdl
,
void
*
);
public
:
MacroSecurity
(
Window
*
pParent
,
cssu
::
Reference
<
css
::
lang
::
XMultiServiceFactory
>&
rxMSF
,
...
...
@@ -137,6 +145,8 @@ protected:
public
:
MacroSecurityTP
(
Window
*
_pParent
,
const
ResId
&
_rResId
,
MacroSecurity
*
_pDlg
);
inline
void
SetTabDlg
(
MacroSecurity
*
pTabDlg
);
virtual
void
ClosePage
(
void
)
=
0
;
};
inline
void
MacroSecurityTP
::
SetTabDlg
(
MacroSecurity
*
_pTabDlg
)
...
...
@@ -153,10 +163,14 @@ private:
RadioButton
maHighRB
;
RadioButton
maMediumRB
;
RadioButton
maLowRB
;
RadioButton
*
GetRadioButton
(
USHORT
_nLevel
);
USHORT
GetLevel
(
void
)
const
;
public
:
MacroSecurityLevelTP
(
Window
*
pParent
,
MacroSecurity
*
_pDlg
);
virtual
void
ActivatePage
();
virtual
void
ClosePage
(
void
);
};
...
...
@@ -182,12 +196,14 @@ private:
DECL_LINK
(
TrustCertLBSelectHdl
,
void
*
);
DECL_LINK
(
TrustFileLocLBSelectHdl
,
void
*
);
cssu
::
Sequence
<
SvtSecurityOptions
::
Certificate
>
maTrustedAuthors
;
// void InsertCert( cssu::Reference< css::security::XCertificate >& _rxCert, USHORT _nInd );
void
FillCertLB
(
void
);
public
:
MacroSecurityTrustedSourcesTP
(
Window
*
pParent
,
MacroSecurity
*
_pDlg
);
virtual
void
ActivatePage
();
virtual
void
ClosePage
(
void
);
};
...
...
xmlsecurity/source/dialogs/macrosecurity.cxx
Dosyayı görüntüle @
2d153fbe
...
...
@@ -2,9 +2,9 @@
*
* $RCSfile: macrosecurity.cxx,v $
*
* $Revision: 1.
5
$
* $Revision: 1.
6
$
*
* last change: $Author: gt $ $Date: 2004-07-
19 15:47:55
$
* last change: $Author: gt $ $Date: 2004-07-
20 15:42:47
$
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
...
...
@@ -114,6 +114,16 @@ using namespace ::com::sun::star;
using
namespace
::
com
::
sun
::
star
;
IMPL_LINK
(
MacroSecurity
,
OkBtnHdl
,
void
*
,
EMTYARG
)
{
mpLevelTP
->
ClosePage
();
mpTrustSrcTP
->
ClosePage
();
// ExitDialog( RET_OK );
return
0
;
}
MacroSecurity
::
MacroSecurity
(
Window
*
_pParent
,
cssu
::
Reference
<
lang
::
XMultiServiceFactory
>&
rxMSF
,
cssu
::
Reference
<
dcss
::
xml
::
crypto
::
XSecurityEnvironment
>&
_rxSecurityEnvironment
)
:
TabDialog
(
_pParent
,
XMLSEC_RES
(
RID_XMLSECTP_MACROSEC
)
)
,
maSignatureHelper
(
rxMSF
)
...
...
@@ -127,9 +137,14 @@ MacroSecurity::MacroSecurity( Window* _pParent, cssu::Reference< lang::XMultiSer
mxSecurityEnvironment
=
_rxSecurityEnvironment
;
maTabCtrl
.
SetTabPage
(
RID_XMLSECTP_SECLEVEL
,
new
MacroSecurityLevelTP
(
&
maTabCtrl
,
this
)
);
maTabCtrl
.
SetTabPage
(
RID_XMLSECTP_TRUSTSOURCES
,
new
MacroSecurityTrustedSourcesTP
(
&
maTabCtrl
,
this
)
);
MacroSecurityTP
*
mpLevelTP
=
new
MacroSecurityLevelTP
(
&
maTabCtrl
,
this
);
MacroSecurityTP
*
mpTrustSrcTP
=
new
MacroSecurityTrustedSourcesTP
(
&
maTabCtrl
,
this
);
maTabCtrl
.
SetTabPage
(
RID_XMLSECTP_SECLEVEL
,
mpLevelTP
);
maTabCtrl
.
SetTabPage
(
RID_XMLSECTP_TRUSTSOURCES
,
mpTrustSrcTP
);
maTabCtrl
.
SetCurPageId
(
RID_XMLSECTP_SECLEVEL
);
maOkBtn
.
SetClickHdl
(
LINK
(
this
,
MacroSecurity
,
OkBtnHdl
)
);
}
MacroSecurity
::~
MacroSecurity
()
...
...
@@ -144,6 +159,39 @@ MacroSecurityTP::MacroSecurityTP( Window* _pParent, const ResId& _rResId, MacroS
}
RadioButton
*
MacroSecurityLevelTP
::
GetRadioButton
(
USHORT
_nLevel
)
{
RadioButton
*
pRet
;
switch
(
_nLevel
)
{
case
0
:
pRet
=
&
maVeryHighRB
;
break
;
case
1
:
pRet
=
&
maHighRB
;
break
;
case
2
:
pRet
=
&
maMediumRB
;
break
;
case
3
:
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
)
)
...
...
@@ -158,6 +206,17 @@ MacroSecurityLevelTP::MacroSecurityLevelTP( Window* _pParent, MacroSecurity* _pD
void
MacroSecurityLevelTP
::
ActivatePage
()
{
mpDlg
->
EnableReset
();
RadioButton
*
pRB
=
GetRadioButton
(
USHORT
(
mpDlg
->
maSecOptions
.
GetMacroSecurityLevel
()
)
);
if
(
pRB
)
pRB
->
Check
();
}
void
MacroSecurityLevelTP
::
ClosePage
(
void
)
{
USHORT
nLevel
=
GetLevel
();
if
(
nLevel
<=
3
)
mpDlg
->
maSecOptions
.
SetMacroSecurityLevel
(
nLevel
);
}
...
...
@@ -252,6 +311,7 @@ IMPL_LINK( MacroSecurityTrustedSourcesTP, RemoveLocPBHdl, void*, EMTYARG )
if
(
nSel
!=
LISTBOX_ENTRY_NOTFOUND
)
{
maTrustFileLocLB
.
RemoveEntry
(
nSel
);
// remove from sequence
}
return
0
;
...
...
@@ -287,7 +347,23 @@ void MacroSecurityTrustedSourcesTP::FillCertLB( void )
{
maTrustCertLB
.
Clear
();
uno
::
Reference
<
css
::
xml
::
crypto
::
XSecurityEnvironment
>
xSecEnv
=
mpDlg
->
maSignatureHelper
.
GetSecurityEnvironment
();
sal_uInt32
nCountEntries
=
maTrustedAuthors
.
getLength
();
String
aCN_Id
(
String
::
CreateFromAscii
(
"CN"
)
);
for
(
sal_uInt32
nEntry
=
0
;
nEntry
<
nCountEntries
;
++
nEntry
)
{
cssu
::
Sequence
<
::
rtl
::
OUString
>&
rEntry
=
maTrustedAuthors
[
nEntry
];
const
SignatureInformation
&
rInfo
=
mpDlg
->
maCurrentSignatureInformations
[
nEntry
];
uno
::
Reference
<
css
::
security
::
XCertificate
>
xCert
;
SvLBoxEntry
*
pLBEntry
=
maTrustCertLB
.
InsertEntry
(
XmlSec
::
GetContentPart
(
xCert
->
getSubjectName
(),
aCN_Id
)
);
maTrustCertLB
.
SetEntryText
(
XmlSec
::
GetContentPart
(
rInfo
.
ouX509IssuerName
,
aCN_Id
),
pLBEntry
,
1
);
maTrustCertLB
.
SetEntryText
(
XmlSec
::
GetDateTimeString
(
rInfo
.
ouDate
,
rInfo
.
ouTime
),
pLBEntry
,
2
);
pLBEntry
->
SetUserData
(
(
void
*
)
sal_Int32
(
nEntry
)
);
// missuse user data as index
}
// m_seqSecureURLs[ nItem ] = aOpt.SubstituteVariable( m_seqSecureURLs[ nItem ] );
/* uno::Reference< css::xml::crypto::XSecurityEnvironment > xSecEnv = mpDlg->maSignatureHelper.GetSecurityEnvironment();
uno::Reference< css::security::XCertificate > xCert;
String aCN_Id( String::CreateFromAscii( "CN" ) );
...
...
@@ -306,7 +382,7 @@ void MacroSecurityTrustedSourcesTP::FillCertLB( void )
}
}
TrustCertLBSelectHdl
(
NULL
);
TrustCertLBSelectHdl( NULL );
*/
}
MacroSecurityTrustedSourcesTP
::
MacroSecurityTrustedSourcesTP
(
Window
*
_pParent
,
MacroSecurity
*
_pDlg
)
...
...
@@ -328,7 +404,8 @@ MacroSecurityTrustedSourcesTP::MacroSecurityTrustedSourcesTP( Window* _pParent,
FreeResource
();
maAddCertPB
.
SetClickHdl
(
LINK
(
this
,
MacroSecurityTrustedSourcesTP
,
AddCertPBHdl
)
);
// maAddCertPB.SetClickHdl( LINK( this, MacroSecurityTrustedSourcesTP, AddCertPBHdl ) );
maAddCertPB
.
Hide
();
// not used in the moment...
maViewCertPB
.
SetClickHdl
(
LINK
(
this
,
MacroSecurityTrustedSourcesTP
,
ViewCertPBHdl
)
);
maViewCertPB
.
Disable
();
maRemoveCertPB
.
SetClickHdl
(
LINK
(
this
,
MacroSecurityTrustedSourcesTP
,
RemoveCertPBHdl
)
);
...
...
@@ -336,11 +413,15 @@ MacroSecurityTrustedSourcesTP::MacroSecurityTrustedSourcesTP( Window* _pParent,
maAddLocPB
.
SetClickHdl
(
LINK
(
this
,
MacroSecurityTrustedSourcesTP
,
AddLocPBHdl
)
);
maRemoveLocPB
.
SetClickHdl
(
LINK
(
this
,
MacroSecurityTrustedSourcesTP
,
RemoveLocPBHdl
)
);
maRemoveLocPB
.
Disable
();
FillCertLB
();
}
void
MacroSecurityTrustedSourcesTP
::
ActivatePage
()
{
mpDlg
->
EnableReset
(
false
);
FillCertLB
();
}
void
MacroSecurityTrustedSourcesTP
::
ClosePage
(
void
)
{
mpDlg
->
maSecOptions
.
SetTrustedAuthors
(
maTrustedAuthors
);
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment