ooo-build r13659 - in trunk: . patches/dev300
- From: kyoshida svn gnome org
- To: svn-commits-list gnome org
- Subject: ooo-build r13659 - in trunk: . patches/dev300
- Date: Fri, 22 Aug 2008 21:35:20 +0000 (UTC)
Author: kyoshida
Date: Fri Aug 22 21:35:20 2008
New Revision: 13659
URL: http://svn.gnome.org/viewvc/ooo-build?rev=13659&view=rev
Log:
2008-08-22 Kohei Yoshida <kyoshida novell com>
* patches/dev300/document-password-change-sfx2.diff: allow users to
change document's current passowrd for encryption, so that they won't
have to save as and overwrite the current document to change it. When
the current password is changed, a simple save will save it with the
new password. To change password, go to File -> Properties and on the
General tab, there is a button named "Change Password...".
* patches/dev300/min-password-length-sfx2.diff: reduce the mininum
password length required for odf encryption from 5 to 1. A single
letter password works just fine, and there is no justification (other
than that "short passwords are insecure" mantra) for requiring a length
of 5 (i#85453).
* patches/dev300/apply: apply these new patches.
Added:
trunk/patches/dev300/document-password-change-sfx2.diff
trunk/patches/dev300/min-password-length-sfx2.diff
Modified:
trunk/ChangeLog
trunk/patches/dev300/apply
Modified: trunk/patches/dev300/apply
==============================================================================
--- trunk/patches/dev300/apply (original)
+++ trunk/patches/dev300/apply Fri Aug 22 21:35:20 2008
@@ -801,6 +801,11 @@
remove-sfx-notify-svx.diff, i#89811, kohei
#sfx-broadcaster-hashset-svtools.diff
+# reduce mininum password length from 5 to 1.
+min-password-length-sfx2.diff, i#85453, kohei
+
+# allow users to change current document password.
+document-password-change-sfx2.diff, kohei
[ PopupRemoval ]
# Remove unnecessary popups that might show up during startup.
Added: trunk/patches/dev300/document-password-change-sfx2.diff
==============================================================================
--- (empty file)
+++ trunk/patches/dev300/document-password-change-sfx2.diff Fri Aug 22 21:35:20 2008
@@ -0,0 +1,157 @@
+diff --git sfx2/inc/sfx2/dinfdlg.hxx sfx2/inc/sfx2/dinfdlg.hxx
+index 3e1c252..113d2db 100644
+--- sfx2/inc/sfx2/dinfdlg.hxx
++++ sfx2/inc/sfx2/dinfdlg.hxx
+@@ -173,6 +173,7 @@ class SfxDocumentPage : public SfxTabPage
+ private:
+ FixedImage aBmp1;
+ Edit aNameED;
++ PushButton aChangePassBtn;
+
+ FixedLine aLine1FL;
+ FixedText aTypeFT;
+@@ -212,7 +213,9 @@ private:
+
+ DECL_LINK( DeleteHdl, PushButton * );
+ DECL_LINK( SignatureHdl, PushButton * );
++ DECL_LINK( ChangePassHdl, PushButton * );
+ void ImplUpdateSignatures();
++ void ImplCheckPasswordState();
+
+ protected:
+ SfxDocumentPage( Window* pParent, const SfxItemSet& );
+diff --git sfx2/source/dialog/dinfdlg.cxx sfx2/source/dialog/dinfdlg.cxx
+index 075f9ee..b897c9c 100644
+--- sfx2/source/dialog/dinfdlg.cxx
++++ sfx2/source/dialog/dinfdlg.cxx
+@@ -66,6 +66,7 @@
+ #include <sfx2/frame.hxx>
+ #include <sfx2/viewfrm.hxx>
+ #include <sfx2/request.hxx>
++#include <sfx2/passwd.hxx>
+ //#include "exptypes.hxx"
+ #include "helper.hxx"
+ #include <sfx2/objsh.hxx>
+@@ -767,6 +768,7 @@ SfxDocumentPage::SfxDocumentPage( Window* pParent, const SfxItemSet& rItemSet )
+
+ aBmp1 ( this, SfxResId( BMP_FILE_1 ) ),
+ aNameED ( this, SfxResId( ED_FILE_NAME ) ),
++ aChangePassBtn ( this, SfxResId( BTN_CHANGE_PASS ) ),
+
+ aLine1FL ( this, SfxResId( FL_FILE_1 ) ),
+ aTypeFT ( this, SfxResId( FT_FILE_TYP ) ),
+@@ -808,8 +810,10 @@ SfxDocumentPage::SfxDocumentPage( Window* pParent, const SfxItemSet& rItemSet )
+ FreeResource();
+
+ ImplUpdateSignatures();
++ ImplCheckPasswordState();
+ aDeleteBtn.SetClickHdl( LINK( this, SfxDocumentPage, DeleteHdl ) );
+ aSignatureBtn.SetClickHdl( LINK( this, SfxDocumentPage, SignatureHdl ) );
++ aChangePassBtn.SetClickHdl( LINK( this, SfxDocumentPage, ChangePassHdl ) );
+
+ // if the button text is too wide, then broaden it
+ const long nOffset = 12;
+@@ -878,6 +882,31 @@ IMPL_LINK( SfxDocumentPage, SignatureHdl, PushButton*, EMPTYARG )
+ return 0;
+ }
+
++IMPL_LINK( SfxDocumentPage, ChangePassHdl, PushButton*, EMPTYARG )
++{
++ SfxObjectShell* pShell = SfxObjectShell::Current();
++ do
++ {
++ if (!pShell)
++ break;
++
++ SfxItemSet* pMedSet = pShell->GetMedium()->GetItemSet();
++ if (!pMedSet)
++ break;
++
++ ::std::auto_ptr<SfxPasswordDialog> pDlg(new SfxPasswordDialog(this));
++ pDlg->SetMinLen(1);
++ pDlg->ShowExtras(SHOWEXTRAS_CONFIRM);
++ if (pDlg->Execute() != RET_OK)
++ break;
++
++ String aNewPass = pDlg->GetPassword();
++ pMedSet->Put( SfxStringItem(SID_PASSWORD, aNewPass) );
++ }
++ while (false);
++ return 0;
++}
++
+ void SfxDocumentPage::ImplUpdateSignatures()
+ {
+ SfxObjectShell* pDoc = SfxObjectShell::Current();
+@@ -913,6 +942,34 @@ void SfxDocumentPage::ImplUpdateSignatures()
+ }
+ }
+
++void SfxDocumentPage::ImplCheckPasswordState()
++{
++ SfxObjectShell* pShell = SfxObjectShell::Current();
++ do
++ {
++ if (!pShell)
++ break;
++
++ SfxItemSet* pMedSet = pShell->GetMedium()->GetItemSet();
++ if (!pMedSet)
++ break;
++
++ const SfxPoolItem* pItem;
++ if (!pMedSet->GetItemState(SID_PASSWORD, true, &pItem))
++ break;
++
++ const SfxStringItem* pStrItem = dynamic_cast<const SfxStringItem*>(pItem);
++ if (!pStrItem)
++ break;
++
++ String aPass = pStrItem->GetValue();
++ aChangePassBtn.Enable();
++ return;
++ }
++ while (false);
++ aChangePassBtn.Disable();
++}
++
+ //------------------------------------------------------------------------
+
+ SfxTabPage* SfxDocumentPage::Create( Window* pParent, const SfxItemSet& rItemSet )
+diff --git sfx2/source/dialog/dinfdlg.hrc sfx2/source/dialog/dinfdlg.hrc
+index 1110be8..543c6ad 100644
+--- sfx2/source/dialog/dinfdlg.hrc
++++ sfx2/source/dialog/dinfdlg.hrc
+@@ -126,6 +126,7 @@
+ #define FT_SIGNED_VAL 77
+ #define STR_MULTSIGNED 78
+ #define BTN_SIGNATURE 79
++#define BTN_CHANGE_PASS 80
+
+ #endif
+
+diff --git sfx2/source/dialog/dinfdlg.src sfx2/source/dialog/dinfdlg.src
+index 5e08e3b..1502c55 100644
+--- sfx2/source/dialog/dinfdlg.src
++++ sfx2/source/dialog/dinfdlg.src
+@@ -123,10 +123,17 @@ TabPage TP_DOCINFODOC
+ };
+ Edit ED_FILE_NAME
+ {
+- Pos = MAP_APPFONT ( 54 , 12 ) ;
+- Size = MAP_APPFONT ( 200 , RSC_CD_TEXTBOX_HEIGHT ) ;
++ Pos = MAP_APPFONT ( 36 , 12 ) ;
++ Size = MAP_APPFONT ( 140 , RSC_CD_TEXTBOX_HEIGHT ) ;
+ Border = TRUE ;
+ };
++ PushButton BTN_CHANGE_PASS
++ {
++ Pos = MAP_APPFONT ( 189 , 11 ) ;
++ Size = MAP_APPFONT ( 65 , RSC_CD_PUSHBUTTON_HEIGHT ) ;
++ Hide = FALSE;
++ Text [ en-US ] = "Change ~Password...";
++ };
+ FixedLine FL_FILE_1
+ {
+ Pos = MAP_APPFONT ( 6 , 31 ) ;
+
Added: trunk/patches/dev300/min-password-length-sfx2.diff
==============================================================================
--- (empty file)
+++ trunk/patches/dev300/min-password-length-sfx2.diff Fri Aug 22 21:35:20 2008
@@ -0,0 +1,13 @@
+diff --git sfx2/source/dialog/passwd.cxx sfx2/source/dialog/passwd.cxx
+index 062fb9c..3bfe4d7 100644
+--- sfx2/source/dialog/passwd.cxx
++++ sfx2/source/dialog/passwd.cxx
+@@ -88,7 +88,7 @@ SfxPasswordDialog::SfxPasswordDialog( Window* pParent, const String* pGroupText
+ maHelpBtn ( this, SfxResId( BTN_PASSWD_HELP ) ),
+ maConfirmStr ( SfxResId( STR_PASSWD_CONFIRM ) ),
+
+- mnMinLen ( 5 ),
++ mnMinLen ( 1 ),
+ maMinLenPwdStr ( SfxResId( STR_PASSWD_MIN_LEN ) ),
+ maEmptyPwdStr ( SfxResId( STR_PASSWD_EMPTY ) ),
+ maMainPwdStr ( ),
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]