Hi Mikhail,
I have made new patches to have the password create dialog integrated, I
tested the dialogs and did not find major problems, except when a wrong
password is input, the error message shows
----------
"Read-Error.\nThe wrong password has been entered."
----------
which is defined by ERRCODE_SFX_WRONGPASSWORD in
/svtools/source/misc/errtext.src, rather than the string defined by
STR_ERROR_PASSWORD_WRONG in /uui/source/passworderrs.src, though the
latter is expected in the ctor of PasswordDialog. The problem also
exists in the old implementation.
I think it is because the error handling on WrongPasswordException in
/sfx2/source/appl/appopen.cxx, in this case maybe it's better one of the
attempts to show the error message be removed? Either way, the related
resource string should be modified according to the specification. I'm
looking forward to your suggestion.
Thanks and Best Regards, :-)
Felix.
Mikhail Voitenko
Hi Felix,
You are right, the only related to this issue section of the
specification is 7.1.
So the first step is to create the new dialogs. You can try to create
the dialogs using the basic dialog editor, and to convert them
afterwards to the res files. That would probably simplify the creation.
Please read more about this possibility using the following link
http://wiki.services.openoffice.org/wiki/Dialog_Dump
Best regards,
Mikhail.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
diff -urNpw @uui/source/iahndl.cxx uui/source/iahndl.cxx
--- @uui/source/iahndl.cxx 2008-02-28 10:47:32.000000000 +0800
+++ uui/source/iahndl.cxx 2008-04-07 20:12:36.000000000 +0800
@@ -1607,15 +1607,6 @@ UUIInteractionHelper::executePasswordDia
xDialog(new PasswordCreateDialog(
getParentProperty(), xManager.get()));
- ::rtl::OUString aTitle( xDialog->GetText() );
- if( aDocName.getLength() )
- {
- aTitle += ::rtl::OUString::createFromAscii( " [" );
- aTitle += aDocName;
- aTitle += ::rtl::OUString::createFromAscii( "]" );
- xDialog->SetText( aTitle );
- }
-
rInfo.SetResult(xDialog->Execute() == RET_OK ? ERRCODE_BUTTON_OK :
ERRCODE_BUTTON_CANCEL);
rInfo.SetPassword( xDialog->GetPassword() );
@@ -1624,16 +1615,7 @@ UUIInteractionHelper::executePasswordDia
{
std::auto_ptr< PasswordDialog >
xDialog(new PasswordDialog(
- getParentProperty(), nMode, xManager.get()));
-
- ::rtl::OUString aTitle( xDialog->GetText() );
- if( aDocName.getLength() )
- {
- aTitle += ::rtl::OUString::createFromAscii( " [" );
- aTitle += aDocName;
- aTitle += ::rtl::OUString::createFromAscii( "]" );
- xDialog->SetText( aTitle );
- }
+ getParentProperty(), nMode, xManager.get(),
aDocName ));
rInfo.SetResult(xDialog->Execute() == RET_OK ? ERRCODE_BUTTON_OK :
ERRCODE_BUTTON_CANCEL);
diff -urNpw @uui/source/passcrtdlg.cxx uui/source/passcrtdlg.cxx
--- @uui/source/passcrtdlg.cxx 2008-02-28 10:47:32.000000000 +0800
+++ uui/source/passcrtdlg.cxx 2008-04-08 11:18:08.000000000 +0800
@@ -2,11 +2,11 @@
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: passcrtdlg.cxx,v $
+* $RCSfile: Generator.java,v $
*
- * $Revision: 1.5 $
+* $Revision: 1.2 $
*
- * last change: $Author: rt $ $Date: 2007/04/26 08:20:04 $
+* last change: $Author: fs $ $Date: 2006/09/05 08:26:35 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
@@ -72,7 +72,6 @@ IMPL_LINK( PasswordCreateDialog, OKHdl_I
String aErrorMsg( ResId( STR_ERROR_PASSWORDS_NOT_IDENTICAL,
*pResourceMgr ));
ErrorBox aErrorBox( this, WB_OK, aErrorMsg );
aErrorBox.Execute();
- aEDPasswordCrt.SetText( String() );
aEDPasswordRepeat.SetText( String() );
aEDPasswordCrt.GrabFocus();
}
@@ -81,23 +80,19 @@ IMPL_LINK( PasswordCreateDialog, OKHdl_I
// -----------------------------------------------------------------------
-PasswordCreateDialog::PasswordCreateDialog
-(
- Window*
pParent,
- ResMgr*
pResMgr
-) :
-
- ModalDialog( pParent, ResId( DLG_UUI_PASSWORD_CRT, *pResMgr ) ),
-
- aFTPasswordCrt ( this, ResId( FT_PASSWORD_CRT, *pResMgr ) ),
- aEDPasswordCrt ( this, ResId( ED_PASSWORD_CRT, *pResMgr ) ),
- aFTPasswordRepeat ( this, ResId( FT_PASSWORD_REPEAT, *pResMgr ) ),
- aEDPasswordRepeat ( this, ResId( ED_PASSWORD_REPEAT, *pResMgr ) ),
- aOKBtn ( this, ResId( BTN_PASSCRT_OK,
*pResMgr ) ),
- aCancelBtn ( this, ResId(
BTN_PASSCRT_CANCEL, *pResMgr ) ),
- aHelpBtn ( this, ResId(
BTN_PASSCRT_HELP, *pResMgr ) ),
- pResourceMgr ( pResMgr ),
- nMinLen(5)
+PasswordCreateDialog::PasswordCreateDialog( Window* _pParent, ResMgr * pResMgr
)
+ :ModalDialog( _pParent, ResId( DLG_UUI_PASSWORD_CRT, *pResMgr ) )
+ ,aFTPasswordCrt ( this, ResId( FT_PASSWORD_CRT, *pResMgr )
)
+ ,aEDPasswordCrt ( this, ResId( ED_PASSWORD_CRT, *pResMgr ) )
+ ,aEDPasswordRepeat ( this, ResId( ED_PASSWORD_REPEAT, *pResMgr )
)
+ ,aOKBtn ( this, ResId( BTN_PASSCRT_OK, *pResMgr ) )
+ ,aCancelBtn ( this, ResId( BTN_PASSCRT_CANCEL, *pResMgr ) )
+ ,aHelpBtn ( this, ResId( BTN_PASSCRT_HELP, *pResMgr ) )
+ ,aFTPasswordRepeat ( this, ResId( FT_PASSWORD_REPEAT, *pResMgr )
)
+ ,aFTWarning ( this, ResId( FT_PASSWORD_WARNING, *pResMgr )
)
+ ,aFixedLine1 ( this, ResId( FL_FIXED_LINE_1, *pResMgr ) )
+ ,pResourceMgr ( pResMgr )
+ ,nMinLen(5)
{
FreeResource();
@@ -105,5 +100,36 @@ PasswordCreateDialog::PasswordCreateDial
aEDPasswordCrt.SetModifyHdl( LINK( this, PasswordCreateDialog,
EditHdl_Impl ) );
aOKBtn.Enable( sal_False );
-};
+ long nLabelWidth = aFTWarning.GetSizePixel().Width();
+ long nLabelHeight = aFTWarning.GetSizePixel().Height();
+ long nTextWidth = aFTWarning.GetCtrlTextWidth( aFTWarning.GetText() );
+ long nTextHeight = aFTWarning.GetTextHeight();
+
+ Rectangle aLabelRect( aFTWarning.GetPosPixel(), aFTWarning.GetSizePixel()
);
+ Rectangle aRect = aFTWarning.GetTextRect( aLabelRect, aFTWarning.GetText()
);
+
+ long nNewLabelHeight = 0;
+ for( nNewLabelHeight = ( nTextWidth / nLabelWidth + 1 ) * nTextHeight;
+ nNewLabelHeight < aRect.GetHeight();
+ nNewLabelHeight += nTextHeight );
+
+ long nDelta = nNewLabelHeight - nLabelHeight;
+
+ Size aNewDlgSize = GetSizePixel();
+ aNewDlgSize.Height() += nDelta;
+ SetSizePixel( aNewDlgSize );
+
+ Size aNewWarningSize = aFTWarning.GetSizePixel();
+ aNewWarningSize.Height() = nNewLabelHeight;
+ aFTWarning.SetPosSizePixel( aFTWarning.GetPosPixel(), aNewWarningSize );
+
+ Window* pControls[] = { &aFixedLine1, &aOKBtn, &aCancelBtn, &aHelpBtn };
+ const sal_Int32 nCCount = sizeof( pControls ) / sizeof( pControls[0] );
+ for ( int i = 0; i < nCCount; ++i )
+ {
+ Point aNewPos =(*pControls[i]).GetPosPixel();
+ aNewPos.Y() += nDelta;
+ pControls[i]->SetPosSizePixel( aNewPos, pControls[i]->GetSizePixel() );
+ }
+}
diff -urNpw @uui/source/passcrtdlg.hrc uui/source/passcrtdlg.hrc
--- @uui/source/passcrtdlg.hrc 2008-02-28 10:47:32.000000000 +0800
+++ uui/source/passcrtdlg.hrc 2008-04-01 15:49:24.000000000 +0800
@@ -2,11 +2,11 @@
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: passcrtdlg.hrc,v $
+* $RCSfile: Generator.java,v $
*
- * $Revision: 1.3 $
+* $Revision: 1.2 $
*
- * last change: $Author: rt $ $Date: 2005/09/09 10:25:39 $
+* last change: $Author: fs $ $Date: 2006/09/05 08:26:35 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
@@ -33,17 +33,19 @@
*
************************************************************************/
-#ifndef UUI_PASSCRT_HRC
-#define UUI_PASSCRT_HRC
+#ifndef UUI_PASSCRTDLG_HRC
+#define UUI_PASSCRTDLG_HRC
-//============================================================================
-#define FT_PASSWORD_CRT 20
-#define ED_PASSWORD_CRT 21
-#define FT_PASSWORD_REPEAT 22
-#define ED_PASSWORD_REPEAT 23
+// local identifiers
+#define BTN_PASSCRT_CANCEL 1
+#define ED_PASSWORD_CRT 2
+#define FT_PASSWORD_REPEAT 3
+#define FT_PASSWORD_WARNING 4
+#define ED_PASSWORD_REPEAT 5
+#define FL_FIXED_LINE_1 6
+#define BTN_PASSCRT_OK 7
+#define BTN_PASSCRT_HELP 8
+#define FT_PASSWORD_CRT 9
-#define BTN_PASSCRT_OK 50
-#define BTN_PASSCRT_CANCEL 51
-#define BTN_PASSCRT_HELP 52
-#endif // UUI_PASSCRT_HRC
+#endif // UUI_PASSCRTDLG_HRC
diff -urNpw @uui/source/passcrtdlg.hxx uui/source/passcrtdlg.hxx
--- @uui/source/passcrtdlg.hxx 2008-02-28 10:47:32.000000000 +0800
+++ uui/source/passcrtdlg.hxx 2008-03-31 11:15:06.000000000 +0800
@@ -2,11 +2,11 @@
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: passcrtdlg.hxx,v $
+* $RCSfile: Generator.java,v $
*
- * $Revision: 1.3 $
+* $Revision: 1.2 $
*
- * last change: $Author: rt $ $Date: 2005/09/09 10:25:55 $
+* last change: $Author: fs $ $Date: 2006/09/05 08:26:35 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
@@ -42,37 +42,44 @@
#ifndef _STDCTRL_HXX
#include <svtools/stdctrl.hxx>
#endif
-#ifndef _SV_BUTTON_HXX
-#include <vcl/button.hxx>
-#endif
+
+
#ifndef _SV_DIALOG_HXX
#include <vcl/dialog.hxx>
#endif
+
#ifndef _SV_EDIT_HXX
#include <vcl/edit.hxx>
#endif
-#ifndef _SV_GROUP_HXX
-#include <vcl/group.hxx>
+#ifndef _SV_FIXED_HXX
+#include <vcl/fixed.hxx>
+#endif
+#ifndef _SV_BUTTON_HXX
+#include <vcl/button.hxx>
#endif
-//============================================================================
+
+//=====================================================================
+//= PasswordCreateDialog
+//=====================================================================
class PasswordCreateDialog : public ModalDialog
{
+private:
FixedText aFTPasswordCrt;
Edit aEDPasswordCrt;
FixedText aFTPasswordRepeat;
Edit aEDPasswordRepeat;
+ FixedText aFTWarning;
+ FixedLine aFixedLine1;
OKButton aOKBtn;
CancelButton aCancelBtn;
HelpButton aHelpBtn;
-
DECL_LINK( OKHdl_Impl, OKButton * );
DECL_LINK( EditHdl_Impl, Edit * );
public:
- PasswordCreateDialog( Window* pParent, ResMgr * pResMgr );
-
+ PasswordCreateDialog( Window* _pParent, ResMgr * pResMgr );
String GetPassword() const { return
aEDPasswordCrt.GetText(); }
private:
@@ -80,4 +87,5 @@ private:
sal_uInt16
nMinLen;
};
+
#endif // UUI_PASSCRTDLG_HXX
diff -urNpw @uui/source/passcrtdlg.src uui/source/passcrtdlg.src
--- @uui/source/passcrtdlg.src 2008-02-28 10:47:32.000000000 +0800
+++ uui/source/passcrtdlg.src 2008-04-07 20:09:14.000000000 +0800
@@ -2,11 +2,11 @@
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: passcrtdlg.src,v $
+* $RCSfile: Generator.java,v $
*
- * $Revision: 1.21 $
+* $Revision: 1.2 $
*
- * last change: $Author: ihi $ $Date: 2007/04/19 12:02:40 $
+* last change: $Author: fs $ $Date: 2006/09/05 08:26:35 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
@@ -39,7 +39,7 @@
#include <ids.hrc>
#endif
#ifndef UUI_PASSCRTDLG_HRC
-#include <passcrtdlg.hrc>
+#include "passcrtdlg.hrc"
#endif
ModalDialog DLG_UUI_PASSWORD_CRT
@@ -49,74 +49,61 @@ ModalDialog DLG_UUI_PASSWORD_CRT
Moveable = TRUE ;
OutputSize = TRUE ;
SVLook = TRUE ;
- Size = MAP_APPFONT ( 165 , 67 ) ;
+ Size = MAP_APPFONT( 145, 129 );
FixedText FT_PASSWORD_CRT
{
- Pos = MAP_APPFONT ( 6 , 5 ) ;
- Size = MAP_APPFONT ( 94 , 10 ) ;
- Text [ en-US ] = "~Enter password";
+ Pos = MAP_APPFONT( 3, 4 );
+ Size = MAP_APPFONT( 139, 9 );
+ Text [ en-US ] = "Enter password";
};
Edit ED_PASSWORD_CRT
{
Border = TRUE ;
- Pos = MAP_APPFONT ( 6 , 15 ) ;
- Size = MAP_APPFONT ( 94 , 12 ) ;
+ Pos = MAP_APPFONT( 3, 17 );
+ Size = MAP_APPFONT( 139, 13 );
PassWord = TRUE ;
};
- FixedText FT_PASSWORD_REPEAT
- {
- Pos = MAP_APPFONT ( 6 , 34 ) ;
- Size = MAP_APPFONT ( 94 , 10 ) ;
- Text [ en-US ] = "~Confirm password";
- };
Edit ED_PASSWORD_REPEAT
{
Border = TRUE ;
- Pos = MAP_APPFONT ( 6 , 44 ) ;
- Size = MAP_APPFONT ( 94 , 12 ) ;
+ Pos = MAP_APPFONT( 3, 47 );
+ Size = MAP_APPFONT( 139, 13 );
PassWord = TRUE ;
};
-
OKButton BTN_PASSCRT_OK
{
- Pos = MAP_APPFONT ( 109 , 6 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
+ Pos = MAP_APPFONT( 27, 110 );
+ Size = MAP_APPFONT( 37, 15 );
DefButton = TRUE ;
};
CancelButton BTN_PASSCRT_CANCEL
{
- Pos = MAP_APPFONT ( 109 , 23 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
+ Pos = MAP_APPFONT( 66, 110 );
+ Size = MAP_APPFONT( 37, 15 );
};
HelpButton BTN_PASSCRT_HELP
{
- Pos = MAP_APPFONT ( 109 , 43 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
+ Pos = MAP_APPFONT( 105, 110 );
+ Size = MAP_APPFONT( 37, 15 );
};
- Text [ en-US ] = "Password";
+ FixedText FT_PASSWORD_REPEAT
+ {
+ Pos = MAP_APPFONT( 3, 34 );
+ Size = MAP_APPFONT( 139, 9 );
+ Text [ en-US ] = "Reenter password";
+ };
+ FixedText FT_PASSWORD_WARNING
+ {
+ Pos = MAP_APPFONT( 4, 64 );
+ Size = MAP_APPFONT( 137, 40 );
+ Text [ en-US ] = "WARNING: If you lose or forget the password, it
cannot be recovered. It is advisable to keep passwords in a safe place.
Passwords are case-sensitive and at least five characters long.";
+ WordBreak = TRUE;
+ };
+ FixedLine FL_FIXED_LINE_1
+ {
+ Pos = MAP_APPFONT( 0, 104 );
+ Size = MAP_APPFONT( 145, 6 );
+ };
+ Text [ en-US ] = "Enter Password";
};
diff -urNpw @uui/source/passworddlg.cxx uui/source/passworddlg.cxx
--- @uui/source/passworddlg.cxx 2008-03-25 11:00:48.000000000 +0800
+++ uui/source/passworddlg.cxx 2008-04-08 09:28:40.000000000 +0800
@@ -64,30 +64,64 @@ IMPL_LINK( PasswordDialog, OKHdl_Impl, O
PasswordDialog::PasswordDialog
(
- Window*
pParent,
- ::com::sun::star::task::PasswordRequestMode aDialogMode,
- ResMgr*
pResMgr
-) :
-
- ModalDialog( pParent, ResId( DLG_UUI_PASSWORD, *pResMgr ) ),
-
- aFTPassword ( this, ResId( FT_PASSWORD, *pResMgr ) ),
- aEDPassword ( this, ResId( ED_PASSWORD, *pResMgr ) ),
- aOKBtn ( this, ResId( BTN_PASSWORD_OK, *pResMgr ) ),
- aCancelBtn ( this, ResId( BTN_PASSWORD_CANCEL, *pResMgr )
),
- aHelpBtn ( this, ResId( BTN_PASSWORD_HELP, *pResMgr ) ),
- nDialogMode ( aDialogMode ),
- pResourceMgr ( pResMgr )
+ Window* _pParent,
+ ::com::sun::star::task::PasswordRequestMode nDlgMode,
+ ResMgr * pResMgr,
+ rtl::OUString aDocURL
+ )
+ :ModalDialog( _pParent, ResId( DLG_UUI_PASSWORD, *pResMgr ) )
+ ,aFTPassword ( this, ResId( FT_PASSWORD, *pResMgr ) )
+ ,aEDPassword ( this, ResId( ED_PASSWORD, *pResMgr ) )
+ ,aOKBtn ( this, ResId( BTN_PASSWORD_OK, *pResMgr ) )
+ ,aCancelBtn ( this, ResId( BTN_PASSWORD_CANCEL, *pResMgr ) )
+ ,aHelpBtn ( this, ResId( BTN_PASSWORD_HELP, *pResMgr ) )
+ ,aFixedLine1 ( this, ResId( FL_FIXED_LINE_1, *pResMgr )
)
+ ,nDialogMode ( nDlgMode )
+ ,pResourceMgr ( pResMgr )
{
if( nDialogMode ==
::com::sun::star::task::PasswordRequestMode_PASSWORD_REENTER )
{
String aErrorMsg( ResId( STR_ERROR_PASSWORD_WRONG,
*pResourceMgr ));
- ErrorBox aErrorBox( pParent, WB_OK, aErrorMsg );
+ ErrorBox aErrorBox( _pParent, WB_OK, aErrorMsg );
aErrorBox.Execute();
}
FreeResource();
+ aFTPassword.SetText( aFTPassword.GetText() + aDocURL );
+
aOKBtn.SetClickHdl( LINK( this, PasswordDialog, OKHdl_Impl ) );
-};
+ long nLabelWidth = aFTPassword.GetSizePixel().Width();
+ long nLabelHeight = aFTPassword.GetSizePixel().Height();
+ long nTextWidth = aFTPassword.GetCtrlTextWidth( aFTPassword.GetText() );
+ long nTextHeight = aFTPassword.GetTextHeight();
+
+ Rectangle aLabelRect( aFTPassword.GetPosPixel(),
aFTPassword.GetSizePixel() );
+ Rectangle aRect = aFTPassword.GetTextRect( aLabelRect,
aFTPassword.GetText() );
+
+ long nNewLabelHeight = 0;
+ for( nNewLabelHeight = ( nTextWidth / nLabelWidth + 1 ) * nTextHeight;
+ nNewLabelHeight < aRect.GetHeight();
+ nNewLabelHeight += nTextHeight );
+
+ long nDelta = nNewLabelHeight - nLabelHeight;
+
+ Size aNewDlgSize = GetSizePixel();
+ aNewDlgSize.Height() += nDelta;
+ SetSizePixel( aNewDlgSize );
+
+ Size aNewLabelSize = aFTPassword.GetSizePixel();
+ aNewLabelSize.Height() = nNewLabelHeight;
+ aFTPassword.SetPosSizePixel( aFTPassword.GetPosPixel(), aNewLabelSize );
+
+ Window* pControls[] = { &aEDPassword, &aFixedLine1, &aOKBtn, &aCancelBtn,
&aHelpBtn };
+ const sal_Int32 nCCount = sizeof( pControls ) / sizeof( pControls[0] );
+ for ( int i = 0; i < nCCount; ++i )
+ {
+ Point aNewPos =(*pControls[i]).GetPosPixel();
+ aNewPos.Y() += nDelta;
+ pControls[i]->SetPosSizePixel( aNewPos, pControls[i]->GetSizePixel() );
+ }
+
+}
diff -urNpw @uui/source/passworddlg.hrc uui/source/passworddlg.hrc
--- @uui/source/passworddlg.hrc 2008-02-28 10:47:32.000000000 +0800
+++ uui/source/passworddlg.hrc 2008-04-01 15:54:18.000000000 +0800
@@ -2,11 +2,11 @@
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: passworddlg.hrc,v $
+* $RCSfile: Generator.java,v $
*
- * $Revision: 1.4 $
+* $Revision: 1.2 $
*
- * last change: $Author: rt $ $Date: 2005/09/09 10:26:45 $
+* last change: $Author: fs $ $Date: 2006/09/05 08:26:35 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
@@ -33,17 +33,16 @@
*
************************************************************************/
-#ifndef UUI_PASSWORD_HRC
-#define UUI_PASSWORD_HRC
+#ifndef PASSWORDDLG_HRC
+#define PASSWORDDLG_HRC
-//============================================================================
-#define FT_PASSWORD 20
-#define ED_PASSWORD 21
-#define FT_PASSWORD_REPEAT 22
-#define ED_PASSWORD_REPEAT 23
+// local identifiers
+#define BTN_PASSWORD_OK 1
+#define ED_PASSWORD 2
+#define FT_PASSWORD 3
+#define FL_FIXED_LINE_1 4
+#define BTN_PASSWORD_HELP 5
+#define BTN_PASSWORD_CANCEL 6
-#define BTN_PASSWORD_OK 50
-#define BTN_PASSWORD_CANCEL 51
-#define BTN_PASSWORD_HELP 52
-#endif // UUI_PASSWORD_HRC
+#endif // PASSWORDDLG_HRC
diff -urNpw @uui/source/passworddlg.hxx uui/source/passworddlg.hxx
--- @uui/source/passworddlg.hxx 2008-03-24 14:35:14.000000000 +0800
+++ uui/source/passworddlg.hxx 2008-04-01 16:09:58.000000000 +0800
@@ -2,11 +2,11 @@
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: passworddlg.hxx,v $
+* $RCSfile: Generator.java,v $
*
- * $Revision: 1.4 $
+* $Revision: 1.2 $
*
- * last change: $Author: rt $ $Date: 2005/09/09 10:27:02 $
+* last change: $Author: fs $ $Date: 2006/09/05 08:26:35 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
@@ -33,8 +33,8 @@
*
************************************************************************/
-#ifndef UUI_PASSWORDDLG_HXX
-#define UUI_PASSWORDDLG_HXX
+#ifndef PASSWORDDLG_HXX
+#define PASSWORDDLG_HXX
#ifndef _COM_SUN_STAR_TASK_PASSWORDREQUESTMODE_HPP
#include <com/sun/star/task/PasswordRequestMode.hpp>
@@ -51,11 +51,13 @@
#ifndef _SV_EDIT_HXX
#include <vcl/edit.hxx>
#endif
-#ifndef _SV_GROUP_HXX
-#include <vcl/group.hxx>
+#ifndef _SV_FIXED_HXX
+#include <vcl/fixed.hxx>
#endif
-//============================================================================
+//=====================================================================
+//= PasswordDialog
+//=====================================================================
class PasswordDialog : public ModalDialog
{
FixedText aFTPassword;
@@ -63,11 +65,12 @@ class PasswordDialog : public ModalDialo
OKButton aOKBtn;
CancelButton aCancelBtn;
HelpButton aHelpBtn;
+ FixedLine aFixedLine1;
DECL_LINK( OKHdl_Impl, OKButton * );
public:
- PasswordDialog( Window* pParent,
::com::sun::star::task::PasswordRequestMode nDlgMode, ResMgr * pResMgr );
+ PasswordDialog( Window* pParent,
::com::sun::star::task::PasswordRequestMode nDlgMode, ResMgr * pResMgr,
rtl::OUString aDocURL );
String GetPassword() const { return
aEDPassword.GetText(); }
@@ -76,5 +79,4 @@ private:
ResMgr*
pResourceMgr;
};
-#endif // UUI_PASSWORDDLG_HXX
-
+#endif // PASSWORDDLG_HXX
diff -urNpw @uui/source/passworddlg.src uui/source/passworddlg.src
--- @uui/source/passworddlg.src 2008-02-28 10:47:32.000000000 +0800
+++ uui/source/passworddlg.src 2008-04-02 09:49:28.000000000 +0800
@@ -2,11 +2,11 @@
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: passworddlg.src,v $
+* $RCSfile: Generator.java,v $
*
- * $Revision: 1.41 $
+* $Revision: 1.2 $
*
- * last change: $Author: ihi $ $Date: 2007/04/19 12:02:52 $
+* last change: $Author: fs $ $Date: 2006/09/05 08:26:35 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
@@ -49,37 +49,46 @@ ModalDialog DLG_UUI_PASSWORD
Moveable = TRUE ;
OutputSize = TRUE ;
SVLook = TRUE ;
- Size = MAP_APPFONT ( 165 , 64 ) ;
- Text [ en-US ] = "Password";
+ Size = MAP_APPFONT( 145, 75 );
+ Text [ en-US ] = "Enter password";
FixedText FT_PASSWORD
{
- Pos = MAP_APPFONT ( 6 , 5 ) ;
- Size = MAP_APPFONT ( 94 , 10 ) ;
- Text [ en-US ] = "Enter password";
+ Pos = MAP_APPFONT( 3, 4 );
+ Size = MAP_APPFONT( 139, 28 );
+ Text [ en-US ] = "Enter password to open the file: \n";
+ WordBreak = TRUE;
};
+
Edit ED_PASSWORD
{
+ Pos = MAP_APPFONT( 3, 35 );
+ Size = MAP_APPFONT( 139, 13 );
Border = TRUE ;
- Pos = MAP_APPFONT ( 6 , 15 ) ;
- Size = MAP_APPFONT ( 94 , 12 ) ;
PassWord = TRUE ;
};
OKButton BTN_PASSWORD_OK
{
- Pos = MAP_APPFONT ( 109 , 6 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- DefButton = TRUE ;
+ Pos = MAP_APPFONT( 27, 56 );
+ Size = MAP_APPFONT( 37, 15 );
};
+
CancelButton BTN_PASSWORD_CANCEL
{
- Pos = MAP_APPFONT ( 109 , 23 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
+ Pos = MAP_APPFONT( 66, 56 );
+ Size = MAP_APPFONT( 37, 15 );
};
+
HelpButton BTN_PASSWORD_HELP
{
- Pos = MAP_APPFONT ( 109 , 43 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
+ Pos = MAP_APPFONT( 105, 56 );
+ Size = MAP_APPFONT( 37, 15 );
+ };
+
+ FixedLine FL_FIXED_LINE_1
+ {
+ Pos = MAP_APPFONT( 0, 50 );
+ Size = MAP_APPFONT( 145, 6 );
};
};
diff -urNpw @sfx2/source/appl/appopen.cxx sfx2/source/appl/appopen.cxx
--- @sfx2/source/appl/appopen.cxx 2008-02-28 10:42:22.000000000 +0800
+++ sfx2/source/appl/appopen.cxx 2008-04-01 11:58:22.000000000 +0800
@@ -390,7 +390,7 @@ ULONG CheckPasswd_Impl
RequestDocumentPassword* pPasswordRequest =
new RequestDocumentPassword(
::com::sun::star::task::PasswordRequestMode_PASSWORD_ENTER,
- INetURLObject( pFile->GetOrigURL()
).GetName( INetURLObject::DECODE_WITH_CHARSET ) );
+ INetURLObject( pFile->GetOrigURL()
).GetMainURL( INetURLObject::DECODE_WITH_CHARSET ) );
Reference< XInteractionRequest > rRequest(
pPasswordRequest );
xInteractionHandler->handle( rRequest );
diff -urNpw @sfx2/source/dialog/filedlghelper.cxx
sfx2/source/dialog/filedlghelper.cxx
--- @sfx2/source/dialog/filedlghelper.cxx 2008-02-28 10:42:24.000000000
+0800
+++ sfx2/source/dialog/filedlghelper.cxx 2008-04-08 11:06:26.000000000
+0800
@@ -114,6 +114,9 @@
#ifndef _COM_SUN_STAR_UCB_INTERACTIVEAUGMENTEDIOEXCEPTION_HPP_
#include <com/sun/star/ucb/InteractiveAugmentedIOException.hpp>
#endif
+#ifndef _COM_SUN_STAR_TASK_XINTERACTIONREQUEST_HPP_
+#include <com/sun/star/task/XInteractionRequest.hpp>
+#endif
#ifndef _COMPHELPER_PROCESSFACTORY_HXX_
#include <comphelper/processfactory.hxx>
@@ -237,6 +240,9 @@
#ifndef _SFX_FILEDLGIMPL_HXX
#include "filedlgimpl.hxx"
#endif
+#ifndef INCLUDED_SVTOOLS_DOCPASSWDREQUEST_HXX
+#include <svtools/docpasswdrequest.hxx>
+#endif
#include <sfxlocal.hrc>
@@ -1654,31 +1660,6 @@ ErrCode FileDialogHelper_Impl::execute(
if( !rpSet )
rpSet = new SfxAllItemSet( SFX_APP()->GetPool() );
- // check, wether or not we have to display a password box
- if ( mbHasPassword && mbIsPwdEnabled && xCtrlAccess.is() )
- {
- try
- {
- Any aValue = xCtrlAccess->getValue(
ExtendedFilePickerElementIds::CHECKBOX_PASSWORD, 0 );
- sal_Bool bPassWord = sal_False;
- if ( ( aValue >>= bPassWord ) && bPassWord )
- {
- // ask for the password
- SfxPasswordDialog aPasswordDlg( NULL );
- aPasswordDlg.ShowExtras(
SHOWEXTRAS_CONFIRM );
- short nRet = aPasswordDlg.Execute();
- if ( RET_OK == nRet )
- {
- String aPasswd =
aPasswordDlg.GetPassword();
- rpSet->Put( SfxStringItem(
SID_PASSWORD, aPasswd ) );
- }
- else
- return ERRCODE_ABORT;
- }
- }
- catch( IllegalArgumentException ){}
- }
-
if( mbExport )
{
try
@@ -1737,6 +1718,21 @@ ErrCode FileDialogHelper_Impl::execute(
if ( rpURLList == NULL )
return ERRCODE_ABORT;
+ // check, whether or not we have to display a password box
+ if ( mbHasPassword && mbIsPwdEnabled && xCtrlAccess.is() )
+ {
+ uno::Reference < ::com::sun::star::task::XInteractionHandler >
xInteractionHandler(
::comphelper::getProcessServiceFactory()->createInstance(::rtl::OUString::createFromAscii("com.sun.star.comp.uui.UUIInteractionHandler")),
UNO_QUERY );
+
+ if( xInteractionHandler.is() )
+ {
+ RequestDocumentPassword* pPasswordRequest = new
RequestDocumentPassword(
+
::com::sun::star::task::PasswordRequestMode_PASSWORD_CREATE,
*(rpURLList->GetObject(0)) );
+
+ uno::Reference< com::sun::star::task::XInteractionRequest >
rRequest( pPasswordRequest );
+ xInteractionHandler->handle( rRequest );
+ }
+ }
+
SaveLastUsedFilter();
return ERRCODE_NONE;
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]