1 --- sfx2/inc/sfx2/dinfdlg.hxx.old 2009-04-02 10:44:03.000000000 +0000
2 +++ sfx2/inc/sfx2/dinfdlg.hxx 2009-04-06 16:41:54.000000000 +0000
3 @@ -184,6 +184,7 @@ class SfxDocumentPage : public SfxTabPag
7 + PushButton aChangePassBtn;
11 @@ -223,7 +224,9 @@ private:
13 DECL_LINK( DeleteHdl, PushButton * );
14 DECL_LINK( SignatureHdl, PushButton * );
15 + DECL_LINK( ChangePassHdl, PushButton * );
16 void ImplUpdateSignatures();
17 + void ImplCheckPasswordState();
20 SfxDocumentPage( Window* pParent, const SfxItemSet& );
21 --- sfx2/source/dialog/dinfdlg.cxx.old 2009-04-06 16:41:46.000000000 +0000
22 +++ sfx2/source/dialog/dinfdlg.cxx 2009-04-06 16:41:54.000000000 +0000
24 #include <sfx2/frame.hxx>
25 #include <sfx2/viewfrm.hxx>
26 #include <sfx2/request.hxx>
27 +#include <sfx2/passwd.hxx>
28 //#include "exptypes.hxx"
30 #include <sfx2/objsh.hxx>
31 @@ -854,6 +855,7 @@ SfxDocumentPage::SfxDocumentPage( Window
33 aBmp1 ( this, SfxResId( BMP_FILE_1 ) ),
34 aNameED ( this, SfxResId( ED_FILE_NAME ) ),
35 + aChangePassBtn ( this, SfxResId( BTN_CHANGE_PASS ) ),
37 aLine1FL ( this, SfxResId( FL_FILE_1 ) ),
38 aTypeFT ( this, SfxResId( FT_FILE_TYP ) ),
39 @@ -895,8 +897,10 @@ SfxDocumentPage::SfxDocumentPage( Window
42 ImplUpdateSignatures();
43 + ImplCheckPasswordState();
44 aDeleteBtn.SetClickHdl( LINK( this, SfxDocumentPage, DeleteHdl ) );
45 aSignatureBtn.SetClickHdl( LINK( this, SfxDocumentPage, SignatureHdl ) );
46 + aChangePassBtn.SetClickHdl( LINK( this, SfxDocumentPage, ChangePassHdl ) );
48 // if the button text is too wide, then broaden it
49 const long nOffset = 12;
50 @@ -965,6 +969,32 @@ IMPL_LINK( SfxDocumentPage, SignatureHdl
54 +IMPL_LINK( SfxDocumentPage, ChangePassHdl, PushButton*, EMPTYARG )
56 + SfxObjectShell* pShell = SfxObjectShell::Current();
62 + SfxItemSet* pMedSet = pShell->GetMedium()->GetItemSet();
66 + ::std::auto_ptr<SfxPasswordDialog> pDlg(new SfxPasswordDialog(this));
68 + pDlg->ShowExtras(SHOWEXTRAS_CONFIRM);
69 + if (pDlg->Execute() != RET_OK)
72 + String aNewPass = pDlg->GetPassword();
73 + pMedSet->Put( SfxStringItem(SID_PASSWORD, aNewPass) );
74 + pShell->SetModified(true);
80 void SfxDocumentPage::ImplUpdateSignatures()
82 SfxObjectShell* pDoc = SfxObjectShell::Current();
83 @@ -1000,6 +1030,34 @@ void SfxDocumentPage::ImplUpdateSignatur
87 +void SfxDocumentPage::ImplCheckPasswordState()
89 + SfxObjectShell* pShell = SfxObjectShell::Current();
95 + SfxItemSet* pMedSet = pShell->GetMedium()->GetItemSet();
99 + const SfxPoolItem* pItem;
100 + if (!pMedSet->GetItemState(SID_PASSWORD, true, &pItem))
103 + const SfxStringItem* pStrItem = dynamic_cast<const SfxStringItem*>(pItem);
107 + String aPass = pStrItem->GetValue();
108 + aChangePassBtn.Enable();
112 + aChangePassBtn.Disable();
115 //------------------------------------------------------------------------
117 SfxTabPage* SfxDocumentPage::Create( Window* pParent, const SfxItemSet& rItemSet )
118 --- sfx2/source/dialog/dinfdlg.hrc.old 2009-04-02 10:43:54.000000000 +0000
119 +++ sfx2/source/dialog/dinfdlg.hrc 2009-04-06 16:41:54.000000000 +0000
121 #define FT_SIGNED_VAL 77
122 #define STR_MULTSIGNED 78
123 #define BTN_SIGNATURE 79
124 +#define BTN_CHANGE_PASS 80
126 #define WIN_PROPERTIES 90
127 #define SB_VERTICAL 91
128 --- sfx2/source/dialog/dinfdlg.src.old 2009-04-02 10:43:54.000000000 +0000
129 +++ sfx2/source/dialog/dinfdlg.src 2009-04-06 16:41:54.000000000 +0000
130 @@ -123,10 +123,17 @@ TabPage TP_DOCINFODOC
134 - Pos = MAP_APPFONT ( 54 , 12 ) ;
135 - Size = MAP_APPFONT ( 200 , RSC_CD_TEXTBOX_HEIGHT ) ;
136 + Pos = MAP_APPFONT ( 36 , 12 ) ;
137 + Size = MAP_APPFONT ( 140 , RSC_CD_TEXTBOX_HEIGHT ) ;
140 + PushButton BTN_CHANGE_PASS
142 + Pos = MAP_APPFONT ( 189 , 11 ) ;
143 + Size = MAP_APPFONT ( 65 , RSC_CD_PUSHBUTTON_HEIGHT ) ;
145 + Text [ en-US ] = "Change ~Password...";
149 Pos = MAP_APPFONT ( 6 , 31 ) ;