[Libreoffice-commits] .: Branch 'libreoffice-3-4' - patches/dev300
Kohei Yoshida
kohei at kemper.freedesktop.org
Wed Apr 6 20:20:53 PDT 2011
patches/dev300/apply | 3
patches/dev300/document-password-change-sfx2.diff | 150 ----------------------
2 files changed, 153 deletions(-)
New commits:
commit 985e89f5ac11804ee499b51aaaf27c174b2a16ae
Author: Kohei Yoshida <kyoshida at novell.com>
Date: Wed Apr 6 23:20:31 2011 -0400
Patch upstreamed to git.
diff --git a/patches/dev300/apply b/patches/dev300/apply
index 69c3d25..01abae6 100644
--- a/patches/dev300/apply
+++ b/patches/dev300/apply
@@ -292,9 +292,6 @@ svtools-default-new-document.diff, rodo
# Grouping items in the templates dialog n#106603
svtools-unsort-template-dialogentries.diff, rodo
-# allow users to change current document password.
-document-password-change-sfx2.diff, kohei
-
[ EasterEgg ]
# go-oo.org people active in this release
go-oo-team.diff, michael
diff --git a/patches/dev300/document-password-change-sfx2.diff b/patches/dev300/document-password-change-sfx2.diff
deleted file mode 100644
index cf36a54..0000000
--- a/patches/dev300/document-password-change-sfx2.diff
+++ /dev/null
@@ -1,150 +0,0 @@
---- 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& );
---- sfx2/source/dialog/dinfdlg.cxx
-+++ sfx2/source/dialog/dinfdlg.cxx
-@@ -65,6 +65,7 @@
- #include <sfx2/frame.hxx>
- #include <sfx2/viewfrm.hxx>
- #include <sfx2/request.hxx>
-+#include <sfx2/passwd.hxx>
- #include "helper.hxx"
- #include <sfx2/objsh.hxx>
- #include <sfx2/docfile.hxx>
-@@ -788,6 +789,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 ) ),
-@@ -829,8 +831,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;
-@@ -906,6 +910,32 @@ 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) );
-+ pShell->SetModified(true);
-+ }
-+ while (false);
-+ return 0;
-+}
-+
- void SfxDocumentPage::ImplUpdateSignatures()
- {
- SfxObjectShell* pDoc = SfxObjectShell::Current();
-@@ -941,6 +971,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 )
---- sfx2/source/dialog/dinfdlg.hrc
-+++ sfx2/source/dialog/dinfdlg.hrc
-@@ -133,6 +133,7 @@
- #define FT_SIGNED_VAL 77
- #define STR_MULTSIGNED 78
- #define BTN_SIGNATURE 79
-+#define BTN_CHANGE_PASS 80
-
- #define WIN_PROPERTIES 90
- #define SB_VERTICAL 91
---- sfx2/source/dialog/dinfdlg.src
-+++ sfx2/source/dialog/dinfdlg.src
-@@ -121,10 +121,18 @@ TabPage TP_DOCINFODOC
- Edit ED_FILE_NAME
- {
- HelpID = "sfx2:Edit:TP_DOCINFODOC: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
-+ {
-+ HelpID = "sfx2:Edit:TP_DOCINFODOC: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 ) ;
More information about the Libreoffice-commits
mailing list