summaryrefslogtreecommitdiff
path: root/uui/source
diff options
context:
space:
mode:
authorDirk Voelzke <dv@openoffice.org>2010-04-22 09:14:14 +0200
committerDirk Voelzke <dv@openoffice.org>2010-04-22 09:14:14 +0200
commitb72bd3e81ad3602822220224474c7f89c7560763 (patch)
tree2fa6240c197fd19525cd5c1f3f8d3deee79be076 /uui/source
parent34e224f6783d92e0a75d070a0e5b5fa65822462b (diff)
parenta001605a190749900d3e09aa864ce56925ff848e (diff)
dv12: merge with DEV300_m76
Diffstat (limited to 'uui/source')
-rw-r--r--uui/source/alreadyopen.cxx5
-rw-r--r--uui/source/alreadyopen.hxx5
-rw-r--r--uui/source/alreadyopen.src5
-rw-r--r--uui/source/cookiedg.cxx7
-rw-r--r--uui/source/cookiedg.hrc5
-rw-r--r--uui/source/cookiedg.hxx5
-rw-r--r--uui/source/cookiedg.src5
-rw-r--r--uui/source/filechanged.cxx5
-rw-r--r--uui/source/filechanged.hxx5
-rw-r--r--uui/source/filechanged.src5
-rw-r--r--uui/source/fltdlg.cxx5
-rw-r--r--uui/source/fltdlg.hrc5
-rw-r--r--uui/source/fltdlg.hxx5
-rw-r--r--uui/source/fltdlg.src5
-rw-r--r--uui/source/getcontinuations.hxx118
-rw-r--r--uui/source/iahndl-authentication.cxx585
-rw-r--r--uui/source/iahndl-cookies.cxx209
-rw-r--r--uui/source/iahndl-errorhandler.cxx318
-rw-r--r--uui/source/iahndl-filter.cxx471
-rw-r--r--uui/source/iahndl-ioexceptions.cxx343
-rw-r--r--uui/source/iahndl-locking.cxx316
-rw-r--r--uui/source/iahndl-ssl.cxx357
-rwxr-xr-x[-rw-r--r--]uui/source/iahndl.cxx4289
-rw-r--r--uui/source/iahndl.hxx475
-rw-r--r--uui/source/ids.hrc11
-rw-r--r--uui/source/ids.src26
-rw-r--r--uui/source/interactionhandler.cxx5
-rw-r--r--uui/source/interactionhandler.hxx5
-rw-r--r--uui/source/lockfailed.cxx5
-rw-r--r--uui/source/lockfailed.hxx5
-rw-r--r--uui/source/lockfailed.src7
-rw-r--r--uui/source/logindlg.cxx5
-rw-r--r--uui/source/logindlg.hrc5
-rw-r--r--uui/source/logindlg.hxx5
-rw-r--r--uui/source/logindlg.src5
-rw-r--r--uui/source/loginerr.hxx5
-rw-r--r--uui/source/makefile.mk38
-rw-r--r--uui/source/masterpasscrtdlg.cxx5
-rw-r--r--uui/source/masterpasscrtdlg.hrc5
-rw-r--r--uui/source/masterpasscrtdlg.hxx5
-rw-r--r--uui/source/masterpasscrtdlg.src5
-rw-r--r--uui/source/masterpassworddlg.cxx5
-rw-r--r--uui/source/masterpassworddlg.hrc5
-rw-r--r--uui/source/masterpassworddlg.hxx5
-rw-r--r--uui/source/masterpassworddlg.src5
-rw-r--r--uui/source/mphndl.hxx5
-rw-r--r--uui/source/newerverwarn.cxx5
-rw-r--r--uui/source/newerverwarn.hrc5
-rw-r--r--uui/source/newerverwarn.hxx5
-rw-r--r--uui/source/newerverwarn.src5
-rw-r--r--uui/source/openlocked.cxx5
-rw-r--r--uui/source/openlocked.hxx5
-rw-r--r--uui/source/openlocked.src5
-rw-r--r--uui/source/passcrtdlg.cxx5
-rw-r--r--uui/source/passcrtdlg.hrc5
-rw-r--r--uui/source/passcrtdlg.hxx5
-rw-r--r--uui/source/passcrtdlg.src5
-rw-r--r--uui/source/passwordcontainer.cxx470
-rw-r--r--uui/source/passwordcontainer.hxx197
-rw-r--r--uui/source/passworddlg.cxx5
-rw-r--r--uui/source/passworddlg.hrc5
-rw-r--r--uui/source/passworddlg.hxx5
-rw-r--r--uui/source/passworddlg.src5
-rw-r--r--uui/source/passworderrs.src5
-rw-r--r--uui/source/requeststringresolver.cxx5
-rw-r--r--uui/source/requeststringresolver.hxx5
-rw-r--r--uui/source/secmacrowarnings.cxx5
-rw-r--r--uui/source/secmacrowarnings.hrc5
-rw-r--r--uui/source/secmacrowarnings.hxx7
-rw-r--r--uui/source/secmacrowarnings.src5
-rw-r--r--uui/source/services.cxx79
-rw-r--r--uui/source/sslwarndlg.cxx5
-rw-r--r--uui/source/sslwarndlg.hrc5
-rw-r--r--uui/source/sslwarndlg.hxx5
-rw-r--r--uui/source/sslwarndlg.src5
-rw-r--r--uui/source/trylater.cxx5
-rw-r--r--uui/source/trylater.hxx5
-rw-r--r--uui/source/trylater.src5
-rw-r--r--uui/source/unknownauthdlg.cxx5
-rw-r--r--uui/source/unknownauthdlg.hrc5
-rw-r--r--uui/source/unknownauthdlg.hxx5
-rw-r--r--uui/source/unknownauthdlg.src5
82 files changed, 4717 insertions, 3921 deletions
diff --git a/uui/source/alreadyopen.cxx b/uui/source/alreadyopen.cxx
index 1f2b170f60fc..d3b96d4e2668 100644
--- a/uui/source/alreadyopen.cxx
+++ b/uui/source/alreadyopen.cxx
@@ -2,13 +2,10 @@
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
- * Copyright 2008 by Sun Microsystems, Inc.
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: openlocked.cxx,v $
- * $Revision: 1.3 $
- *
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
diff --git a/uui/source/alreadyopen.hxx b/uui/source/alreadyopen.hxx
index 2ba2db8a06b9..b265aee85921 100644
--- a/uui/source/alreadyopen.hxx
+++ b/uui/source/alreadyopen.hxx
@@ -2,13 +2,10 @@
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
- * Copyright 2008 by Sun Microsystems, Inc.
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: openlocked.hxx,v $
- * $Revision: 1.3 $
- *
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
diff --git a/uui/source/alreadyopen.src b/uui/source/alreadyopen.src
index e4222af91dce..928973947e38 100644
--- a/uui/source/alreadyopen.src
+++ b/uui/source/alreadyopen.src
@@ -2,13 +2,10 @@
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
- * Copyright 2008 by Sun Microsystems, Inc.
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: openlocked.src,v $
- * $Revision: 1.3 $
- *
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
diff --git a/uui/source/cookiedg.cxx b/uui/source/cookiedg.cxx
index 699814efef32..a806ff4e59e8 100644
--- a/uui/source/cookiedg.cxx
+++ b/uui/source/cookiedg.cxx
@@ -2,13 +2,10 @@
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
- * Copyright 2008 by Sun Microsystems, Inc.
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: cookiedg.cxx,v $
- * $Revision: 1.4 $
- *
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
@@ -28,7 +25,7 @@
*
************************************************************************/
-#include <svtools/httpcook.hxx>
+#include <svl/httpcook.hxx>
#include <tools/urlobj.hxx>
#include <vcl/msgbox.hxx>
diff --git a/uui/source/cookiedg.hrc b/uui/source/cookiedg.hrc
index 8f48c068fda2..01d93e17de7f 100644
--- a/uui/source/cookiedg.hrc
+++ b/uui/source/cookiedg.hrc
@@ -2,13 +2,10 @@
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
- * Copyright 2008 by Sun Microsystems, Inc.
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: cookiedg.hrc,v $
- * $Revision: 1.3 $
- *
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
diff --git a/uui/source/cookiedg.hxx b/uui/source/cookiedg.hxx
index a0eab6117eb5..42dec3d08611 100644
--- a/uui/source/cookiedg.hxx
+++ b/uui/source/cookiedg.hxx
@@ -2,13 +2,10 @@
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
- * Copyright 2008 by Sun Microsystems, Inc.
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: cookiedg.hxx,v $
- * $Revision: 1.3 $
- *
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
diff --git a/uui/source/cookiedg.src b/uui/source/cookiedg.src
index 4e88955f76b7..9df0d481d6ae 100644
--- a/uui/source/cookiedg.src
+++ b/uui/source/cookiedg.src
@@ -2,13 +2,10 @@
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
- * Copyright 2008 by Sun Microsystems, Inc.
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: cookiedg.src,v $
- * $Revision: 1.33 $
- *
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
diff --git a/uui/source/filechanged.cxx b/uui/source/filechanged.cxx
index 31e942309c0d..900336d043b0 100644
--- a/uui/source/filechanged.cxx
+++ b/uui/source/filechanged.cxx
@@ -2,13 +2,10 @@
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
- * Copyright 2008 by Sun Microsystems, Inc.
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: openlocked.cxx,v $
- * $Revision: 1.3 $
- *
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
diff --git a/uui/source/filechanged.hxx b/uui/source/filechanged.hxx
index 76f4ad3e8e97..09c542d1f781 100644
--- a/uui/source/filechanged.hxx
+++ b/uui/source/filechanged.hxx
@@ -2,13 +2,10 @@
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
- * Copyright 2008 by Sun Microsystems, Inc.
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: openlocked.hxx,v $
- * $Revision: 1.3 $
- *
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
diff --git a/uui/source/filechanged.src b/uui/source/filechanged.src
index 4ebf0826e0a5..fa07c40c0853 100644
--- a/uui/source/filechanged.src
+++ b/uui/source/filechanged.src
@@ -2,13 +2,10 @@
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
- * Copyright 2008 by Sun Microsystems, Inc.
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: openlocked.src,v $
- * $Revision: 1.3 $
- *
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
diff --git a/uui/source/fltdlg.cxx b/uui/source/fltdlg.cxx
index d8de709448ef..4bda9fb9e579 100644
--- a/uui/source/fltdlg.cxx
+++ b/uui/source/fltdlg.cxx
@@ -2,13 +2,10 @@
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
- * Copyright 2008 by Sun Microsystems, Inc.
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: fltdlg.cxx,v $
- * $Revision: 1.5 $
- *
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
diff --git a/uui/source/fltdlg.hrc b/uui/source/fltdlg.hrc
index ecec7fa013ec..8a6b2fddcd16 100644
--- a/uui/source/fltdlg.hrc
+++ b/uui/source/fltdlg.hrc
@@ -2,13 +2,10 @@
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
- * Copyright 2008 by Sun Microsystems, Inc.
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: fltdlg.hrc,v $
- * $Revision: 1.4 $
- *
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
diff --git a/uui/source/fltdlg.hxx b/uui/source/fltdlg.hxx
index 9cbf0a8749d8..7284ae001437 100644
--- a/uui/source/fltdlg.hxx
+++ b/uui/source/fltdlg.hxx
@@ -2,13 +2,10 @@
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
- * Copyright 2008 by Sun Microsystems, Inc.
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: fltdlg.hxx,v $
- * $Revision: 1.4 $
- *
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
diff --git a/uui/source/fltdlg.src b/uui/source/fltdlg.src
index bbadb91e2fc4..84e27cd1be1f 100644
--- a/uui/source/fltdlg.src
+++ b/uui/source/fltdlg.src
@@ -2,13 +2,10 @@
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
- * Copyright 2008 by Sun Microsystems, Inc.
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: fltdlg.src,v $
- * $Revision: 1.17 $
- *
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
diff --git a/uui/source/getcontinuations.hxx b/uui/source/getcontinuations.hxx
new file mode 100644
index 000000000000..650bb50bedfb
--- /dev/null
+++ b/uui/source/getcontinuations.hxx
@@ -0,0 +1,118 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef INCLUDED_UUI_GETCONTINUATIONS_HXX
+#define INCLUDED_UUI_GETCONTINUATIONS_HXX
+
+#include "com/sun/star/uno/Reference.hxx"
+#include "com/sun/star/uno/Sequence.hxx"
+
+namespace com { namespace sun { namespace star {
+ namespace task {
+ class XInteractionContinuation;
+ }
+} } }
+
+template< class t1 >
+bool setContinuation(
+ com::sun::star::uno::Reference<
+ com::sun::star::task::XInteractionContinuation > const & rContinuation,
+ com::sun::star::uno::Reference< t1 > * pContinuation)
+{
+ if (pContinuation && !pContinuation->is())
+ {
+ pContinuation->set(rContinuation, com::sun::star::uno::UNO_QUERY);
+ if (pContinuation->is())
+ return true;
+ }
+ return false;
+}
+
+template< class t1, class t2 >
+void getContinuations(
+ com::sun::star::uno::Sequence<
+ com::sun::star::uno::Reference<
+ com::sun::star::task::XInteractionContinuation > > const &
+ rContinuations,
+ com::sun::star::uno::Reference< t1 > * pContinuation1,
+ com::sun::star::uno::Reference< t2 > * pContinuation2)
+{
+ for (sal_Int32 i = 0; i < rContinuations.getLength(); ++i)
+ {
+ if (setContinuation(rContinuations[i], pContinuation1))
+ continue;
+ if (setContinuation(rContinuations[i], pContinuation2))
+ continue;
+ }
+}
+
+template< class t1, class t2, class t3 >
+void getContinuations(
+ com::sun::star::uno::Sequence<
+ com::sun::star::uno::Reference<
+ com::sun::star::task::XInteractionContinuation > > const &
+ rContinuations,
+ com::sun::star::uno::Reference< t1 > * pContinuation1,
+ com::sun::star::uno::Reference< t2 > * pContinuation2,
+ com::sun::star::uno::Reference< t3 > * pContinuation3)
+{
+ for (sal_Int32 i = 0; i < rContinuations.getLength(); ++i)
+ {
+ if (setContinuation(rContinuations[i], pContinuation1))
+ continue;
+ if (setContinuation(rContinuations[i], pContinuation2))
+ continue;
+ if (setContinuation(rContinuations[i], pContinuation3))
+ continue;
+ }
+}
+
+template< class t1, class t2, class t3, class t4 >
+void getContinuations(
+ com::sun::star::uno::Sequence<
+ com::sun::star::uno::Reference<
+ com::sun::star::task::XInteractionContinuation > > const &
+ rContinuations,
+ com::sun::star::uno::Reference< t1 > * pContinuation1,
+ com::sun::star::uno::Reference< t2 > * pContinuation2,
+ com::sun::star::uno::Reference< t3 > * pContinuation3,
+ com::sun::star::uno::Reference< t4 > * pContinuation4)
+{
+ for (sal_Int32 i = 0; i < rContinuations.getLength(); ++i)
+ {
+ if (setContinuation(rContinuations[i], pContinuation1))
+ continue;
+ if (setContinuation(rContinuations[i], pContinuation2))
+ continue;
+ if (setContinuation(rContinuations[i], pContinuation3))
+ continue;
+ if (setContinuation(rContinuations[i], pContinuation4))
+ continue;
+ }
+}
+
+#endif /* INCLUDED_UUI_GETCONTINUATIONS_HXX */
diff --git a/uui/source/iahndl-authentication.cxx b/uui/source/iahndl-authentication.cxx
new file mode 100644
index 000000000000..f31397f1ef92
--- /dev/null
+++ b/uui/source/iahndl-authentication.cxx
@@ -0,0 +1,585 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#include "com/sun/star/task/DocumentPasswordRequest.hpp"
+#include "com/sun/star/task/DocumentMSPasswordRequest.hpp"
+#include "com/sun/star/task/MasterPasswordRequest.hpp"
+#include "com/sun/star/task/XInteractionAbort.hpp"
+#include "com/sun/star/task/XInteractionPassword.hpp"
+#include "com/sun/star/task/XInteractionRetry.hpp"
+#include "com/sun/star/ucb/XInteractionSupplyAuthentication2.hpp"
+#include "com/sun/star/ucb/URLAuthenticationRequest.hpp"
+
+#include "rtl/digest.h"
+#include "vos/mutex.hxx"
+#include "tools/errcode.hxx"
+#include "vcl/msgbox.hxx"
+#include "vcl/svapp.hxx"
+
+#include "ids.hrc"
+#include "getcontinuations.hxx"
+#include "passwordcontainer.hxx"
+#include "loginerr.hxx"
+#include "logindlg.hxx"
+#include "masterpasscrtdlg.hxx"
+#include "masterpassworddlg.hxx"
+#include "passcrtdlg.hxx"
+#include "passworddlg.hxx"
+
+#include "iahndl.hxx"
+
+using namespace com::sun::star;
+
+namespace {
+
+void
+executeLoginDialog(
+ Window * pParent,
+ LoginErrorInfo & rInfo,
+ rtl::OUString const & rRealm)
+ SAL_THROW((uno::RuntimeException))
+{
+ try
+ {
+ vos::OGuard aGuard(Application::GetSolarMutex());
+
+ bool bAccount = (rInfo.GetFlags() & LOGINERROR_FLAG_MODIFY_ACCOUNT)
+ != 0;
+ bool bSavePassword = rInfo.GetIsPersistentPassword()
+ || rInfo.GetIsSavePassword();
+ bool bCanUseSysCreds = rInfo.GetCanUseSystemCredentials();
+
+ sal_uInt16 nFlags = 0;
+ if (rInfo.GetPath().Len() == 0)
+ nFlags |= LF_NO_PATH;
+ if (rInfo.GetErrorText().Len() == 0)
+ nFlags |= LF_NO_ERRORTEXT;
+ if (!bAccount)
+ nFlags |= LF_NO_ACCOUNT;
+ if (!(rInfo.GetFlags() & LOGINERROR_FLAG_MODIFY_USER_NAME))
+ nFlags |= LF_USERNAME_READONLY;
+
+ if (!bSavePassword)
+ nFlags |= LF_NO_SAVEPASSWORD;
+
+ if (!bCanUseSysCreds)
+ nFlags |= LF_NO_USESYSCREDS;
+
+ std::auto_ptr< ResMgr > xManager(
+ ResMgr::CreateResMgr(CREATEVERSIONRESMGR_NAME(uui)));
+ UniString aRealm(rRealm);
+ std::auto_ptr< LoginDialog > xDialog(
+ new LoginDialog(pParent,
+ nFlags,
+ rInfo.GetServer(),
+ &aRealm,
+ xManager.get()));
+ if (rInfo.GetErrorText().Len() != 0)
+ xDialog->SetErrorText(rInfo.GetErrorText());
+ xDialog->SetName(rInfo.GetUserName());
+ if (bAccount)
+ xDialog->ClearAccount();
+ else
+ xDialog->ClearPassword();
+ xDialog->SetPassword(rInfo.GetPassword());
+
+ if (bSavePassword)
+ {
+ xDialog->
+ SetSavePasswordText(ResId(rInfo.GetIsPersistentPassword() ?
+ RID_SAVE_PASSWORD :
+ RID_KEEP_PASSWORD,
+ *xManager.get()));
+ xDialog->SetSavePassword(rInfo.GetIsSavePassword());
+ }
+
+ if ( bCanUseSysCreds )
+ xDialog->SetUseSystemCredentials(
+ rInfo.GetIsUseSystemCredentials() );
+
+ rInfo.SetResult(xDialog->Execute() == RET_OK ? ERRCODE_BUTTON_OK :
+ ERRCODE_BUTTON_CANCEL);
+ rInfo.SetUserName(xDialog->GetName());
+ rInfo.SetPassword(xDialog->GetPassword());
+ rInfo.SetAccount(xDialog->GetAccount());
+ rInfo.SetSavePassword(xDialog->IsSavePassword());
+
+ if ( bCanUseSysCreds )
+ rInfo.SetIsUseSystemCredentials( xDialog->IsUseSystemCredentials() );
+ }
+ catch (std::bad_alloc const &)
+ {
+ throw uno::RuntimeException(
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("out of memory")),
+ uno::Reference< uno::XInterface >());
+ }
+}
+
+void
+handleAuthenticationRequest_(
+ Window * pParent,
+ uno::Reference< task::XInteractionHandler > const & xIH,
+ uno::Reference< lang::XMultiServiceFactory > const & xServiceFactory,
+ ucb::AuthenticationRequest const & rRequest,
+ uno::Sequence< uno::Reference< task::XInteractionContinuation > > const &
+ rContinuations,
+ const rtl::OUString & rURL)
+ SAL_THROW((uno::RuntimeException))
+{
+ uno::Reference< task::XInteractionRetry > xRetry;
+ uno::Reference< task::XInteractionAbort > xAbort;
+ uno::Reference< ucb::XInteractionSupplyAuthentication >
+ xSupplyAuthentication;
+ uno::Reference< ucb::XInteractionSupplyAuthentication2 >
+ xSupplyAuthentication2;
+ getContinuations(rContinuations, &xRetry, &xAbort, &xSupplyAuthentication);
+ if (xSupplyAuthentication.is())
+ xSupplyAuthentication2.set(xSupplyAuthentication, uno::UNO_QUERY);
+
+ //////////////////////////
+ // First, try to obatin credentials from password container service.
+ uui::PasswordContainerHelper aPwContainerHelper(xServiceFactory);
+ if (aPwContainerHelper.handleAuthenticationRequest(rRequest,
+ xSupplyAuthentication,
+ rURL,
+ xIH))
+ {
+ xSupplyAuthentication->select();
+ return;
+ }
+
+ //////////////////////////
+ // Second, try to obtain credentials from user via password dialog.
+ bool bRemember;
+ bool bRememberPersistent;
+ if (xSupplyAuthentication.is())
+ {
+ ucb::RememberAuthentication eDefault;
+ uno::Sequence< ucb::RememberAuthentication >
+ aModes(xSupplyAuthentication->getRememberPasswordModes(eDefault));
+ bRemember = eDefault != ucb::RememberAuthentication_NO;
+ bRememberPersistent = false;
+ for (sal_Int32 i = 0; i < aModes.getLength(); ++i)
+ if (aModes[i] == ucb::RememberAuthentication_PERSISTENT)
+ {
+ bRememberPersistent = true;
+ break;
+ }
+ }
+ else
+ {
+ bRemember = false;
+ bRememberPersistent = false;
+ }
+
+ sal_Bool bCanUseSystemCredentials;
+ sal_Bool bDefaultUseSystemCredentials;
+ if (xSupplyAuthentication2.is())
+ {
+ bCanUseSystemCredentials
+ = xSupplyAuthentication2->canUseSystemCredentials(
+ bDefaultUseSystemCredentials);
+ }
+ else
+ {
+ bCanUseSystemCredentials = sal_False;
+ bDefaultUseSystemCredentials = sal_False;
+ }
+
+ LoginErrorInfo aInfo;
+ aInfo.SetTitle(rRequest.ServerName);
+ aInfo.SetServer(rRequest.ServerName);
+ if (rRequest.HasAccount)
+ aInfo.SetAccount(rRequest.Account);
+ if (rRequest.HasUserName)
+ aInfo.SetUserName(rRequest.UserName);
+ if (rRequest.HasPassword)
+ aInfo.SetPassword(rRequest.Password);
+ aInfo.SetErrorText(rRequest.Diagnostic);
+ aInfo.SetPersistentPassword(bRememberPersistent);
+ aInfo.SetSavePassword(bRemember);
+ aInfo.SetCanUseSystemCredentials(bCanUseSystemCredentials);
+ aInfo.SetIsUseSystemCredentials( bDefaultUseSystemCredentials );
+ aInfo.SetModifyAccount(rRequest.HasAccount
+ && xSupplyAuthentication.is()
+ && xSupplyAuthentication->canSetAccount());
+ aInfo.SetModifyUserName(rRequest.HasUserName
+ && xSupplyAuthentication.is()
+ && xSupplyAuthentication->canSetUserName());
+ executeLoginDialog(pParent,
+ aInfo,
+ rRequest.HasRealm ? rRequest.Realm : rtl::OUString());
+ switch (aInfo.GetResult())
+ {
+ case ERRCODE_BUTTON_OK:
+ if (xSupplyAuthentication.is())
+ {
+ if (xSupplyAuthentication->canSetUserName())
+ xSupplyAuthentication->setUserName(aInfo.GetUserName());
+ if (xSupplyAuthentication->canSetPassword())
+ xSupplyAuthentication->setPassword(aInfo.GetPassword());
+ xSupplyAuthentication->
+ setRememberPassword(
+ aInfo.GetIsSavePassword() ?
+ bRememberPersistent ?
+ ucb::RememberAuthentication_PERSISTENT :
+ ucb::RememberAuthentication_SESSION :
+ ucb::RememberAuthentication_NO);
+ if (rRequest.HasRealm)
+ {
+ if (xSupplyAuthentication->canSetRealm())
+ xSupplyAuthentication->setRealm(aInfo.GetAccount());
+ }
+ else if (xSupplyAuthentication->canSetAccount())
+ xSupplyAuthentication->setAccount(aInfo.GetAccount());
+
+ if ( xSupplyAuthentication2.is() && bCanUseSystemCredentials )
+ xSupplyAuthentication2->setUseSystemCredentials(
+ aInfo.GetIsUseSystemCredentials() );
+
+ xSupplyAuthentication->select();
+ }
+
+ //////////////////////////
+ // Third, store credentials in password container.
+
+ if ( aInfo.GetIsUseSystemCredentials() )
+ {
+ if (aInfo.GetIsSavePassword())
+ {
+ aPwContainerHelper.addRecord(
+ rURL.getLength() ? rURL : rRequest.ServerName,
+ rtl::OUString(), // empty u/p -> sys creds
+ uno::Sequence< rtl::OUString >(),
+ xIH,
+ bRememberPersistent);
+ }
+ }
+ // Empty user name can not be valid:
+ else if (aInfo.GetUserName().Len() != 0)
+ {
+ if (aInfo.GetIsSavePassword())
+ {
+ uno::Sequence< rtl::OUString >
+ aPassList(aInfo.GetAccount().Len() == 0 ? 1 : 2);
+ aPassList[0] = aInfo.GetPassword();
+ if (aInfo.GetAccount().Len() != 0)
+ aPassList[1] = aInfo.GetAccount();
+
+ aPwContainerHelper.addRecord(
+ rURL.getLength() ? rURL : rRequest.ServerName,
+ aInfo.GetUserName(),
+ aPassList,
+ xIH,
+ bRememberPersistent);
+ }
+ }
+ break;
+
+ case ERRCODE_BUTTON_RETRY:
+ if (xRetry.is())
+ xRetry->select();
+ break;
+
+ default:
+ if (xAbort.is())
+ xAbort->select();
+ break;
+ }
+}
+
+void
+executeMasterPasswordDialog(
+ Window * pParent,
+ LoginErrorInfo & rInfo,
+ task::PasswordRequestMode nMode)
+ SAL_THROW((uno::RuntimeException))
+{
+ rtl::OString aMaster;
+ try
+ {
+ vos::OGuard aGuard(Application::GetSolarMutex());
+
+ std::auto_ptr< ResMgr > xManager(
+ ResMgr::CreateResMgr(CREATEVERSIONRESMGR_NAME(uui)));
+ if( nMode == task::PasswordRequestMode_PASSWORD_CREATE )
+ {
+ std::auto_ptr< MasterPasswordCreateDialog > xDialog(
+ new MasterPasswordCreateDialog(pParent, xManager.get()));
+ rInfo.SetResult(xDialog->Execute()
+ == RET_OK ? ERRCODE_BUTTON_OK : ERRCODE_BUTTON_CANCEL);
+ aMaster = rtl::OUStringToOString(
+ xDialog->GetMasterPassword(), RTL_TEXTENCODING_UTF8);
+ }
+ else
+ {
+ std::auto_ptr< MasterPasswordDialog > xDialog(
+ new MasterPasswordDialog(pParent, nMode, xManager.get()));
+ rInfo.SetResult(xDialog->Execute()
+ == RET_OK ? ERRCODE_BUTTON_OK : ERRCODE_BUTTON_CANCEL);
+ aMaster = rtl::OUStringToOString(
+ xDialog->GetMasterPassword(), RTL_TEXTENCODING_UTF8);
+ }
+ }
+ catch (std::bad_alloc const &)
+ {
+ throw uno::RuntimeException(
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("out of memory")),
+ uno::Reference< uno::XInterface >());
+ }
+
+ sal_uInt8 aKey[RTL_DIGEST_LENGTH_MD5];
+ rtl_digest_PBKDF2(aKey,
+ RTL_DIGEST_LENGTH_MD5,
+ reinterpret_cast< sal_uInt8 const * >(aMaster.getStr()),
+ aMaster.getLength(),
+ reinterpret_cast< sal_uInt8 const * >(
+ "3B5509ABA6BC42D9A3A1F3DAD49E56A51"),
+ 32,
+ 1000);
+
+ rtl::OUStringBuffer aBuffer;
+ for (int i = 0; i < RTL_DIGEST_LENGTH_MD5; ++i)
+ {
+ aBuffer.append(static_cast< sal_Unicode >('a' + (aKey[i] >> 4)));
+ aBuffer.append(static_cast< sal_Unicode >('a' + (aKey[i] & 15)));
+ }
+ rInfo.SetPassword(aBuffer.makeStringAndClear());
+}
+
+void
+handleMasterPasswordRequest_(
+ Window * pParent,
+ task::PasswordRequestMode nMode,
+ uno::Sequence< uno::Reference< task::XInteractionContinuation > > const &
+ rContinuations)
+ SAL_THROW((uno::RuntimeException))
+{
+ uno::Reference< task::XInteractionRetry > xRetry;
+ uno::Reference< task::XInteractionAbort > xAbort;
+ uno::Reference< ucb::XInteractionSupplyAuthentication >
+ xSupplyAuthentication;
+ getContinuations(rContinuations, &xRetry, &xAbort, &xSupplyAuthentication);
+ LoginErrorInfo aInfo;
+
+ // in case of master password a hash code is returned
+ executeMasterPasswordDialog(pParent, aInfo, nMode);
+
+ switch (aInfo.GetResult())
+ {
+ case ERRCODE_BUTTON_OK:
+ if (xSupplyAuthentication.is())
+ {
+ if (xSupplyAuthentication->canSetPassword())
+ xSupplyAuthentication->setPassword(aInfo.GetPassword());
+ xSupplyAuthentication->select();
+ }
+ break;
+
+ case ERRCODE_BUTTON_RETRY:
+ if (xRetry.is())
+ xRetry->select();
+ break;
+
+ default:
+ if (xAbort.is())
+ xAbort->select();
+ break;
+ }
+}
+
+void
+executePasswordDialog(
+ Window * pParent,
+ LoginErrorInfo & rInfo,
+ task::PasswordRequestMode nMode,
+ ::rtl::OUString aDocName,
+ bool bMSCryptoMode)
+ SAL_THROW((uno::RuntimeException))
+{
+ try
+ {
+ vos::OGuard aGuard(Application::GetSolarMutex());
+
+ std::auto_ptr< ResMgr > xManager(
+ ResMgr::CreateResMgr(CREATEVERSIONRESMGR_NAME(uui)));
+ if( nMode == task::PasswordRequestMode_PASSWORD_CREATE )
+ {
+ std::auto_ptr< PasswordCreateDialog > xDialog(
+ new PasswordCreateDialog(pParent,
+ xManager.get(),
+ bMSCryptoMode));
+
+ rInfo.SetResult(xDialog->Execute()
+ == RET_OK ? ERRCODE_BUTTON_OK : ERRCODE_BUTTON_CANCEL);
+ rInfo.SetPassword( xDialog->GetPassword() );
+ }
+ else
+ {
+ std::auto_ptr< PasswordDialog > xDialog(
+ new PasswordDialog(pParent, nMode, xManager.get(), aDocName));
+
+ rInfo.SetResult(xDialog->Execute()
+ == RET_OK ? ERRCODE_BUTTON_OK : ERRCODE_BUTTON_CANCEL);
+ rInfo.SetPassword( xDialog->GetPassword() );
+ }
+ }
+ catch (std::bad_alloc const &)
+ {
+ throw uno::RuntimeException(
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("out of memory")),
+ uno::Reference< uno::XInterface>());
+ }
+}
+
+void
+handlePasswordRequest_(
+ Window * pParent,
+ task::PasswordRequestMode nMode,
+ uno::Sequence< uno::Reference< task::XInteractionContinuation > > const &
+ rContinuations,
+ ::rtl::OUString aDocumentName,
+ bool bMSCryptoMode )
+ SAL_THROW((uno::RuntimeException))
+{
+ uno::Reference< task::XInteractionRetry > xRetry;
+ uno::Reference< task::XInteractionAbort > xAbort;
+ uno::Reference< task::XInteractionPassword > xPassword;
+ getContinuations(rContinuations, &xRetry, &xAbort, &xPassword);
+ LoginErrorInfo aInfo;
+
+ executePasswordDialog(pParent,
+ aInfo,
+ nMode,
+ aDocumentName,
+ bMSCryptoMode);
+
+ switch (aInfo.GetResult())
+ {
+ case ERRCODE_BUTTON_OK:
+ if (xPassword.is())
+ {
+ xPassword->setPassword(aInfo.GetPassword());
+ xPassword->select();
+ }
+ break;
+
+ case ERRCODE_BUTTON_RETRY:
+ if (xRetry.is())
+ xRetry->select();
+ break;
+
+ default:
+ if (xAbort.is())
+ xAbort->select();
+ break;
+ }
+}
+
+} // namespace
+
+bool
+UUIInteractionHelper::handleAuthenticationRequest(
+ uno::Reference< task::XInteractionRequest > const & rRequest)
+ SAL_THROW((uno::RuntimeException))
+{
+ uno::Any aAnyRequest(rRequest->getRequest());
+
+ ucb::URLAuthenticationRequest aURLAuthenticationRequest;
+ if (aAnyRequest >>= aURLAuthenticationRequest)
+ {
+ handleAuthenticationRequest_(getParentProperty(),
+ getInteractionHandler(),
+ m_xServiceFactory,
+ aURLAuthenticationRequest,
+ rRequest->getContinuations(),
+ aURLAuthenticationRequest.URL);
+ return true;
+ }
+
+ ucb::AuthenticationRequest aAuthenticationRequest;
+ if (aAnyRequest >>= aAuthenticationRequest)
+ {
+ handleAuthenticationRequest_(getParentProperty(),
+ getInteractionHandler(),
+ m_xServiceFactory,
+ aAuthenticationRequest,
+ rRequest->getContinuations(),
+ rtl::OUString());
+ return true;
+ }
+ return false;
+}
+
+bool
+UUIInteractionHelper::handleMasterPasswordRequest(
+ uno::Reference< task::XInteractionRequest > const & rRequest)
+ SAL_THROW((uno::RuntimeException))
+{
+ uno::Any aAnyRequest(rRequest->getRequest());
+
+ task::MasterPasswordRequest aMasterPasswordRequest;
+ if (aAnyRequest >>= aMasterPasswordRequest)
+ {
+ handleMasterPasswordRequest_(getParentProperty(),
+ aMasterPasswordRequest.Mode,
+ rRequest->getContinuations());
+ return true;
+ }
+ return false;
+}
+
+bool
+UUIInteractionHelper::handlePasswordRequest(
+ uno::Reference< task::XInteractionRequest > const & rRequest)
+ SAL_THROW((uno::RuntimeException))
+{
+ uno::Any aAnyRequest(rRequest->getRequest());
+
+ task::DocumentPasswordRequest aDocumentPasswordRequest;
+ if (aAnyRequest >>= aDocumentPasswordRequest)
+ {
+ handlePasswordRequest_(getParentProperty(),
+ aDocumentPasswordRequest.Mode,
+ rRequest->getContinuations(),
+ aDocumentPasswordRequest.Name,
+ false /* bool bMSCryptoMode */);
+ return true;
+ }
+
+ task::DocumentMSPasswordRequest aDocumentMSPasswordRequest;
+ if (aAnyRequest >>= aDocumentMSPasswordRequest)
+ {
+ handlePasswordRequest_(getParentProperty(),
+ aDocumentMSPasswordRequest.Mode,
+ rRequest->getContinuations(),
+ aDocumentMSPasswordRequest.Name,
+ true /* bool bMSCryptoMode */);
+ return true;
+ }
+ return false;
+}
diff --git a/uui/source/iahndl-cookies.cxx b/uui/source/iahndl-cookies.cxx
new file mode 100644
index 000000000000..db8da498c407
--- /dev/null
+++ b/uui/source/iahndl-cookies.cxx
@@ -0,0 +1,209 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#include "com/sun/star/ucb/HandleCookiesRequest.hpp"
+#include "com/sun/star/ucb/XInteractionCookieHandling.hpp"
+#include "com/sun/star/task/XInteractionRequest.hpp"
+
+#include "vos/mutex.hxx"
+#include "tools/list.hxx"
+#include "svl/httpcook.hxx"
+#include "vcl/svapp.hxx"
+
+#include "cookiedg.hxx"
+
+#include "iahndl.hxx"
+
+using namespace com::sun::star;
+
+namespace {
+
+class CookieList: public List
+{
+public:
+ ~CookieList() SAL_THROW(());
+};
+
+CookieList::~CookieList() SAL_THROW(())
+{
+ while (Count() != 0)
+ delete static_cast< CntHTTPCookie * >(Remove(Count() - 1));
+}
+
+void
+executeCookieDialog(Window * pParent, CntHTTPCookieRequest & rRequest)
+ SAL_THROW((uno::RuntimeException))
+{
+ try
+ {
+ vos::OGuard aGuard(Application::GetSolarMutex());
+
+ std::auto_ptr< ResMgr > xManager(
+ ResMgr::CreateResMgr(CREATEVERSIONRESMGR_NAME(uui)));
+ std::auto_ptr< CookiesDialog > xDialog(
+ new CookiesDialog(pParent, &rRequest, xManager.get()));
+ xDialog->Execute();
+ }
+ catch (std::bad_alloc const &)
+ {
+ throw uno::RuntimeException(
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("out of memory")),
+ uno::Reference< uno::XInterface>());
+ }
+}
+
+void
+handleCookiesRequest_(
+ Window * pParent,
+ ucb::HandleCookiesRequest const & rRequest,
+ uno::Sequence< uno::Reference< task::XInteractionContinuation > > const &
+ rContinuations)
+ SAL_THROW((uno::RuntimeException))
+{
+ CookieList aCookies;
+ for (sal_Int32 i = 0; i < rRequest.Cookies.getLength(); ++i)
+ {
+ try
+ {
+ std::auto_ptr< CntHTTPCookie > xCookie(new CntHTTPCookie);
+ xCookie->m_aName = UniString(rRequest.Cookies[i].Name);
+ xCookie->m_aValue = UniString(rRequest.Cookies[i].Value);
+ xCookie->m_aDomain = UniString(rRequest.Cookies[i].Domain);
+ xCookie->m_aPath = UniString(rRequest.Cookies[i].Path);
+ xCookie->m_aExpires
+ = DateTime(Date(rRequest.Cookies[i].Expires.Day,
+ rRequest.Cookies[i].Expires.Month,
+ rRequest.Cookies[i].Expires.Year),
+ Time(rRequest.Cookies[i].Expires.Hours,
+ rRequest.Cookies[i].Expires.Minutes,
+ rRequest.Cookies[i].Expires.Seconds,
+ rRequest.Cookies[i].Expires.HundredthSeconds));
+ xCookie->m_nFlags
+ = rRequest.Cookies[i].Secure ? CNTHTTP_COOKIE_FLAG_SECURE : 0;
+ switch (rRequest.Cookies[i].Policy)
+ {
+ case ucb::CookiePolicy_CONFIRM:
+ xCookie->m_nPolicy = CNTHTTP_COOKIE_POLICY_INTERACTIVE;
+ break;
+
+ case ucb::CookiePolicy_ACCEPT:
+ xCookie->m_nPolicy = CNTHTTP_COOKIE_POLICY_ACCEPTED;
+ break;
+
+ case ucb::CookiePolicy_IGNORE:
+ xCookie->m_nPolicy = CNTHTTP_COOKIE_POLICY_BANNED;
+ break;
+
+ default:
+ OSL_ASSERT(false);
+ break;
+ }
+ aCookies.Insert(xCookie.get(), LIST_APPEND);
+ xCookie.release();
+ }
+ catch (std::bad_alloc const &)
+ {
+ throw uno::RuntimeException(
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
+ "out of memory")),
+ uno::Reference< uno::XInterface >());
+ }
+ }
+
+ CntHTTPCookieRequest
+ aRequest(rRequest.URL,
+ aCookies,
+ rRequest.Request == ucb::CookieRequest_RECEIVE
+ ? CNTHTTP_COOKIE_REQUEST_RECV
+ : CNTHTTP_COOKIE_REQUEST_SEND);
+ executeCookieDialog(pParent, aRequest);
+ for (sal_Int32 i = 0; i < rContinuations.getLength(); ++i)
+ {
+ uno::Reference< ucb::XInteractionCookieHandling >
+ xCookieHandling(rContinuations[i], uno::UNO_QUERY);
+ if (xCookieHandling.is())
+ {
+ switch (aRequest.m_nRet)
+ {
+ case CNTHTTP_COOKIE_POLICY_INTERACTIVE:
+ xCookieHandling->
+ setGeneralPolicy(ucb::CookiePolicy_CONFIRM);
+ break;
+
+ case CNTHTTP_COOKIE_POLICY_ACCEPTED:
+ xCookieHandling->
+ setGeneralPolicy(ucb::CookiePolicy_ACCEPT);
+ break;
+
+ case CNTHTTP_COOKIE_POLICY_BANNED:
+ xCookieHandling->
+ setGeneralPolicy(ucb::CookiePolicy_IGNORE);
+ break;
+ }
+ for (sal_Int32 j = 0; j < rRequest.Cookies.getLength(); ++j)
+ if (rRequest.Cookies[j].Policy
+ == ucb::CookiePolicy_CONFIRM)
+ switch (static_cast< CntHTTPCookie * >(aCookies.
+ GetObject(j))->
+ m_nPolicy)
+ {
+ case CNTHTTP_COOKIE_POLICY_ACCEPTED:
+ xCookieHandling->
+ setSpecificPolicy(rRequest.Cookies[j], true);
+ break;
+
+ case CNTHTTP_COOKIE_POLICY_BANNED:
+ xCookieHandling->
+ setSpecificPolicy(rRequest.Cookies[j], false);
+ break;
+ }
+ xCookieHandling->select();
+ break;
+ }
+ }
+}
+
+} // namespace
+
+bool
+UUIInteractionHelper::handleCookiesRequest(
+ uno::Reference< task::XInteractionRequest > const & rRequest)
+ SAL_THROW((uno::RuntimeException))
+{
+ uno::Any aAnyRequest(rRequest->getRequest());
+
+ ucb::HandleCookiesRequest aCookiesRequest;
+ if (aAnyRequest >>= aCookiesRequest)
+ {
+ handleCookiesRequest_(getParentProperty(),
+ aCookiesRequest,
+ rRequest->getContinuations());
+ return true;
+ }
+ return false;
+}
+
diff --git a/uui/source/iahndl-errorhandler.cxx b/uui/source/iahndl-errorhandler.cxx
new file mode 100644
index 000000000000..d37376abdd00
--- /dev/null
+++ b/uui/source/iahndl-errorhandler.cxx
@@ -0,0 +1,318 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#include <memory>
+
+#include "vos/mutex.hxx"
+#include "vcl/svapp.hxx"
+#include "vcl/msgbox.hxx"
+
+#include "com/sun/star/task/XInteractionAbort.hpp"
+#include "com/sun/star/task/XInteractionApprove.hpp"
+#include "com/sun/star/task/XInteractionDisapprove.hpp"
+#include "com/sun/star/task/XInteractionRetry.hpp"
+
+#include "tools/errinf.hxx" // ErrorHandler, ErrorContext, ...
+#include "svl/svtools.hrc" // RID_ERRHDL
+
+#include "ids.hrc"
+#include "getcontinuations.hxx"
+
+#include "iahndl.hxx"
+
+using namespace com::sun::star;
+
+namespace {
+
+USHORT
+executeErrorDialog(
+ Window * pParent,
+ task::InteractionClassification eClassification,
+ rtl::OUString const & rContext,
+ rtl::OUString const & rMessage,
+ WinBits nButtonMask)
+ SAL_THROW((uno::RuntimeException))
+{
+ vos::OGuard aGuard(Application::GetSolarMutex());
+
+ rtl::OUStringBuffer aText(rContext);
+ if (rContext.getLength() != 0 && rMessage.getLength() != 0)
+ aText.appendAscii(RTL_CONSTASCII_STRINGPARAM(":\n"));
+ //TODO! must be internationalized
+ aText.append(rMessage);
+
+ std::auto_ptr< MessBox > xBox;
+ try
+ {
+ switch (eClassification)
+ {
+ case task::InteractionClassification_ERROR:
+ xBox.reset(new ErrorBox(pParent,
+ nButtonMask,
+ aText.makeStringAndClear()));
+ break;
+
+ case task::InteractionClassification_WARNING:
+ xBox.reset(new WarningBox(pParent,
+ nButtonMask,
+ aText.makeStringAndClear()));
+ break;
+
+ case task::InteractionClassification_INFO:
+ if ((nButtonMask & 0x01F00000) == WB_DEF_OK)
+ //TODO! missing win bit button mask define (want to ignore
+ // any default button settings)...
+ xBox.reset(new InfoBox(pParent,
+ aText.makeStringAndClear()));
+ else
+ xBox.reset(new ErrorBox(pParent,
+ nButtonMask,
+ aText.makeStringAndClear()));
+ break;
+
+ case task::InteractionClassification_QUERY:
+ xBox.reset(new QueryBox(pParent,
+ nButtonMask,
+ aText.makeStringAndClear()));
+ break;
+
+ default:
+ OSL_ASSERT(false);
+ break;
+ }
+ }
+ catch (std::bad_alloc const &)
+ {
+ throw uno::RuntimeException(
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("out of memory")),
+ uno::Reference< uno::XInterface >());
+ }
+
+ USHORT aResult = xBox->Execute();
+ switch( aResult )
+ {
+ case BUTTONID_OK:
+ aResult = ERRCODE_BUTTON_OK;
+ break;
+ case BUTTONID_CANCEL:
+ aResult = ERRCODE_BUTTON_CANCEL;
+ break;
+ case BUTTONID_YES:
+ aResult = ERRCODE_BUTTON_YES;
+ break;
+ case BUTTONID_NO:
+ aResult = ERRCODE_BUTTON_NO;
+ break;
+ case BUTTONID_RETRY:
+ aResult = ERRCODE_BUTTON_RETRY;
+ break;
+ }
+
+ return aResult;
+}
+
+}
+
+void
+UUIInteractionHelper::handleErrorHandlerRequest(
+ task::InteractionClassification eClassification,
+ ErrCode nErrorCode,
+ std::vector< rtl::OUString > const & rArguments,
+ uno::Sequence< uno::Reference< task::XInteractionContinuation > > const &
+ rContinuations,
+ bool bObtainErrorStringOnly,
+ bool & bHasErrorString,
+ rtl::OUString & rErrorString)
+ SAL_THROW((uno::RuntimeException))
+{
+ if (bObtainErrorStringOnly)
+ {
+ bHasErrorString = isInformationalErrorMessageRequest(rContinuations);
+ if (!bHasErrorString)
+ return;
+ }
+
+ rtl::OUString aMessage;
+ {
+ enum Source { SOURCE_DEFAULT, SOURCE_CNT, SOURCE_SVX, SOURCE_UUI };
+ static char const * const aManager[4]
+ = { CREATEVERSIONRESMGR_NAME(ofa),
+ CREATEVERSIONRESMGR_NAME(cnt),
+ CREATEVERSIONRESMGR_NAME(svx),
+ CREATEVERSIONRESMGR_NAME(uui) };
+ static USHORT const aId[4]
+ = { RID_ERRHDL,
+ RID_CHAOS_START + 12,
+ // cf. chaos/source/inc/cntrids.hrc, where
+ // #define RID_CHAOS_ERRHDL (RID_CHAOS_START + 12)
+ RID_SVX_START + 350, // RID_SVXERRCODE
+ RID_UUI_ERRHDL };
+ ErrCode nErrorId = nErrorCode & ~ERRCODE_WARNING_MASK;
+ Source eSource = nErrorId < ERRCODE_AREA_LIB1 ?
+ SOURCE_DEFAULT :
+ nErrorId >= ERRCODE_AREA_CHAOS
+ && nErrorId < ERRCODE_AREA_CHAOS_END ?
+ SOURCE_CNT :
+ nErrorId >= ERRCODE_AREA_SVX
+ && nErrorId <= ERRCODE_AREA_SVX_END ?
+ SOURCE_SVX :
+ SOURCE_UUI;
+
+ vos::OGuard aGuard(Application::GetSolarMutex());
+ std::auto_ptr< ResMgr > xManager;
+ xManager.reset(ResMgr::CreateResMgr(aManager[eSource]));
+ if (!xManager.get())
+ return;
+ ResId aResId(aId[eSource], *xManager.get());
+ if (!ErrorResource(aResId).getString(nErrorCode, &aMessage))
+ return;
+ }
+
+ aMessage = replaceMessageWithArguments( aMessage, rArguments );
+
+ if (bObtainErrorStringOnly)
+ {
+ rErrorString = aMessage;
+ return;
+ }
+ else
+ {
+ //TODO! It can happen that the buttons calculated below do not match
+ // the error text from the resource (e.g., some text that is not a
+ // question, but YES and NO buttons). Some error texts have
+ // ExtraData that specifies a set of buttons, but that data is not
+ // really useful, because a single error text may well make sense
+ // both with only an OK button and with RETRY and CANCEL buttons.
+
+ uno::Reference< task::XInteractionApprove > xApprove;
+ uno::Reference< task::XInteractionDisapprove > xDisapprove;
+ uno::Reference< task::XInteractionRetry > xRetry;
+ uno::Reference< task::XInteractionAbort > xAbort;
+ getContinuations(
+ rContinuations, &xApprove, &xDisapprove, &xRetry, &xAbort);
+
+ // The following mapping uses the bit mask
+ // Approve = 8,
+ // Disapprove = 4,
+ // Retry = 2,
+ // Abort = 1
+ //
+ // The mapping has five properties on which the code to select the
+ // correct continuation relies:
+ // 1 The OK button is mapped to Approve if that is available,
+ // otherwise to Abort if that is available, otherwise to none.
+ // 2 The CANCEL button is always mapped to Abort.
+ // 3 The RETRY button is always mapped to Retry.
+ // 4 The NO button is always mapped to Disapprove.
+ // 5 The YES button is always mapped to Approve.
+ //
+ // Because the WinBits button combinations are quite restricted, not
+ // every request can be served here.
+ //
+ // Finally, it seems to be better to leave default button
+ // determination to VCL (the favouring of CANCEL as default button
+ // seems to not always be what the user wants)...
+ WinBits const aButtonMask[16]
+ = { 0,
+ WB_OK /*| WB_DEF_OK*/, // Abort
+ 0,
+ WB_RETRY_CANCEL /*| WB_DEF_CANCEL*/, // Retry, Abort
+ 0,
+ 0,
+ 0,
+ 0,
+ WB_OK /*| WB_DEF_OK*/, // Approve
+ WB_OK_CANCEL /*| WB_DEF_CANCEL*/, // Approve, Abort
+ 0,
+ 0,
+ WB_YES_NO /*| WB_DEF_NO*/, // Approve, Disapprove
+ WB_YES_NO_CANCEL /*| WB_DEF_CANCEL*/,
+ // Approve, Disapprove, Abort
+ 0,
+ 0 };
+
+ WinBits nButtonMask = aButtonMask[(xApprove.is() ? 8 : 0)
+ | (xDisapprove.is() ? 4 : 0)
+ | (xRetry.is() ? 2 : 0)
+ | (xAbort.is() ? 1 : 0)];
+ if (nButtonMask == 0)
+ return;
+
+ //TODO! remove this backwards compatibility?
+ rtl::OUString aContext(getContextProperty());
+ if (aContext.getLength() == 0 && nErrorCode != 0)
+ {
+ vos::OGuard aGuard(Application::GetSolarMutex());
+ ErrorContext * pContext = ErrorContext::GetContext();
+ if (pContext)
+ {
+ UniString aContextString;
+ if (pContext->GetString(nErrorCode, aContextString))
+ aContext = aContextString;
+ }
+ }
+
+ USHORT nResult = executeErrorDialog(
+ getParentProperty(), eClassification, aContext, aMessage, nButtonMask );
+
+ switch (nResult)
+ {
+ case ERRCODE_BUTTON_OK:
+ OSL_ENSURE(xApprove.is() || xAbort.is(), "unexpected situation");
+ if (xApprove.is())
+ xApprove->select();
+ else if (xAbort.is())
+ xAbort->select();
+ break;
+
+ case ERRCODE_BUTTON_CANCEL:
+ OSL_ENSURE(xAbort.is(), "unexpected situation");
+ if (xAbort.is())
+ xAbort->select();
+ break;
+
+ case ERRCODE_BUTTON_RETRY:
+ OSL_ENSURE(xRetry.is(), "unexpected situation");
+ if (xRetry.is())
+ xRetry->select();
+ break;
+
+ case ERRCODE_BUTTON_NO:
+ OSL_ENSURE(xDisapprove.is(), "unexpected situation");
+ if (xDisapprove.is())
+ xDisapprove->select();
+ break;
+
+ case ERRCODE_BUTTON_YES:
+ OSL_ENSURE(xApprove.is(), "unexpected situation");
+ if (xApprove.is())
+ xApprove->select();
+ break;
+ }
+
+ }
+}
diff --git a/uui/source/iahndl-filter.cxx b/uui/source/iahndl-filter.cxx
new file mode 100644
index 000000000000..c05762a82332
--- /dev/null
+++ b/uui/source/iahndl-filter.cxx
@@ -0,0 +1,471 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#include "com/sun/star/beans/XPropertyAccess.hpp"
+#include "com/sun/star/container/XContainerQuery.hpp"
+#include "com/sun/star/container/XNameContainer.hpp"
+#include "com/sun/star/document/AmbigousFilterRequest.hpp"
+#include "com/sun/star/document/FilterOptionsRequest.hpp"
+#include "com/sun/star/document/NoSuchFilterRequest.hpp"
+#include "com/sun/star/document/XImporter.hpp"
+#include "com/sun/star/document/XInteractionFilterOptions.hpp"
+#include "com/sun/star/document/XInteractionFilterSelect.hpp"
+#include "com/sun/star/lang/XMultiServiceFactory.hpp"
+#include "com/sun/star/task/XInteractionAbort.hpp"
+#include "com/sun/star/task/XInteractionRequest.hpp"
+#include "com/sun/star/ui/dialogs/XExecutableDialog.hpp"
+
+#include "vos/mutex.hxx"
+#include "comphelper/sequenceashashmap.hxx"
+#include "vcl/svapp.hxx"
+
+#include "getcontinuations.hxx"
+#include "fltdlg.hxx"
+
+#include "iahndl.hxx"
+
+using namespace com::sun::star;
+
+namespace {
+
+void
+executeFilterDialog(
+ Window * pParent ,
+ rtl::OUString const & rURL ,
+ uui::FilterNameList const & rFilters,
+ rtl::OUString & rFilter )
+ SAL_THROW((uno::RuntimeException))
+{
+ try
+ {
+ vos::OGuard aGuard(Application::GetSolarMutex());
+
+ std::auto_ptr< ResMgr > xManager(
+ ResMgr::CreateResMgr(CREATEVERSIONRESMGR_NAME(uui)));
+
+ std::auto_ptr< uui::FilterDialog > xDialog(
+ new uui::FilterDialog(pParent, xManager.get()));
+
+ xDialog->SetURL(rURL);
+ xDialog->ChangeFilters(&rFilters);
+
+ uui::FilterNameListPtr pSelected = rFilters.end();
+ if( xDialog->AskForFilter( pSelected ) )
+ {
+ rFilter = pSelected->sInternal;
+ }
+ }
+ catch (std::bad_alloc const &)
+ {
+ throw uno::RuntimeException(
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("out of memory")),
+ uno::Reference< uno::XInterface >());
+ }
+}
+
+void
+handleNoSuchFilterRequest_(
+ Window * pParent,
+ uno::Reference< lang::XMultiServiceFactory > const & xServiceFactory,
+ document::NoSuchFilterRequest const & rRequest,
+ uno::Sequence< uno::Reference< task::XInteractionContinuation > > const &
+ rContinuations )
+ SAL_THROW((uno::RuntimeException))
+{
+ uno::Reference< task::XInteractionAbort > xAbort;
+ uno::Reference< document::XInteractionFilterSelect > xFilterTransport;
+ getContinuations(rContinuations, &xAbort, &xFilterTransport);
+
+ // check neccessary ressources - if they don't exist - abort or
+ // break this operation
+ if (!xAbort.is())
+ return;
+
+ if (!xFilterTransport.is())
+ {
+ xAbort->select();
+ return;
+ }
+
+ uno::Reference< container::XContainerQuery > xFilterContainer;
+ try
+ {
+ xFilterContainer.set( xServiceFactory->createInstance(
+ ::rtl::OUString::createFromAscii(
+ "com.sun.star.document.FilterFactory") ),
+ uno::UNO_QUERY );
+ }
+ catch ( uno::Exception const & )
+ {
+ }
+
+ if (!xFilterContainer.is())
+ {
+ xAbort->select();
+ return;
+ }
+
+ uui::FilterNameList lNames;
+
+ // Note: We look for all filters here which match the following criteria:
+ // - they are import filters as minimum (of course they can
+ // support export too)
+ // - we don't show any filter which are flaged as "don't show it
+ // at the UI" or "they are not installed"
+ // - we ignore filters, which have not set any valid
+ // DocumentService (e.g. our pure graphic filters)
+ // - we show it sorted by her UIName's
+ // - We don't use the order flag or prefer default filters.
+ // (Because this list shows all filters and the user should
+ // find his filter vry easy by his UIName ...)
+ // - We use "_query_all" here ... but we filter graphic filters
+ // out by using DocumentService property later!
+ uno::Reference< container::XEnumeration > xFilters
+ = xFilterContainer->createSubSetEnumerationByQuery(
+ ::rtl::OUString::createFromAscii(
+ "_query_all:sort_prop=uiname:iflags=1:eflags=143360"));
+ while (xFilters->hasMoreElements())
+ {
+ try
+ {
+ ::comphelper::SequenceAsHashMap lProps(xFilters->nextElement());
+ uui::FilterNamePair aPair;
+
+ aPair.sInternal = lProps.getUnpackedValueOrDefault(
+ rtl::OUString::createFromAscii("Name"), ::rtl::OUString());
+ aPair.sUI = lProps.getUnpackedValueOrDefault(
+ rtl::OUString::createFromAscii("UIName"), ::rtl::OUString());
+ if ( (!aPair.sInternal.Len()) || (!aPair.sUI.Len() ) )
+ {
+ continue;
+ }
+ lNames.push_back( aPair );
+ }
+ catch(const uno::RuntimeException&)
+ {
+ throw;
+ }
+ catch(const uno::Exception&)
+ {
+ continue;
+ }
+ }
+
+ // no list available for showing
+ // -> abort operation
+ if (lNames.size()<1)
+ {
+ xAbort->select();
+ return;
+ }
+
+ // let the user select the right filter
+ rtl::OUString sSelectedFilter;
+ executeFilterDialog( pParent,
+ rRequest.URL,
+ lNames,
+ sSelectedFilter );
+
+ // If he doesn't select anyone
+ // -> abort operation
+ if (sSelectedFilter.getLength()<1)
+ {
+ xAbort->select();
+ return;
+ }
+
+ // otherwhise set it for return
+ xFilterTransport->setFilter( sSelectedFilter );
+ xFilterTransport->select();
+}
+
+void
+handleAmbigousFilterRequest_(
+ Window * pParent,
+ uno::Reference< lang::XMultiServiceFactory > const & xServiceFactory,
+ document::AmbigousFilterRequest const & rRequest,
+ uno::Sequence<
+ uno::Reference<
+ task::XInteractionContinuation > > const & rContinuations)
+ SAL_THROW((uno::RuntimeException))
+{
+ uno::Reference< task::XInteractionAbort > xAbort;
+ uno::Reference< document::XInteractionFilterSelect > xFilterTransport;
+ getContinuations(rContinuations, &xAbort, &xFilterTransport);
+
+ uui::FilterNameList lNames;
+
+ uno::Reference< container::XNameContainer > xFilterContainer;
+ try
+ {
+ xFilterContainer.set( xServiceFactory->createInstance(
+ ::rtl::OUString::createFromAscii(
+ "com.sun.star.document.FilterFactory") ),
+ uno::UNO_QUERY );
+ }
+ catch ( uno::Exception & )
+ {
+ }
+
+ if( xFilterContainer.is() )
+ {
+ uno::Any aPackedSet ;
+ uno::Sequence< beans::PropertyValue > lProps ;
+ sal_Int32 nStep ;
+ uui::FilterNamePair aPair ;
+
+ try
+ {
+ aPackedSet = xFilterContainer->getByName( rRequest.SelectedFilter );
+ }
+ catch(const container::NoSuchElementException&)
+ {
+ aPackedSet.clear();
+ }
+ aPackedSet >>= lProps;
+ for( nStep=0; nStep<lProps.getLength(); ++nStep )
+ {
+ if( lProps[nStep].Name.compareToAscii("UIName") == 0 )
+ {
+ ::rtl::OUString sTemp;
+ lProps[nStep].Value >>= sTemp;
+ aPair.sUI = sTemp;
+ aPair.sInternal = rRequest.SelectedFilter;
+ lNames.push_back( aPair );
+ break;
+ }
+ }
+
+ try
+ {
+ aPackedSet = xFilterContainer->getByName( rRequest.DetectedFilter );
+ }
+ catch(const container::NoSuchElementException&)
+ {
+ aPackedSet.clear();
+ }
+ aPackedSet >>= lProps;
+ for( nStep=0; nStep<lProps.getLength(); ++nStep )
+ {
+ if( lProps[nStep].Name.compareToAscii("UIName") == 0 )
+ {
+ ::rtl::OUString sTemp;
+ lProps[nStep].Value >>= sTemp;
+ aPair.sUI = sTemp;
+ aPair.sInternal = rRequest.DetectedFilter;
+ lNames.push_back( aPair );
+ break;
+ }
+ }
+ }
+
+ if( xAbort.is() && xFilterTransport.is() )
+ {
+ if( lNames.size() < 1 )
+ {
+ xAbort->select();
+ }
+ else
+ {
+ rtl::OUString sFilter;
+ executeFilterDialog( pParent,
+ rRequest.URL,
+ lNames,
+ sFilter );
+
+ if( sFilter.getLength() > 0 )
+ {
+ xFilterTransport->setFilter( sFilter );
+ xFilterTransport->select();
+ }
+ else
+ xAbort->select();
+ }
+ }
+}
+
+void
+handleFilterOptionsRequest_(
+ uno::Reference< lang::XMultiServiceFactory > const & xServiceFactory,
+ document::FilterOptionsRequest const & rRequest,
+ uno::Sequence< uno::Reference< task::XInteractionContinuation > > const &
+ rContinuations)
+ SAL_THROW((uno::RuntimeException))
+{
+ uno::Reference< task::XInteractionAbort > xAbort;
+ uno::Reference< document::XInteractionFilterOptions > xFilterOptions;
+ getContinuations(rContinuations, &xAbort, &xFilterOptions);
+
+ uno::Reference< container::XNameAccess > xFilterCFG;
+ try
+ {
+ xFilterCFG.set( xServiceFactory->createInstance(
+ ::rtl::OUString::createFromAscii(
+ "com.sun.star.document.FilterFactory" ) ),
+ uno::UNO_QUERY );
+ }
+ catch ( uno::Exception const & )
+ {
+ }
+
+ if( xFilterCFG.is() && rRequest.rProperties.getLength() )
+ {
+ try
+ {
+ ::rtl::OUString aFilterName;
+ sal_Int32 nPropCount = rRequest.rProperties.getLength();
+ for( sal_Int32 ind = 0; ind < nPropCount; ++ind )
+ {
+ rtl::OUString tmp = rRequest.rProperties[ind].Name;
+ if( rRequest.rProperties[ind].Name.equals(
+ ::rtl::OUString::createFromAscii("FilterName")) )
+ {
+ rRequest.rProperties[ind].Value >>= aFilterName;
+ break;
+ }
+ }
+
+ uno::Sequence < beans::PropertyValue > aProps;
+ if ( xFilterCFG->getByName( aFilterName ) >>= aProps )
+ {
+ sal_Int32 nPropertyCount = aProps.getLength();
+ for( sal_Int32 nProperty=0;
+ nProperty < nPropertyCount;
+ ++nProperty )
+ if( aProps[nProperty].Name.equals(
+ ::rtl::OUString::createFromAscii("UIComponent")) )
+ {
+ ::rtl::OUString aServiceName;
+ aProps[nProperty].Value >>= aServiceName;
+ if( aServiceName.getLength() )
+ {
+ uno::Reference<
+ ui::dialogs::XExecutableDialog > xFilterDialog(
+ xServiceFactory->createInstance(
+ aServiceName ),
+ uno::UNO_QUERY );
+ uno::Reference< beans::XPropertyAccess >
+ xFilterProperties( xFilterDialog,
+ uno::UNO_QUERY );
+
+ if( xFilterDialog.is() && xFilterProperties.is() )
+ {
+ uno::Reference<
+ document::XImporter > xImporter(
+ xFilterDialog, uno::UNO_QUERY );
+ if( xImporter.is() )
+ xImporter->setTargetDocument(
+ uno::Reference< lang::XComponent >(
+ rRequest.rModel, uno::UNO_QUERY ) );
+
+ xFilterProperties->setPropertyValues(
+ rRequest.rProperties );
+
+ if( xFilterDialog->execute() )
+ {
+ xFilterOptions->setFilterOptions(
+ xFilterProperties->getPropertyValues() );
+ xFilterOptions->select();
+ return;
+ }
+ }
+ }
+ break;
+ }
+ }
+ }
+ catch( container::NoSuchElementException& )
+ {
+ // the filter name is unknown
+ }
+ catch( uno::Exception& )
+ {
+ }
+ }
+
+ xAbort->select();
+}
+
+} // namespace
+
+bool
+UUIInteractionHelper::handleNoSuchFilterRequest(
+ uno::Reference< task::XInteractionRequest > const & rRequest)
+ SAL_THROW((uno::RuntimeException))
+{
+ uno::Any aAnyRequest(rRequest->getRequest());
+
+ document::NoSuchFilterRequest aNoSuchFilterRequest;
+ if (aAnyRequest >>= aNoSuchFilterRequest)
+ {
+ handleNoSuchFilterRequest_(getParentProperty(),
+ m_xServiceFactory,
+ aNoSuchFilterRequest,
+ rRequest->getContinuations());
+ return true;
+ }
+ return false;
+}
+
+bool
+UUIInteractionHelper::handleAmbigousFilterRequest(
+ uno::Reference< task::XInteractionRequest > const & rRequest)
+ SAL_THROW((uno::RuntimeException))
+{
+ uno::Any aAnyRequest(rRequest->getRequest());
+
+ document::AmbigousFilterRequest aAmbigousFilterRequest;
+ if (aAnyRequest >>= aAmbigousFilterRequest)
+ {
+ handleAmbigousFilterRequest_(getParentProperty(),
+ m_xServiceFactory,
+ aAmbigousFilterRequest,
+ rRequest->getContinuations());
+ return true;
+ }
+ return false;
+}
+
+bool
+UUIInteractionHelper::handleFilterOptionsRequest(
+ uno::Reference< task::XInteractionRequest > const & rRequest)
+ SAL_THROW((uno::RuntimeException))
+{
+ uno::Any aAnyRequest(rRequest->getRequest());
+
+ document::FilterOptionsRequest aFilterOptionsRequest;
+ if (aAnyRequest >>= aFilterOptionsRequest)
+ {
+ handleFilterOptionsRequest_(m_xServiceFactory,
+ aFilterOptionsRequest,
+ rRequest->getContinuations());
+ return true;
+ }
+ return false;
+}
+
+
diff --git a/uui/source/iahndl-ioexceptions.cxx b/uui/source/iahndl-ioexceptions.cxx
new file mode 100644
index 000000000000..d21fe3e98f0b
--- /dev/null
+++ b/uui/source/iahndl-ioexceptions.cxx
@@ -0,0 +1,343 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#include "com/sun/star/beans/PropertyValue.hpp"
+#include "com/sun/star/task/XInteractionRequest.hpp"
+#include "com/sun/star/ucb/InteractiveAugmentedIOException.hpp"
+
+#include "ids.hrc"
+
+#include "iahndl.hxx"
+
+using namespace com::sun::star;
+
+namespace {
+
+bool
+getStringRequestArgument(uno::Sequence< uno::Any > const & rArguments,
+ rtl::OUString const & rKey,
+ rtl::OUString * pValue)
+ SAL_THROW(())
+{
+ for (sal_Int32 i = 0; i < rArguments.getLength(); ++i)
+ {
+ beans::PropertyValue aProperty;
+ if ((rArguments[i] >>= aProperty) && aProperty.Name == rKey)
+ {
+ rtl::OUString aValue;
+ if (aProperty.Value >>= aValue)
+ {
+ if (pValue)
+ *pValue = aValue;
+ return true;
+ }
+ }
+ }
+ return false;
+}
+
+bool
+getBoolRequestArgument(uno::Sequence< uno::Any > const & rArguments,
+ rtl::OUString const & rKey,
+ bool * pValue)
+ SAL_THROW(())
+{
+ for (sal_Int32 i = 0; i < rArguments.getLength(); ++i)
+ {
+ beans::PropertyValue aProperty;
+ if ((rArguments[i] >>= aProperty) && aProperty.Name == rKey)
+ {
+ sal_Bool bValue = sal_Bool();
+ if (aProperty.Value >>= bValue)
+ {
+ if (pValue)
+ *pValue = bValue;
+ return true;
+ }
+ }
+ }
+ return false;
+}
+
+bool
+getResourceNameRequestArgument(uno::Sequence< uno::Any > const & rArguments,
+ rtl::OUString * pValue)
+ SAL_THROW(())
+{
+ if (!getStringRequestArgument(rArguments,
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
+ "Uri")),
+ pValue))
+ return false;
+ // Use the resource name only for file URLs, to avoid confusion:
+ //TODO! work with ucp locality concept instead of hardcoded "file"?
+ if (pValue
+ && pValue->matchIgnoreAsciiCaseAsciiL(RTL_CONSTASCII_STRINGPARAM(
+ "file:")))
+ getStringRequestArgument(rArguments,
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
+ "ResourceName")),
+ pValue);
+ return true;
+}
+
+} // namespace
+
+bool
+UUIInteractionHelper::handleInteractiveIOException(
+ uno::Reference< task::XInteractionRequest > const & rRequest,
+ bool bObtainErrorStringOnly,
+ bool & bHasErrorString,
+ rtl::OUString & rErrorString)
+ SAL_THROW((uno::RuntimeException))
+{
+ uno::Any aAnyRequest(rRequest->getRequest());
+ bHasErrorString = false;
+
+ ucb::InteractiveIOException aIoException;
+ if (aAnyRequest >>= aIoException)
+ {
+ uno::Sequence< uno::Any > aRequestArguments;
+ ucb::InteractiveAugmentedIOException aAugmentedIoException;
+ if (aAnyRequest >>= aAugmentedIoException)
+ aRequestArguments = aAugmentedIoException.Arguments;
+
+ ErrCode nErrorCode;
+ std::vector< rtl::OUString > aArguments;
+ static ErrCode const
+ aErrorCode[ucb::IOErrorCode_WRONG_VERSION + 1][2]
+ = { { ERRCODE_IO_ABORT, ERRCODE_UUI_IO_ABORT }, // ABORT
+ { ERRCODE_IO_ACCESSDENIED, ERRCODE_UUI_IO_ACCESSDENIED },
+ // ACCESS_DENIED
+ { ERRCODE_IO_ALREADYEXISTS,
+ ERRCODE_UUI_IO_ALREADYEXISTS }, // ALREADY_EXISTING
+ { ERRCODE_IO_BADCRC, ERRCODE_UUI_IO_BADCRC }, // BAD_CRC
+ { ERRCODE_IO_CANTCREATE, ERRCODE_UUI_IO_CANTCREATE },
+ // CANT_CREATE
+ { ERRCODE_IO_CANTREAD, ERRCODE_UUI_IO_CANTREAD },
+ // CANT_READ
+ { ERRCODE_IO_CANTSEEK, ERRCODE_UUI_IO_CANTSEEK },
+ // CANT_SEEK
+ { ERRCODE_IO_CANTTELL, ERRCODE_UUI_IO_CANTTELL },
+ // CANT_TELL
+ { ERRCODE_IO_CANTWRITE, ERRCODE_UUI_IO_CANTWRITE },
+ // CANT_WRITE
+ { ERRCODE_IO_CURRENTDIR, ERRCODE_UUI_IO_CURRENTDIR },
+ // CURRENT_DIRECTORY
+ { ERRCODE_IO_DEVICENOTREADY, ERRCODE_UUI_IO_NOTREADY },
+ // DEVICE_NOT_READY
+ { ERRCODE_IO_NOTSAMEDEVICE,
+ ERRCODE_UUI_IO_NOTSAMEDEVICE }, // DIFFERENT_DEVICES
+ { ERRCODE_IO_GENERAL, ERRCODE_UUI_IO_GENERAL }, // GENERAL
+ { ERRCODE_IO_INVALIDACCESS,
+ ERRCODE_UUI_IO_INVALIDACCESS }, // INVALID_ACCESS
+ { ERRCODE_IO_INVALIDCHAR, ERRCODE_UUI_IO_INVALIDCHAR },
+ // INVALID_CHARACTER
+ { ERRCODE_IO_INVALIDDEVICE,
+ ERRCODE_UUI_IO_INVALIDDEVICE }, // INVALID_DEVICE
+ { ERRCODE_IO_INVALIDLENGTH,
+ ERRCODE_UUI_IO_INVALIDLENGTH }, // INVALID_LENGTH
+ { ERRCODE_IO_INVALIDPARAMETER,
+ ERRCODE_UUI_IO_INVALIDPARAMETER }, // INVALID_PARAMETER
+ { ERRCODE_IO_ISWILDCARD, ERRCODE_UUI_IO_ISWILDCARD },
+ // IS_WILDCARD
+ { ERRCODE_IO_LOCKVIOLATION,
+ ERRCODE_UUI_IO_LOCKVIOLATION }, // LOCKING_VIOLATION
+ { ERRCODE_IO_MISPLACEDCHAR,
+ ERRCODE_UUI_IO_MISPLACEDCHAR }, // MISPLACED_CHARACTER
+ { ERRCODE_IO_NAMETOOLONG, ERRCODE_UUI_IO_NAMETOOLONG },
+ // NAME_TOO_LONG
+ { ERRCODE_IO_NOTEXISTS, ERRCODE_UUI_IO_NOTEXISTS },
+ // NOT_EXISTING
+ { ERRCODE_IO_NOTEXISTSPATH,
+ ERRCODE_UUI_IO_NOTEXISTSPATH }, // NOT_EXISTING_PATH
+ { ERRCODE_IO_NOTSUPPORTED, ERRCODE_UUI_IO_NOTSUPPORTED },
+ // NOT_SUPPORTED
+ { ERRCODE_IO_NOTADIRECTORY,
+ ERRCODE_UUI_IO_NOTADIRECTORY }, // NO_DIRECTORY
+ { ERRCODE_IO_NOTAFILE, ERRCODE_UUI_IO_NOTAFILE },
+ // NO_FILE
+ { ERRCODE_IO_OUTOFSPACE, ERRCODE_UUI_IO_OUTOFSPACE },
+ // OUT_OF_DISK_SPACE
+ { ERRCODE_IO_TOOMANYOPENFILES,
+ ERRCODE_UUI_IO_TOOMANYOPENFILES },
+ // OUT_OF_FILE_HANDLES
+ { ERRCODE_IO_OUTOFMEMORY, ERRCODE_UUI_IO_OUTOFMEMORY },
+ // OUT_OF_MEMORY
+ { ERRCODE_IO_PENDING, ERRCODE_UUI_IO_PENDING }, // PENDING
+ { ERRCODE_IO_RECURSIVE, ERRCODE_UUI_IO_RECURSIVE },
+ // RECURSIVE
+ { ERRCODE_IO_UNKNOWN, ERRCODE_UUI_IO_UNKNOWN }, // UNKNOWN
+ { ERRCODE_IO_WRITEPROTECTED,
+ ERRCODE_UUI_IO_WRITEPROTECTED }, // WRITE_PROTECTED
+ { ERRCODE_IO_WRONGFORMAT, ERRCODE_UUI_IO_WRONGFORMAT },
+ // WRONG_FORMAT
+ { ERRCODE_IO_WRONGVERSION,
+ ERRCODE_UUI_IO_WRONGVERSION } }; // WRONG_VERSION
+ switch (aIoException.Code)
+ {
+ case ucb::IOErrorCode_CANT_CREATE:
+ {
+ rtl::OUString aArgFolder;
+ if (getStringRequestArgument(
+ aRequestArguments,
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
+ "Folder")),
+ &aArgFolder))
+ {
+ rtl::OUString aArgUri;
+ if (getResourceNameRequestArgument(aRequestArguments,
+ &aArgUri))
+ {
+ nErrorCode = ERRCODE_UUI_IO_CANTCREATE;
+ aArguments.reserve(2);
+ aArguments.push_back(aArgUri);
+ aArguments.push_back(aArgFolder);
+ }
+ else
+ {
+ nErrorCode = ERRCODE_UUI_IO_CANTCREATE_NONAME;
+ aArguments.push_back(aArgFolder);
+ }
+ }
+ else
+ nErrorCode = aErrorCode[aIoException.Code][0];
+ break;
+ }
+
+ case ucb::IOErrorCode_DEVICE_NOT_READY:
+ {
+ rtl::OUString aArgUri;
+ if (getResourceNameRequestArgument(aRequestArguments,
+ &aArgUri))
+ {
+ rtl::OUString aResourceType;
+ getStringRequestArgument(
+ aRequestArguments,
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
+ "ResourceType")),
+ &aResourceType);
+ bool bRemovable = false;
+ getBoolRequestArgument(aRequestArguments,
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "Removable")),
+ &bRemovable);
+ nErrorCode
+ = aResourceType.equalsAsciiL(
+ RTL_CONSTASCII_STRINGPARAM("volume"))
+ ? (bRemovable
+ ? ERRCODE_UUI_IO_NOTREADY_VOLUME_REMOVABLE
+ : ERRCODE_UUI_IO_NOTREADY_VOLUME)
+ : (bRemovable
+ ? ERRCODE_UUI_IO_NOTREADY_REMOVABLE
+ : ERRCODE_UUI_IO_NOTREADY);
+ aArguments.push_back(aArgUri);
+ }
+ else
+ nErrorCode = aErrorCode[aIoException.Code][0];
+ break;
+ }
+
+ case ucb::IOErrorCode_DIFFERENT_DEVICES:
+ {
+ rtl::OUString aArgVolume;
+ rtl::OUString aArgOtherVolume;
+ if (getStringRequestArgument(
+ aRequestArguments,
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
+ "Volume")),
+ &aArgVolume)
+ && getStringRequestArgument(
+ aRequestArguments,
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
+ "OtherVolume")),
+ &aArgOtherVolume))
+ {
+ nErrorCode = aErrorCode[aIoException.Code][1];
+ aArguments.reserve(2);
+ aArguments.push_back(aArgVolume);
+ aArguments.push_back(aArgOtherVolume);
+ }
+ else
+ nErrorCode = aErrorCode[aIoException.Code][0];
+ break;
+ }
+
+ case ucb::IOErrorCode_NOT_EXISTING:
+ {
+ rtl::OUString aArgUri;
+ if (getResourceNameRequestArgument(aRequestArguments,
+ &aArgUri))
+ {
+ rtl::OUString aResourceType;
+ getStringRequestArgument(
+ aRequestArguments,
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
+ "ResourceType")),
+ &aResourceType);
+ nErrorCode
+ = aResourceType.equalsAsciiL(
+ RTL_CONSTASCII_STRINGPARAM("volume"))
+ ? ERRCODE_UUI_IO_NOTEXISTS_VOLUME
+ : (aResourceType.equalsAsciiL(
+ RTL_CONSTASCII_STRINGPARAM("folder"))
+ ? ERRCODE_UUI_IO_NOTEXISTS_FOLDER
+ : ERRCODE_UUI_IO_NOTEXISTS);
+ aArguments.push_back(aArgUri);
+ }
+ else
+ nErrorCode = aErrorCode[aIoException.Code][0];
+ break;
+ }
+
+ default:
+ {
+ rtl::OUString aArgUri;
+ if (getResourceNameRequestArgument(aRequestArguments,
+ &aArgUri))
+ {
+ nErrorCode = aErrorCode[aIoException.Code][1];
+ aArguments.push_back(aArgUri);
+ }
+ else
+ nErrorCode = aErrorCode[aIoException.Code][0];
+ break;
+ }
+ }
+
+ handleErrorHandlerRequest(aIoException.Classification,
+ nErrorCode,
+ aArguments,
+ rRequest->getContinuations(),
+ bObtainErrorStringOnly,
+ bHasErrorString,
+ rErrorString);
+ return true;
+ }
+ return false;
+}
diff --git a/uui/source/iahndl-locking.cxx b/uui/source/iahndl-locking.cxx
new file mode 100644
index 000000000000..bb8148e17645
--- /dev/null
+++ b/uui/source/iahndl-locking.cxx
@@ -0,0 +1,316 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#include <memory>
+
+#include "com/sun/star/document/ChangedByOthersRequest.hpp"
+#include "com/sun/star/document/LockedDocumentRequest.hpp"
+#include "com/sun/star/document/LockedOnSavingRequest.hpp"
+#include "com/sun/star/document/LockFileIgnoreRequest.hpp"
+#include "com/sun/star/document/OwnLockOnDocumentRequest.hpp"
+#include "com/sun/star/task/XInteractionApprove.hpp"
+#include "com/sun/star/task/XInteractionDisapprove.hpp"
+#include "com/sun/star/task/XInteractionAbort.hpp"
+#include "com/sun/star/task/XInteractionRequest.hpp"
+
+#include "vos/mutex.hxx"
+#include "vcl/svapp.hxx"
+#include "vcl/msgbox.hxx"
+
+#include "ids.hrc"
+#include "getcontinuations.hxx"
+#include "openlocked.hxx"
+#include "trylater.hxx"
+#include "alreadyopen.hxx"
+#include "filechanged.hxx"
+#include "lockfailed.hxx"
+
+#include "iahndl.hxx"
+
+#define UUI_DOC_LOAD_LOCK 0
+#define UUI_DOC_OWN_LOAD_LOCK 1
+#define UUI_DOC_SAVE_LOCK 2
+#define UUI_DOC_OWN_SAVE_LOCK 3
+
+using namespace com::sun::star;
+
+namespace {
+
+void
+handleLockedDocumentRequest_(
+ Window * pParent,
+ const ::rtl::OUString& aDocumentURL,
+ const ::rtl::OUString& aInfo,
+ uno::Sequence< uno::Reference< task::XInteractionContinuation > > const &
+ rContinuations,
+ sal_uInt16 nMode )
+ SAL_THROW((uno::RuntimeException))
+{
+ uno::Reference< task::XInteractionApprove > xApprove;
+ uno::Reference< task::XInteractionDisapprove > xDisapprove;
+ uno::Reference< task::XInteractionAbort > xAbort;
+ getContinuations(rContinuations, &xApprove, &xDisapprove, &xAbort);
+
+ if ( !xApprove.is() || !xDisapprove.is() || !xAbort.is() )
+ return;
+
+ try
+ {
+ vos::OGuard aGuard(Application::GetSolarMutex());
+ std::auto_ptr< ResMgr > xManager(
+ ResMgr::CreateResMgr(CREATEVERSIONRESMGR_NAME(uui)));
+ if (!xManager.get())
+ return;
+
+ ::rtl::OUString aMessage;
+ std::vector< rtl::OUString > aArguments;
+ aArguments.push_back( aDocumentURL );
+
+ sal_Int32 nResult = RET_CANCEL;
+ if ( nMode == UUI_DOC_LOAD_LOCK )
+ {
+ aArguments.push_back( aInfo.getLength()
+ ? aInfo
+ : ::rtl::OUString( String(
+ ResId( STR_UNKNOWNUSER,
+ *xManager.get() ) ) ) );
+ aMessage = String( ResId( STR_OPENLOCKED_MSG, *xManager.get() ) );
+ aMessage = UUIInteractionHelper::replaceMessageWithArguments(
+ aMessage, aArguments );
+
+ std::auto_ptr< OpenLockedQueryBox > xDialog(new OpenLockedQueryBox(
+ pParent, xManager.get(), aMessage ) );
+ nResult = xDialog->Execute();
+ }
+ else if ( nMode == UUI_DOC_SAVE_LOCK )
+ {
+ aArguments.push_back( aInfo.getLength()
+ ? aInfo
+ : ::rtl::OUString( String(
+ ResId( STR_UNKNOWNUSER,
+ *xManager.get() ) ) ) );
+ aMessage = String( ResId( STR_TRYLATER_MSG, *xManager.get() ) );
+ aMessage = UUIInteractionHelper::replaceMessageWithArguments(
+ aMessage, aArguments );
+
+ std::auto_ptr< TryLaterQueryBox > xDialog(
+ new TryLaterQueryBox( pParent, xManager.get(), aMessage ) );
+ nResult = xDialog->Execute();
+ }
+ else if ( nMode == UUI_DOC_OWN_LOAD_LOCK ||
+ nMode == UUI_DOC_OWN_SAVE_LOCK )
+ {
+ aArguments.push_back( aInfo );
+ aMessage = String( ResId( nMode == UUI_DOC_OWN_SAVE_LOCK
+ ? STR_ALREADYOPEN_SAVE_MSG
+ : STR_ALREADYOPEN_MSG,
+ *xManager.get() ) );
+ aMessage = UUIInteractionHelper::replaceMessageWithArguments(
+ aMessage, aArguments );
+
+ std::auto_ptr< AlreadyOpenQueryBox > xDialog(
+ new AlreadyOpenQueryBox( pParent,
+ xManager.get(),
+ aMessage,
+ nMode == UUI_DOC_OWN_SAVE_LOCK ) );
+ nResult = xDialog->Execute();
+ }
+
+ if ( nResult == RET_YES )
+ xApprove->select();
+ else if ( nResult == RET_NO )
+ xDisapprove->select();
+ else
+ xAbort->select();
+ }
+ catch (std::bad_alloc const &)
+ {
+ throw uno::RuntimeException(
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("out of memory")),
+ uno::Reference< uno::XInterface >());
+ }
+}
+
+void
+handleChangedByOthersRequest_(
+ Window * pParent,
+ uno::Sequence< uno::Reference< task::XInteractionContinuation > > const &
+ rContinuations )
+ SAL_THROW((uno::RuntimeException))
+{
+ uno::Reference< task::XInteractionApprove > xApprove;
+ uno::Reference< task::XInteractionAbort > xAbort;
+ getContinuations(rContinuations, &xApprove, &xAbort);
+
+ if ( !xApprove.is() || !xAbort.is() )
+ return;
+
+ try
+ {
+ vos::OGuard aGuard(Application::GetSolarMutex());
+ std::auto_ptr< ResMgr > xManager(
+ ResMgr::CreateResMgr(CREATEVERSIONRESMGR_NAME(uui)));
+ if (!xManager.get())
+ return;
+
+ std::auto_ptr< FileChangedQueryBox > xDialog(
+ new FileChangedQueryBox( pParent, xManager.get() ) );
+ sal_Int32 nResult = xDialog->Execute();
+
+ if ( nResult == RET_YES )
+ xApprove->select();
+ else
+ xAbort->select();
+ }
+ catch (std::bad_alloc const &)
+ {
+ throw uno::RuntimeException(
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("out of memory")),
+ uno::Reference< uno::XInterface >());
+ }
+}
+
+void
+handleLockFileIgnoreRequest_(
+ Window * pParent,
+ uno::Sequence< uno::Reference< task::XInteractionContinuation > > const &
+ rContinuations )
+ SAL_THROW((uno::RuntimeException))
+{
+ uno::Reference< task::XInteractionApprove > xApprove;
+ uno::Reference< task::XInteractionAbort > xAbort;
+ getContinuations(rContinuations, &xApprove, &xAbort);
+
+ if ( !xApprove.is() || !xAbort.is() )
+ return;
+
+ try
+ {
+ vos::OGuard aGuard(Application::GetSolarMutex());
+ std::auto_ptr< ResMgr > xManager(
+ ResMgr::CreateResMgr(CREATEVERSIONRESMGR_NAME(uui)));
+ if (!xManager.get())
+ return;
+
+ std::auto_ptr< LockFailedQueryBox > xDialog(
+ new LockFailedQueryBox( pParent, xManager.get() ) );
+ sal_Int32 nResult = xDialog->Execute();
+
+ if ( nResult == RET_OK )
+ xApprove->select();
+ else
+ xAbort->select();
+ }
+ catch (std::bad_alloc const &)
+ {
+ throw uno::RuntimeException(
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("out of memory")),
+ uno::Reference< uno::XInterface >());
+ }
+}
+
+} // namespace
+
+bool
+UUIInteractionHelper::handleLockedDocumentRequest(
+ uno::Reference< task::XInteractionRequest > const & rRequest)
+ SAL_THROW((::com::sun::star::uno::RuntimeException))
+{
+ uno::Any aAnyRequest(rRequest->getRequest());
+
+ document::LockedDocumentRequest aLockedDocumentRequest;
+ if (aAnyRequest >>= aLockedDocumentRequest )
+ {
+ handleLockedDocumentRequest_( getParentProperty(),
+ aLockedDocumentRequest.DocumentURL,
+ aLockedDocumentRequest.UserInfo,
+ rRequest->getContinuations(),
+ UUI_DOC_LOAD_LOCK );
+ return true;
+ }
+
+ document::OwnLockOnDocumentRequest aOwnLockOnDocumentRequest;
+ if (aAnyRequest >>= aOwnLockOnDocumentRequest )
+ {
+ handleLockedDocumentRequest_( getParentProperty(),
+ aOwnLockOnDocumentRequest.DocumentURL,
+ aOwnLockOnDocumentRequest.TimeInfo,
+ rRequest->getContinuations(),
+ aOwnLockOnDocumentRequest.IsStoring
+ ? UUI_DOC_OWN_SAVE_LOCK
+ : UUI_DOC_OWN_LOAD_LOCK );
+ return true;
+ }
+
+ document::LockedOnSavingRequest aLockedOnSavingRequest;
+ if (aAnyRequest >>= aLockedOnSavingRequest )
+ {
+ handleLockedDocumentRequest_( getParentProperty(),
+ aLockedOnSavingRequest.DocumentURL,
+ aLockedOnSavingRequest.UserInfo,
+ rRequest->getContinuations(),
+ UUI_DOC_SAVE_LOCK );
+ return true;
+ }
+ return false;
+}
+
+bool
+UUIInteractionHelper::handleChangedByOthersRequest(
+ uno::Reference< task::XInteractionRequest > const & rRequest)
+ SAL_THROW((uno::RuntimeException))
+{
+ uno::Any aAnyRequest(rRequest->getRequest());
+
+ document::ChangedByOthersRequest aChangedByOthersRequest;
+ if (aAnyRequest >>= aChangedByOthersRequest )
+ {
+ handleChangedByOthersRequest_( getParentProperty(),
+ rRequest->getContinuations() );
+ return true;
+ }
+ return false;
+}
+
+bool
+UUIInteractionHelper::handleLockFileIgnoreRequest(
+ uno::Reference< task::XInteractionRequest > const & rRequest)
+ SAL_THROW((uno::RuntimeException))
+{
+ uno::Any aAnyRequest(rRequest->getRequest());
+
+ document::LockFileIgnoreRequest aLockFileIgnoreRequest;
+ if (aAnyRequest >>= aLockFileIgnoreRequest )
+ {
+ handleLockFileIgnoreRequest_( getParentProperty(),
+ rRequest->getContinuations() );
+ return true;
+ }
+ return false;
+}
+
+
diff --git a/uui/source/iahndl-ssl.cxx b/uui/source/iahndl-ssl.cxx
new file mode 100644
index 000000000000..4df133c7c674
--- /dev/null
+++ b/uui/source/iahndl-ssl.cxx
@@ -0,0 +1,357 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#include "com/sun/star/security/CertificateValidity.hpp"
+#include "com/sun/star/task/XInteractionAbort.hpp"
+#include "com/sun/star/task/XInteractionApprove.hpp"
+#include "com/sun/star/task/XInteractionRequest.hpp"
+#include "com/sun/star/ucb/CertificateValidationRequest.hpp"
+
+#include "vos/mutex.hxx"
+#include "tools/datetime.hxx"
+#include "svl/zforlist.hxx"
+#include "vcl/svapp.hxx"
+
+#include "ids.hrc"
+#include "getcontinuations.hxx"
+#include "sslwarndlg.hxx"
+#include "unknownauthdlg.hxx"
+
+#include "iahndl.hxx"
+
+#define DESCRIPTION_1 1
+#define DESCRIPTION_2 2
+#define TITLE 3
+
+using namespace com::sun::star;
+
+namespace {
+
+String
+getContentPart( const String& _rRawString )
+{
+ // search over some parts to find a string
+ //static char* aIDs[] = { "CN", "OU", "O", "E", NULL };
+ static char const * aIDs[] = { "CN=", "OU=", "O=", "E=", NULL };// By CP
+ String sPart;
+ int i = 0;
+ while ( aIDs[i] )
+ {
+ String sPartId = String::CreateFromAscii( aIDs[i++] );
+ xub_StrLen nContStart = _rRawString.Search( sPartId );
+ if ( nContStart != STRING_NOTFOUND )
+ {
+ nContStart = nContStart + sPartId.Len();
+ xub_StrLen nContEnd
+ = _rRawString.Search( sal_Unicode( ',' ), nContStart );
+ sPart = String( _rRawString, nContStart, nContEnd - nContStart );
+ break;
+ }
+ }
+ return sPart;
+}
+
+bool
+isDomainMatch(
+ rtl::OUString hostName, rtl::OUString certHostName)
+{
+ if (hostName.equalsIgnoreAsciiCase( certHostName ))
+ return true;
+
+ if ( 0 == certHostName.indexOf( rtl::OUString::createFromAscii( "*" ) ) &&
+ hostName.getLength() >= certHostName.getLength() )
+ {
+ rtl::OUString cmpStr = certHostName.copy( 1 );
+
+ if ( hostName.matchIgnoreAsciiCase(
+ cmpStr, hostName.getLength() - cmpStr.getLength()) )
+ return true;
+ }
+
+ return false;
+}
+
+rtl::OUString
+getLocalizedDatTimeStr(
+ uno::Reference< lang::XMultiServiceFactory > const & xServiceFactory,
+ util::DateTime const & rDateTime )
+{
+ rtl::OUString aDateTimeStr;
+ Date aDate;
+ Time aTime;
+
+ aDate = Date( rDateTime.Day, rDateTime.Month, rDateTime.Year );
+ aTime = Time( rDateTime.Hours, rDateTime.Minutes, rDateTime.Seconds );
+
+ LanguageType eUILang = Application::GetSettings().GetUILanguage();
+ SvNumberFormatter *pNumberFormatter
+ = new SvNumberFormatter( xServiceFactory, eUILang );
+ String aTmpStr;
+ Color* pColor = NULL;
+ Date* pNullDate = pNumberFormatter->GetNullDate();
+ sal_uInt32 nFormat
+ = pNumberFormatter->GetStandardFormat( NUMBERFORMAT_DATE, eUILang );
+
+ pNumberFormatter->GetOutputString(
+ aDate - *pNullDate, nFormat, aTmpStr, &pColor );
+ aDateTimeStr = aTmpStr + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" "));
+
+ nFormat = pNumberFormatter->GetStandardFormat( NUMBERFORMAT_TIME, eUILang );
+ pNumberFormatter->GetOutputString(
+ aTime.GetTimeInDays(), nFormat, aTmpStr, &pColor );
+ aDateTimeStr += aTmpStr;
+
+ return aDateTimeStr;
+}
+
+sal_Bool
+executeUnknownAuthDialog(
+ Window * pParent,
+ uno::Reference< lang::XMultiServiceFactory > const & xServiceFactory,
+ const uno::Reference< security::XCertificate >& rXCert)
+ SAL_THROW((uno::RuntimeException))
+{
+ try
+ {
+ vos::OGuard aGuard(Application::GetSolarMutex());
+
+ std::auto_ptr< ResMgr > xManager(
+ ResMgr::CreateResMgr(CREATEVERSIONRESMGR_NAME(uui)));
+ std::auto_ptr< UnknownAuthDialog > xDialog(
+ new UnknownAuthDialog( pParent,
+ rXCert,
+ xServiceFactory,
+ xManager.get()));
+
+ // Get correct ressource string
+ rtl::OUString aMessage;
+
+ std::vector< rtl::OUString > aArguments;
+ aArguments.push_back( getContentPart( rXCert->getSubjectName()) );
+
+ if (xManager.get())
+ {
+ ResId aResId(RID_UUI_ERRHDL, *xManager.get());
+ if (ErrorResource(aResId).getString(
+ ERRCODE_UUI_UNKNOWNAUTH_UNTRUSTED, &aMessage))
+ {
+ aMessage = UUIInteractionHelper::replaceMessageWithArguments(
+ aMessage, aArguments );
+ xDialog->setDescriptionText( aMessage );
+ }
+ }
+
+ return static_cast<sal_Bool> (xDialog->Execute());
+ }
+ catch (std::bad_alloc const &)
+ {
+ throw uno::RuntimeException(
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("out of memory")),
+ uno::Reference< uno::XInterface >());
+ }
+}
+
+sal_Bool
+executeSSLWarnDialog(
+ Window * pParent,
+ uno::Reference< lang::XMultiServiceFactory > const & xServiceFactory,
+ const uno::Reference< security::XCertificate >& rXCert,
+ sal_Int32 const & failure,
+ const rtl::OUString & hostName )
+ SAL_THROW((uno::RuntimeException))
+{
+ try
+ {
+ vos::OGuard aGuard(Application::GetSolarMutex());
+
+ std::auto_ptr< ResMgr > xManager(
+ ResMgr::CreateResMgr(CREATEVERSIONRESMGR_NAME(uui)));
+ std::auto_ptr< SSLWarnDialog > xDialog(
+ new SSLWarnDialog( pParent,
+ rXCert,
+ xServiceFactory,
+ xManager.get()));
+
+ // Get correct ressource string
+ rtl::OUString aMessage_1;
+ std::vector< rtl::OUString > aArguments_1;
+
+ switch( failure )
+ {
+ case SSLWARN_TYPE_DOMAINMISMATCH:
+ aArguments_1.push_back( hostName );
+ aArguments_1.push_back(
+ getContentPart( rXCert->getSubjectName()) );
+ aArguments_1.push_back( hostName );
+ break;
+ case SSLWARN_TYPE_EXPIRED:
+ aArguments_1.push_back(
+ getContentPart( rXCert->getSubjectName()) );
+ aArguments_1.push_back(
+ getLocalizedDatTimeStr( xServiceFactory,
+ rXCert->getNotValidAfter() ) );
+ aArguments_1.push_back(
+ getLocalizedDatTimeStr( xServiceFactory,
+ rXCert->getNotValidAfter() ) );
+ break;
+ case SSLWARN_TYPE_INVALID:
+ break;
+ }
+
+ if (xManager.get())
+ {
+ ResId aResId(RID_UUI_ERRHDL, *xManager.get());
+ if (ErrorResource(aResId).getString(
+ ERRCODE_AREA_UUI_UNKNOWNAUTH + failure + DESCRIPTION_1,
+ &aMessage_1))
+ {
+ aMessage_1 = UUIInteractionHelper::replaceMessageWithArguments(
+ aMessage_1, aArguments_1 );
+ xDialog->setDescription1Text( aMessage_1 );
+ }
+
+ rtl::OUString aTitle;
+ ErrorResource(aResId).getString(
+ ERRCODE_AREA_UUI_UNKNOWNAUTH + failure + TITLE, &aTitle);
+ xDialog->SetText( aTitle );
+ }
+
+ return static_cast<sal_Bool> (xDialog->Execute());
+ }
+ catch (std::bad_alloc const &)
+ {
+ throw uno::RuntimeException(
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("out of memory")),
+ uno::Reference< uno::XInterface >());
+ }
+}
+
+void
+handleCertificateValidationRequest_(
+ Window * pParent,
+ uno::Reference< lang::XMultiServiceFactory > const & xServiceFactory,
+ ucb::CertificateValidationRequest const & rRequest,
+ uno::Sequence< uno::Reference< task::XInteractionContinuation > > const &
+ rContinuations)
+ SAL_THROW((uno::RuntimeException))
+{
+ uno::Reference< task::XInteractionApprove > xApprove;
+ uno::Reference< task::XInteractionAbort > xAbort;
+ getContinuations(rContinuations, &xApprove, &xAbort);
+
+ sal_Int32 failures = rRequest.CertificateValidity;
+ sal_Bool trustCert = sal_True;
+
+ if ( ((failures & security::CertificateValidity::UNTRUSTED)
+ == security::CertificateValidity::UNTRUSTED ) ||
+ ((failures & security::CertificateValidity::ISSUER_UNTRUSTED)
+ == security::CertificateValidity::ISSUER_UNTRUSTED) ||
+ ((failures & security::CertificateValidity::ROOT_UNTRUSTED)
+ == security::CertificateValidity::ROOT_UNTRUSTED) )
+ {
+ trustCert = executeUnknownAuthDialog( pParent,
+ xServiceFactory,
+ rRequest.Certificate );
+ }
+
+ if ( (!isDomainMatch(
+ rRequest.HostName,
+ getContentPart(
+ rRequest.Certificate->getSubjectName()) )) &&
+ trustCert )
+ {
+ trustCert = executeSSLWarnDialog( pParent,
+ xServiceFactory,
+ rRequest.Certificate,
+ SSLWARN_TYPE_DOMAINMISMATCH,
+ rRequest.HostName );
+ }
+
+ if ( (((failures & security::CertificateValidity::TIME_INVALID)
+ == security::CertificateValidity::TIME_INVALID) ||
+ ((failures & security::CertificateValidity::NOT_TIME_NESTED)
+ == security::CertificateValidity::NOT_TIME_NESTED)) &&
+ trustCert )
+ {
+ trustCert = executeSSLWarnDialog( pParent,
+ xServiceFactory,
+ rRequest.Certificate,
+ SSLWARN_TYPE_EXPIRED,
+ rRequest.HostName );
+ }
+
+ if ( (((failures & security::CertificateValidity::REVOKED)
+ == security::CertificateValidity::REVOKED) ||
+ ((failures & security::CertificateValidity::SIGNATURE_INVALID)
+ == security::CertificateValidity::SIGNATURE_INVALID) ||
+ ((failures & security::CertificateValidity::EXTENSION_INVALID)
+ == security::CertificateValidity::EXTENSION_INVALID) ||
+ ((failures & security::CertificateValidity::INVALID)
+ == security::CertificateValidity::INVALID)) &&
+ trustCert )
+ {
+ trustCert = executeSSLWarnDialog( pParent,
+ xServiceFactory,
+ rRequest.Certificate,
+ SSLWARN_TYPE_INVALID,
+ rRequest.HostName );
+ }
+
+ if ( trustCert )
+ {
+ if (xApprove.is())
+ xApprove->select();
+ }
+ else
+ {
+ if (xAbort.is())
+ xAbort->select();
+ }
+}
+
+} // namespace
+
+bool
+UUIInteractionHelper::handleCertificateValidationRequest(
+ uno::Reference< task::XInteractionRequest > const & rRequest)
+ SAL_THROW((uno::RuntimeException))
+{
+ uno::Any aAnyRequest(rRequest->getRequest());
+
+ ucb::CertificateValidationRequest aCertificateValidationRequest;
+ if (aAnyRequest >>= aCertificateValidationRequest)
+ {
+ handleCertificateValidationRequest_(getParentProperty(),
+ m_xServiceFactory,
+ aCertificateValidationRequest,
+ rRequest->getContinuations());
+ return true;
+ }
+
+ return false;
+}
+
diff --git a/uui/source/iahndl.cxx b/uui/source/iahndl.cxx
index 4fbbb7f75c26..e883bd60848d 100644..100755
--- a/uui/source/iahndl.cxx
+++ b/uui/source/iahndl.cxx
@@ -2,13 +2,10 @@
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
- * Copyright 2008 by Sun Microsystems, Inc.
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: iahndl.cxx,v $
- * $Revision: 1.67.22.1 $
- *
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
@@ -28,123 +25,72 @@
*
************************************************************************/
-#include "iahndl.hxx"
-
#include <memory>
-#include "osl/diagnose.h"
-#include "osl/conditn.hxx"
-#include "rtl/digest.h"
-#include "rtl/ustrbuf.hxx"
+#include "com/sun/star/awt/XWindow.hpp"
#include "com/sun/star/beans/PropertyValue.hpp"
-#include "com/sun/star/beans/XPropertyAccess.hpp"
#include "com/sun/star/configuration/backend/MergeRecoveryRequest.hpp"
#include "com/sun/star/configuration/backend/StratumCreationException.hpp"
-#include <com/sun/star/container/XHierarchicalNameAccess.hpp>
-#include "com/sun/star/container/XContainerQuery.hpp"
-#include "com/sun/star/container/XNameAccess.hpp"
-#include "com/sun/star/container/XNameContainer.hpp"
+#include "com/sun/star/container/XHierarchicalNameAccess.hpp"
#include "com/sun/star/document/BrokenPackageRequest.hpp"
-#include "com/sun/star/document/FilterOptionsRequest.hpp"
-#include "com/sun/star/document/NoSuchFilterRequest.hpp"
-#include "com/sun/star/document/AmbigousFilterRequest.hpp"
-#include "com/sun/star/document/LockedDocumentRequest.hpp"
-#include "com/sun/star/document/OwnLockOnDocumentRequest.hpp"
-#include "com/sun/star/document/LockedOnSavingRequest.hpp"
-#include "com/sun/star/document/ChangedByOthersRequest.hpp"
-#include "com/sun/star/document/LockFileIgnoreRequest.hpp"
-#include "com/sun/star/document/XImporter.hpp"
-#include "com/sun/star/document/XInteractionFilterOptions.hpp"
-#include "com/sun/star/document/XInteractionFilterSelect.hpp"
+#include "com/sun/star/task/DocumentMacroConfirmationRequest.hpp"
#include "com/sun/star/java/WrongJavaVersionException.hpp"
+#include "com/sun/star/lang/XInitialization.hpp"
#include "com/sun/star/lang/XMultiServiceFactory.hpp"
#include "com/sun/star/script/ModuleSizeExceededRequest.hpp"
#include "com/sun/star/sync2/BadPartnershipException.hpp"
-#include "com/sun/star/task/XInteractionHandler.hpp"
-#include "com/sun/star/task/XInteractionHandler2.hpp"
-#include "com/sun/star/task/DocumentPasswordRequest.hpp"
-#include "com/sun/star/task/DocumentMSPasswordRequest.hpp"
#include "com/sun/star/task/ErrorCodeIOException.hpp"
#include "com/sun/star/task/ErrorCodeRequest.hpp"
-#include "com/sun/star/task/MasterPasswordRequest.hpp"
-#include "com/sun/star/task/NoMasterException.hpp"
-#include "com/sun/star/task/DocumentMacroConfirmationRequest.hpp"
-#include "com/sun/star/task/DocumentMacroConfirmationRequest2.hpp"
+#include "com/sun/star/task/FutureDocumentVersionProductUpdateRequest.hpp"
#include "com/sun/star/task/XInteractionAbort.hpp"
#include "com/sun/star/task/XInteractionApprove.hpp"
+#include "com/sun/star/task/XInteractionAskLater.hpp"
#include "com/sun/star/task/XInteractionDisapprove.hpp"
-#include "com/sun/star/task/XInteractionPassword.hpp"
+#include "com/sun/star/task/XInteractionHandler2.hpp"
#include "com/sun/star/task/XInteractionRequest.hpp"
#include "com/sun/star/task/XInteractionRetry.hpp"
-#include "com/sun/star/task/XPasswordContainer.hpp"
-#include "com/sun/star/task/XUrlContainer.hpp"
-#include "com/sun/star/task/XInteractionAskLater.hpp"
-#include "com/sun/star/ucb/AuthenticationRequest.hpp"
-#include "com/sun/star/ucb/URLAuthenticationRequest.hpp"
-#include "com/sun/star/ucb/CertificateValidationRequest.hpp"
-#include "com/sun/star/ucb/HandleCookiesRequest.hpp"
#include "com/sun/star/ucb/InteractiveAppException.hpp"
-#include "com/sun/star/ucb/InteractiveAugmentedIOException.hpp"
#include "com/sun/star/ucb/InteractiveCHAOSException.hpp"
+#include "com/sun/star/ucb/InteractiveLockingLockedException.hpp"
+#include "com/sun/star/ucb/InteractiveLockingNotLockedException.hpp"
+#include "com/sun/star/ucb/InteractiveLockingLockExpiredException.hpp"
#include "com/sun/star/ucb/InteractiveNetworkConnectException.hpp"
-#include "com/sun/star/ucb/InteractiveNetworkException.hpp"
-#include "com/sun/star/ucb/InteractiveNetworkGeneralException.hpp"
#include "com/sun/star/ucb/InteractiveNetworkOffLineException.hpp"
#include "com/sun/star/ucb/InteractiveNetworkReadException.hpp"
#include "com/sun/star/ucb/InteractiveNetworkResolveNameException.hpp"
#include "com/sun/star/ucb/InteractiveNetworkWriteException.hpp"
#include "com/sun/star/ucb/InteractiveWrongMediumException.hpp"
-#include "com/sun/star/ucb/IOErrorCode.hpp"
#include "com/sun/star/ucb/NameClashException.hpp"
#include "com/sun/star/ucb/NameClashResolveRequest.hpp"
#include "com/sun/star/ucb/UnsupportedNameClashException.hpp"
-#include "com/sun/star/ucb/XInteractionCookieHandling.hpp"
#include "com/sun/star/ucb/XInteractionReplaceExistingData.hpp"
-#include "com/sun/star/ucb/XInteractionSupplyAuthentication.hpp"
-#include "com/sun/star/ucb/XInteractionSupplyAuthentication2.hpp"
#include "com/sun/star/ucb/XInteractionSupplyName.hpp"
-#include <com/sun/star/ui/dialogs/XExecutableDialog.hpp>
-#include "com/sun/star/uno/RuntimeException.hpp"
#include "com/sun/star/xforms/InvalidDataOnSubmitException.hpp"
-#include <com/sun/star/security/CertificateValidity.hpp>
-#include <com/sun/star/lang/XInitialization.hpp>
-
+#include "osl/conditn.hxx"
+#include "tools/rcid.h" // RSC_STRING
+#include "tools/errinf.hxx" // ErrorHandler, ErrorContext, ...
#include "vos/mutex.hxx"
-#include "tools/rcid.h"
+#include "tools/diagnose_ex.h"
+#include "comphelper/documentconstants.hxx" // ODFVER_012_TEXT
+#include "svtools/sfxecode.hxx" // ERRCODE_SFX_*
+#include "vcl/msgbox.hxx"
#include "vcl/svapp.hxx"
-#include "svtools/svtools.hrc"
-#include "svtools/httpcook.hxx"
-#include "svtools/sfxecode.hxx"
-#include "toolkit/helper/vclunohelper.hxx"
-#include "comphelper/sequenceashashmap.hxx"
-#include "comphelper/documentconstants.hxx"
#include "unotools/configmgr.hxx"
+#include "toolkit/helper/vclunohelper.hxx"
+#include "comphelper/namedvaluecollection.hxx"
+#include "typelib/typedescription.hxx"
+#include "unotools/confignode.hxx"
#include "ids.hrc"
-#include "cookiedg.hxx"
+
+#include "getcontinuations.hxx"
#include "secmacrowarnings.hxx"
-#include "masterpasscrtdlg.hxx"
-#include "masterpassworddlg.hxx"
-#include "logindlg.hxx"
-#include "passcrtdlg.hxx"
-#include "passworddlg.hxx"
-#include "unknownauthdlg.hxx"
-#include "sslwarndlg.hxx"
-#include "openlocked.hxx"
#include "newerverwarn.hxx"
-#include "alreadyopen.hxx"
-#include "filechanged.hxx"
-#include "trylater.hxx"
-#include "lockfailed.hxx"
-#include "loginerr.hxx"
-
-#include <comphelper/processfactory.hxx>
-#include <svtools/zforlist.hxx>
-using namespace com::sun;
-namespace csss = ::com::sun::star::security;
+#include "iahndl.hxx"
+/** === begin UNO using === **/
using ::com::sun::star::uno::Sequence;
using ::com::sun::star::uno::UNO_QUERY;
using ::com::sun::star::uno::Reference;
@@ -153,286 +99,40 @@ using ::com::sun::star::task::XInteractionAbort;
using ::com::sun::star::task::XInteractionApprove;
using ::com::sun::star::task::XInteractionAskLater;
using ::com::sun::star::task::FutureDocumentVersionProductUpdateRequest;
-
-
-#define CONFIG_INTERACTIONHANDLERS_KEY "/org.openoffice.ucb.InteractionHandler/InteractionHandlers"
+using ::com::sun::star::uno::XInterface;
+using ::com::sun::star::lang::XInitialization;
+using ::com::sun::star::uno::UNO_QUERY_THROW;
+using ::com::sun::star::task::XInteractionHandler2;
+using ::com::sun::star::uno::Exception;
+using ::com::sun::star::uno::Any;
+using ::com::sun::star::task::XInteractionRequest;
+using ::com::sun::star::lang::XMultiServiceFactory;
+/** === end UNO using === **/
+
+using namespace ::com::sun::star;
namespace {
-class CookieList: public List
-{
-public:
- ~CookieList() SAL_THROW(());
-};
-
-CookieList::~CookieList() SAL_THROW(())
-{
- while (Count() != 0)
- delete static_cast< CntHTTPCookie * >(Remove(Count() - 1));
-}
-
-class ErrorResource: private Resource
+class HandleData : public osl::Condition
{
public:
- inline ErrorResource(ResId & rResId) SAL_THROW(()): Resource(rResId) {}
-
- inline ~ErrorResource() SAL_THROW(()) { FreeResource(); }
-
- bool getString(ErrCode nErrorCode, rtl::OUString * pString) const
- SAL_THROW(());
-};
-
-bool ErrorResource::getString(ErrCode nErrorCode, rtl::OUString * pString)
- const SAL_THROW(())
-{
- OSL_ENSURE(pString, "specification violation");
- ResId aResId(static_cast< USHORT >(nErrorCode & ERRCODE_RES_MASK), *m_pResMgr);
- aResId.SetRT(RSC_STRING);
- if (!IsAvailableRes(aResId))
- return false;
- aResId.SetAutoRelease(false);
- *pString = UniString(aResId);
- m_pResMgr->PopContext();
- return true;
-}
-
-void
-getContinuations(
- star::uno::Sequence< star::uno::Reference<
- star::task::XInteractionContinuation > > const & rContinuations,
- star::uno::Reference< star::task::XInteractionApprove > * pApprove,
- star::uno::Reference< star::task::XInteractionDisapprove > * pDisapprove,
- star::uno::Reference< star::task::XInteractionRetry > * pRetry,
- star::uno::Reference< star::task::XInteractionAbort > * pAbort,
- star::uno::Reference< star::ucb::XInteractionSupplyAuthentication > *
- pSupplyAuthentication,
- star::uno::Reference< star::ucb::XInteractionSupplyAuthentication2 > *
- pSupplyAuthentication2,
- star::uno::Reference< star::task::XInteractionPassword > * pPassword,
- star::uno::Reference< star::ucb::XInteractionSupplyName > *
- pSupplyName,
- star::uno::Reference< star::ucb::XInteractionReplaceExistingData > *
- pReplaceExistingData)
- SAL_THROW((star::uno::RuntimeException))
-{
- for (sal_Int32 i = 0; i < rContinuations.getLength(); ++i)
- {
- if (pApprove && !pApprove->is())
- {
- *pApprove
- = star::uno::Reference< star::task::XInteractionApprove >(
- rContinuations[i], star::uno::UNO_QUERY);
- if (pApprove->is())
- continue;
- }
- if (pDisapprove && !pDisapprove->is())
- {
- *pDisapprove
- = star::uno::Reference< star::task::XInteractionDisapprove >(
- rContinuations[i], star::uno::UNO_QUERY);
- if (pDisapprove->is())
- continue;
- }
- if (pRetry && !pRetry->is())
- {
- *pRetry = star::uno::Reference< star::task::XInteractionRetry >(
- rContinuations[i], star::uno::UNO_QUERY);
- if (pRetry->is())
- continue;
- }
- if (pAbort && !pAbort->is())
- {
- *pAbort = star::uno::Reference< star::task::XInteractionAbort >(
- rContinuations[i], star::uno::UNO_QUERY);
- if (pAbort->is())
- continue;
- }
- if (pSupplyAuthentication && !pSupplyAuthentication->is())
- {
- *pSupplyAuthentication
- = star::uno::Reference<
- star::ucb::XInteractionSupplyAuthentication >(
- rContinuations[i], star::uno::UNO_QUERY);
- if (pSupplyAuthentication->is())
- {
- // is it even a supplyauthentication2, which is derived from
- // supplyauthentication?
- if (pSupplyAuthentication2 && !pSupplyAuthentication2->is())
- *pSupplyAuthentication2
- = star::uno::Reference<
- star::ucb::XInteractionSupplyAuthentication2 >(
- rContinuations[i], star::uno::UNO_QUERY);
- continue;
- }
- }
- if (pPassword && !pPassword->is())
- {
- *pPassword
- = star::uno::Reference< star::task::XInteractionPassword >(
- rContinuations[i], star::uno::UNO_QUERY);
- if (pPassword->is())
- continue;
- }
- if (pSupplyName && !pSupplyName->is())
- {
- *pSupplyName
- = star::uno::Reference< star::ucb::XInteractionSupplyName >(
- rContinuations[i], star::uno::UNO_QUERY);
- if (pSupplyName->is())
- continue;
- }
- if (pReplaceExistingData && !pReplaceExistingData->is())
- {
- *pReplaceExistingData
- = star::uno::Reference<
- star::ucb::XInteractionReplaceExistingData >(
- rContinuations[i], star::uno::UNO_QUERY);
- if (pReplaceExistingData->is())
- continue;
- }
- }
-}
-
-::rtl::OUString replaceMessageWithArguments(
- ::rtl::OUString aMessage,
- std::vector< rtl::OUString > const & rArguments )
-{
- for (sal_Int32 i = 0;;)
- {
- i = aMessage.
- indexOf(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("$(ARG")), i);
- if (i == -1)
- break;
- if (aMessage.getLength() - i >= RTL_CONSTASCII_LENGTH("$(ARGx)")
- && aMessage.getStr()[i + RTL_CONSTASCII_LENGTH("$(ARGx")] == ')')
- {
- sal_Unicode c
- = aMessage.getStr()[i + RTL_CONSTASCII_LENGTH("$(ARG")];
- if (c >= '1' && c <= '2')
- {
- std::vector< rtl::OUString >::size_type nIndex
- = static_cast< std::vector< rtl::OUString >::size_type >(
- c - '1');
- if (nIndex < rArguments.size())
- {
- aMessage
- = aMessage.replaceAt(i,
- RTL_CONSTASCII_LENGTH("$(ARGx)"),
- rArguments[nIndex]);
- i += rArguments[nIndex].getLength();
- continue;
- }
- }
- }
- ++i;
- }
-
- return aMessage;
-}
-
-
-bool
-getStringRequestArgument(star::uno::Sequence< star::uno::Any > const &
- rArguments,
- rtl::OUString const & rKey,
- rtl::OUString * pValue)
- SAL_THROW(())
-{
- for (sal_Int32 i = 0; i < rArguments.getLength(); ++i)
- {
- star::beans::PropertyValue aProperty;
- if ((rArguments[i] >>= aProperty) && aProperty.Name == rKey)
- {
- rtl::OUString aValue;
- if (aProperty.Value >>= aValue)
- {
- if (pValue)
- *pValue = aValue;
- return true;
- }
- }
- }
- return false;
-}
-
-bool
-getBoolRequestArgument(star::uno::Sequence< star::uno::Any > const &
- rArguments,
- rtl::OUString const & rKey,
- bool * pValue)
- SAL_THROW(())
-{
- for (sal_Int32 i = 0; i < rArguments.getLength(); ++i)
+ HandleData(
+ uno::Reference< task::XInteractionRequest > const & rRequest)
+ : osl::Condition(),
+ m_rRequest(rRequest),
+ bHandled( false )
{
- star::beans::PropertyValue aProperty;
- if ((rArguments[i] >>= aProperty) && aProperty.Name == rKey)
- {
- sal_Bool bValue = sal_Bool();
- if (aProperty.Value >>= bValue)
- {
- if (pValue)
- *pValue = bValue;
- return true;
- }
- }
}
- return false;
-}
-
-bool
-getResourceNameRequestArgument(star::uno::Sequence< star::uno::Any > const &
- rArguments,
- rtl::OUString * pValue)
- SAL_THROW(())
-{
- if (!getStringRequestArgument(rArguments,
- rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
- "Uri")),
- pValue))
- return false;
- // Use the resource name only for file URLs, to avoid confusion:
- //TODO! work with ucp locality concept instead of hardcoded "file"?
- if (pValue
- && pValue->matchIgnoreAsciiCaseAsciiL(RTL_CONSTASCII_STRINGPARAM(
- "file:")))
- getStringRequestArgument(rArguments,
- rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
- "ResourceName")),
- pValue);
- return true;
-}
-
-bool isInformationalErrorMessageRequest(
- star::uno::Sequence< star::uno::Reference<
- star::task::XInteractionContinuation > > const &
- rContinuations)
-{
- // Only requests with a single continuation (user has no choice, request
- // is just informational)
- if (rContinuations.getLength() != 1 )
- return false;
-
- // user can only abort or approve, all other continuations are not
- // considered to be informational.
- star::uno::Reference< star::task::XInteractionApprove > xApprove(
- rContinuations[0], star::uno::UNO_QUERY);
- if (xApprove.is())
- return true;
-
- star::uno::Reference< star::task::XInteractionAbort > xAbort(
- rContinuations[0], star::uno::UNO_QUERY);
- if (xAbort.is())
- return true;
-
- return false;
-}
+ uno::Reference< task::XInteractionRequest > m_rRequest;
+ bool bHandled;
+ beans::Optional< rtl::OUString > m_aResult;
+};
} /* namespace */
UUIInteractionHelper::UUIInteractionHelper(
- star::uno::Reference< star::lang::XMultiServiceFactory > const &
- rServiceFactory,
- star::uno::Sequence< star::uno::Any > const & rArguments)
+ uno::Reference< lang::XMultiServiceFactory > const & rServiceFactory,
+ uno::Sequence< uno::Any > const & rArguments)
SAL_THROW(()):
m_xServiceFactory(rServiceFactory),
m_aProperties(rArguments)
@@ -440,8 +140,7 @@ UUIInteractionHelper::UUIInteractionHelper(
}
UUIInteractionHelper::UUIInteractionHelper(
- star::uno::Reference< star::lang::XMultiServiceFactory > const &
- rServiceFactory)
+ uno::Reference< lang::XMultiServiceFactory > const & rServiceFactory)
SAL_THROW(()):
m_xServiceFactory(rServiceFactory)
{
@@ -451,41 +150,32 @@ UUIInteractionHelper::~UUIInteractionHelper()
{
}
-class HandleData : public osl::Condition {
-public:
- HandleData(
- star::uno::Reference< star::task::XInteractionRequest > const &
- rRequest)
- : osl::Condition(),
- m_rRequest(rRequest),
- bHandled( false )
- {
- }
- star::uno::Reference< star::task::XInteractionRequest > m_rRequest;
- bool bHandled;
- star::beans::Optional< rtl::OUString > m_aResult;
-};
-
-long UUIInteractionHelper::handlerequest(
- void* pHandleData,void* pInteractionHelper)
-{
- HandleData* pHND = (HandleData*) pHandleData;
- UUIInteractionHelper* pUUI = (UUIInteractionHelper*) pInteractionHelper;
- pHND->bHandled = pUUI->handle_impl(pHND->m_rRequest);
+long
+UUIInteractionHelper::handlerequest(
+ void* pHandleData, void* pInteractionHelper)
+{
+ HandleData* pHND
+ = static_cast< HandleData * >(pHandleData);
+ UUIInteractionHelper* pUUI
+ = static_cast< UUIInteractionHelper * >(pInteractionHelper);
+ bool bDummy = false;
+ rtl::OUString aDummy;
+ pHND->bHandled
+ = pUUI->handleRequest_impl(pHND->m_rRequest, false, bDummy, aDummy);
pHND->set();
return 0;
}
-
bool
UUIInteractionHelper::handleRequest(
- star::uno::Reference< star::task::XInteractionRequest > const & rRequest)
- throw (star::uno::RuntimeException)
+ uno::Reference< task::XInteractionRequest > const & rRequest)
+ SAL_THROW((uno::RuntimeException))
{
Application* pApp = 0;
if(
// be aware,it is the same type
- ((oslThreadIdentifier) Application::GetMainThreadIdentifier())
+ static_cast< oslThreadIdentifier >(
+ Application::GetMainThreadIdentifier())
!= osl_getThreadIdentifier(NULL)
&&
(pApp = GetpApp())
@@ -501,10 +191,15 @@ UUIInteractionHelper::handleRequest(
return aHD.bHandled;
}
else
- return handle_impl(rRequest);
+ {
+ bool bDummy = false;
+ rtl::OUString aDummy;
+ return handleRequest_impl(rRequest, false, bDummy, aDummy);
+ }
}
-long UUIInteractionHelper::getstringfromrequest(
+long
+UUIInteractionHelper::getstringfromrequest(
void* pHandleData,void* pInteractionHelper)
{
HandleData* pHND = (HandleData*) pHandleData;
@@ -514,30 +209,34 @@ long UUIInteractionHelper::getstringfromrequest(
return 0;
}
-star::beans::Optional< rtl::OUString >
+beans::Optional< rtl::OUString >
UUIInteractionHelper::getStringFromRequest_impl(
- star::uno::Reference< star::task::XInteractionRequest > const & rRequest)
- throw (star::uno::RuntimeException)
+ uno::Reference< task::XInteractionRequest > const & rRequest)
+ SAL_THROW((uno::RuntimeException))
{
bool bSuccess = false;
rtl::OUString aMessage;
- handleMessageboxRequests(rRequest, true, bSuccess, aMessage);
+ handleRequest_impl(rRequest, true, bSuccess, aMessage);
- if (!bSuccess)
- handleErrorHandlerRequests(rRequest, true, bSuccess, aMessage);
+ OSL_ENSURE(bSuccess ||
+ !isInformationalErrorMessageRequest(
+ rRequest->getContinuations()),
+ "Interaction request is a candidate for a string representation."
+ "Please implement!");
- return star::beans::Optional< rtl::OUString >(bSuccess, aMessage);
+ return beans::Optional< rtl::OUString >(bSuccess, aMessage);
}
-star::beans::Optional< rtl::OUString >
+beans::Optional< rtl::OUString >
UUIInteractionHelper::getStringFromRequest(
- star::uno::Reference< star::task::XInteractionRequest > const & rRequest)
- throw (star::uno::RuntimeException)
+ uno::Reference< task::XInteractionRequest > const & rRequest)
+ SAL_THROW((uno::RuntimeException))
{
Application* pApp = 0;
if(
// be aware,it is the same type
- ((oslThreadIdentifier) Application::GetMainThreadIdentifier())
+ static_cast< oslThreadIdentifier >(
+ Application::GetMainThreadIdentifier())
!= osl_getThreadIdentifier(NULL)
&&
(pApp = GetpApp())
@@ -556,879 +255,732 @@ UUIInteractionHelper::getStringFromRequest(
return getStringFromRequest_impl(rRequest);
}
-bool UUIInteractionHelper::handleMessageboxRequests(
- star::uno::Reference< star::task::XInteractionRequest > const & rRequest,
- bool bObtainErrorStringOnly,
- bool & bHasErrorString,
- rtl::OUString & rErrorString)
+::rtl::OUString
+UUIInteractionHelper::replaceMessageWithArguments(
+ ::rtl::OUString aMessage,
+ std::vector< rtl::OUString > const & rArguments )
{
- star::uno::Any aAnyRequest(rRequest->getRequest());
-
- star::script::ModuleSizeExceededRequest aModSizeException;
- if (aAnyRequest >>= aModSizeException )
+ for (sal_Int32 i = 0;;)
{
- ErrCode nErrorCode = ERRCODE_UUI_IO_MODULESIZEEXCEEDED;
- std::vector< rtl::OUString > aArguments;
- star::uno::Sequence< rtl::OUString > sModules
- = aModSizeException.Names;
- if ( sModules.getLength() )
+ i = aMessage.
+ indexOf(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("$(ARG")), i);
+ if (i == -1)
+ break;
+ if (aMessage.getLength() - i >= RTL_CONSTASCII_LENGTH("$(ARGx)")
+ && aMessage.getStr()[i + RTL_CONSTASCII_LENGTH("$(ARGx")] == ')')
{
- rtl::OUString aName;
- for ( sal_Int32 index=0; index< sModules.getLength(); ++index )
+ sal_Unicode c
+ = aMessage.getStr()[i + RTL_CONSTASCII_LENGTH("$(ARG")];
+ if (c >= '1' && c <= '2')
{
- if ( index )
- aName = aName + rtl::OUString( ',' ) + sModules[index];
- else
- aName = sModules[index]; // 1st name
+ std::vector< rtl::OUString >::size_type nIndex
+ = static_cast< std::vector< rtl::OUString >::size_type >(
+ c - '1');
+ if (nIndex < rArguments.size())
+ {
+ aMessage
+ = aMessage.replaceAt(i,
+ RTL_CONSTASCII_LENGTH("$(ARGx)"),
+ rArguments[nIndex]);
+ i += rArguments[nIndex].getLength();
+ continue;
+ }
}
- aArguments.push_back( aName );
}
- handleErrorRequest( star::task::InteractionClassification_WARNING,
- nErrorCode,
- aArguments,
- rRequest->getContinuations(),
- bObtainErrorStringOnly,
- bHasErrorString,
- rErrorString);
- return true;
+ ++i;
}
- star::ucb::NameClashException aNCException;
- if (aAnyRequest >>= aNCException)
+ return aMessage;
+}
+
+bool
+UUIInteractionHelper::isInformationalErrorMessageRequest(
+ uno::Sequence< uno::Reference< task::XInteractionContinuation > > const &
+ rContinuations)
+{
+ // Only requests with a single continuation (user has no choice, request
+ // is just informational)
+ if (rContinuations.getLength() != 1 )
+ return false;
+
+ // user can only abort or approve, all other continuations are not
+ // considered to be informational.
+ uno::Reference< task::XInteractionApprove > xApprove(
+ rContinuations[0], uno::UNO_QUERY);
+ if (xApprove.is())
+ return true;
+
+ uno::Reference< task::XInteractionAbort > xAbort(
+ rContinuations[0], uno::UNO_QUERY);
+ if (xAbort.is())
+ return true;
+
+ return false;
+}
+
+bool
+UUIInteractionHelper::tryOtherInteractionHandler(
+ uno::Reference< task::XInteractionRequest > const & rRequest)
+ SAL_THROW((uno::RuntimeException))
+{
+ InteractionHandlerDataList dataList;
+ getInteractionHandlerList(dataList);
+
+ InteractionHandlerDataList::const_iterator aEnd(dataList.end());
+ for (InteractionHandlerDataList::const_iterator aIt(dataList.begin());
+ aIt != aEnd;
+ ++aIt)
{
- ErrCode nErrorCode = ERRCODE_UUI_IO_TARGETALREADYEXISTS;
- std::vector< rtl::OUString > aArguments;
+ if ( handleCustomRequest( rRequest, aIt->ServiceName ) )
+ return true;
+ }
+ return false;
+}
- if( aNCException.Name.getLength() )
+namespace
+{
+ // .................................................................................................................
+ static bool lcl_matchesRequest( const Any& i_rRequest, const ::rtl::OUString& i_rTypeName, const ::rtl::OUString& i_rPropagation )
+ {
+ const ::com::sun::star::uno::TypeDescription aTypeDesc( i_rTypeName );
+ const typelib_TypeDescription* pTypeDesc = aTypeDesc.get();
+ if ( !pTypeDesc || !pTypeDesc->pWeakRef )
{
- nErrorCode = ERRCODE_UUI_IO_ALREADYEXISTS;
- aArguments.push_back( aNCException.Name );
+#if OSL_DEBUG_LEVEL > 0
+ ::rtl::OStringBuffer aMessage;
+ aMessage.append( "no type found for '" );
+ aMessage.append( ::rtl::OUStringToOString( i_rTypeName, RTL_TEXTENCODING_UTF8 ) );
+ aMessage.append( "'" );
+ OSL_ENSURE( false, aMessage.makeStringAndClear().getStr() );
+#endif
+ return false;
}
+ const ::com::sun::star::uno::Type aType( pTypeDesc->pWeakRef );
- handleErrorRequest( aNCException.Classification,
- nErrorCode,
- aArguments,
- rRequest->getContinuations(),
- bObtainErrorStringOnly,
- bHasErrorString,
- rErrorString);
- return true;
+ const bool bExactMatch = ( i_rPropagation.compareToAscii( "named-only" ) == 0 );
+ if ( bExactMatch )
+ return i_rRequest.getValueType().equals( aType );
+
+ return i_rRequest.isExtractableTo( aType );
}
+}
- star::ucb::UnsupportedNameClashException aUORequest;
- if (aAnyRequest >>= aUORequest)
+// ---------------------------------------------------------------------------------------------------------------------
+bool UUIInteractionHelper::handleCustomRequest( const Reference< XInteractionRequest >& i_rRequest, const ::rtl::OUString& i_rServiceName ) const
+{
+ try
{
- ErrCode nErrorCode = ERRCODE_UUI_IO_UNSUPPORTEDOVERWRITE;
- std::vector< rtl::OUString > aArguments;
+ Reference< XInteractionHandler2 > xHandler( m_xServiceFactory->createInstance( i_rServiceName ), UNO_QUERY_THROW );
- star::uno::Reference< star::task::XInteractionApprove > xApprove;
- star::uno::Reference<
- star::task::XInteractionDisapprove > xDisapprove;
- getContinuations(
- rRequest->getContinuations(),
- &xApprove, &xDisapprove, 0, 0, 0, 0, 0, 0, 0);
-
- if( xApprove.is() && xDisapprove.is() )
+ Reference< XInitialization > xHandlerInit( xHandler, UNO_QUERY );
+ if ( xHandlerInit.is() )
{
- handleErrorRequest( star::task::InteractionClassification_QUERY,
- nErrorCode,
- aArguments,
- rRequest->getContinuations(),
- bObtainErrorStringOnly,
- bHasErrorString,
- rErrorString);
+ ::comphelper::NamedValueCollection aInitArgs;
+ aInitArgs.put( "Parent", getParentXWindow() );
+ xHandlerInit->initialize( aInitArgs.getWrappedPropertyValues() );
}
- return true;
- }
- star::document::BrokenPackageRequest aBrokenPackageRequest;
- if (aAnyRequest >>= aBrokenPackageRequest)
+ if ( xHandler->handleInteractionRequest( i_rRequest ) )
+ return true;
+ }
+ catch( const Exception& )
{
- std::vector< rtl::OUString > aArguments;
-
- if( aBrokenPackageRequest.aName.getLength() )
- aArguments.push_back( aBrokenPackageRequest.aName );
+ DBG_UNHANDLED_EXCEPTION();
+ }
+ return false;
+}
- handleBrokenPackageRequest( aArguments,
- rRequest->getContinuations(),
- bObtainErrorStringOnly,
- bHasErrorString,
- rErrorString);
- return true;
+// ---------------------------------------------------------------------------------------------------------------------
+bool UUIInteractionHelper::handleTypedHandlerImplementations( Reference< XInteractionRequest > const & rRequest )
+{
+ // the request
+ const Any aRequest( rRequest->getRequest() );
+
+ const StringHashMap::const_iterator aCacheHitTest = m_aTypedCustomHandlers.find( aRequest.getValueTypeName() );
+ if ( aCacheHitTest != m_aTypedCustomHandlers.end() )
+ return handleCustomRequest( rRequest, aCacheHitTest->second );
+
+ // the base registration node for "typed" interaction handlers
+ const ::utl::OConfigurationTreeRoot aConfigRoot( ::utl::OConfigurationTreeRoot::createWithServiceFactory(
+ m_xServiceFactory,
+ ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "/org.openoffice.Interaction/InteractionHandlers" ) ),
+ -1,
+ ::utl::OConfigurationTreeRoot::CM_READONLY
+ ) );
+
+ // loop through all registered implementations
+ const Sequence< ::rtl::OUString > aRegisteredHandlers( aConfigRoot.getNodeNames() );
+ const ::rtl::OUString* pHandlerName = aRegisteredHandlers.getConstArray();
+ const ::rtl::OUString* pHandlersEnd = aRegisteredHandlers.getConstArray() + aRegisteredHandlers.getLength();
+ for ( ; pHandlerName != pHandlersEnd; ++pHandlerName )
+ {
+ const ::utl::OConfigurationNode aHandlerNode( aConfigRoot.openNode( *pHandlerName ) );
+ const ::utl::OConfigurationNode aTypesNode( aHandlerNode.openNode( "HandledRequestTypes" ) );
+
+ // loop through all the types which the current handler is registered for
+ const Sequence< ::rtl::OUString > aHandledTypes( aTypesNode.getNodeNames() );
+ const ::rtl::OUString* pType = aHandledTypes.getConstArray();
+ const ::rtl::OUString* pTypesEnd = aHandledTypes.getConstArray() + aHandledTypes.getLength();
+ for ( ; pType != pTypesEnd; ++pType )
+ {
+ // the UNO type is the node name
+ ::utl::OConfigurationNode aType( aTypesNode.openNode( *pType ) );
+ // and there's a child denoting how the responsibility propagates
+ ::rtl::OUString sPropagation;
+ OSL_VERIFY( aType.getNodeValue( "Propagation" ) >>= sPropagation );
+ if ( lcl_matchesRequest( aRequest, *pType, sPropagation ) )
+ {
+ // retrieve the service/implementation name of the handler
+ ::rtl::OUString sServiceName;
+ OSL_VERIFY( aHandlerNode.getNodeValue( "ServiceName" ) >>= sServiceName );
+ // cache the information who feels responsible for requests of this type
+ m_aTypedCustomHandlers[ aRequest.getValueTypeName() ] = sServiceName;
+ // actually handle the request
+ return handleCustomRequest( rRequest, sServiceName );
+ }
+ }
}
- star::ucb::InteractiveIOException aIoException;
- if (aAnyRequest >>= aIoException)
+ return false;
+}
+
+bool
+UUIInteractionHelper::handleRequest_impl(
+ uno::Reference< task::XInteractionRequest > const & rRequest,
+ bool bObtainErrorStringOnly,
+ bool & bHasErrorString,
+ rtl::OUString & rErrorString)
+ SAL_THROW((uno::RuntimeException))
+{
+ try
{
- star::uno::Sequence< star::uno::Any > aRequestArguments;
- star::ucb::InteractiveAugmentedIOException aAugmentedIoException;
- if (aAnyRequest >>= aAugmentedIoException)
- aRequestArguments = aAugmentedIoException.Arguments;
-
- ErrCode nErrorCode;
- std::vector< rtl::OUString > aArguments;
- static ErrCode const
- aErrorCode[star::ucb::IOErrorCode_WRONG_VERSION + 1][2]
- = { { ERRCODE_IO_ABORT, ERRCODE_UUI_IO_ABORT }, // ABORT
- { ERRCODE_IO_ACCESSDENIED, ERRCODE_UUI_IO_ACCESSDENIED },
- // ACCESS_DENIED
- { ERRCODE_IO_ALREADYEXISTS,
- ERRCODE_UUI_IO_ALREADYEXISTS }, // ALREADY_EXISTING
- { ERRCODE_IO_BADCRC, ERRCODE_UUI_IO_BADCRC }, // BAD_CRC
- { ERRCODE_IO_CANTCREATE, ERRCODE_UUI_IO_CANTCREATE },
- // CANT_CREATE
- { ERRCODE_IO_CANTREAD, ERRCODE_UUI_IO_CANTREAD },
- // CANT_READ
- { ERRCODE_IO_CANTSEEK, ERRCODE_UUI_IO_CANTSEEK },
- // CANT_SEEK
- { ERRCODE_IO_CANTTELL, ERRCODE_UUI_IO_CANTTELL },
- // CANT_TELL
- { ERRCODE_IO_CANTWRITE, ERRCODE_UUI_IO_CANTWRITE },
- // CANT_WRITE
- { ERRCODE_IO_CURRENTDIR, ERRCODE_UUI_IO_CURRENTDIR },
- // CURRENT_DIRECTORY
- { ERRCODE_IO_DEVICENOTREADY, ERRCODE_UUI_IO_NOTREADY },
- // DEVICE_NOT_READY
- { ERRCODE_IO_NOTSAMEDEVICE,
- ERRCODE_UUI_IO_NOTSAMEDEVICE }, // DIFFERENT_DEVICES
- { ERRCODE_IO_GENERAL, ERRCODE_UUI_IO_GENERAL }, // GENERAL
- { ERRCODE_IO_INVALIDACCESS,
- ERRCODE_UUI_IO_INVALIDACCESS }, // INVALID_ACCESS
- { ERRCODE_IO_INVALIDCHAR, ERRCODE_UUI_IO_INVALIDCHAR },
- // INVALID_CHARACTER
- { ERRCODE_IO_INVALIDDEVICE,
- ERRCODE_UUI_IO_INVALIDDEVICE }, // INVALID_DEVICE
- { ERRCODE_IO_INVALIDLENGTH,
- ERRCODE_UUI_IO_INVALIDLENGTH }, // INVALID_LENGTH
- { ERRCODE_IO_INVALIDPARAMETER,
- ERRCODE_UUI_IO_INVALIDPARAMETER }, // INVALID_PARAMETER
- { ERRCODE_IO_ISWILDCARD, ERRCODE_UUI_IO_ISWILDCARD },
- // IS_WILDCARD
- { ERRCODE_IO_LOCKVIOLATION,
- ERRCODE_UUI_IO_LOCKVIOLATION }, // LOCKING_VIOLATION
- { ERRCODE_IO_MISPLACEDCHAR,
- ERRCODE_UUI_IO_MISPLACEDCHAR }, // MISPLACED_CHARACTER
- { ERRCODE_IO_NAMETOOLONG, ERRCODE_UUI_IO_NAMETOOLONG },
- // NAME_TOO_LONG
- { ERRCODE_IO_NOTEXISTS, ERRCODE_UUI_IO_NOTEXISTS },
- // NOT_EXISTING
- { ERRCODE_IO_NOTEXISTSPATH,
- ERRCODE_UUI_IO_NOTEXISTSPATH }, // NOT_EXISTING_PATH
- { ERRCODE_IO_NOTSUPPORTED, ERRCODE_UUI_IO_NOTSUPPORTED },
- // NOT_SUPPORTED
- { ERRCODE_IO_NOTADIRECTORY,
- ERRCODE_UUI_IO_NOTADIRECTORY }, // NO_DIRECTORY
- { ERRCODE_IO_NOTAFILE, ERRCODE_UUI_IO_NOTAFILE },
- // NO_FILE
- { ERRCODE_IO_OUTOFSPACE, ERRCODE_UUI_IO_OUTOFSPACE },
- // OUT_OF_DISK_SPACE
- { ERRCODE_IO_TOOMANYOPENFILES,
- ERRCODE_UUI_IO_TOOMANYOPENFILES },
- // OUT_OF_FILE_HANDLES
- { ERRCODE_IO_OUTOFMEMORY, ERRCODE_UUI_IO_OUTOFMEMORY },
- // OUT_OF_MEMORY
- { ERRCODE_IO_PENDING, ERRCODE_UUI_IO_PENDING }, // PENDING
- { ERRCODE_IO_RECURSIVE, ERRCODE_UUI_IO_RECURSIVE },
- // RECURSIVE
- { ERRCODE_IO_UNKNOWN, ERRCODE_UUI_IO_UNKNOWN }, // UNKNOWN
- { ERRCODE_IO_WRITEPROTECTED,
- ERRCODE_UUI_IO_WRITEPROTECTED }, // WRITE_PROTECTED
- { ERRCODE_IO_WRONGFORMAT, ERRCODE_UUI_IO_WRONGFORMAT },
- // WRONG_FORMAT
- { ERRCODE_IO_WRONGVERSION,
- ERRCODE_UUI_IO_WRONGVERSION } }; // WRONG_VERSION
- switch (aIoException.Code)
+ if (!rRequest.is())
+ return false;
+
+ uno::Any aAnyRequest(rRequest->getRequest());
+
+ script::ModuleSizeExceededRequest aModSizeException;
+ if (aAnyRequest >>= aModSizeException )
{
- case star::ucb::IOErrorCode_CANT_CREATE:
+ ErrCode nErrorCode = ERRCODE_UUI_IO_MODULESIZEEXCEEDED;
+ std::vector< rtl::OUString > aArguments;
+ uno::Sequence< rtl::OUString > sModules
+ = aModSizeException.Names;
+ if ( sModules.getLength() )
{
- rtl::OUString aArgFolder;
- if (getStringRequestArgument(
- aRequestArguments,
- rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
- "Folder")),
- &aArgFolder))
+ rtl::OUString aName;
+ for ( sal_Int32 index=0; index< sModules.getLength(); ++index )
{
- rtl::OUString aArgUri;
- if (getResourceNameRequestArgument(aRequestArguments,
- &aArgUri))
- {
- nErrorCode = ERRCODE_UUI_IO_CANTCREATE;
- aArguments.reserve(2);
- aArguments.push_back(aArgUri);
- aArguments.push_back(aArgFolder);
- }
+ if ( index )
+ aName = aName + rtl::OUString( ',' ) + sModules[index];
else
- {
- nErrorCode = ERRCODE_UUI_IO_CANTCREATE_NONAME;
- aArguments.push_back(aArgFolder);
- }
+ aName = sModules[index]; // 1st name
}
- else
- nErrorCode = aErrorCode[aIoException.Code][0];
- break;
+ aArguments.push_back( aName );
}
+ handleErrorHandlerRequest( task::InteractionClassification_WARNING,
+ nErrorCode,
+ aArguments,
+ rRequest->getContinuations(),
+ bObtainErrorStringOnly,
+ bHasErrorString,
+ rErrorString);
+ return true;
+ }
+
+ ucb::NameClashException aNCException;
+ if (aAnyRequest >>= aNCException)
+ {
+ ErrCode nErrorCode = ERRCODE_UUI_IO_TARGETALREADYEXISTS;
+ std::vector< rtl::OUString > aArguments;
- case star::ucb::IOErrorCode_DEVICE_NOT_READY:
+ if( aNCException.Name.getLength() )
{
- rtl::OUString aArgUri;
- if (getResourceNameRequestArgument(aRequestArguments,
- &aArgUri))
- {
- rtl::OUString aResourceType;
- getStringRequestArgument(
- aRequestArguments,
- rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
- "ResourceType")),
- &aResourceType);
- bool bRemovable = false;
- getBoolRequestArgument(aRequestArguments,
- rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM(
- "Removable")),
- &bRemovable);
- nErrorCode
- = aResourceType.equalsAsciiL(
- RTL_CONSTASCII_STRINGPARAM("volume"))
- ? (bRemovable
- ? ERRCODE_UUI_IO_NOTREADY_VOLUME_REMOVABLE
- : ERRCODE_UUI_IO_NOTREADY_VOLUME)
- : (bRemovable
- ? ERRCODE_UUI_IO_NOTREADY_REMOVABLE
- : ERRCODE_UUI_IO_NOTREADY);
- aArguments.push_back(aArgUri);
- }
- else
- nErrorCode = aErrorCode[aIoException.Code][0];
- break;
+ nErrorCode = ERRCODE_UUI_IO_ALREADYEXISTS;
+ aArguments.push_back( aNCException.Name );
}
- case star::ucb::IOErrorCode_DIFFERENT_DEVICES:
- {
- rtl::OUString aArgVolume;
- rtl::OUString aArgOtherVolume;
- if (getStringRequestArgument(
- aRequestArguments,
- rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
- "Volume")),
- &aArgVolume)
- && getStringRequestArgument(
- aRequestArguments,
- rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
- "OtherVolume")),
- &aArgOtherVolume))
- {
- nErrorCode = aErrorCode[aIoException.Code][1];
- aArguments.reserve(2);
- aArguments.push_back(aArgVolume);
- aArguments.push_back(aArgOtherVolume);
- }
- else
- nErrorCode = aErrorCode[aIoException.Code][0];
- break;
+ handleErrorHandlerRequest( aNCException.Classification,
+ nErrorCode,
+ aArguments,
+ rRequest->getContinuations(),
+ bObtainErrorStringOnly,
+ bHasErrorString,
+ rErrorString);
+ return true;
}
- case star::ucb::IOErrorCode_NOT_EXISTING:
- {
- rtl::OUString aArgUri;
- if (getResourceNameRequestArgument(aRequestArguments,
- &aArgUri))
- {
- rtl::OUString aResourceType;
- getStringRequestArgument(
- aRequestArguments,
- rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
- "ResourceType")),
- &aResourceType);
- nErrorCode
- = aResourceType.equalsAsciiL(
- RTL_CONSTASCII_STRINGPARAM("volume"))
- ? ERRCODE_UUI_IO_NOTEXISTS_VOLUME
- : (aResourceType.equalsAsciiL(
- RTL_CONSTASCII_STRINGPARAM("folder"))
- ? ERRCODE_UUI_IO_NOTEXISTS_FOLDER
- : ERRCODE_UUI_IO_NOTEXISTS);
- aArguments.push_back(aArgUri);
- }
- else
- nErrorCode = aErrorCode[aIoException.Code][0];
- break;
- }
+ ucb::UnsupportedNameClashException aUORequest;
+ if (aAnyRequest >>= aUORequest)
+ {
+ ErrCode nErrorCode = ERRCODE_UUI_IO_UNSUPPORTEDOVERWRITE;
+ std::vector< rtl::OUString > aArguments;
- default:
+ uno::Reference< task::XInteractionApprove > xApprove;
+ uno::Reference< task::XInteractionDisapprove > xDisapprove;
+ getContinuations(
+ rRequest->getContinuations(), &xApprove, &xDisapprove);
+
+ if ( xApprove.is() && xDisapprove.is() )
{
- rtl::OUString aArgUri;
- if (getResourceNameRequestArgument(aRequestArguments,
- &aArgUri))
- {
- nErrorCode = aErrorCode[aIoException.Code][1];
- aArguments.push_back(aArgUri);
- }
- else
- nErrorCode = aErrorCode[aIoException.Code][0];
- break;
+ handleErrorHandlerRequest( task::InteractionClassification_QUERY,
+ nErrorCode,
+ aArguments,
+ rRequest->getContinuations(),
+ bObtainErrorStringOnly,
+ bHasErrorString,
+ rErrorString);
}
+ return true;
}
- handleErrorRequest(aIoException.Classification,
- nErrorCode,
- aArguments,
- rRequest->getContinuations(),
- bObtainErrorStringOnly,
- bHasErrorString,
- rErrorString);
- return true;
- }
-
- star::ucb::InteractiveAppException aAppException;
- if (aAnyRequest >>= aAppException)
- {
- std::vector< rtl::OUString > aArguments;
- handleErrorRequest( aAppException.Classification,
- aAppException.Code,
- aArguments,
- rRequest->getContinuations(),
- bObtainErrorStringOnly,
- bHasErrorString,
- rErrorString);
- return true;
- }
+ if ( handleInteractiveIOException( rRequest,
+ bObtainErrorStringOnly,
+ bHasErrorString,
+ rErrorString ) )
+ return true;
- star::ucb::InteractiveNetworkException aNetworkException;
- if (aAnyRequest >>= aNetworkException)
- {
- ErrCode nErrorCode;
- std::vector< rtl::OUString > aArguments;
- star::ucb::InteractiveNetworkOffLineException aOffLineException;
- star::ucb::InteractiveNetworkResolveNameException
- aResolveNameException;
- star::ucb::InteractiveNetworkConnectException aConnectException;
- star::ucb::InteractiveNetworkReadException aReadException;
- star::ucb::InteractiveNetworkWriteException aWriteException;
- if (aAnyRequest >>= aOffLineException)
- nErrorCode = ERRCODE_INET_OFFLINE;
- else if (aAnyRequest >>= aResolveNameException)
- {
- nErrorCode = ERRCODE_INET_NAME_RESOLVE;
- aArguments.push_back(aResolveNameException.Server);
- }
- else if (aAnyRequest >>= aConnectException)
- {
- nErrorCode = ERRCODE_INET_CONNECT;
- aArguments.push_back(aConnectException.Server);
- }
- else if (aAnyRequest >>= aReadException)
- {
- nErrorCode = ERRCODE_INET_READ;
- aArguments.push_back(aReadException.Diagnostic);
+ ucb::InteractiveAppException aAppException;
+ if (aAnyRequest >>= aAppException)
+ {
+ std::vector< rtl::OUString > aArguments;
+ handleErrorHandlerRequest( aAppException.Classification,
+ aAppException.Code,
+ aArguments,
+ rRequest->getContinuations(),
+ bObtainErrorStringOnly,
+ bHasErrorString,
+ rErrorString);
+ return true;
}
- else if (aAnyRequest >>= aWriteException)
+
+ ucb::InteractiveNetworkException aNetworkException;
+ if (aAnyRequest >>= aNetworkException)
{
- nErrorCode = ERRCODE_INET_WRITE;
- aArguments.push_back(aWriteException.Diagnostic);
+ ErrCode nErrorCode;
+ std::vector< rtl::OUString > aArguments;
+ ucb::InteractiveNetworkOffLineException aOffLineException;
+ ucb::InteractiveNetworkResolveNameException aResolveNameException;
+ ucb::InteractiveNetworkConnectException aConnectException;
+ ucb::InteractiveNetworkReadException aReadException;
+ ucb::InteractiveNetworkWriteException aWriteException;
+ if (aAnyRequest >>= aOffLineException)
+ nErrorCode = ERRCODE_INET_OFFLINE;
+ else if (aAnyRequest >>= aResolveNameException)
+ {
+ nErrorCode = ERRCODE_INET_NAME_RESOLVE;
+ aArguments.push_back(aResolveNameException.Server);
+ }
+ else if (aAnyRequest >>= aConnectException)
+ {
+ nErrorCode = ERRCODE_INET_CONNECT;
+ aArguments.push_back(aConnectException.Server);
+ }
+ else if (aAnyRequest >>= aReadException)
+ {
+ nErrorCode = ERRCODE_INET_READ;
+ aArguments.push_back(aReadException.Diagnostic);
+ }
+ else if (aAnyRequest >>= aWriteException)
+ {
+ nErrorCode = ERRCODE_INET_WRITE;
+ aArguments.push_back(aWriteException.Diagnostic);
+ }
+ else
+ nErrorCode = ERRCODE_INET_GENERAL;
+
+ handleErrorHandlerRequest(aNetworkException.Classification,
+ nErrorCode,
+ aArguments,
+ rRequest->getContinuations(),
+ bObtainErrorStringOnly,
+ bHasErrorString,
+ rErrorString);
+ return true;
}
- else
- nErrorCode = ERRCODE_INET_GENERAL;
-
- handleErrorRequest(aNetworkException.Classification,
- nErrorCode,
- aArguments,
- rRequest->getContinuations(),
- bObtainErrorStringOnly,
- bHasErrorString,
- rErrorString);
- return true;
- }
- star::ucb::InteractiveCHAOSException aChaosException;
- if (aAnyRequest >>= aChaosException)
- {
- std::vector< rtl::OUString > aArguments;
- sal_Int32 nCount
- = std::min< sal_Int32 >(aChaosException.Arguments.getLength(),
- 2);
- aArguments.
- reserve(
- static_cast< std::vector< rtl::OUString >::size_type >(
+ ucb::InteractiveCHAOSException aChaosException;
+ if (aAnyRequest >>= aChaosException)
+ {
+ std::vector< rtl::OUString > aArguments;
+ sal_Int32 nCount
+ = std::min< sal_Int32 >(aChaosException.Arguments.getLength(),
+ 2);
+ aArguments.
+ reserve(static_cast< std::vector< rtl::OUString >::size_type >(
nCount));
- for (sal_Int32 i = 0; i < nCount; ++i)
- aArguments.push_back(aChaosException.Arguments[i]);
- handleErrorRequest(aChaosException.Classification,
- aChaosException.ID,
- aArguments,
- rRequest->getContinuations(),
- bObtainErrorStringOnly,
- bHasErrorString,
- rErrorString);
- return true;
- }
+ for (sal_Int32 i = 0; i < nCount; ++i)
+ aArguments.push_back(aChaosException.Arguments[i]);
+ handleErrorHandlerRequest(aChaosException.Classification,
+ aChaosException.ID,
+ aArguments,
+ rRequest->getContinuations(),
+ bObtainErrorStringOnly,
+ bHasErrorString,
+ rErrorString);
+ return true;
+ }
- star::ucb::InteractiveWrongMediumException aWrongMediumException;
- if (aAnyRequest >>= aWrongMediumException)
- {
- sal_Int32 nMedium = 0;
- aWrongMediumException.Medium >>= nMedium;
- std::vector< rtl::OUString > aArguments;
- aArguments.push_back(UniString::CreateFromInt32(nMedium + 1));
- handleErrorRequest(aWrongMediumException.Classification,
- ERRCODE_UUI_WRONGMEDIUM,
- aArguments,
- rRequest->getContinuations(),
- bObtainErrorStringOnly,
- bHasErrorString,
- rErrorString);
- return true;
- }
+ ucb::InteractiveWrongMediumException aWrongMediumException;
+ if (aAnyRequest >>= aWrongMediumException)
+ {
+ sal_Int32 nMedium = 0;
+ aWrongMediumException.Medium >>= nMedium;
+ std::vector< rtl::OUString > aArguments;
+ aArguments.push_back(UniString::CreateFromInt32(nMedium + 1));
+ handleErrorHandlerRequest(aWrongMediumException.Classification,
+ ERRCODE_UUI_WRONGMEDIUM,
+ aArguments,
+ rRequest->getContinuations(),
+ bObtainErrorStringOnly,
+ bHasErrorString,
+ rErrorString);
+ return true;
+ }
- star::java::WrongJavaVersionException aWrongJavaVersionException;
- if (aAnyRequest >>= aWrongJavaVersionException)
- {
- ErrCode nErrorCode;
- std::vector< rtl::OUString > aArguments;
- if (aWrongJavaVersionException.DetectedVersion.getLength() == 0)
- if (aWrongJavaVersionException.LowestSupportedVersion.
- getLength()
- == 0)
- nErrorCode = ERRCODE_UUI_WRONGJAVA;
+ java::WrongJavaVersionException aWrongJavaVersionException;
+ if (aAnyRequest >>= aWrongJavaVersionException)
+ {
+ ErrCode nErrorCode;
+ std::vector< rtl::OUString > aArguments;
+ if (aWrongJavaVersionException.DetectedVersion.getLength() == 0)
+ if (aWrongJavaVersionException.LowestSupportedVersion.
+ getLength()
+ == 0)
+ nErrorCode = ERRCODE_UUI_WRONGJAVA;
+ else
+ {
+ nErrorCode = ERRCODE_UUI_WRONGJAVA_MIN;
+ aArguments.push_back(aWrongJavaVersionException.
+ LowestSupportedVersion);
+ }
+ else if (aWrongJavaVersionException.LowestSupportedVersion.
+ getLength()
+ == 0)
+ {
+ nErrorCode = ERRCODE_UUI_WRONGJAVA_VERSION;
+ aArguments.push_back(aWrongJavaVersionException.
+ DetectedVersion);
+ }
else
{
- nErrorCode = ERRCODE_UUI_WRONGJAVA_MIN;
+ nErrorCode = ERRCODE_UUI_WRONGJAVA_VERSION_MIN;
+ aArguments.reserve(2);
+ aArguments.push_back(aWrongJavaVersionException.
+ DetectedVersion);
aArguments.push_back(aWrongJavaVersionException.
LowestSupportedVersion);
}
- else if (aWrongJavaVersionException.LowestSupportedVersion.
- getLength()
- == 0)
- {
- nErrorCode = ERRCODE_UUI_WRONGJAVA_VERSION;
- aArguments.push_back(aWrongJavaVersionException.
- DetectedVersion);
+ handleErrorHandlerRequest(task::InteractionClassification_ERROR,
+ nErrorCode,
+ aArguments,
+ rRequest->getContinuations(),
+ bObtainErrorStringOnly,
+ bHasErrorString,
+ rErrorString);
+ return true;
}
- else
+
+ sync2::BadPartnershipException aBadPartnershipException;
+ if (aAnyRequest >>= aBadPartnershipException)
{
- nErrorCode = ERRCODE_UUI_WRONGJAVA_VERSION_MIN;
- aArguments.reserve(2);
- aArguments.push_back(aWrongJavaVersionException.
- DetectedVersion);
- aArguments.push_back(aWrongJavaVersionException.
- LowestSupportedVersion);
+ ErrCode nErrorCode;
+ std::vector< rtl::OUString > aArguments;
+ if (aBadPartnershipException.Partnership.getLength() == 0)
+ nErrorCode = ERRCODE_UUI_BADPARTNERSHIP;
+ else
+ {
+ nErrorCode = ERRCODE_UUI_BADPARTNERSHIP_NAME;
+ aArguments.push_back(aBadPartnershipException.Partnership);
+ }
+ handleErrorHandlerRequest(task::InteractionClassification_ERROR,
+ nErrorCode,
+ aArguments,
+ rRequest->getContinuations(),
+ bObtainErrorStringOnly,
+ bHasErrorString,
+ rErrorString);
+ return true;
}
- handleErrorRequest(star::task::InteractionClassification_ERROR,
- nErrorCode,
- aArguments,
- rRequest->getContinuations(),
- bObtainErrorStringOnly,
- bHasErrorString,
- rErrorString);
- return true;
- }
- star::sync2::BadPartnershipException aBadPartnershipException;
- if (aAnyRequest >>= aBadPartnershipException)
- {
- ErrCode nErrorCode;
- std::vector< rtl::OUString > aArguments;
- if (aBadPartnershipException.Partnership.getLength() == 0)
- nErrorCode = ERRCODE_UUI_BADPARTNERSHIP;
- else
+ configuration::backend::MergeRecoveryRequest aMergeRecoveryRequest;
+ if (aAnyRequest >>= aMergeRecoveryRequest)
{
- nErrorCode = ERRCODE_UUI_BADPARTNERSHIP_NAME;
- aArguments.push_back(aBadPartnershipException.Partnership);
- }
- handleErrorRequest(star::task::InteractionClassification_ERROR,
- nErrorCode,
- aArguments,
- rRequest->getContinuations(),
- bObtainErrorStringOnly,
- bHasErrorString,
- rErrorString);
- return true;
- }
+ ErrCode nErrorCode = aMergeRecoveryRequest.IsRemovalRequest
+ ? ERRCODE_UUI_CONFIGURATION_BROKENDATA_WITHREMOVE
+ : ERRCODE_UUI_CONFIGURATION_BROKENDATA_NOREMOVE;
- star::configuration::backend::MergeRecoveryRequest aMergeRecoveryRequest;
- if (aAnyRequest >>= aMergeRecoveryRequest)
- {
- ErrCode nErrorCode = aMergeRecoveryRequest.IsRemovalRequest
- ? ERRCODE_UUI_CONFIGURATION_BROKENDATA_WITHREMOVE
- : ERRCODE_UUI_CONFIGURATION_BROKENDATA_NOREMOVE;
-
- std::vector< rtl::OUString > aArguments;
- aArguments.push_back(aMergeRecoveryRequest.ErrorLayerId);
-
- handleErrorRequest(star::task::InteractionClassification_ERROR,
- nErrorCode,
- aArguments,
- rRequest->getContinuations(),
- bObtainErrorStringOnly,
- bHasErrorString,
- rErrorString);
- return true;
- }
+ std::vector< rtl::OUString > aArguments;
+ aArguments.push_back(aMergeRecoveryRequest.ErrorLayerId);
- star::configuration::backend::StratumCreationException
- aStratumCreationException;
+ handleErrorHandlerRequest(task::InteractionClassification_ERROR,
+ nErrorCode,
+ aArguments,
+ rRequest->getContinuations(),
+ bObtainErrorStringOnly,
+ bHasErrorString,
+ rErrorString);
+ return true;
+ }
- if (aAnyRequest >>= aStratumCreationException)
- {
- const ErrCode nErrorCode = ERRCODE_UUI_CONFIGURATION_BACKENDMISSING;
-
- rtl::OUString aStratum = aStratumCreationException.StratumData;
- if (aStratum.getLength() == 0)
- aStratum = aStratumCreationException.StratumService;
-
- std::vector< rtl::OUString > aArguments;
- aArguments.push_back(aStratum);
-
- handleErrorRequest(star::task::InteractionClassification_ERROR,
- nErrorCode,
- aArguments,
- rRequest->getContinuations(),
- bObtainErrorStringOnly,
- bHasErrorString,
- rErrorString);
- return true;
- }
+ configuration::backend::StratumCreationException
+ aStratumCreationException;
- star::xforms::InvalidDataOnSubmitException aInvalidDataOnSubmitException;
- if (aAnyRequest >>= aInvalidDataOnSubmitException)
- {
- const ErrCode nErrorCode = ERRCODE_UUI_INVALID_XFORMS_SUBMISSION_DATA;
+ if (aAnyRequest >>= aStratumCreationException)
+ {
+ const ErrCode nErrorCode = ERRCODE_UUI_CONFIGURATION_BACKENDMISSING;
- std::vector< rtl::OUString > aArguments;
+ rtl::OUString aStratum = aStratumCreationException.StratumData;
+ if (aStratum.getLength() == 0)
+ aStratum = aStratumCreationException.StratumService;
- handleErrorRequest(star::task::InteractionClassification_QUERY,
- nErrorCode,
- aArguments,
- rRequest->getContinuations(),
- bObtainErrorStringOnly,
- bHasErrorString,
- rErrorString);
- return true;
- }
+ std::vector< rtl::OUString > aArguments;
+ aArguments.push_back(aStratum);
- return false;
-}
+ handleErrorHandlerRequest(task::InteractionClassification_ERROR,
+ nErrorCode,
+ aArguments,
+ rRequest->getContinuations(),
+ bObtainErrorStringOnly,
+ bHasErrorString,
+ rErrorString);
+ return true;
+ }
-bool UUIInteractionHelper::handleDialogRequests(
- star::uno::Reference< star::task::XInteractionRequest > const & rRequest)
-{
- star::uno::Any aAnyRequest(rRequest->getRequest());
+ xforms::InvalidDataOnSubmitException aInvalidDataOnSubmitException;
+ if (aAnyRequest >>= aInvalidDataOnSubmitException)
+ {
+ const ErrCode nErrorCode =
+ ERRCODE_UUI_INVALID_XFORMS_SUBMISSION_DATA;
- star::ucb::URLAuthenticationRequest aURLAuthenticationRequest;
- if (aAnyRequest >>= aURLAuthenticationRequest)
- {
- handleAuthenticationRequest(aURLAuthenticationRequest,
- rRequest->getContinuations(),
- aURLAuthenticationRequest.URL);
- return true;
- }
+ std::vector< rtl::OUString > aArguments;
- star::ucb::AuthenticationRequest aAuthenticationRequest;
- if (aAnyRequest >>= aAuthenticationRequest)
- {
- handleAuthenticationRequest(aAuthenticationRequest,
- rRequest->getContinuations(),
- rtl::OUString());
- return true;
- }
+ handleErrorHandlerRequest(task::InteractionClassification_QUERY,
+ nErrorCode,
+ aArguments,
+ rRequest->getContinuations(),
+ bObtainErrorStringOnly,
+ bHasErrorString,
+ rErrorString);
+ return true;
+ }
- star::ucb::CertificateValidationRequest aCertificateValidationRequest;
- if (aAnyRequest >>= aCertificateValidationRequest)
- {
- handleCertificateValidationRequest(aCertificateValidationRequest,
- rRequest->getContinuations());
- return true;
- }
+ ucb::InteractiveLockingLockedException aLLException;
+ if (aAnyRequest >>= aLLException)
+ {
+ ErrCode nErrorCode = aLLException.SelfOwned
+ ? ERRCODE_UUI_LOCKING_LOCKED_SELF : ERRCODE_UUI_LOCKING_LOCKED;
+ std::vector< rtl::OUString > aArguments;
+ aArguments.push_back( aLLException.Url );
-// @@@ Todo #i29340#: activate!
-// star::ucb::NameClashResolveRequest aNameClashResolveRequest;
-// if (aAnyRequest >>= aNameClashResolveRequest)
-// {
-// handleNameClashResolveRequest(aNameClashResolveRequest,
-// rRequest->getContinuations());
-// return;
-// }
-
- star::task::MasterPasswordRequest aMasterPasswordRequest;
- if (aAnyRequest >>= aMasterPasswordRequest)
- {
- handleMasterPasswordRequest(aMasterPasswordRequest.Mode,
- rRequest->getContinuations());
- return true;
- }
+ handleErrorHandlerRequest( aLLException.Classification,
+ nErrorCode,
+ aArguments,
+ rRequest->getContinuations(),
+ bObtainErrorStringOnly,
+ bHasErrorString,
+ rErrorString );
+ return true;
+ }
- star::task::DocumentPasswordRequest aDocumentPasswordRequest;
- if (aAnyRequest >>= aDocumentPasswordRequest)
- {
- handlePasswordRequest(aDocumentPasswordRequest.Mode,
- rRequest->getContinuations(),
- aDocumentPasswordRequest.Name);
- return true;
- }
+ ucb::InteractiveLockingNotLockedException aLNLException;
+ if (aAnyRequest >>= aLNLException)
+ {
+ ErrCode nErrorCode = ERRCODE_UUI_LOCKING_NOT_LOCKED;
+ std::vector< rtl::OUString > aArguments;
+ aArguments.push_back( aLNLException.Url );
- star::task::DocumentMSPasswordRequest aDocumentMSPasswordRequest;
- if (aAnyRequest >>= aDocumentMSPasswordRequest)
- {
- handleMSPasswordRequest(aDocumentMSPasswordRequest.Mode,
- rRequest->getContinuations(),
- aDocumentMSPasswordRequest.Name);
- return true;
- }
+ handleErrorHandlerRequest( aLNLException.Classification,
+ nErrorCode,
+ aArguments,
+ rRequest->getContinuations(),
+ bObtainErrorStringOnly,
+ bHasErrorString,
+ rErrorString );
+ return true;
+ }
- star::task::PasswordRequest aPasswordRequest;
- if (aAnyRequest >>= aPasswordRequest)
- {
- handlePasswordRequest(aPasswordRequest.Mode,
- rRequest->getContinuations());
- return true;
- }
+ ucb::InteractiveLockingLockExpiredException aLLEException;
+ if (aAnyRequest >>= aLLEException)
+ {
+ ErrCode nErrorCode = ERRCODE_UUI_LOCKING_LOCK_EXPIRED;
+ std::vector< rtl::OUString > aArguments;
+ aArguments.push_back( aLLEException.Url );
- star::ucb::HandleCookiesRequest aCookiesRequest;
- if (aAnyRequest >>= aCookiesRequest)
- {
- handleCookiesRequest(aCookiesRequest,
- rRequest->getContinuations());
- return true;
- }
+ handleErrorHandlerRequest( aLLEException.Classification,
+ nErrorCode,
+ aArguments,
+ rRequest->getContinuations(),
+ bObtainErrorStringOnly,
+ bHasErrorString,
+ rErrorString );
+ return true;
+ }
- star::document::NoSuchFilterRequest aNoSuchFilterRequest;
- if (aAnyRequest >>= aNoSuchFilterRequest)
- {
- handleNoSuchFilterRequest(aNoSuchFilterRequest,
- rRequest->getContinuations());
- return true;
- }
+ document::BrokenPackageRequest aBrokenPackageRequest;
+ if (aAnyRequest >>= aBrokenPackageRequest)
+ {
+ std::vector< rtl::OUString > aArguments;
- star::document::AmbigousFilterRequest aAmbigousFilterRequest;
- if (aAnyRequest >>= aAmbigousFilterRequest)
- {
- handleAmbigousFilterRequest(aAmbigousFilterRequest,
- rRequest->getContinuations());
- return true;
- }
+ if( aBrokenPackageRequest.aName.getLength() )
+ aArguments.push_back( aBrokenPackageRequest.aName );
- star::document::FilterOptionsRequest aFilterOptionsRequest;
- if (aAnyRequest >>= aFilterOptionsRequest)
- {
- handleFilterOptionsRequest(aFilterOptionsRequest,
- rRequest->getContinuations());
- return true;
- }
+ handleBrokenPackageRequest( aArguments,
+ rRequest->getContinuations(),
+ bObtainErrorStringOnly,
+ bHasErrorString,
+ rErrorString );
+ return true;
+ }
- star::document::LockedDocumentRequest aLockedDocumentRequest;
- if (aAnyRequest >>= aLockedDocumentRequest )
- {
- handleLockedDocumentRequest( aLockedDocumentRequest.DocumentURL,
- aLockedDocumentRequest.UserInfo,
- rRequest->getContinuations(),
- UUI_DOC_LOAD_LOCK );
- return true;
- }
+ task::ErrorCodeRequest aErrorCodeRequest;
+ if (aAnyRequest >>= aErrorCodeRequest)
+ {
+ handleGenericErrorRequest( aErrorCodeRequest.ErrCode,
+ rRequest->getContinuations(),
+ bObtainErrorStringOnly,
+ bHasErrorString,
+ rErrorString);
+ return true;
+ }
- star::document::OwnLockOnDocumentRequest aOwnLockOnDocumentRequest;
- if (aAnyRequest >>= aOwnLockOnDocumentRequest )
- {
- handleLockedDocumentRequest( aOwnLockOnDocumentRequest.DocumentURL,
- aOwnLockOnDocumentRequest.TimeInfo,
- rRequest->getContinuations(),
- aOwnLockOnDocumentRequest.IsStoring ? UUI_DOC_OWN_SAVE_LOCK : UUI_DOC_OWN_LOAD_LOCK );
- return true;
- }
+ task::ErrorCodeIOException aErrorCodeIOException;
+ if (aAnyRequest >>= aErrorCodeIOException)
+ {
+ handleGenericErrorRequest( aErrorCodeIOException.ErrCode,
+ rRequest->getContinuations(),
+ bObtainErrorStringOnly,
+ bHasErrorString,
+ rErrorString);
+ return true;
+ }
- star::document::LockedOnSavingRequest aLockedOnSavingRequest;
- if (aAnyRequest >>= aLockedOnSavingRequest )
- {
- handleLockedDocumentRequest( aLockedOnSavingRequest.DocumentURL,
- aLockedOnSavingRequest.UserInfo,
- rRequest->getContinuations(),
- UUI_DOC_SAVE_LOCK );
- return true;
- }
- star::document::ChangedByOthersRequest aChangedByOthersRequest;
- if (aAnyRequest >>= aChangedByOthersRequest )
- {
- handleChangedByOthersRequest( rRequest->getContinuations() );
- return true;
- }
+ ///////////////////////////////////////////////////////////////////
+ // Handle requests which do not have a plain string representation.
+ ///////////////////////////////////////////////////////////////////
+ if (!bObtainErrorStringOnly)
+ {
+ if ( handleAuthenticationRequest( rRequest ) )
+ return true;
- star::document::LockFileIgnoreRequest aLockFileIgnoreRequest;
- if (aAnyRequest >>= aLockFileIgnoreRequest )
- {
- handleLockFileIgnoreRequest( rRequest->getContinuations() );
- return true;
- }
+ if ( handleCertificateValidationRequest( rRequest ) )
+ return true;
- return false;
-}
+// @@@ Todo #i29340#: activate!
+// ucb::NameClashResolveRequest aNameClashResolveRequest;
+// if (aAnyRequest >>= aNameClashResolveRequest)
+// {
+// handleNameClashResolveRequest(aNameClashResolveRequest,
+// rRequest->getContinuations());
+// return true;
+// }
+
+ if ( handleMasterPasswordRequest( rRequest ) )
+ return true;
-bool UUIInteractionHelper::handleErrorHandlerRequests(
- star::uno::Reference< star::task::XInteractionRequest > const & rRequest,
- bool bObtainErrorStringOnly,
- bool & bHasErrorString,
- rtl::OUString & rErrorString)
-{
- star::uno::Any aAnyRequest(rRequest->getRequest());
+ if ( handlePasswordRequest( rRequest ) )
+ return true;
- star::task::ErrorCodeRequest aErrorCodeRequest;
- if (aAnyRequest >>= aErrorCodeRequest)
- {
- handleGenericErrorRequest( aErrorCodeRequest.ErrCode,
- rRequest->getContinuations(),
- bObtainErrorStringOnly,
- bHasErrorString,
- rErrorString);
- return true;
- }
+ if ( handleCookiesRequest( rRequest ) )
+ return true;
- star::task::DocumentMacroConfirmationRequest aMacroConfirmRequest;
- if (aAnyRequest >>= aMacroConfirmRequest)
- {
- handleMacroConfirmRequest(
- aMacroConfirmRequest.DocumentURL,
- aMacroConfirmRequest.DocumentStorage,
- ODFVER_012_TEXT,
- aMacroConfirmRequest.DocumentSignatureInformation,
- rRequest->getContinuations()
- );
- return true;
- }
+ if ( handleNoSuchFilterRequest( rRequest ) )
+ return true;
- star::task::DocumentMacroConfirmationRequest2 aMacroConfirmRequest2;
- if (aAnyRequest >>= aMacroConfirmRequest2)
- {
- handleMacroConfirmRequest(
- aMacroConfirmRequest2.DocumentURL,
- aMacroConfirmRequest2.DocumentZipStorage,
- aMacroConfirmRequest2.DocumentVersion,
- aMacroConfirmRequest2.DocumentSignatureInformation,
- rRequest->getContinuations()
- );
- return true;
- }
+ if ( handleAmbigousFilterRequest( rRequest ) )
+ return true;
- FutureDocumentVersionProductUpdateRequest aProductUpdateRequest;
- if (aAnyRequest >>= aProductUpdateRequest)
- {
- handleFutureDocumentVersionUpdateRequest(
- aProductUpdateRequest,
- rRequest->getContinuations()
- );
- return true;
- }
+ if ( handleFilterOptionsRequest( rRequest ) )
+ return true;
- star::task::ErrorCodeIOException aErrorCodeIOException;
- if (aAnyRequest >>= aErrorCodeIOException)
- {
- handleGenericErrorRequest( aErrorCodeIOException.ErrCode,
- rRequest->getContinuations(),
- bObtainErrorStringOnly,
- bHasErrorString,
- rErrorString);
- return true;
- }
+ if ( handleLockedDocumentRequest( rRequest ) )
+ return true;
- return false;
-}
+ if ( handleChangedByOthersRequest( rRequest ) )
+ return true;
-bool
-UUIInteractionHelper::handle_impl(
- star::uno::Reference< star::task::XInteractionRequest > const & rRequest)
- throw (star::uno::RuntimeException)
-{
- try
- {
- if (!rRequest.is())
- return false;
+ if ( handleLockFileIgnoreRequest( rRequest ) )
+ return true;
- ////////////////////////////////////////////////////////////
- // Display Messagebox
- ////////////////////////////////////////////////////////////
- bool bDummy = false;
- rtl::OUString aDummy;
- if (! handleMessageboxRequests(rRequest, false, bDummy, aDummy))
- {
- ////////////////////////////////////////////////////////////
- // Use ErrorHandler::HandleError
- ////////////////////////////////////////////////////////////
- if (!handleErrorHandlerRequests(rRequest, false, bDummy, aDummy))
+ task::DocumentMacroConfirmationRequest aMacroConfirmRequest;
+ if (aAnyRequest >>= aMacroConfirmRequest)
{
- ////////////////////////////////////////////////////////////
- // Display Special Dialog
- ////////////////////////////////////////////////////////////
- if (!handleDialogRequests(rRequest))
- {
- ////////////////////////////////////////////////////////////
- // Use customized InteractionHandler from configuration
- ////////////////////////////////////////////////////////////
- InteractionHandlerDataList dataList;
-
- GetInteractionHandlerList(dataList);
+ handleMacroConfirmRequest(
+ aMacroConfirmRequest.DocumentURL,
+ aMacroConfirmRequest.DocumentStorage,
+ aMacroConfirmRequest.DocumentVersion.getLength() ? aMacroConfirmRequest.DocumentVersion : ODFVER_012_TEXT,
+ aMacroConfirmRequest.DocumentSignatureInformation,
+ rRequest->getContinuations());
+ return true;
+ }
- InteractionHandlerDataList::const_iterator aEnd(dataList.end());
- for (InteractionHandlerDataList::const_iterator aIt(dataList.begin());
- aIt != aEnd; ++aIt)
- {
- Reference< uno::XInterface > xIfc =
- m_xServiceFactory->createInstance(aIt->ServiceName);
-
-
- Reference< com::sun::star::lang::XInitialization > xInitialization =
- Reference< com::sun::star::lang::XInitialization >( xIfc, UNO_QUERY );
-
- OSL_ENSURE( xInitialization.is(), "Custom Interactionhandler does not implement mandatory interface XInitialization!" );
- if (xInitialization.is())
- {
- uno::Sequence< uno::Any > propertyValues(1);
- beans::PropertyValue aProperty;
-
- aProperty.Name = rtl::OUString::createFromAscii( "Parent" );
- aProperty.Value <<= getParentXWindow();
- propertyValues[ 0 ] <<= aProperty;
-
- xInitialization->initialize(propertyValues);
- }
-
- Reference< task::XInteractionHandler2 >
- xInteractionHandler( xIfc, UNO_QUERY );
-
- OSL_ENSURE( xInteractionHandler.is(),
- "Custom Interactionhandler does not implement "
- "mandatory interface XInteractionHandler2!" );
- if (xInteractionHandler.is())
- if (xInteractionHandler->handleInteractionRequest(rRequest))
- return true;
- }
- return false;
- }
+ task::FutureDocumentVersionProductUpdateRequest
+ aProductUpdateRequest;
+ if (aAnyRequest >>= aProductUpdateRequest)
+ {
+ handleFutureDocumentVersionUpdateRequest(
+ aProductUpdateRequest,
+ rRequest->getContinuations());
+ return true;
}
+
+ ///////////////////////////////////////////////////////////////
+ // Last chance: interaction handlers registered in the configuration
+ ///////////////////////////////////////////////////////////////
+
+ // typed InteractionHandlers (ooo.Interactions)
+ if ( handleTypedHandlerImplementations( rRequest ) )
+ return true;
+
+ // legacy configuration (ooo.ucb.InteractionHandlers)
+ if (tryOtherInteractionHandler( rRequest ))
+ return true;
}
+
+ // Not handled.
+ return false;
}
catch (std::bad_alloc const &)
{
- throw star::uno::RuntimeException(
+ throw uno::RuntimeException(
rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("out of memory")),
- star::uno::Reference< star::uno::XInterface >());
+ uno::Reference< uno::XInterface >());
}
- return true;
+ catch( const uno::RuntimeException& )
+ {
+ throw; // allowed to leave here
+ }
+ catch( const uno::Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+ return false;
}
-void UUIInteractionHelper::GetInteractionHandlerList(InteractionHandlerDataList &rdataList)
+void
+UUIInteractionHelper::getInteractionHandlerList(
+ InteractionHandlerDataList &rdataList)
+ SAL_THROW((uno::RuntimeException))
{
+ try
+ {
uno::Reference< lang::XMultiServiceFactory > xConfigProv(
- m_xServiceFactory->createInstance(
- rtl::OUString::createFromAscii(
- "com.sun.star.configuration.ConfigurationProvider" ) ),
- uno::UNO_QUERY );
+ m_xServiceFactory->createInstance(
+ rtl::OUString::createFromAscii(
+ "com.sun.star.configuration.ConfigurationProvider" ) ),
+ uno::UNO_QUERY );
if ( !xConfigProv.is() )
- {
- OSL_ENSURE( false,
- "GetInteractionHandlerList - No config provider!" );
- return;
- }
+ throw uno::RuntimeException(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "unable to instanciate config provider service")),
+ uno::Reference< uno::XInterface >());
rtl::OUStringBuffer aFullPath;
- aFullPath.appendAscii( CONFIG_INTERACTIONHANDLERS_KEY );
+ aFullPath.appendAscii(
+ "/org.openoffice.ucb.InteractionHandler/InteractionHandlers" );
uno::Sequence< uno::Any > aArguments( 1 );
beans::PropertyValue aProperty;
@@ -1444,21 +996,20 @@ void UUIInteractionHelper::GetInteractionHandlerList(InteractionHandlerDataList
aArguments ) );
if ( !xInterface.is() )
- {
- OSL_ENSURE( false,
- "GetInteractionHandlerList - No config access!" );
- return;
- }
+ throw uno::RuntimeException(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "unable to instanciate config access")),
+ uno::Reference< uno::XInterface >());
uno::Reference< container::XNameAccess > xNameAccess(
- xInterface, uno::UNO_QUERY );
-
+ xInterface, uno::UNO_QUERY );
if ( !xNameAccess.is() )
- {
- OSL_ENSURE( false,
- "GetInteractionHandlerList - No XNameAccess!" );
- return;
- }
+ throw uno::RuntimeException(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "config access does not implement XNameAccess")),
+ uno::Reference< uno::XInterface >());
uno::Sequence< rtl::OUString > aElems = xNameAccess->getElementNames();
const rtl::OUString* pElems = aElems.getConstArray();
@@ -1470,12 +1021,11 @@ void UUIInteractionHelper::GetInteractionHandlerList(InteractionHandlerDataList
xHierNameAccess( xInterface, uno::UNO_QUERY );
if ( !xHierNameAccess.is() )
- {
- OSL_ENSURE( false,
- "GetInteractionHandlerList - "
- "No XHierarchicalNameAccess!" );
- return;
- }
+ throw uno::RuntimeException(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "config access does not implement XHierarchicalNameAccess")),
+ uno::Reference< uno::XInterface >());
// Iterate over children.
for ( sal_Int32 n = 0; n < nCount; ++n )
@@ -1517,41 +1067,51 @@ void UUIInteractionHelper::GetInteractionHandlerList(InteractionHandlerDataList
}
}
}
+ }
+ catch ( uno::RuntimeException const & )
+ {
+ throw;
+ }
+ catch ( uno::Exception const & )
+ {
+ OSL_ENSURE( false, "GetInteractionHandlerList - Caught Exception!" );
+ }
}
-Window * UUIInteractionHelper::getParentProperty() SAL_THROW(())
+Window *
+UUIInteractionHelper::getParentProperty()
+ SAL_THROW(())
{
- star::uno::Reference< star::awt::XWindow > xWindow = getParentXWindow();
+ uno::Reference< awt::XWindow > xWindow = getParentXWindow();
if ( xWindow.is() )
return VCLUnoHelper::GetWindow(xWindow);
return 0;
}
-star::uno::Reference< ::com::sun::star::awt::XWindow> UUIInteractionHelper::getParentXWindow() SAL_THROW(())
+uno::Reference< awt::XWindow>
+UUIInteractionHelper::getParentXWindow() const
+ SAL_THROW(())
{
osl::MutexGuard aGuard(m_aPropertyMutex);
- for (sal_Int32 i = 0; i < m_aProperties.getLength(); ++i)
+ ::comphelper::NamedValueCollection aProperties( m_aProperties );
+ if ( aProperties.has( "Parent" ) )
{
- star::beans::PropertyValue aProperty;
- if ((m_aProperties[i] >>= aProperty)
- && aProperty.
- Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("Parent")))
- {
- star::uno::Reference< star::awt::XWindow > xWindow;
- aProperty.Value >>= xWindow;
- return xWindow;
- }
+ uno::Reference< awt::XWindow > xWindow;
+ OSL_VERIFY( aProperties.get( "Parent" ) >>= xWindow );
+ return xWindow;
}
return 0;
}
-rtl::OUString UUIInteractionHelper::getContextProperty() SAL_THROW(())
+rtl::OUString
+UUIInteractionHelper::getContextProperty()
+ SAL_THROW(())
{
osl::MutexGuard aGuard(m_aPropertyMutex);
for (sal_Int32 i = 0; i < m_aProperties.getLength(); ++i)
{
- star::beans::PropertyValue aProperty;
+ beans::PropertyValue aProperty;
if ((m_aProperties[i] >>= aProperty)
&& aProperty.
Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("Context")))
@@ -1564,582 +1124,45 @@ rtl::OUString UUIInteractionHelper::getContextProperty() SAL_THROW(())
return rtl::OUString();
}
-bool
-UUIInteractionHelper::initPasswordContainer(
- star::uno::Reference< star::task::XPasswordContainer > * pContainer,
- star::uno::Reference< star::task::XUrlContainer > * pUrlContainer)
- const SAL_THROW(())
-{
- OSL_ENSURE(pContainer, "specification violation");
- if (!pContainer->is() && m_xServiceFactory.is())
- try
- {
- *pContainer
- = star::uno::Reference< star::task::XPasswordContainer >(
- m_xServiceFactory->
- createInstance(
- rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM(
- "com.sun.star.task.PasswordContainer"))),
- star::uno::UNO_QUERY);
-
- if ( pContainer->is() )
- {
- *pUrlContainer = star::uno::Reference< star::task::XUrlContainer >( *pContainer, UNO_QUERY );
- OSL_ENSURE( pUrlContainer->is(), "Got no XUrlContainer!" );
- }
- }
- catch (star::uno::Exception const &)
- {}
- OSL_ENSURE(pContainer->is(), "unexpected situation");
- return pContainer->is() && pUrlContainer->is();
-}
-
-
-String GetContentPart( const String& _rRawString )
-{
- // search over some parts to find a string
- //static char* aIDs[] = { "CN", "OU", "O", "E", NULL };
- static char const * aIDs[] = { "CN=", "OU=", "O=", "E=", NULL };// By CP
- String sPart;
- int i = 0;
- while ( aIDs[i] )
- {
- String sPartId = String::CreateFromAscii( aIDs[i++] );
- xub_StrLen nContStart = _rRawString.Search( sPartId );
- if ( nContStart != STRING_NOTFOUND )
- {
- nContStart = nContStart + sPartId.Len();
- //++nContStart; // now it's start of content, directly after Id // delete By CP
- xub_StrLen nContEnd = _rRawString.Search( sal_Unicode( ',' ), nContStart );
- sPart = String( _rRawString, nContStart, nContEnd - nContStart );
- break;
- }
- }
-
- return sPart;
-}
-
-
-sal_Bool UUIInteractionHelper::executeUnknownAuthDialog( const cssu::Reference< dcss::security::XCertificate >& rXCert)
- SAL_THROW((star::uno::RuntimeException))
-{
- try
- {
- vos::OGuard aGuard(Application::GetSolarMutex());
-
- std::auto_ptr< ResMgr >
- xManager(ResMgr::CreateResMgr(CREATEVERSIONRESMGR_NAME(uui)));
- std::auto_ptr< UnknownAuthDialog >
- xDialog(new UnknownAuthDialog( getParentProperty(),
- rXCert,
- m_xServiceFactory,
- xManager.get()));
-
- // Get correct ressource string
- rtl::OUString aMessage;
-
- std::vector< rtl::OUString > aArguments;
- aArguments.push_back( GetContentPart( rXCert.get()->getSubjectName()) );
- //aArguments.push_back( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("out of memory")) );
-
- if (xManager.get())
- {
- ResId aResId(RID_UUI_ERRHDL, *xManager.get());
- if (ErrorResource(aResId).getString(ERRCODE_UUI_UNKNOWNAUTH_UNTRUSTED, &aMessage))
- {
- aMessage = replaceMessageWithArguments( aMessage, aArguments );
- xDialog->setDescriptionText( aMessage );
- }
- }
-
- return static_cast<sal_Bool> (xDialog->Execute());
- }
- catch (std::bad_alloc const &)
- {
- throw star::uno::RuntimeException(
- rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("out of memory")),
- star::uno::Reference< star::uno::XInterface >());
- }
-}
-
-rtl::OUString
-UUIInteractionHelper::getLocalizedDatTimeStr( ::com::sun::star::util::DateTime aDateTime )
-{
-
-
- rtl::OUString aDateTimeStr;
- Date aDate;
- Time aTime;
-
- aDate = Date( aDateTime.Day, aDateTime.Month, aDateTime.Year );
- aTime = Time( aDateTime.Hours, aDateTime.Minutes, aDateTime.Seconds );
-
- LanguageType eUILang = Application::GetSettings().GetUILanguage();
- SvNumberFormatter *pNumberFormatter = new SvNumberFormatter( ::comphelper::getProcessServiceFactory(), eUILang );
- String aTmpStr;
- Color* pColor = NULL;
- Date* pNullDate = pNumberFormatter->GetNullDate();
- sal_uInt32 nFormat = pNumberFormatter->GetStandardFormat( NUMBERFORMAT_DATE, eUILang );
-
- pNumberFormatter->GetOutputString( aDate - *pNullDate, nFormat, aTmpStr, &pColor );
- aDateTimeStr = aTmpStr + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" "));
-
- nFormat = pNumberFormatter->GetStandardFormat( NUMBERFORMAT_TIME, eUILang );
- pNumberFormatter->GetOutputString( aTime.GetTimeInDays(), nFormat, aTmpStr, &pColor );
- aDateTimeStr += aTmpStr;
-
- return aDateTimeStr;
-}
-
-sal_Bool UUIInteractionHelper::executeSSLWarnDialog( const cssu::Reference< dcss::security::XCertificate >& rXCert,
- sal_Int32 const & failure,
- const rtl::OUString & hostName )
- SAL_THROW((star::uno::RuntimeException))
-{
- try
- {
- vos::OGuard aGuard(Application::GetSolarMutex());
-
- std::auto_ptr< ResMgr >
- xManager(ResMgr::CreateResMgr(CREATEVERSIONRESMGR_NAME(uui)));
- std::auto_ptr< SSLWarnDialog >
- xDialog(new SSLWarnDialog( getParentProperty(),
- rXCert,
- m_xServiceFactory,
- xManager.get()));
-
- // Get correct ressource string
- rtl::OUString aMessage_1;
- std::vector< rtl::OUString > aArguments_1;
-
- switch( failure )
- {
- case SSLWARN_TYPE_DOMAINMISMATCH:
- aArguments_1.push_back( hostName );
- aArguments_1.push_back( GetContentPart( rXCert.get()->getSubjectName()) );
- aArguments_1.push_back( hostName );
- break;
- case SSLWARN_TYPE_EXPIRED:
- aArguments_1.push_back( GetContentPart( rXCert.get()->getSubjectName()) );
- aArguments_1.push_back( getLocalizedDatTimeStr( rXCert.get()->getNotValidAfter() ) );
- aArguments_1.push_back( getLocalizedDatTimeStr( rXCert.get()->getNotValidAfter() ) );
- break;
- case SSLWARN_TYPE_INVALID:
- break;
- }
-
-
-
- //aArguments.push_back( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("out of memory")) );
-
- if (xManager.get())
- {
- ResId aResId(RID_UUI_ERRHDL, *xManager.get());
- if (ErrorResource(aResId).getString( ERRCODE_AREA_UUI_UNKNOWNAUTH + failure + DESCRIPTION_1, &aMessage_1))
- {
- aMessage_1 = replaceMessageWithArguments( aMessage_1, aArguments_1 );
- xDialog->setDescription1Text( aMessage_1 );
- }
-
- rtl::OUString aTitle;
- ErrorResource(aResId).getString( ERRCODE_AREA_UUI_UNKNOWNAUTH + failure + TITLE, &aTitle);
- xDialog->SetText( aTitle );
- }
-
-
-
- return static_cast<sal_Bool> (xDialog->Execute());
- }
- catch (std::bad_alloc const &)
- {
- throw star::uno::RuntimeException(
- rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("out of memory")),
- star::uno::Reference< star::uno::XInterface >());
- }
-}
-
-void UUIInteractionHelper::executeLoginDialog(LoginErrorInfo & rInfo,
- rtl::OUString const & rRealm)
- SAL_THROW((star::uno::RuntimeException))
-{
- try
- {
- vos::OGuard aGuard(Application::GetSolarMutex());
-
- bool bAccount = (rInfo.GetFlags() & LOGINERROR_FLAG_MODIFY_ACCOUNT)
- != 0;
- bool bSavePassword = rInfo.GetIsPersistentPassword()
- || rInfo.GetIsSavePassword();
- bool bCanUseSysCreds = rInfo.GetCanUseSystemCredentials();
-
- sal_uInt16 nFlags = 0;
- if (rInfo.GetPath().Len() == 0)
- nFlags |= LF_NO_PATH;
- if (rInfo.GetErrorText().Len() == 0)
- nFlags |= LF_NO_ERRORTEXT;
- if (!bAccount)
- nFlags |= LF_NO_ACCOUNT;
- if (!(rInfo.GetFlags() & LOGINERROR_FLAG_MODIFY_USER_NAME))
- nFlags |= LF_USERNAME_READONLY;
-
- if (!bSavePassword)
- nFlags |= LF_NO_SAVEPASSWORD;
-
- if (!bCanUseSysCreds)
- nFlags |= LF_NO_USESYSCREDS;
-
- std::auto_ptr< ResMgr >
- xManager(ResMgr::CreateResMgr(CREATEVERSIONRESMGR_NAME(uui)));
- UniString aRealm(rRealm); // Forte compiler needs it spelled out...
- std::auto_ptr< LoginDialog >
- xDialog(new LoginDialog(getParentProperty(),
- nFlags,
- rInfo.GetServer(),
- &aRealm,
- xManager.get()));
- if (rInfo.GetErrorText().Len() != 0)
- xDialog->SetErrorText(rInfo.GetErrorText());
- xDialog->SetName(rInfo.GetUserName());
- if (bAccount)
- xDialog->ClearAccount();
- else
- xDialog->ClearPassword();
- xDialog->SetPassword(rInfo.GetPassword());
-
- if (bSavePassword)
- {
- xDialog->
- SetSavePasswordText(ResId(rInfo.GetIsPersistentPassword() ?
- RID_SAVE_PASSWORD :
- RID_KEEP_PASSWORD,
- *xManager.get()));
- xDialog->SetSavePassword(rInfo.GetIsSavePassword());
- }
-
- if ( bCanUseSysCreds )
- xDialog->SetUseSystemCredentials( rInfo.GetIsUseSystemCredentials() );
-
- rInfo.SetResult(xDialog->Execute() == RET_OK ? ERRCODE_BUTTON_OK :
- ERRCODE_BUTTON_CANCEL);
- rInfo.SetUserName(xDialog->GetName());
- rInfo.SetPassword(xDialog->GetPassword());
- rInfo.SetAccount(xDialog->GetAccount());
- rInfo.SetSavePassword(xDialog->IsSavePassword());
-
- if ( bCanUseSysCreds )
- rInfo.SetIsUseSystemCredentials( xDialog->IsUseSystemCredentials() );
- }
- catch (std::bad_alloc const &)
- {
- throw star::uno::RuntimeException(
- rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("out of memory")),
- star::uno::Reference< star::uno::XInterface >());
- }
-}
-
-void
-UUIInteractionHelper::executeMasterPasswordDialog(
- LoginErrorInfo & rInfo,
- star::task::PasswordRequestMode nMode)
- SAL_THROW((star::uno::RuntimeException))
-{
- rtl::OString aMaster;
- try
- {
- vos::OGuard aGuard(Application::GetSolarMutex());
-
- std::auto_ptr< ResMgr >
- xManager(ResMgr::CreateResMgr(CREATEVERSIONRESMGR_NAME(uui)));
- if( nMode == star::task::PasswordRequestMode_PASSWORD_CREATE )
- {
- std::auto_ptr< MasterPasswordCreateDialog >
- xDialog(new MasterPasswordCreateDialog(
- getParentProperty(), xManager.get()));
- rInfo.SetResult(xDialog->Execute()
- == RET_OK ? ERRCODE_BUTTON_OK
- : ERRCODE_BUTTON_CANCEL);
- aMaster = rtl::OUStringToOString(xDialog->GetMasterPassword(),
- RTL_TEXTENCODING_UTF8);
- }
- else
- {
- std::auto_ptr< MasterPasswordDialog >
- xDialog(new MasterPasswordDialog(
- getParentProperty(), nMode, xManager.get()));
- rInfo.SetResult(xDialog->Execute()
- == RET_OK ? ERRCODE_BUTTON_OK
- : ERRCODE_BUTTON_CANCEL);
- aMaster = rtl::OUStringToOString(xDialog->GetMasterPassword(),
- RTL_TEXTENCODING_UTF8);
- }
-
- }
- catch (std::bad_alloc const &)
- {
- throw star::uno::RuntimeException(
- rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("out of memory")),
- star::uno::Reference< star::uno::XInterface >());
- }
-
- sal_uInt8 aKey[RTL_DIGEST_LENGTH_MD5];
- rtl_digest_PBKDF2(aKey,
- RTL_DIGEST_LENGTH_MD5,
- reinterpret_cast< sal_uInt8 const * >(aMaster.getStr()),
- aMaster.getLength(),
- reinterpret_cast< sal_uInt8 const * >(
- "3B5509ABA6BC42D9A3A1F3DAD49E56A51"),
- 32,
- 1000);
-
- rtl::OUStringBuffer aBuffer;
- for (int i = 0; i < RTL_DIGEST_LENGTH_MD5; ++i)
- {
- aBuffer.append(static_cast< sal_Unicode >('a' + (aKey[i] >> 4)));
- aBuffer.append(static_cast< sal_Unicode >('a' + (aKey[i] & 15)));
- }
- rInfo.SetPassword(aBuffer.makeStringAndClear());
-}
-
-void
-UUIInteractionHelper::executePasswordDialog(
- LoginErrorInfo & rInfo,
- star::task::PasswordRequestMode nMode,
- ::rtl::OUString aDocName)
- SAL_THROW((star::uno::RuntimeException))
+uno::Reference< task::XInteractionHandler >
+UUIInteractionHelper::getInteractionHandler()
+ SAL_THROW((uno::RuntimeException))
{
+ uno::Reference< task::XInteractionHandler > xIH;
try
{
- vos::OGuard aGuard(Application::GetSolarMutex());
-
- std::auto_ptr< ResMgr >
- xManager(ResMgr::CreateResMgr(CREATEVERSIONRESMGR_NAME(uui)));
- if( nMode == star::task::PasswordRequestMode_PASSWORD_CREATE )
- {
- std::auto_ptr< PasswordCreateDialog >
- xDialog(new PasswordCreateDialog(
- getParentProperty(), xManager.get()));
-
- rInfo.SetResult(xDialog->Execute() == RET_OK ? ERRCODE_BUTTON_OK :
- ERRCODE_BUTTON_CANCEL);
- rInfo.SetPassword( xDialog->GetPassword() );
- }
- else
- {
- std::auto_ptr< PasswordDialog >
- xDialog(new PasswordDialog(
- getParentProperty(), nMode, xManager.get(), aDocName ));
-
- rInfo.SetResult(xDialog->Execute() == RET_OK ? ERRCODE_BUTTON_OK :
- ERRCODE_BUTTON_CANCEL);
- rInfo.SetPassword( xDialog->GetPassword() );
- }
- }
- catch (std::bad_alloc const &)
- {
- throw star::uno::RuntimeException(
- rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("out of memory")),
- star::uno::Reference< star::uno::XInterface>());
- }
-}
-
-void
-UUIInteractionHelper::executeMSPasswordDialog(
- LoginErrorInfo & rInfo,
- star::task::PasswordRequestMode nMode,
- ::rtl::OUString aDocName)
- SAL_THROW((star::uno::RuntimeException))
-{
- try
- {
- vos::OGuard aGuard(Application::GetSolarMutex());
-
- std::auto_ptr< ResMgr >
- xManager(ResMgr::CreateResMgr(CREATEVERSIONRESMGR_NAME(uui)));
- if( nMode == star::task::PasswordRequestMode_PASSWORD_CREATE )
- {
- std::auto_ptr< PasswordCreateDialog >
- xDialog(new PasswordCreateDialog(
- getParentProperty(), xManager.get(), true));
-
- rInfo.SetResult(xDialog->Execute() == RET_OK ? ERRCODE_BUTTON_OK :
- ERRCODE_BUTTON_CANCEL);
- rInfo.SetPassword( xDialog->GetPassword() );
- }
- else
- {
- std::auto_ptr< PasswordDialog >
- xDialog(new PasswordDialog(
- getParentProperty(), nMode, xManager.get(), aDocName ));
-
- rInfo.SetResult(xDialog->Execute() == RET_OK ? ERRCODE_BUTTON_OK :
- ERRCODE_BUTTON_CANCEL);
- rInfo.SetPassword( xDialog->GetPassword() );
- }
- }
- catch (std::bad_alloc const &)
- {
- throw star::uno::RuntimeException(
- rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("out of memory")),
- star::uno::Reference< star::uno::XInterface>());
- }
-}
-
-void
-UUIInteractionHelper::executeCookieDialog(CntHTTPCookieRequest & rRequest)
- SAL_THROW((star::uno::RuntimeException))
-{
- try
- {
- vos::OGuard aGuard(Application::GetSolarMutex());
-
- std::auto_ptr< ResMgr >
- xManager(ResMgr::CreateResMgr(CREATEVERSIONRESMGR_NAME(uui)));
- std::auto_ptr< CookiesDialog >
- xDialog(new CookiesDialog(
- getParentProperty(), &rRequest, xManager.get()));
- xDialog->Execute();
- }
- catch (std::bad_alloc const &)
- {
- throw star::uno::RuntimeException(
- rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("out of memory")),
- star::uno::Reference< star::uno::XInterface>());
+ xIH.set(m_xServiceFactory->createInstanceWithArguments(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.task.InteractionHandler")),
+ m_aProperties),
+ uno::UNO_QUERY);
}
-}
-
-void UUIInteractionHelper::executeFilterDialog(
- rtl::OUString const & rURL ,
- uui::FilterNameList const & rFilters,
- rtl::OUString & rFilter )
- SAL_THROW((star::uno::RuntimeException))
-{
- try
- {
- vos::OGuard aGuard(Application::GetSolarMutex());
-
- std::auto_ptr< ResMgr >
- xManager(ResMgr::CreateResMgr(CREATEVERSIONRESMGR_NAME(uui)));
-
- std::auto_ptr< uui::FilterDialog >
- xDialog(new uui::FilterDialog(getParentProperty(),
- xManager.get()));
-
- xDialog->SetURL(rURL);
- xDialog->ChangeFilters(&rFilters);
+ catch (uno::Exception const &)
+ {}
- uui::FilterNameListPtr pSelected = rFilters.end();
- if( xDialog->AskForFilter( pSelected ) )
- {
- rFilter = pSelected->sInternal;
- }
- }
- catch (std::bad_alloc const &)
- {
- throw star::uno::RuntimeException(
- rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("out of memory")),
- star::uno::Reference< star::uno::XInterface >());
- }
+ if (!xIH.is())
+ throw uno::RuntimeException(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "unable to instanciate Interaction Handler service")),
+ uno::Reference< uno::XInterface >());
+ return xIH;
}
-USHORT
-UUIInteractionHelper::executeErrorDialog(
- star::task::InteractionClassification eClassification,
- rtl::OUString const & rContext,
- rtl::OUString const & rMessage,
- WinBits nButtonMask)
- SAL_THROW((star::uno::RuntimeException))
-{
-
- vos::OGuard aGuard(Application::GetSolarMutex());
-
- rtl::OUStringBuffer aText(rContext);
- if (rContext.getLength() != 0 && rMessage.getLength() != 0)
- aText.appendAscii(RTL_CONSTASCII_STRINGPARAM(":\n"));
- //TODO! must be internationalized
- aText.append(rMessage);
-
- std::auto_ptr< MessBox > xBox;
- try
- {
- switch (eClassification)
- {
- case star::task::InteractionClassification_ERROR:
- xBox.reset(new ErrorBox(getParentProperty(),
- nButtonMask,
- aText.makeStringAndClear()));
- break;
-
- case star::task::InteractionClassification_WARNING:
- xBox.reset(new WarningBox(getParentProperty(),
- nButtonMask,
- aText.makeStringAndClear()));
- break;
-
- case star::task::InteractionClassification_INFO:
- if ((nButtonMask & 0x01F00000) == WB_DEF_OK)
- //TODO! missing win bit button mask define (want to ignore
- // any default button settings)...
- xBox.reset(new InfoBox(getParentProperty(),
- aText.makeStringAndClear()));
- else
- xBox.reset(new ErrorBox(getParentProperty(),
- nButtonMask,
- aText.makeStringAndClear()));
- break;
-
- case star::task::InteractionClassification_QUERY:
- xBox.reset(new QueryBox(getParentProperty(),
- nButtonMask,
- aText.makeStringAndClear()));
- break;
-
- default:
- OSL_ASSERT(false);
- break;
- }
- }
- catch (std::bad_alloc const &)
- {
- throw star::uno::RuntimeException(
- rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("out of memory")),
- star::uno::Reference< star::uno::XInterface >());
- }
-
- USHORT aResult = xBox->Execute();
- switch( aResult )
- {
- case BUTTONID_OK:
- aResult = ERRCODE_BUTTON_OK;
- break;
- case BUTTONID_CANCEL:
- aResult = ERRCODE_BUTTON_CANCEL;
- break;
- case BUTTONID_YES:
- aResult = ERRCODE_BUTTON_YES;
- break;
- case BUTTONID_NO:
- aResult = ERRCODE_BUTTON_NO;
- break;
- case BUTTONID_RETRY:
- aResult = ERRCODE_BUTTON_RETRY;
- break;
- }
-
- return aResult;
-}
+namespace {
USHORT
-UUIInteractionHelper::executeMessageBox(
+executeMessageBox(
+ Window * pParent,
rtl::OUString const & rTitle,
rtl::OUString const & rMessage,
WinBits nButtonMask )
- SAL_THROW((star::uno::RuntimeException))
+ SAL_THROW((uno::RuntimeException))
{
-
vos::OGuard aGuard(Application::GetSolarMutex());
- MessBox xBox( getParentProperty(), nButtonMask, rTitle, rMessage );
+ MessBox xBox( pParent, nButtonMask, rTitle, rMessage );
USHORT aResult = xBox.Execute();
switch( aResult )
@@ -2163,481 +1186,12 @@ UUIInteractionHelper::executeMessageBox(
return aResult;
}
-star::uno::Reference< star::task::XInteractionHandler >
-UUIInteractionHelper::getInteractionHandler() const
- SAL_THROW((star::uno::RuntimeException))
-{
- star::uno::Reference< star::task::XInteractionHandler > xIH;
- try
- {
- xIH = star::uno::Reference< star::task::XInteractionHandler >(
- m_xServiceFactory->createInstanceWithArguments(
- rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM(
- "com.sun.star.task.InteractionHandler")),
- m_aProperties),
- star::uno::UNO_QUERY);
- }
- catch (star::uno::Exception const &)
- {}
-
- if (!xIH.is())
- throw star::uno::RuntimeException(
- rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM(
- "unable to instanciate Interaction Handler service")),
- star::uno::Reference< star::uno::XInterface >());
- return xIH;
-}
-
-namespace
-{
-bool fillContinuation(
- bool bUseSystemCredentials,
- const star::ucb::AuthenticationRequest & rRequest,
- const star::task::UrlRecord & aRec,
- const star::uno::Reference< star::ucb::XInteractionSupplyAuthentication > &
- xSupplyAuthentication,
- const star::uno::Reference< star::ucb::XInteractionSupplyAuthentication2 > &
- xSupplyAuthentication2,
- bool bCanUseSystemCredentials,
- bool bCheckForEqualPasswords )
-{
- if ( bUseSystemCredentials )
- {
- // "use system creds" record found.
- // Wants client that we use it?
- if ( xSupplyAuthentication2.is() &&
- bCanUseSystemCredentials )
- {
- xSupplyAuthentication2->setUseSystemCredentials( sal_True );
- return true;
- }
- return false;
- }
- else if (aRec.UserList.getLength() != 0)
- {
- if (aRec.UserList[0].Passwords.getLength() == 0)
- {
- // Password sequence can be empty, for instance if master
- // password was not given (e.g. master pw dialog canceled)
- // pw container does not throw NoMasterException in this case.
- // bug???
- return false;
- }
-
- // "user/pass" record found.
- if (!bCheckForEqualPasswords || !rRequest.HasPassword
- || rRequest.Password != aRec.UserList[0].Passwords[0]) // failed login attempt?
- {
- if (xSupplyAuthentication->canSetUserName())
- xSupplyAuthentication->
- setUserName(aRec.UserList[0].UserName.getStr());
-
- if (xSupplyAuthentication->canSetPassword())
- xSupplyAuthentication->
- setPassword(aRec.UserList[0].Passwords[0].getStr());
- if (aRec.UserList[0].Passwords.getLength() > 1)
- {
- if (rRequest.HasRealm)
- {
- if (xSupplyAuthentication->canSetRealm())
- xSupplyAuthentication->
- setRealm(aRec.UserList[0].Passwords[1].
- getStr());
- }
- else if (xSupplyAuthentication->canSetAccount())
- xSupplyAuthentication->
- setAccount(aRec.UserList[0].Passwords[1].
- getStr());
- }
-
- if ( xSupplyAuthentication2.is() &&
- bCanUseSystemCredentials )
- xSupplyAuthentication2->setUseSystemCredentials( sal_False );
-
- return true;
- }
- }
- return false;
-}
-
-}
-
-void
-UUIInteractionHelper::handleAuthenticationRequest(
- star::ucb::AuthenticationRequest const & rRequest,
- star::uno::Sequence< star::uno::Reference<
- star::task::XInteractionContinuation > > const &
- rContinuations,
- const rtl::OUString & rURL)
- SAL_THROW((star::uno::RuntimeException))
-{
- star::uno::Reference< star::task::XInteractionHandler > xIH;
-
- star::uno::Reference< star::task::XInteractionRetry > xRetry;
- star::uno::Reference< star::task::XInteractionAbort > xAbort;
- star::uno::Reference< star::ucb::XInteractionSupplyAuthentication >
- xSupplyAuthentication;
- star::uno::Reference< star::ucb::XInteractionSupplyAuthentication2 >
- xSupplyAuthentication2;
- getContinuations(
- rContinuations,
- 0, 0, &xRetry, &xAbort,
- &xSupplyAuthentication, &xSupplyAuthentication2, 0, 0, 0 );
- bool bRemember;
- bool bRememberPersistent;
- if (xSupplyAuthentication.is())
- {
- star::ucb::RememberAuthentication eDefault;
- star::uno::Sequence< star::ucb::RememberAuthentication >
- aModes(xSupplyAuthentication->getRememberPasswordModes(eDefault));
- bRemember = eDefault != star::ucb::RememberAuthentication_NO;
- bRememberPersistent = false;
- for (sal_Int32 i = 0; i < aModes.getLength(); ++i)
- if (aModes[i] == star::ucb::RememberAuthentication_PERSISTENT)
- {
- bRememberPersistent = true;
- break;
- }
- }
- else
- {
- bRemember = false;
- bRememberPersistent = false;
- }
-
- sal_Bool bCanUseSystemCredentials;
- sal_Bool bDefaultUseSystemCredentials;
- if (xSupplyAuthentication2.is())
- {
- bCanUseSystemCredentials
- = xSupplyAuthentication2->canUseSystemCredentials(
- bDefaultUseSystemCredentials );
- }
- else
- {
- bCanUseSystemCredentials = sal_False;
- bDefaultUseSystemCredentials = sal_False;
- }
-
- com::sun::star::uno::Reference< com::sun::star::task::XPasswordContainer >
- xContainer;
- com::sun::star::uno::Reference< com::sun::star::task::XUrlContainer >
- xUrlContainer;
-
- if ( bCanUseSystemCredentials && initPasswordContainer( &xContainer, &xUrlContainer ) )
- {
- // Runtime / Persistent info avail for current auth request?
-
- rtl::OUString aResult = xUrlContainer->findUrl(
- rURL.getLength() ? rURL : rRequest.ServerName );
- if ( aResult.getLength() > 0 )
- {
- if ( fillContinuation( true,
- rRequest,
- star::task::UrlRecord(),
- xSupplyAuthentication,
- xSupplyAuthentication2,
- bCanUseSystemCredentials,
- false ) )
- {
- xSupplyAuthentication->select();
- return;
- }
- }
- }
-
- // xContainer works with userName passwdSequences pairs:
- if (rRequest.HasUserName
- && rRequest.HasPassword
- && initPasswordContainer(&xContainer, &xUrlContainer))
- {
- xIH = getInteractionHandler();
- try
- {
- if (rRequest.UserName.getLength() == 0)
- {
- star::task::UrlRecord aRec;
- if ( rURL.getLength() )
- aRec = xContainer->find(rURL, xIH);
-
- if ( aRec.UserList.getLength() == 0 )
- {
- // compat: try server name.
- aRec = xContainer->find(rRequest.ServerName, xIH);
- }
-
- if ( fillContinuation( false,
- rRequest,
- aRec,
- xSupplyAuthentication,
- xSupplyAuthentication2,
- bCanUseSystemCredentials,
- false ) )
- {
- xSupplyAuthentication->select();
- return;
- }
- }
- else
- {
- star::task::UrlRecord aRec;
- if ( rURL.getLength() )
- aRec = xContainer->findForName(
- rURL, rRequest.UserName, xIH);
-
- if ( aRec.UserList.getLength() == 0 )
- {
- // compat: try server name.
- aRec = xContainer->findForName(
- rRequest.ServerName, rRequest.UserName, xIH);
- }
-
- if ( fillContinuation( false,
- rRequest,
- aRec,
- xSupplyAuthentication,
- xSupplyAuthentication2,
- bCanUseSystemCredentials,
- true ) )
- {
- xSupplyAuthentication->select();
- return;
- }
- }
- }
- catch (star::task::NoMasterException const &)
- {} // user did not enter master password
- }
-
- LoginErrorInfo aInfo;
- aInfo.SetTitle(rRequest.ServerName);
- aInfo.SetServer(rRequest.ServerName);
- if (rRequest.HasAccount)
- aInfo.SetAccount(rRequest.Account);
- if (rRequest.HasUserName)
- aInfo.SetUserName(rRequest.UserName);
- if (rRequest.HasPassword)
- aInfo.SetPassword(rRequest.Password);
- aInfo.SetErrorText(rRequest.Diagnostic);
- aInfo.SetPersistentPassword(bRememberPersistent);
- aInfo.SetSavePassword(bRemember);
- aInfo.SetCanUseSystemCredentials( bCanUseSystemCredentials );
- aInfo.SetIsUseSystemCredentials( bDefaultUseSystemCredentials );
- aInfo.SetModifyAccount(rRequest.HasAccount
- && xSupplyAuthentication.is()
- && xSupplyAuthentication->canSetAccount());
- aInfo.SetModifyUserName(rRequest.HasUserName
- && xSupplyAuthentication.is()
- && xSupplyAuthentication->canSetUserName());
- executeLoginDialog(aInfo,
- rRequest.HasRealm ? rRequest.Realm : rtl::OUString());
- switch (aInfo.GetResult())
- {
- case ERRCODE_BUTTON_OK:
- if (xSupplyAuthentication.is())
- {
- if (xSupplyAuthentication->canSetUserName())
- xSupplyAuthentication->setUserName(aInfo.GetUserName());
- if (xSupplyAuthentication->canSetPassword())
- xSupplyAuthentication->setPassword(aInfo.GetPassword());
- xSupplyAuthentication->
- setRememberPassword(
- aInfo.GetIsSavePassword() ?
- bRememberPersistent ?
- star::ucb::RememberAuthentication_PERSISTENT :
- star::ucb::RememberAuthentication_SESSION :
- star::ucb::RememberAuthentication_NO);
- if (rRequest.HasRealm)
- {
- if (xSupplyAuthentication->canSetRealm())
- xSupplyAuthentication->setRealm(aInfo.GetAccount());
- }
- else if (xSupplyAuthentication->canSetAccount())
- xSupplyAuthentication->setAccount(aInfo.GetAccount());
-
- if ( xSupplyAuthentication2.is() && bCanUseSystemCredentials )
- xSupplyAuthentication2->setUseSystemCredentials(
- aInfo.GetIsUseSystemCredentials() );
-
- xSupplyAuthentication->select();
- }
-
- if ( aInfo.GetIsUseSystemCredentials() )
- {
- if (aInfo.GetIsSavePassword())
- {
- if ( initPasswordContainer(&xContainer, &xUrlContainer) )
- xUrlContainer->addUrl(
- rURL.getLength() ? rURL : rRequest.ServerName,
- bRememberPersistent );
- }
- }
- else if (aInfo.GetUserName().Len() != 0 // Empty user name can not be valid:
- && initPasswordContainer(&xContainer, &xUrlContainer))
- {
- try
- {
- if (aInfo.GetIsSavePassword())
- {
- star::uno::Sequence< rtl::OUString >
- aPassList(aInfo.GetAccount().Len() == 0 ? 1 : 2);
- aPassList[0] = aInfo.GetPassword();
- if (aInfo.GetAccount().Len() != 0)
- aPassList[1] = aInfo.GetAccount();
-
- if (!xIH.is())
- xIH = getInteractionHandler();
-
- if (bRememberPersistent)
- xContainer->addPersistent(
- rURL.getLength() ? rURL : rRequest.ServerName,
- aInfo.GetUserName(),
- aPassList,
- xIH);
- else
- xContainer->add(
- rURL.getLength() ? rURL : rRequest.ServerName,
- aInfo.GetUserName(),
- aPassList,
- xIH);
- }
- }
- catch (star::task::NoMasterException const &)
- {} // user did not enter master password
- }
- break;
-
- case ERRCODE_BUTTON_RETRY:
- if (xRetry.is())
- xRetry->select();
- break;
-
- default:
- if (xAbort.is())
- xAbort->select();
- break;
- }
-}
-
-sal_Bool
-UUIInteractionHelper::isDomainMatch( rtl::OUString hostName, rtl::OUString certHostName)
-{
- if (hostName.equalsIgnoreAsciiCase( certHostName ))
- return sal_True;
-
-
-
- if ( 0 == certHostName.indexOf( rtl::OUString::createFromAscii( "*" ) ) && hostName.getLength() >= certHostName.getLength() )
- {
- rtl::OUString cmpStr = certHostName.copy( 1 );
-
- if ( hostName.matchIgnoreAsciiCase( cmpStr, hostName.getLength( ) - cmpStr.getLength()) )
- return sal_True;
-
- }
-
- return sal_False;
-}
-
-
-void
-UUIInteractionHelper::handleCertificateValidationRequest(
- star::ucb::CertificateValidationRequest const & rRequest,
- star::uno::Sequence< star::uno::Reference<
- star::task::XInteractionContinuation > > const &
- rContinuations)
- SAL_THROW((star::uno::RuntimeException))
-{
- star::uno::Reference< star::task::XInteractionHandler > xIH = getInteractionHandler();
-
- star::uno::Reference< star::task::XInteractionApprove > xApprove;
- star::uno::Reference< star::task::XInteractionAbort > xAbort;
-
- getContinuations(
- rContinuations, &xApprove, 0, 0, &xAbort, 0, 0, 0, 0, 0);
-
- sal_Int32 failures = rRequest.CertificateValidity;
-
- sal_Bool trustCert = sal_True;
-
-
- if ( ((failures & csss::CertificateValidity::UNTRUSTED) == csss::CertificateValidity::UNTRUSTED ) ||
- ((failures & csss::CertificateValidity::ISSUER_UNTRUSTED) == csss::CertificateValidity::ISSUER_UNTRUSTED) ||
- ((failures & csss::CertificateValidity::ROOT_UNTRUSTED) == csss::CertificateValidity::ROOT_UNTRUSTED) )
- {
- if ( executeUnknownAuthDialog( rRequest.Certificate ) )
- trustCert = sal_True;
- else
- trustCert = sal_False;
- }
-
- if ( (!isDomainMatch( rRequest.HostName, GetContentPart( rRequest.Certificate.get()->getSubjectName()) )) &&
- trustCert )
- {
- if ( executeSSLWarnDialog( rRequest.Certificate, SSLWARN_TYPE_DOMAINMISMATCH, rRequest.HostName ) )
- trustCert = sal_True;
- else
- trustCert = sal_False;
- }
-
- if ( (((failures & csss::CertificateValidity::TIME_INVALID) == csss::CertificateValidity::TIME_INVALID) ||
- ((failures & csss::CertificateValidity::NOT_TIME_NESTED) == csss::CertificateValidity::NOT_TIME_NESTED)) &&
- trustCert )
- {
- if ( executeSSLWarnDialog( rRequest.Certificate, SSLWARN_TYPE_EXPIRED, rRequest.HostName ) )
- trustCert = sal_True;
- else
- trustCert = sal_False;
- }
-
- if ( (((failures & csss::CertificateValidity::REVOKED) == csss::CertificateValidity::REVOKED) ||
- ((failures & csss::CertificateValidity::SIGNATURE_INVALID) == csss::CertificateValidity::SIGNATURE_INVALID) ||
- ((failures & csss::CertificateValidity::EXTENSION_INVALID) == csss::CertificateValidity::EXTENSION_INVALID) ||
- ((failures & csss::CertificateValidity::INVALID) == csss::CertificateValidity::INVALID)) &&
- trustCert )
- {
- if ( executeSSLWarnDialog( rRequest.Certificate, SSLWARN_TYPE_INVALID, rRequest.HostName ) )
- trustCert = sal_True;
- else
- trustCert = sal_False;
- }
-
- if ( trustCert )
- {
- if (xApprove.is())
- xApprove->select();
- } else
- {
- if (xAbort.is())
- xAbort->select();
- }
-
- /*
-
- switch (executeMessageBox( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Dialog1")), rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Dummy dialog")), WB_YES_NO | WB_DEF_YES ))
- {
- case ERRCODE_BUTTON_YES:
- if (xApprove.is())
- xApprove->select();
- break;
- default:
- if (xAbort.is())
- xAbort->select();
- break;
- }
- */
-}
-
-// @@@ Todo #i29340#: activate!
-#if 0
-namespace {
enum NameClashResolveDialogResult { ABORT, RENAME, OVERWRITE };
NameClashResolveDialogResult
executeNameClashResolveDialog(
+ Window * /*pParent*/,
rtl::OUString const & /*rTargetFolderURL*/,
rtl::OUString const & /*rClashingName*/,
rtl::OUString & /*rProposedNewName*/)
@@ -2650,6 +1204,7 @@ executeNameClashResolveDialog(
NameClashResolveDialogResult
executeSimpleNameClashResolveDialog(
+ Window * /*pParent*/,
rtl::OUString const & /*rTargetFolderURL*/,
rtl::OUString const & /*rClashingName*/,
rtl::OUString & /*rProposedNewName*/)
@@ -2664,10 +1219,10 @@ executeSimpleNameClashResolveDialog(
void
UUIInteractionHelper::handleNameClashResolveRequest(
- star::ucb::NameClashResolveRequest const & rRequest,
- star::uno::Sequence< star::uno::Reference<
- star::task::XInteractionContinuation > > const & rContinuations)
- SAL_THROW((star::uno::RuntimeException))
+ ucb::NameClashResolveRequest const & rRequest,
+ uno::Sequence< uno::Reference<
+ task::XInteractionContinuation > > const & rContinuations)
+ SAL_THROW((uno::RuntimeException))
{
OSL_ENSURE(
rRequest.TargetFolderURL.getLength() > 0,
@@ -2677,15 +1232,11 @@ UUIInteractionHelper::handleNameClashResolveRequest(
rRequest.ClashingName.getLength() > 0,
"NameClashResolveRequest must not contain empty ClashingName" );
- star::uno::Reference< star::task::XInteractionAbort >
- xAbort;
- star::uno::Reference< star::ucb::XInteractionSupplyName >
- xSupplyName;
- star::uno::Reference< star::ucb::XInteractionReplaceExistingData >
- xReplaceExistingData;
+ uno::Reference< task::XInteractionAbort > xAbort;
+ uno::Reference< ucb::XInteractionSupplyName > xSupplyName;
+ uno::Reference< ucb::XInteractionReplaceExistingData > xReplaceExistingData;
getContinuations(
- rContinuations,
- 0, 0, 0, &xAbort, 0, 0, 0, &xSupplyName, &xReplaceExistingData);
+ rContinuations, &xAbort, &xSupplyName, &xReplaceExistingData);
OSL_ENSURE( xAbort.is(),
"NameClashResolveRequest must contain Abort continuation" );
@@ -2697,14 +1248,16 @@ UUIInteractionHelper::handleNameClashResolveRequest(
rtl::OUString aProposedNewName( rRequest.ProposedNewName );
if ( xReplaceExistingData.is() )
eResult = executeNameClashResolveDialog(
- rRequest.TargetFolderURL,
- rRequest.ClashingName,
- aProposedNewName);
+ getParentProperty(),
+ rRequest.TargetFolderURL,
+ rRequest.ClashingName,
+ aProposedNewName);
else
eResult = executeSimpleNameClashResolveDialog(
- rRequest.TargetFolderURL,
- rRequest.ClashingName,
- aProposedNewName);
+ getParentProperty(),
+ rRequest.TargetFolderURL,
+ rRequest.ClashingName,
+ aProposedNewName);
switch ( eResult )
{
@@ -2731,598 +1284,108 @@ UUIInteractionHelper::handleNameClashResolveRequest(
break;
}
}
-#endif
-
-void
-UUIInteractionHelper::handleMasterPasswordRequest(
- star::task::PasswordRequestMode nMode,
- star::uno::Sequence< star::uno::Reference<
- star::task::XInteractionContinuation > > const &
- rContinuations)
- SAL_THROW((star::uno::RuntimeException))
-{
- star::uno::Reference< star::task::XInteractionRetry > xRetry;
- star::uno::Reference< star::task::XInteractionAbort > xAbort;
- star::uno::Reference< star::ucb::XInteractionSupplyAuthentication >
- xSupplyAuthentication;
- getContinuations(
- rContinuations,
- 0, 0, &xRetry, &xAbort, &xSupplyAuthentication, 0, 0, 0, 0);
- LoginErrorInfo aInfo;
-
- // in case of master password a hash code is returned
- executeMasterPasswordDialog(aInfo, nMode);
-
- switch (aInfo.GetResult())
- {
- case ERRCODE_BUTTON_OK:
- if (xSupplyAuthentication.is())
- {
- if (xSupplyAuthentication->canSetPassword())
- xSupplyAuthentication->setPassword(aInfo.GetPassword());
- xSupplyAuthentication->select();
- }
- break;
-
- case ERRCODE_BUTTON_RETRY:
- if (xRetry.is())
- xRetry->select();
- break;
-
- default:
- if (xAbort.is())
- xAbort->select();
- break;
- }
-}
-
-void
-UUIInteractionHelper::handlePasswordRequest(
- star::task::PasswordRequestMode nMode,
- star::uno::Sequence< star::uno::Reference<
- star::task::XInteractionContinuation > > const &
- rContinuations,
- ::rtl::OUString aDocumentName )
- SAL_THROW((star::uno::RuntimeException))
-{
- star::uno::Reference< star::task::XInteractionRetry > xRetry;
- star::uno::Reference< star::task::XInteractionAbort > xAbort;
- star::uno::Reference< star::task::XInteractionPassword >
- xPassword;
- getContinuations(
- rContinuations, 0, 0, &xRetry, &xAbort, 0, 0, &xPassword, 0, 0);
- LoginErrorInfo aInfo;
-
- executePasswordDialog(aInfo, nMode, aDocumentName);
-
- switch (aInfo.GetResult())
- {
- case ERRCODE_BUTTON_OK:
- if (xPassword.is())
- {
- xPassword->setPassword(aInfo.GetPassword());
- xPassword->select();
- }
- break;
-
- case ERRCODE_BUTTON_RETRY:
- if (xRetry.is())
- xRetry->select();
- break;
-
- default:
- if (xAbort.is())
- xAbort->select();
- break;
- }
-}
-
-void
-UUIInteractionHelper::handleMSPasswordRequest(
- star::task::PasswordRequestMode nMode,
- star::uno::Sequence< star::uno::Reference<
- star::task::XInteractionContinuation > > const &
- rContinuations,
- ::rtl::OUString aDocumentName )
- SAL_THROW((star::uno::RuntimeException))
-{
- star::uno::Reference< star::task::XInteractionRetry > xRetry;
- star::uno::Reference< star::task::XInteractionAbort > xAbort;
- star::uno::Reference< star::task::XInteractionPassword >
- xPassword;
- getContinuations(
- rContinuations, 0, 0, &xRetry, &xAbort, 0, 0, &xPassword, 0, 0);
- LoginErrorInfo aInfo;
-
- executeMSPasswordDialog(aInfo, nMode, aDocumentName);
-
- switch (aInfo.GetResult())
- {
- case ERRCODE_BUTTON_OK:
- if (xPassword.is())
- {
- xPassword->setPassword(aInfo.GetPassword());
- xPassword->select();
- }
- break;
-
- case ERRCODE_BUTTON_RETRY:
- if (xRetry.is())
- xRetry->select();
- break;
-
- default:
- if (xAbort.is())
- xAbort->select();
- break;
- }
-}
-
-void
-UUIInteractionHelper::handleCookiesRequest(
- star::ucb::HandleCookiesRequest const & rRequest,
- star::uno::Sequence< star::uno::Reference<
- star::task::XInteractionContinuation > > const &
- rContinuations)
- SAL_THROW((star::uno::RuntimeException))
-{
- CookieList aCookies;
- for (sal_Int32 i = 0; i < rRequest.Cookies.getLength(); ++i)
- {
- try
- {
- std::auto_ptr< CntHTTPCookie > xCookie(new CntHTTPCookie);
- xCookie->m_aName = UniString(rRequest.Cookies[i].Name);
- xCookie->m_aValue = UniString(rRequest.Cookies[i].Value);
- xCookie->m_aDomain = UniString(rRequest.Cookies[i].Domain);
- xCookie->m_aPath = UniString(rRequest.Cookies[i].Path);
- xCookie->m_aExpires
- = DateTime(Date(rRequest.Cookies[i].Expires.Day,
- rRequest.Cookies[i].Expires.Month,
- rRequest.Cookies[i].Expires.Year),
- Time(rRequest.Cookies[i].Expires.Hours,
- rRequest.Cookies[i].Expires.Minutes,
- rRequest.Cookies[i].Expires.Seconds,
- rRequest.Cookies[i].Expires.
- HundredthSeconds));
- xCookie->m_nFlags
- = rRequest.Cookies[i].Secure ? CNTHTTP_COOKIE_FLAG_SECURE : 0;
- switch (rRequest.Cookies[i].Policy)
- {
- case star::ucb::CookiePolicy_CONFIRM:
- xCookie->m_nPolicy = CNTHTTP_COOKIE_POLICY_INTERACTIVE;
- break;
-
- case star::ucb::CookiePolicy_ACCEPT:
- xCookie->m_nPolicy = CNTHTTP_COOKIE_POLICY_ACCEPTED;
- break;
-
- case star::ucb::CookiePolicy_IGNORE:
- xCookie->m_nPolicy = CNTHTTP_COOKIE_POLICY_BANNED;
- break;
-
- default:
- OSL_ASSERT(false);
- break;
- }
- aCookies.Insert(xCookie.get(), LIST_APPEND);
- xCookie.release();
- }
- catch (std::bad_alloc const &)
- {
- throw star::uno::RuntimeException(
- rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
- "out of memory")),
- star::uno::Reference< star::uno::XInterface >());
- }
- }
-
- CntHTTPCookieRequest
- aRequest(rRequest.URL,
- aCookies,
- rRequest.Request == star::ucb::CookieRequest_RECEIVE ?
- CNTHTTP_COOKIE_REQUEST_RECV :
- CNTHTTP_COOKIE_REQUEST_SEND);
- executeCookieDialog(aRequest);
- for (sal_Int32 i = 0; i < rContinuations.getLength(); ++i)
- {
- star::uno::Reference< star::ucb::XInteractionCookieHandling >
- xCookieHandling(rContinuations[i], star::uno::UNO_QUERY);
- if (xCookieHandling.is())
- {
- switch (aRequest.m_nRet)
- {
- case CNTHTTP_COOKIE_POLICY_INTERACTIVE:
- xCookieHandling->
- setGeneralPolicy(star::ucb::CookiePolicy_CONFIRM);
- break;
-
- case CNTHTTP_COOKIE_POLICY_ACCEPTED:
- xCookieHandling->
- setGeneralPolicy(star::ucb::CookiePolicy_ACCEPT);
- break;
-
- case CNTHTTP_COOKIE_POLICY_BANNED:
- xCookieHandling->
- setGeneralPolicy(star::ucb::CookiePolicy_IGNORE);
- break;
- }
- for (sal_Int32 j = 0; j < rRequest.Cookies.getLength(); ++j)
- if (rRequest.Cookies[j].Policy
- == star::ucb::CookiePolicy_CONFIRM)
- switch (static_cast< CntHTTPCookie * >(aCookies.
- GetObject(j))->
- m_nPolicy)
- {
- case CNTHTTP_COOKIE_POLICY_ACCEPTED:
- xCookieHandling->
- setSpecificPolicy(rRequest.Cookies[j], true);
- break;
-
- case CNTHTTP_COOKIE_POLICY_BANNED:
- xCookieHandling->
- setSpecificPolicy(rRequest.Cookies[j], false);
- break;
- }
- xCookieHandling->select();
- break;
- }
- }
-}
-
-void
-UUIInteractionHelper::handleNoSuchFilterRequest(
- star::document::NoSuchFilterRequest const & rRequest,
- star::uno::Sequence<
- star::uno::Reference< star::task::XInteractionContinuation > > const &
- rContinuations )
- SAL_THROW((star::uno::RuntimeException))
-{
- star::uno::Reference< star::task::XInteractionAbort > xAbort;
- star::uno::Reference<
- star::document::XInteractionFilterSelect > xFilterTransport;
-
- sal_Int32 nCount = rContinuations.getLength();
- for( sal_Int32 nStep=0; nStep<nCount; ++nStep )
- {
- if( ! xAbort.is() )
- xAbort = star::uno::Reference< star::task::XInteractionAbort >(
- rContinuations[nStep], star::uno::UNO_QUERY );
-
- if( ! xFilterTransport.is() )
- xFilterTransport = star::uno::Reference<
- star::document::XInteractionFilterSelect >(
- rContinuations[nStep], star::uno::UNO_QUERY );
- }
-
- // check neccessary ressources - if they doesn't exist - abort or
- // break this operation
- if (!xAbort.is())
- return;
-
- if (!xFilterTransport.is() || !m_xServiceFactory.is())
- {
- xAbort->select();
- return;
- }
-
- star::uno::Reference< star::container::XContainerQuery >
- xFilterContainer( m_xServiceFactory->createInstance(
- ::rtl::OUString::createFromAscii(
- "com.sun.star.document.FilterFactory") ),
- star::uno::UNO_QUERY );
- if (!xFilterContainer.is())
- {
- xAbort->select();
- return;
- }
-
- uui::FilterNameList lNames;
-
- // Note: We look for all filters here which match the following criteria:
- // - they are import filters as minimum (of course they can
- // support export too)
- // - we don't show any filter which are flaged as "don't show it
- // at the UI" or "they are not installed"
- // - we ignore filters, which have not set any valid
- // DocumentService (e.g. our pure graphic filters)
- // - we show it sorted by her UIName's
- // - We don't use the order flag or prefer default filters.
- // (Because this list shows all filters and the user should
- // find his filter vry easy by his UIName ...)
- // - We use "_query_all" here ... but we filter graphic filters
- // out by using DocumentService property later!
- star::uno::Reference< star::container::XEnumeration > xFilters
- = xFilterContainer->createSubSetEnumerationByQuery(
- ::rtl::OUString::createFromAscii(
- "_query_all:sort_prop=uiname:iflags=1:eflags=143360"));
- while (xFilters->hasMoreElements())
- {
- try
- {
- ::comphelper::SequenceAsHashMap lProps(xFilters->nextElement());
- uui::FilterNamePair aPair;
-
- aPair.sInternal = lProps.getUnpackedValueOrDefault(
- rtl::OUString::createFromAscii("Name"), ::rtl::OUString());
- aPair.sUI = lProps.getUnpackedValueOrDefault(
- rtl::OUString::createFromAscii("UIName"), ::rtl::OUString());
- if (
- (!aPair.sInternal.Len()) ||
- (!aPair.sUI.Len() )
- )
- {
- continue;
- }
- lNames.push_back( aPair );
- }
- catch(const star::uno::RuntimeException&)
- {
- throw;
- }
- catch(const star::uno::Exception&)
- {
- continue;
- }
- }
-
- // no list available for showing
- // -> abort operation
- if (lNames.size()<1)
- {
- xAbort->select();
- return;
- }
-
- // let the user select the right filter
- rtl::OUString sSelectedFilter;
- executeFilterDialog( rRequest.URL, lNames, sSelectedFilter );
-
- // If he doesn't select anyone
- // -> abort operation
- if (sSelectedFilter.getLength()<1)
- {
- xAbort->select();
- return;
- }
-
- // otherwhise set it for return
- xFilterTransport->setFilter( sSelectedFilter );
- xFilterTransport->select();
-}
-
-void
-UUIInteractionHelper::handleAmbigousFilterRequest(
- star::document::AmbigousFilterRequest const & rRequest,
- star::uno::Sequence<
- star::uno::Reference<
- star::task::XInteractionContinuation > > const & rContinuations)
- SAL_THROW((star::uno::RuntimeException))
-{
- star::uno::Reference< star::task::XInteractionAbort > xAbort;
- star::uno::Reference<
- star::document::XInteractionFilterSelect > xFilterTransport;
-
- sal_Int32 nCount = rContinuations.getLength();
- for( sal_Int32 nStep=0; nStep<nCount; ++nStep )
- {
- if( ! xAbort.is() )
- xAbort = star::uno::Reference< star::task::XInteractionAbort >(
- rContinuations[nStep], star::uno::UNO_QUERY );
-
- if( ! xFilterTransport.is() )
- xFilterTransport = star::uno::Reference<
- star::document::XInteractionFilterSelect >(
- rContinuations[nStep], star::uno::UNO_QUERY );
- }
-
- uui::FilterNameList lNames;
-
- if( m_xServiceFactory.is() == sal_True )
- {
- star::uno::Reference< star::container::XNameContainer >
- xFilterContainer( m_xServiceFactory->createInstance(
- ::rtl::OUString::createFromAscii(
- "com.sun.star.document.FilterFactory") ),
- star::uno::UNO_QUERY );
- if( xFilterContainer.is() == sal_True )
- {
- star::uno::Any aPackedSet ;
- star::uno::Sequence< star::beans::PropertyValue > lProps ;
- sal_Int32 nStep ;
- uui::FilterNamePair aPair ;
-
- try
- {
- aPackedSet
- = xFilterContainer->getByName( rRequest.SelectedFilter );
- }
- catch(const ::com::sun::star::container::NoSuchElementException&)
- {
- aPackedSet.clear();
- }
- aPackedSet >>= lProps;
- for( nStep=0; nStep<lProps.getLength(); ++nStep )
- {
- if( lProps[nStep].Name.compareToAscii("UIName") == 0 )
- {
- ::rtl::OUString sTemp;
- lProps[nStep].Value >>= sTemp;
- aPair.sUI = sTemp;
- aPair.sInternal = rRequest.SelectedFilter;
- lNames.push_back( aPair );
- break;
- }
- }
-
- try
- {
- aPackedSet
- = xFilterContainer->getByName( rRequest.DetectedFilter );
- }
- catch(const ::com::sun::star::container::NoSuchElementException&)
- {
- aPackedSet.clear();
- }
- aPackedSet >>= lProps;
- for( nStep=0; nStep<lProps.getLength(); ++nStep )
- {
- if( lProps[nStep].Name.compareToAscii("UIName") == 0 )
- {
- ::rtl::OUString sTemp;
- lProps[nStep].Value >>= sTemp;
- aPair.sUI = sTemp;
- aPair.sInternal = rRequest.DetectedFilter;
- lNames.push_back( aPair );
- break;
- }
- }
- }
- }
-
- if( xAbort.is() && xFilterTransport.is() )
- {
- if( lNames.size() < 1 )
- {
- xAbort->select();
- }
- else
- {
- rtl::OUString sFilter;
- executeFilterDialog( rRequest.URL, lNames, sFilter );
-
- if( sFilter.getLength() > 0 )
- {
- xFilterTransport->setFilter( sFilter );
- xFilterTransport->select();
- }
- else
- xAbort->select();
- }
- }
-}
void
UUIInteractionHelper::handleGenericErrorRequest(
sal_Int32 nErrorCode,
- star::uno::Sequence< star::uno::Reference<
- star::task::XInteractionContinuation > > const & rContinuations,
+ uno::Sequence< uno::Reference<
+ task::XInteractionContinuation > > const & rContinuations,
bool bObtainErrorStringOnly,
bool & bHasErrorString,
rtl::OUString & rErrorString)
- SAL_THROW((star::uno::RuntimeException))
+ SAL_THROW((uno::RuntimeException))
{
if (bObtainErrorStringOnly)
{
bHasErrorString = isInformationalErrorMessageRequest(rContinuations);
if (bHasErrorString)
- {
- String aErrorString;
- ErrorHandler::GetErrorString(nErrorCode, aErrorString);
- rErrorString = aErrorString;
- }
+ {
+ String aErrorString;
+ ErrorHandler::GetErrorString(nErrorCode, aErrorString);
+ rErrorString = aErrorString;
+ }
}
else
{
- star::uno::Reference< star::task::XInteractionAbort > xAbort;
- star::uno::Reference< star::task::XInteractionApprove > xApprove;
-
- sal_Int32 nCount = rContinuations.getLength();
- for( sal_Int32 nStep=0; nStep<nCount; ++nStep )
- {
- if( ! xAbort.is() )
- xAbort
- = star::uno::Reference< star::task::XInteractionAbort >(
- rContinuations[nStep], star::uno::UNO_QUERY );
-
- if( ! xApprove.is() )
- xApprove
- = star::uno::Reference< star::task::XInteractionApprove >(
- rContinuations[nStep], star::uno::UNO_QUERY );
- }
-
- // Note: It's important to convert the transported long to the
- // required unsigned long value. Otherwhise using as flag field
- // can fail ...
- ErrCode nError = (ErrCode)nErrorCode;
- sal_Bool bWarning = !ERRCODE_TOERROR(nError);
-
- if ( nError == ERRCODE_SFX_BROKENSIGNATURE
- || nError == ERRCODE_SFX_INCOMPLETE_ENCRYPTION )
- {
- // the security warning need a special title
- String aErrorString;
- ErrorHandler::GetErrorString( nErrorCode, aErrorString );
+ uno::Reference< task::XInteractionAbort > xAbort;
+ uno::Reference< task::XInteractionApprove > xApprove;
+ getContinuations(rContinuations, &xApprove, &xAbort);
- std::auto_ptr< ResMgr >
- xManager( ResMgr::CreateResMgr( CREATEVERSIONRESMGR_NAME( uui ) ) );
- ::rtl::OUString aTitle;
+ // Note: It's important to convert the transported long to the
+ // required unsigned long value. Otherwhise using as flag field
+ // can fail ...
+ ErrCode nError = static_cast< ErrCode >(nErrorCode);
+ sal_Bool bWarning = !ERRCODE_TOERROR(nError);
- try
+ if ( nError == ERRCODE_SFX_BROKENSIGNATURE
+ || nError == ERRCODE_SFX_INCOMPLETE_ENCRYPTION )
{
- star::uno::Any aProductNameAny =
- ::utl::ConfigManager::GetConfigManager()->GetDirectConfigProperty(
- ::utl::ConfigManager::PRODUCTNAME );
- aProductNameAny >>= aTitle;
- } catch( star::uno::Exception& )
- {}
+ // the security warning box needs a special title
+ String aErrorString;
+ ErrorHandler::GetErrorString( nErrorCode, aErrorString );
- ::rtl::OUString aErrTitle = String( ResId( nError == ERRCODE_SFX_BROKENSIGNATURE ? STR_WARNING_BROKENSIGNATURE_TITLE : STR_WARNING_INCOMPLETE_ENCRYPTION_TITLE, *xManager.get() ) );
+ std::auto_ptr< ResMgr > xManager(
+ ResMgr::CreateResMgr( CREATEVERSIONRESMGR_NAME( uui ) ) );
+ ::rtl::OUString aTitle;
- if ( aTitle.getLength() && aErrTitle.getLength() )
- aTitle += ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( " - " ) );
- aTitle += aErrTitle;
+ try
+ {
+ uno::Any aProductNameAny =
+ ::utl::ConfigManager::GetConfigManager()
+ ->GetDirectConfigProperty(
+ ::utl::ConfigManager::PRODUCTNAME );
+ aProductNameAny >>= aTitle;
+ }
+ catch( uno::Exception& )
+ {
+ }
- executeMessageBox( aTitle, aErrorString, WB_OK );
- }
- else
- ErrorHandler::HandleError(nErrorCode);
+ ::rtl::OUString aErrTitle
+ = String( ResId( nError == ERRCODE_SFX_BROKENSIGNATURE
+ ? STR_WARNING_BROKENSIGNATURE_TITLE
+ : STR_WARNING_INCOMPLETE_ENCRYPTION_TITLE,
+ *xManager.get() ) );
- if (xApprove.is() && bWarning)
- xApprove->select();
- else if (xAbort.is())
- xAbort->select();
- }
-}
+ if ( aTitle.getLength() && aErrTitle.getLength() )
+ aTitle += ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( " - " ) );
+ aTitle += aErrTitle;
-namespace
-{
- template< class INTERACTION_TYPE >
- bool lcl_findContinuation( const Sequence< Reference< XInteractionContinuation > >& _rContinuations,
- Reference< INTERACTION_TYPE >& _rContinuation )
- {
- const Reference< XInteractionContinuation >* pContinuation = _rContinuations.getConstArray();
- const Reference< XInteractionContinuation >* pContinuationEnd = _rContinuations.getConstArray() + _rContinuations.getLength();
- while ( pContinuation != pContinuationEnd )
- {
- if ( _rContinuation.set( *pContinuation++, UNO_QUERY ) )
- return true;
+ executeMessageBox(
+ getParentProperty(), aTitle, aErrorString, WB_OK );
}
- return false;
+ else
+ ErrorHandler::HandleError(nErrorCode);
+
+ if (xApprove.is() && bWarning)
+ xApprove->select();
+ else if (xAbort.is())
+ xAbort->select();
}
}
void
UUIInteractionHelper::handleMacroConfirmRequest(
const ::rtl::OUString& aDocumentURL,
- const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xZipStorage,
+ const uno::Reference< embed::XStorage >& xZipStorage,
const ::rtl::OUString& aDocumentVersion,
- const ::com::sun::star::uno::Sequence< ::com::sun::star::security::DocumentSignatureInformation > aSignInfo,
- star::uno::Sequence< star::uno::Reference<
- star::task::XInteractionContinuation > > const & rContinuations
-)
- SAL_THROW((star::uno::RuntimeException))
+ const uno::Sequence< security::DocumentSignatureInformation > aSignInfo,
+ uno::Sequence< uno::Reference< task::XInteractionContinuation > > const &
+ rContinuations )
+ SAL_THROW((uno::RuntimeException))
{
- Reference< XInteractionAbort > xAbort; lcl_findContinuation( rContinuations, xAbort );
- Reference< XInteractionApprove > xApprove; lcl_findContinuation( rContinuations, xApprove );
+ uno::Reference< task::XInteractionAbort > xAbort;
+ uno::Reference< task::XInteractionApprove > xApprove;
+ getContinuations( rContinuations, &xApprove, &xAbort );
bool bApprove = false;
- std::auto_ptr< ResMgr > pResMgr( ResMgr::CreateResMgr( CREATEVERSIONRESMGR_NAME( uui ) ) );
+ std::auto_ptr< ResMgr > pResMgr(
+ ResMgr::CreateResMgr( CREATEVERSIONRESMGR_NAME( uui ) ) );
if ( pResMgr.get() )
{
bool bShowSignatures = aSignInfo.getLength() > 0;
- MacroWarning aWarning( getParentProperty(), bShowSignatures, *pResMgr.get() );
+ MacroWarning aWarning(
+ getParentProperty(), bShowSignatures, *pResMgr.get() );
aWarning.SetDocumentURL( aDocumentURL );
if ( aSignInfo.getLength() > 1 )
@@ -3345,372 +1408,97 @@ UUIInteractionHelper::handleMacroConfirmRequest(
void
UUIInteractionHelper::handleFutureDocumentVersionUpdateRequest(
- const FutureDocumentVersionProductUpdateRequest& _rRequest,
- Sequence< Reference< XInteractionContinuation > > const & rContinuations
-)
- SAL_THROW((star::uno::RuntimeException))
+ const task::FutureDocumentVersionProductUpdateRequest& _rRequest,
+ uno::Sequence< uno::Reference< task::XInteractionContinuation > > const &
+ rContinuations )
+ SAL_THROW((uno::RuntimeException))
{
- Reference< XInteractionAbort > xAbort; lcl_findContinuation( rContinuations, xAbort );
- Reference< XInteractionApprove > xApprove; lcl_findContinuation( rContinuations, xApprove );
- Reference< XInteractionApprove > xAskLater; lcl_findContinuation( rContinuations, xAskLater );
+ uno::Reference< task::XInteractionAbort > xAbort;
+ uno::Reference< task::XInteractionApprove > xApprove;
+ uno::Reference< task::XInteractionAskLater > xAskLater;
+ getContinuations( rContinuations, &xApprove, &xAbort, &xAskLater );
short nResult = RET_CANCEL;
static bool s_bDeferredToNextSession = false;
- // TODO: this static variable is somewhat hacky. Formerly (before the dialog was moved from SFX2 to the
- // interaction handler implementation), this was stored in SFX_APP()'s impl structure, in member
- // bODFVersionWarningLater. Of course, we do not have access to it here.
- //
- // A proper solution which I would envision would be:
- // - There's a central implementation (this one here) of css.task.InteractionHandler
- // - There's a configuration which maps UNO names to service names
- // - If the handler is confronted with a request, it tries to find the name of the UNO structure describing
- // the request in the said configuration.
- // - If an entry is found, then
- // - the respective service is instantiated
- // - the component is queried for css.task.XInteractionHandler, and the request is delegated
- // - if no entry is found, then the request is silenced (with calling the AbortContinuation, if possible)
- // This way, the FutureDocumentVersionProductUpdateRequest could be handled in SFX (or any other
- // suitable place), again, and we would only have one place where we remember the s_bDeferredToNextSession
- // flag.
- //
- // The side effect (well, actually the more important effect) would be that we do not need to burden
- // this central implementation with all interactions which are possible. Instead, separate parts of OOo
- // can define/implement different requests. (for instance, everything which today is done in the
- // css.sdb.InteractionHandler can then be routed through a "normal" interaction handler, where today we
- // always need to tell people to instantiate the SDB-version of the handler, not the normal one.)
+ // TODO: this static variable is somewhat hacky. Formerly (before the dialog was moved from SFX2 to the
+ // interaction handler implementation), this was stored in SFX_APP()'s impl structure, in member
+ // bODFVersionWarningLater. Of course, we do not have access to it here.
+ //
+ // A proper solution which I would envision would be:
+ // - There's a central implementation (this one here) of css.task.InteractionHandler
+ // - There's a configuration which maps UNO names to service names
+ // - If the handler is confronted with a request, it tries to find the name of the UNO structure describing
+ // the request in the said configuration.
+ // - If an entry is found, then
+ // - the respective service is instantiated
+ // - the component is queried for css.task.XInteractionHandler, and the request is delegated
+ // - if no entry is found, then the request is silenced (with calling the AbortContinuation, if possible)
+ // This way, the FutureDocumentVersionProductUpdateRequest could be handled in SFX (or any other
+ // suitable place), again, and we would only have one place where we remember the s_bDeferredToNextSession
+ // flag.
+ //
+ // Note: The above pattern has been implemented in CWS autorecovery. Now the remaining task is to move the
+ // handling of this interaction to SFX, again.
if ( !s_bDeferredToNextSession )
{
- std::auto_ptr< ResMgr > pResMgr( ResMgr::CreateResMgr( CREATEVERSIONRESMGR_NAME( uui ) ) );
+ std::auto_ptr< ResMgr > pResMgr(
+ ResMgr::CreateResMgr( CREATEVERSIONRESMGR_NAME( uui ) ) );
if ( pResMgr.get() )
{
- ::uui::NewerVersionWarningDialog aDialog( getParentProperty(), _rRequest.DocumentODFVersion, *pResMgr.get() );
+ ::uui::NewerVersionWarningDialog aDialog(
+ getParentProperty(),
+ _rRequest.DocumentODFVersion,
+ *pResMgr.get() );
nResult = aDialog.Execute();
}
}
switch ( nResult )
{
- case RET_OK: if ( xApprove.is() ) xApprove->select(); break;
- case RET_CANCEL: if ( xAbort.is() ) xAbort->select(); break;
- case RET_ASK_LATER: if ( xAskLater.is() ) xAskLater->select(); s_bDeferredToNextSession = true; break;
+ case RET_OK:
+ if ( xApprove.is() )
+ xApprove->select();
+ break;
+ case RET_CANCEL:
+ if ( xAbort.is() )
+ xAbort->select();
+ break;
+ case RET_ASK_LATER:
+ if ( xAskLater.is() )
+ xAskLater->select();
+ s_bDeferredToNextSession = true;
+ break;
default:
- OSL_ENSURE( false, "UUIInteractionHelper::handleFutureDocumentVersionUpdateRequest: unexpected dialog return value!" );
+ OSL_ENSURE( false,
+ "UUIInteractionHelper::handleFutureDocumentVersionUpdateRequest: "
+ "unexpected dialog return value!" );
break;
}
}
void
-UUIInteractionHelper::handleFilterOptionsRequest(
- star::document::FilterOptionsRequest const & rRequest,
- star::uno::Sequence< star::uno::Reference<
- star::task::XInteractionContinuation > > const & rContinuations)
- SAL_THROW((com::sun::star::uno::RuntimeException))
-{
- star::uno::Reference< star::task::XInteractionAbort > xAbort;
- star::uno::Reference<
- star::document::XInteractionFilterOptions > xFilterOptions;
-
- sal_Int32 nCount = rContinuations.getLength();
- for( sal_Int32 nStep=0; nStep<nCount; ++nStep )
- {
- if( ! xAbort.is() )
- xAbort = star::uno::Reference< star::task::XInteractionAbort >(
- rContinuations[nStep], star::uno::UNO_QUERY );
-
- if( ! xFilterOptions.is() )
- xFilterOptions = star::uno::Reference<
- star::document::XInteractionFilterOptions >(
- rContinuations[nStep], star::uno::UNO_QUERY );
- }
-
- star::uno::Reference< star::container::XNameAccess > xFilterCFG;
- if( m_xServiceFactory.is() )
- {
- xFilterCFG = star::uno::Reference< star::container::XNameAccess >(
- m_xServiceFactory->createInstance(
- ::rtl::OUString::createFromAscii(
- "com.sun.star.document.FilterFactory" ) ),
- star::uno::UNO_QUERY );
- }
-
- if( xFilterCFG.is() && rRequest.rProperties.getLength() )
- {
- try {
- ::rtl::OUString aFilterName;
- sal_Int32 nPropCount = rRequest.rProperties.getLength();
- for( sal_Int32 ind = 0; ind < nPropCount; ++ind )
- {
- rtl::OUString tmp = rRequest.rProperties[ind].Name;
- if( rRequest.rProperties[ind].Name.equals(
- ::rtl::OUString::createFromAscii("FilterName")) )
- {
- rRequest.rProperties[ind].Value >>= aFilterName;
- break;
- }
- }
-
- star::uno::Sequence < star::beans::PropertyValue > aProps;
- if ( xFilterCFG->getByName( aFilterName ) >>= aProps )
- {
- sal_Int32 nPropertyCount = aProps.getLength();
- for( sal_Int32 nProperty=0;
- nProperty < nPropertyCount;
- ++nProperty )
- if( aProps[nProperty].Name.equals(
- ::rtl::OUString::createFromAscii("UIComponent")) )
- {
- ::rtl::OUString aServiceName;
- aProps[nProperty].Value >>= aServiceName;
- if( aServiceName.getLength() )
- {
- star::uno::Reference<
- star::ui::dialogs::XExecutableDialog >
- xFilterDialog(
- m_xServiceFactory->createInstance(
- aServiceName ),
- star::uno::UNO_QUERY );
- star::uno::Reference<
- star::beans::XPropertyAccess >
- xFilterProperties(
- xFilterDialog,
- star::uno::UNO_QUERY );
-
- if( xFilterDialog.is() && xFilterProperties.is() )
- {
- star::uno::Reference<
- star::document::XImporter > xImporter(
- xFilterDialog,
- star::uno::UNO_QUERY );
- if( xImporter.is() )
- xImporter->setTargetDocument(
- star::uno::Reference<
- star::lang::XComponent >(
- rRequest.rModel,
- star::uno::UNO_QUERY ) );
-
- xFilterProperties->setPropertyValues(
- rRequest.rProperties );
-
- if( xFilterDialog->execute() )
- {
- xFilterOptions->setFilterOptions(
- xFilterProperties
- ->getPropertyValues() );
- xFilterOptions->select();
- return;
-
- }
- }
- }
- break;
- }
- }
- }
- catch( star::container::NoSuchElementException& )
- {
- // the filter name is unknown
- }
- catch( star::uno::Exception& )
- {
- }
- }
-
- xAbort->select();
-}
-
-void
-UUIInteractionHelper::handleErrorRequest(
- star::task::InteractionClassification eClassification,
- ErrCode nErrorCode,
+UUIInteractionHelper::handleBrokenPackageRequest(
std::vector< rtl::OUString > const & rArguments,
- star::uno::Sequence< star::uno::Reference<
- star::task::XInteractionContinuation > > const & rContinuations,
+ uno::Sequence< uno::Reference< task::XInteractionContinuation > > const &
+ rContinuations,
bool bObtainErrorStringOnly,
bool & bHasErrorString,
rtl::OUString & rErrorString)
- SAL_THROW((star::uno::RuntimeException))
+ SAL_THROW((uno::RuntimeException))
{
- rtl::OUString aMessage;
- {
- enum Source { SOURCE_DEFAULT, SOURCE_CNT, SOURCE_SVX, SOURCE_UUI };
- static char const * const aManager[4]
- = { CREATEVERSIONRESMGR_NAME(ofa),
- CREATEVERSIONRESMGR_NAME(cnt),
- CREATEVERSIONRESMGR_NAME(svx),
- CREATEVERSIONRESMGR_NAME(uui) };
- static USHORT const aId[4]
- = { RID_ERRHDL,
- RID_CHAOS_START + 12,
- // cf. chaos/source/inc/cntrids.hrc, where
- // #define RID_CHAOS_ERRHDL (RID_CHAOS_START + 12)
- RID_SVX_START + 350, // RID_SVXERRCODE
- RID_UUI_ERRHDL };
- ErrCode nErrorId = nErrorCode & ~ERRCODE_WARNING_MASK;
- Source eSource = nErrorId < ERRCODE_AREA_LIB1 ?
- SOURCE_DEFAULT :
- nErrorId >= ERRCODE_AREA_CHAOS
- && nErrorId < ERRCODE_AREA_CHAOS_END ?
- SOURCE_CNT :
- nErrorId >= ERRCODE_AREA_SVX
- && nErrorId <= ERRCODE_AREA_SVX_END ?
- SOURCE_SVX :
- SOURCE_UUI;
-
- vos::OGuard aGuard(Application::GetSolarMutex());
- std::auto_ptr< ResMgr > xManager;
- xManager.reset(ResMgr::CreateResMgr(aManager[eSource]));
- if (!xManager.get())
- return;
- ResId aResId(aId[eSource], *xManager.get());
- if (!ErrorResource(aResId). getString(nErrorCode, &aMessage))
- return;
- }
-
- aMessage = replaceMessageWithArguments( aMessage, rArguments );
-
if (bObtainErrorStringOnly)
{
bHasErrorString = isInformationalErrorMessageRequest(rContinuations);
- if (bHasErrorString)
- rErrorString = aMessage;
- return;
- }
- else
- {
- //TODO! It can happen that the buttons calculated below do not match
- // the error text from the resource (e.g., some text that is not a
- // question, but YES and NO buttons). Some error texts have
- // ExtraData that specifies a set of buttons, but that data is not
- // really useful, because a single error text may well make sense
- // both with only an OK button and with RETRY and CANCEL buttons.
-
- star::uno::Reference< star::task::XInteractionApprove > xApprove;
- star::uno::Reference< star::task::XInteractionDisapprove > xDisapprove;
- star::uno::Reference< star::task::XInteractionRetry > xRetry;
- star::uno::Reference< star::task::XInteractionAbort > xAbort;
- getContinuations(
- rContinuations,
- &xApprove, &xDisapprove, &xRetry, &xAbort, 0, 0, 0, 0, 0);
-
- // The following mapping uses the bit mask
- // Approve = 8,
- // Disapprove = 4,
- // Retry = 2,
- // Abort = 1
- //
- // The mapping has five properties on which the code to select the
- // correct continuation relies:
- // 1 The OK button is mapped to Approve if that is available,
- // otherwise to Abort if that is available, otherwise to none.
- // 2 The CANCEL button is always mapped to Abort.
- // 3 The RETRY button is always mapped to Retry.
- // 4 The NO button is always mapped to Disapprove.
- // 5 The YES button is always mapped to Approve.
- //
- // Because the WinBits button combinations are quite restricted, not
- // every request can be served here.
- //
- // Finally, it seems to be better to leave default button
- // determination to VCL (the favouring of CANCEL as default button
- // seems to not always be what the user wants)...
- WinBits const aButtonMask[16]
- = { 0,
- WB_OK /*| WB_DEF_OK*/, // Abort
- 0,
- WB_RETRY_CANCEL /*| WB_DEF_CANCEL*/, // Retry, Abort
- 0,
- 0,
- 0,
- 0,
- WB_OK /*| WB_DEF_OK*/, // Approve
- WB_OK_CANCEL /*| WB_DEF_CANCEL*/, // Approve, Abort
- 0,
- 0,
- WB_YES_NO /*| WB_DEF_NO*/, // Approve, Disapprove
- WB_YES_NO_CANCEL /*| WB_DEF_CANCEL*/,
- // Approve, Disapprove, Abort
- 0,
- 0 };
-
- WinBits nButtonMask = aButtonMask[(xApprove.is() ? 8 : 0)
- | (xDisapprove.is() ? 4 : 0)
- | (xRetry.is() ? 2 : 0)
- | (xAbort.is() ? 1 : 0)];
- if (nButtonMask == 0)
+ if (!bHasErrorString)
return;
-
- //TODO! remove this backwards compatibility?
- rtl::OUString aContext(getContextProperty());
- if (aContext.getLength() == 0 && nErrorCode != 0)
- {
- vos::OGuard aGuard(Application::GetSolarMutex());
- ErrorContext * pContext = ErrorContext::GetContext();
- if (pContext)
- {
- UniString aContextString;
- if (pContext->GetString(nErrorCode, aContextString))
- aContext = aContextString;
- }
- }
-
- USHORT nResult = executeErrorDialog(
- eClassification, aContext, aMessage, nButtonMask );
- switch (nResult)
- {
- case ERRCODE_BUTTON_OK:
- OSL_ENSURE(xApprove.is() || xAbort.is(), "unexpected situation");
- if (xApprove.is())
- xApprove->select();
- else if (xAbort.is())
- xAbort->select();
- break;
-
- case ERRCODE_BUTTON_CANCEL:
- OSL_ENSURE(xAbort.is(), "unexpected situation");
- if (xAbort.is())
- xAbort->select();
- break;
-
- case ERRCODE_BUTTON_RETRY:
- OSL_ENSURE(xRetry.is(), "unexpected situation");
- if (xRetry.is())
- xRetry->select();
- break;
-
- case ERRCODE_BUTTON_NO:
- OSL_ENSURE(xDisapprove.is(), "unexpected situation");
- if (xDisapprove.is())
- xDisapprove->select();
- break;
-
- case ERRCODE_BUTTON_YES:
- OSL_ENSURE(xApprove.is(), "unexpected situation");
- if (xApprove.is())
- xApprove->select();
- break;
- }
-
}
-}
-void
-UUIInteractionHelper::handleBrokenPackageRequest(
- std::vector< rtl::OUString > const & rArguments,
- star::uno::Sequence< star::uno::Reference<
- star::task::XInteractionContinuation > > const &
- rContinuations,
- bool bObtainErrorStringOnly,
- bool & bHasErrorString,
- rtl::OUString & rErrorString)
- SAL_THROW((star::uno::RuntimeException))
-{
- star::uno::Reference< star::task::XInteractionApprove > xApprove;
- star::uno::Reference< star::task::XInteractionDisapprove > xDisapprove;
- star::uno::Reference< star::task::XInteractionAbort > xAbort;
- getContinuations(
- rContinuations, &xApprove, &xDisapprove, 0, &xAbort, 0, 0, 0, 0, 0);
+ uno::Reference< task::XInteractionApprove > xApprove;
+ uno::Reference< task::XInteractionDisapprove > xDisapprove;
+ uno::Reference< task::XInteractionAbort > xAbort;
+ getContinuations(rContinuations, &xApprove, &xDisapprove, &xAbort);
ErrCode nErrorCode;
if( xApprove.is() && xDisapprove.is() )
@@ -3728,7 +1516,7 @@ UUIInteractionHelper::handleBrokenPackageRequest(
{
vos::OGuard aGuard(Application::GetSolarMutex());
std::auto_ptr< ResMgr > xManager(
- ResMgr::CreateResMgr(CREATEVERSIONRESMGR_NAME(uui)));
+ ResMgr::CreateResMgr(CREATEVERSIONRESMGR_NAME(uui)));
if (!xManager.get())
return;
@@ -3741,226 +1529,81 @@ UUIInteractionHelper::handleBrokenPackageRequest(
if (bObtainErrorStringOnly)
{
- bHasErrorString = isInformationalErrorMessageRequest(rContinuations);
- if (bHasErrorString)
- rErrorString = aMessage;
+ rErrorString = aMessage;
return;
}
- else
- {
- WinBits nButtonMask;
- if( xApprove.is() && xDisapprove.is() )
- {
- nButtonMask = WB_YES_NO | WB_DEF_YES;
- }
- else if ( xAbort.is() )
- {
- nButtonMask = WB_OK;
- }
- else
- return;
-
- star::uno::Any aProductNameAny =
- ::utl::ConfigManager::GetConfigManager()->GetDirectConfigProperty(
- ::utl::ConfigManager::PRODUCTNAME );
- star::uno::Any aProductVersionAny =
- ::utl::ConfigManager::GetConfigManager()->GetDirectConfigProperty(
- ::utl::ConfigManager::PRODUCTVERSION );
- ::rtl::OUString aProductName, aProductVersion;
- if ( !( aProductNameAny >>= aProductName ) )
- aProductName
- = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("StarOffice") );
-
- ::rtl::OUString aTitle( aProductName );
- if( aProductVersionAny >>= aProductVersion )
- {
- aTitle += ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(" ") );
- aTitle += aProductVersion;
- }
-
- switch ( executeMessageBox( aTitle, aMessage, nButtonMask ))
- {
- case ERRCODE_BUTTON_OK:
- OSL_ENSURE( xAbort.is(), "unexpected situation" );
- if (xAbort.is())
- xAbort->select();
- break;
-
- case ERRCODE_BUTTON_NO:
- OSL_ENSURE(xDisapprove.is(), "unexpected situation");
- if (xDisapprove.is())
- xDisapprove->select();
- break;
-
- case ERRCODE_BUTTON_YES:
- OSL_ENSURE(xApprove.is(), "unexpected situation");
- if (xApprove.is())
- xApprove->select();
- break;
- }
- }
-}
-void
-UUIInteractionHelper::handleLockedDocumentRequest(
- const ::rtl::OUString& aDocumentURL,
- const ::rtl::OUString& aInfo,
- star::uno::Sequence< star::uno::Reference<
- star::task::XInteractionContinuation > > const &
- rContinuations,
- sal_uInt16 nMode )
- SAL_THROW((star::uno::RuntimeException))
-{
- star::uno::Reference< star::task::XInteractionApprove > xApprove;
- star::uno::Reference< star::task::XInteractionDisapprove > xDisapprove;
- star::uno::Reference< star::task::XInteractionAbort > xAbort;
- getContinuations(
- rContinuations, &xApprove, &xDisapprove, 0, &xAbort, 0, 0, 0, 0, 0);
-
- if ( !xApprove.is() || !xDisapprove.is() || !xAbort.is() )
- return;
-
- try
+ WinBits nButtonMask;
+ if( xApprove.is() && xDisapprove.is() )
{
- vos::OGuard aGuard(Application::GetSolarMutex());
- std::auto_ptr< ResMgr > xManager(
- ResMgr::CreateResMgr(CREATEVERSIONRESMGR_NAME(uui)));
- if (!xManager.get())
- return;
-
- ::rtl::OUString aMessage;
- std::vector< rtl::OUString > aArguments;
- aArguments.push_back( aDocumentURL );
-
- sal_Int32 nResult = RET_CANCEL;
- if ( nMode == UUI_DOC_LOAD_LOCK )
- {
- aArguments.push_back( aInfo.getLength()
- ? aInfo
- : ::rtl::OUString( String( ResId( STR_UNKNOWNUSER, *xManager.get() ) ) ) );
- aMessage = String( ResId( STR_OPENLOCKED_MSG, *xManager.get() ) );
- aMessage = replaceMessageWithArguments( aMessage, aArguments );
-
- std::auto_ptr< OpenLockedQueryBox > xDialog(new OpenLockedQueryBox(
- getParentProperty(), xManager.get(), aMessage ) );
- nResult = xDialog->Execute();
- }
- else if ( nMode == UUI_DOC_SAVE_LOCK )
- {
- aArguments.push_back( aInfo.getLength()
- ? aInfo
- : ::rtl::OUString( String( ResId( STR_UNKNOWNUSER, *xManager.get() ) ) ) );
- aMessage = String( ResId( STR_TRYLATER_MSG, *xManager.get() ) );
- aMessage = replaceMessageWithArguments( aMessage, aArguments );
-
- std::auto_ptr< TryLaterQueryBox > xDialog(new TryLaterQueryBox(
- getParentProperty(), xManager.get(), aMessage ) );
- nResult = xDialog->Execute();
- }
- else if ( nMode == UUI_DOC_OWN_LOAD_LOCK || nMode == UUI_DOC_OWN_SAVE_LOCK )
- {
- aArguments.push_back( aInfo );
- aMessage = String( ResId( nMode == UUI_DOC_OWN_SAVE_LOCK ? STR_ALREADYOPEN_SAVE_MSG : STR_ALREADYOPEN_MSG, *xManager.get() ) );
- aMessage = replaceMessageWithArguments( aMessage, aArguments );
-
- std::auto_ptr< AlreadyOpenQueryBox > xDialog(new AlreadyOpenQueryBox(
- getParentProperty(), xManager.get(), aMessage, nMode == UUI_DOC_OWN_SAVE_LOCK ) );
- nResult = xDialog->Execute();
- }
-
- if ( nResult == RET_YES )
- xApprove->select();
- else if ( nResult == RET_NO )
- xDisapprove->select();
- else
- xAbort->select();
+ nButtonMask = WB_YES_NO | WB_DEF_YES;
}
- catch (std::bad_alloc const &)
+ else if ( xAbort.is() )
{
- throw star::uno::RuntimeException(
- rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("out of memory")),
- star::uno::Reference< star::uno::XInterface >());
+ nButtonMask = WB_OK;
}
-}
-
-void
-UUIInteractionHelper::handleChangedByOthersRequest(
- star::uno::Sequence< star::uno::Reference<
- star::task::XInteractionContinuation > > const &
- rContinuations )
- SAL_THROW((star::uno::RuntimeException))
-{
- star::uno::Reference< star::task::XInteractionApprove > xApprove;
- star::uno::Reference< star::task::XInteractionAbort > xAbort;
- getContinuations(
- rContinuations, &xApprove, 0, 0, &xAbort, 0, 0, 0, 0, 0);
-
- if ( !xApprove.is() || !xAbort.is() )
+ else
return;
- try
- {
- vos::OGuard aGuard(Application::GetSolarMutex());
- std::auto_ptr< ResMgr > xManager(
- ResMgr::CreateResMgr(CREATEVERSIONRESMGR_NAME(uui)));
- if (!xManager.get())
- return;
-
- std::auto_ptr< FileChangedQueryBox > xDialog(new FileChangedQueryBox(
- getParentProperty(), xManager.get() ) );
- sal_Int32 nResult = xDialog->Execute();
+ uno::Any aProductNameAny =
+ ::utl::ConfigManager::GetConfigManager()->GetDirectConfigProperty(
+ ::utl::ConfigManager::PRODUCTNAME );
+ uno::Any aProductVersionAny =
+ ::utl::ConfigManager::GetConfigManager()->GetDirectConfigProperty(
+ ::utl::ConfigManager::PRODUCTVERSION );
+ ::rtl::OUString aProductName, aProductVersion;
+ if ( !( aProductNameAny >>= aProductName ) )
+ aProductName
+ = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("StarOffice") );
- if ( nResult == RET_YES )
- xApprove->select();
- else
- xAbort->select();
- }
- catch (std::bad_alloc const &)
+ ::rtl::OUString aTitle( aProductName );
+ if( aProductVersionAny >>= aProductVersion )
{
- throw star::uno::RuntimeException(
- rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("out of memory")),
- star::uno::Reference< star::uno::XInterface >());
+ aTitle += ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(" ") );
+ aTitle += aProductVersion;
}
-}
-
-void
-UUIInteractionHelper::handleLockFileIgnoreRequest(
- star::uno::Sequence< star::uno::Reference<
- star::task::XInteractionContinuation > > const &
- rContinuations )
- SAL_THROW((star::uno::RuntimeException))
-{
- star::uno::Reference< star::task::XInteractionApprove > xApprove;
- star::uno::Reference< star::task::XInteractionAbort > xAbort;
- getContinuations(
- rContinuations, &xApprove, 0, 0, &xAbort, 0, 0, 0, 0, 0);
-
- if ( !xApprove.is() || !xAbort.is() )
- return;
- try
+ switch ( executeMessageBox( getParentProperty(),
+ aTitle,
+ aMessage,
+ nButtonMask ))
{
- vos::OGuard aGuard(Application::GetSolarMutex());
- std::auto_ptr< ResMgr > xManager(
- ResMgr::CreateResMgr(CREATEVERSIONRESMGR_NAME(uui)));
- if (!xManager.get())
- return;
+ case ERRCODE_BUTTON_OK:
+ OSL_ENSURE( xAbort.is(), "unexpected situation" );
+ if (xAbort.is())
+ xAbort->select();
+ break;
- std::auto_ptr< LockFailedQueryBox > xDialog(new LockFailedQueryBox(
- getParentProperty(), xManager.get() ) );
- sal_Int32 nResult = xDialog->Execute();
+ case ERRCODE_BUTTON_NO:
+ OSL_ENSURE(xDisapprove.is(), "unexpected situation");
+ if (xDisapprove.is())
+ xDisapprove->select();
+ break;
- if ( nResult == RET_OK )
+ case ERRCODE_BUTTON_YES:
+ OSL_ENSURE(xApprove.is(), "unexpected situation");
+ if (xApprove.is())
xApprove->select();
- else
- xAbort->select();
- }
- catch (std::bad_alloc const &)
- {
- throw star::uno::RuntimeException(
- rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("out of memory")),
- star::uno::Reference< star::uno::XInterface >());
+ break;
}
}
+//=========================================================================
+// ErrorResource Implementation
+//=========================================================================
+bool
+ErrorResource::getString(ErrCode nErrorCode, rtl::OUString * pString)
+ const SAL_THROW(())
+{
+ OSL_ENSURE(pString, "specification violation");
+ ResId aResId(static_cast< USHORT >(nErrorCode & ERRCODE_RES_MASK),
+ *m_pResMgr);
+ aResId.SetRT(RSC_STRING);
+ if (!IsAvailableRes(aResId))
+ return false;
+ aResId.SetAutoRelease(false);
+ *pString = UniString(aResId);
+ m_pResMgr->PopContext();
+ return true;
+}
diff --git a/uui/source/iahndl.hxx b/uui/source/iahndl.hxx
index 6c16769406c5..42935565a314 100644
--- a/uui/source/iahndl.hxx
+++ b/uui/source/iahndl.hxx
@@ -2,13 +2,10 @@
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
- * Copyright 2008 by Sun Microsystems, Inc.
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: iahndl.hxx,v $
- * $Revision: 1.21.22.1 $
- *
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
@@ -31,45 +28,51 @@
#ifndef UUI_IAHNDL_HXX
#define UUI_IAHNDL_HXX
-#ifndef INCLUDED_VECTOR
#include <vector>
-#define INCLUDED_VECTOR
-#endif
+
#include "osl/mutex.hxx"
+#include "rtl/ustring.hxx"
+
#include "com/sun/star/uno/Reference.hxx"
#include "com/sun/star/uno/Sequence.hxx"
#include "com/sun/star/beans/Optional.hpp"
-#include "com/sun/star/embed/XStorage.hpp"
#include "com/sun/star/task/InteractionClassification.hpp"
-#include "com/sun/star/task/PasswordRequestMode.hpp"
-#include "com/sun/star/task/FutureDocumentVersionProductUpdateRequest.hpp"
-#include "com/sun/star/security/DocumentSignatureInformation.hpp"
-#include "tools/solar.h"
-#include "tools/errcode.hxx"
-#include "vcl/wintypes.hxx"
-#include "fltdlg.hxx"
-#include <com/sun/star/security/XCertificate.hpp>
-#ifndef _COM_SUN_STAR_XML_CRYPTO_XXSECURITYENVIRONMENT_HPP_
-#include <com/sun/star/xml/crypto/XSecurityEnvironment.hpp>
-#endif
-class Window;
-class LoginErrorInfo;
-struct CntHTTPCookieRequest;
+#include "tools/solar.h" // USHORT
+#include "tools/errcode.hxx" // ErrCode
+#include "tools/rc.hxx" // Resource
+#include "vcl/wintypes.hxx" // WinBits
+
+namespace com { namespace sun { namespace star {
+ namespace awt {
+ class XWindow;
+ }
+ namespace embed {
+ class XStorage;
+ }
+ namespace lang {
+ class XMultiServiceFactory;
+ }
+ namespace security {
+ class DocumentSignatureInformation;
+ }
+ namespace task {
+ class FutureDocumentVersionProductUpdateRequest;
+ class XInteractionContinuation;
+ class XInteractionHandler;
+ class XInteractionRequest;
+ }
+ namespace ucb {
+ class NameClashResolveRequest;
+ }
+} } }
-#define DESCRIPTION_1 1
-#define DESCRIPTION_2 2
-#define TITLE 3
+#include <hash_map>
-#define UUI_DOC_LOAD_LOCK 0
-#define UUI_DOC_OWN_LOAD_LOCK 1
-#define UUI_DOC_SAVE_LOCK 2
-#define UUI_DOC_OWN_SAVE_LOCK 3
+class Window;
//============================================================================
-/** Information about a InteractionHandler
- */
struct InteractionHandlerData
{
/** The UNO service name to use to instanciate the content provider.
@@ -77,194 +80,139 @@ struct InteractionHandlerData
rtl::OUString ServiceName;
InteractionHandlerData() {};
- InteractionHandlerData( const rtl::OUString & rService)
+ InteractionHandlerData(const rtl::OUString & rService)
: ServiceName( rService ){}
};
typedef std::vector< InteractionHandlerData > InteractionHandlerDataList;
-namespace cssu = com::sun::star::uno;
-namespace dcss = ::com::sun::star;
+typedef ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionContinuation > > Continuations;
-namespace com { namespace sun { namespace star {
- namespace document {
- class AmbigousFilterRequest;
- class FilterOptionsRequest;
- class NoSuchFilterRequest;
- }
- namespace lang {
- class XMultiServiceFactory;
- }
- namespace task {
- class XInteractionContinuation;
- class XInteractionHandler;
- class XInteractionRequest;
- class XPasswordContainer;
- class XUrlContainer;
- }
- namespace ucb {
- class AuthenticationRequest;
- class HandleCookiesRequest;
- class NameClashResolveRequest;
- class CertificateValidationRequest;
- }
- namespace uno {
- class RuntimeException;
- }
-} } }
+typedef ::std::hash_map< ::rtl::OUString, ::rtl::OUString, ::rtl::OUStringHash > StringHashMap;
+//============================================================================
class UUIInteractionHelper
{
private:
- osl::Mutex m_aPropertyMutex;
- com::sun::star::uno::Reference<
- com::sun::star::lang::XMultiServiceFactory >
- m_xServiceFactory;
- com::sun::star::uno::Sequence< com::sun::star::uno::Any > m_aProperties;
-
+ mutable osl::Mutex m_aPropertyMutex;
+ ::com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory > m_xServiceFactory;
+ ::com::sun::star::uno::Sequence< com::sun::star::uno::Any > m_aProperties;
+ StringHashMap m_aTypedCustomHandlers;
UUIInteractionHelper(UUIInteractionHelper &); // not implemented
void operator =(UUIInteractionHelper); // not implemented
public:
- UUIInteractionHelper(com::sun::star::uno::Reference<
- com::sun::star::lang::XMultiServiceFactory >
- const & rServiceFactory,
- com::sun::star::uno::Sequence<
- com::sun::star::uno::Any > const & rArguments)
+ UUIInteractionHelper(
+ com::sun::star::uno::Reference<
+ com::sun::star::lang::XMultiServiceFactory > const & rServiceFactory,
+ com::sun::star::uno::Sequence<
+ com::sun::star::uno::Any > const & rArguments)
SAL_THROW(());
- UUIInteractionHelper(com::sun::star::uno::Reference<
- com::sun::star::lang::XMultiServiceFactory >
- const & rServiceFactory)
+ UUIInteractionHelper(
+ com::sun::star::uno::Reference<
+ com::sun::star::lang::XMultiServiceFactory > const & rServiceFactory)
SAL_THROW(());
~UUIInteractionHelper() SAL_THROW(());
bool
- handleRequest(com::sun::star::uno::Reference<
- com::sun::star::task::XInteractionRequest > const &
- rRequest)
- throw (com::sun::star::uno::RuntimeException);
+ handleRequest(
+ com::sun::star::uno::Reference<
+ com::sun::star::task::XInteractionRequest > const & rRequest)
+ SAL_THROW((com::sun::star::uno::RuntimeException));
com::sun::star::beans::Optional< rtl::OUString >
- getStringFromRequest(com::sun::star::uno::Reference<
- com::sun::star::task::XInteractionRequest > const &
- rRequest)
- throw (com::sun::star::uno::RuntimeException);
+ getStringFromRequest(
+ com::sun::star::uno::Reference<
+ com::sun::star::task::XInteractionRequest > const & rRequest)
+ SAL_THROW((com::sun::star::uno::RuntimeException));
+
+ // Helper.
+ static ::rtl::OUString
+ replaceMessageWithArguments(
+ ::rtl::OUString aMessage,
+ std::vector< rtl::OUString > const & rArguments );
private:
bool
- handle_impl(com::sun::star::uno::Reference<
- com::sun::star::task::XInteractionRequest > const &
- rRequest)
- throw (com::sun::star::uno::RuntimeException);
-
- void
- GetInteractionHandlerList(InteractionHandlerDataList &rdataList);
+ handleRequest_impl(
+ com::sun::star::uno::Reference<
+ com::sun::star::task::XInteractionRequest > const & rRequest,
+ bool bObtainErrorStringOnly,
+ bool & bHasErrorString,
+ rtl::OUString & rErrorString)
+ SAL_THROW((com::sun::star::uno::RuntimeException));
- sal_Bool
- isDomainMatch( rtl::OUString hostName, rtl::OUString certHostName);
static long
handlerequest(void* pHandleData, void* pInteractionHandler);
com::sun::star::beans::Optional< rtl::OUString >
- getStringFromRequest_impl(com::sun::star::uno::Reference<
- com::sun::star::task::XInteractionRequest > const &
- rRequest)
- throw (com::sun::star::uno::RuntimeException);
+ getStringFromRequest_impl(
+ com::sun::star::uno::Reference<
+ com::sun::star::task::XInteractionRequest > const & rRequest)
+ SAL_THROW((com::sun::star::uno::RuntimeException));
static long
getstringfromrequest(void* pHandleData, void* pInteractionHandler);
- Window * getParentProperty() SAL_THROW(());
-
- ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow> getParentXWindow() SAL_THROW(());
+ Window *
+ getParentProperty()
+ SAL_THROW(());
- rtl::OUString getContextProperty() SAL_THROW(());
+ ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow>
+ getParentXWindow() const
+ SAL_THROW(());
- bool
- initPasswordContainer(com::sun::star::uno::Reference<
- com::sun::star::task::XPasswordContainer > *
- pContainer,
- com::sun::star::uno::Reference<
- com::sun::star::task::XUrlContainer > *
- pUrlContainer)
- const SAL_THROW(());
+ rtl::OUString
+ getContextProperty()
+ SAL_THROW(());
com::sun::star::uno::Reference< com::sun::star::task::XInteractionHandler >
- getInteractionHandler() const
- SAL_THROW((com::sun::star::uno::RuntimeException));
-
- void executeLoginDialog(LoginErrorInfo & rInfo,
- rtl::OUString const & rRealm)
+ getInteractionHandler()
SAL_THROW((com::sun::star::uno::RuntimeException));
- void
- executeMasterPasswordDialog(LoginErrorInfo & rInfo,
- com::sun::star::task::PasswordRequestMode nMode)
- SAL_THROW((com::sun::star::uno::RuntimeException));
+ bool handleTypedHandlerImplementations(
+ ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionRequest > const & rRequest
+ );
- void
- executePasswordDialog(LoginErrorInfo & rInfo,
- com::sun::star::task::PasswordRequestMode nMode,
- ::rtl::OUString aDocumentName)
+ bool
+ tryOtherInteractionHandler(
+ com::sun::star::uno::Reference<
+ com::sun::star::task::XInteractionRequest > const & rRequest)
SAL_THROW((com::sun::star::uno::RuntimeException));
void
- executeMSPasswordDialog(LoginErrorInfo & rInfo,
- com::sun::star::task::PasswordRequestMode nMode,
- ::rtl::OUString aDocumentName)
- SAL_THROW((com::sun::star::uno::RuntimeException));
-
- void executeCookieDialog(CntHTTPCookieRequest & rRequest)
+ getInteractionHandlerList(InteractionHandlerDataList &rdataList)
SAL_THROW((com::sun::star::uno::RuntimeException));
- void executeFilterDialog(rtl::OUString const & rURL ,
- uui::FilterNameList const & rFilters,
- rtl::OUString & rFilter )
- SAL_THROW((com::sun::star::uno::RuntimeException));
-
- sal_Bool executeUnknownAuthDialog( const cssu::Reference< dcss::security::XCertificate >& rXCert )
- SAL_THROW((com::sun::star::uno::RuntimeException));
-
- sal_Bool executeSSLWarnDialog( const cssu::Reference< dcss::security::XCertificate >& rXCert,
- sal_Int32 const & failures,
- const rtl::OUString & hostName)
- SAL_THROW((com::sun::star::uno::RuntimeException));
+ static bool
+ isInformationalErrorMessageRequest(
+ com::sun::star::uno::Sequence<
+ com::sun::star::uno::Reference<
+ com::sun::star::task::XInteractionContinuation > > const &
+ rContinuations);
- rtl::OUString
- getLocalizedDatTimeStr( ::com::sun::star::util::DateTime aDateTime );
-
- USHORT
- executeErrorDialog(com::sun::star::task::InteractionClassification
- eClassification,
- rtl::OUString const & rContext,
- rtl::OUString const & rMessage,
- WinBits nButtonMask )
- SAL_THROW((com::sun::star::uno::RuntimeException));
+ //=====================================================================
- USHORT
- executeMessageBox( rtl::OUString const & rTitle,
- rtl::OUString const & rMessage,
- WinBits nButtonMask )
+ bool
+ handleInteractiveIOException(
+ com::sun::star::uno::Reference<
+ com::sun::star::task::XInteractionRequest > const & rRequest,
+ bool bObtainErrorStringOnly,
+ bool & bHasErrorString,
+ rtl::OUString & rErrorString)
SAL_THROW((com::sun::star::uno::RuntimeException));
- void
+ bool
handleAuthenticationRequest(
- com::sun::star::ucb::AuthenticationRequest const & rRequest,
- com::sun::star::uno::Sequence<
com::sun::star::uno::Reference<
- com::sun::star::task::XInteractionContinuation > > const &
- rContinuations,
- rtl::OUString const & rURL)
+ com::sun::star::task::XInteractionRequest > const & rRequest)
SAL_THROW((com::sun::star::uno::RuntimeException));
- void
+ bool
handleCertificateValidationRequest(
- com::sun::star::ucb::CertificateValidationRequest const & rRequest,
- com::sun::star::uno::Sequence<
com::sun::star::uno::Reference<
- com::sun::star::task::XInteractionContinuation > > const &
- rContinuations)
+ com::sun::star::task::XInteractionRequest > const & rRequest)
SAL_THROW((com::sun::star::uno::RuntimeException));
// @@@ Todo #i29340#: activate!
@@ -272,181 +220,160 @@ private:
void
handleNameClashResolveRequest(
com::sun::star::ucb::NameClashResolveRequest const & rRequest,
- com::sun::star::uno::Sequence< com::sun::star::uno::Reference<
- com::sun::star::task::XInteractionContinuation > > const &
- rContinuations)
+ com::sun::star::uno::Sequence<
+ com::sun::star::uno::Reference<
+ com::sun::star::task::XInteractionContinuation > > const &
+ rContinuations)
SAL_THROW((com::sun::star::uno::RuntimeException));
-#endif
- void
+ bool
handleMasterPasswordRequest(
- com::sun::star::task::PasswordRequestMode nMode,
- com::sun::star::uno::Sequence<
com::sun::star::uno::Reference<
- com::sun::star::task::XInteractionContinuation > > const &
- rContinuations)
+ com::sun::star::task::XInteractionRequest > const & rRequest)
SAL_THROW((com::sun::star::uno::RuntimeException));
-
- void
+ bool
handlePasswordRequest(
- com::sun::star::task::PasswordRequestMode nMode,
- com::sun::star::uno::Sequence<
- com::sun::star::uno::Reference<
- com::sun::star::task::XInteractionContinuation > > const &
- rContinuations,
- ::rtl::OUString aDocumentName = ::rtl::OUString())
- SAL_THROW((com::sun::star::uno::RuntimeException));
-
- void
- handleMSPasswordRequest(
- com::sun::star::task::PasswordRequestMode nMode,
- com::sun::star::uno::Sequence<
com::sun::star::uno::Reference<
- com::sun::star::task::XInteractionContinuation > > const &
- rContinuations,
- ::rtl::OUString aDocumentName = ::rtl::OUString())
+ com::sun::star::task::XInteractionRequest > const & rRequest)
SAL_THROW((com::sun::star::uno::RuntimeException));
- void
+ bool
handleCookiesRequest(
- com::sun::star::ucb::HandleCookiesRequest const & rRequest,
- com::sun::star::uno::Sequence<
com::sun::star::uno::Reference<
- com::sun::star::task::XInteractionContinuation > > const &
- rContinuations)
+ com::sun::star::task::XInteractionRequest > const & rRequest)
SAL_THROW((com::sun::star::uno::RuntimeException));
- void
+ bool
handleNoSuchFilterRequest(
- com::sun::star::document::NoSuchFilterRequest const & rRequest,
- com::sun::star::uno::Sequence<
com::sun::star::uno::Reference<
- com::sun::star::task::XInteractionContinuation > > const &
- rContinuations)
+ com::sun::star::task::XInteractionRequest > const & rRequest)
SAL_THROW((com::sun::star::uno::RuntimeException));
- void
+ bool
handleAmbigousFilterRequest(
- com::sun::star::document::AmbigousFilterRequest const & rRequest,
- com::sun::star::uno::Sequence<
com::sun::star::uno::Reference<
- com::sun::star::task::XInteractionContinuation > > const &
- rContinuations)
+ com::sun::star::task::XInteractionRequest > const & rRequest)
SAL_THROW((com::sun::star::uno::RuntimeException));
- void
+ bool
handleFilterOptionsRequest(
- com::sun::star::document::FilterOptionsRequest const & rRequest,
- com::sun::star::uno::Sequence<
com::sun::star::uno::Reference<
- com::sun::star::task::XInteractionContinuation > > const &
- rContinuations)
+ com::sun::star::task::XInteractionRequest > const & rRequest)
SAL_THROW((com::sun::star::uno::RuntimeException));
+#endif
void
- handleErrorRequest(
+ handleErrorHandlerRequest(
com::sun::star::task::InteractionClassification eClassification,
ErrCode nErrorCode,
std::vector< rtl::OUString > const & rArguments,
com::sun::star::uno::Sequence<
- com::sun::star::uno::Reference<
- com::sun::star::task::XInteractionContinuation > > const &
- rContinuations,
- bool bObtainErrorStringOnly,
- bool & bHasErrorString,
- rtl::OUString & rErrorString)
+ com::sun::star::uno::Reference<
+ com::sun::star::task::XInteractionContinuation > > const &
+ rContinuations,
+ bool bObtainErrorStringOnly,
+ bool & bHasErrorString,
+ rtl::OUString & rErrorString)
SAL_THROW((com::sun::star::uno::RuntimeException));
void
handleGenericErrorRequest(
- sal_Int32 nErrorCode,
+ sal_Int32 nErrorCode,
com::sun::star::uno::Sequence<
- com::sun::star::uno::Reference<
- com::sun::star::task::XInteractionContinuation > > const &
- rContinuations,
- bool bObtainErrorStringOnly,
- bool & bHasErrorString,
- rtl::OUString & rErrorString)
+ com::sun::star::uno::Reference<
+ com::sun::star::task::XInteractionContinuation > > const &
+ rContinuations,
+ bool bObtainErrorStringOnly,
+ bool & bHasErrorString,
+ rtl::OUString & rErrorString)
SAL_THROW((com::sun::star::uno::RuntimeException));
void
handleMacroConfirmRequest(
const ::rtl::OUString& aDocumentURL,
- const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xZipStorage,
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::embed::XStorage >& xZipStorage,
const ::rtl::OUString& aDocumentVersion,
- const ::com::sun::star::uno::Sequence< ::com::sun::star::security::DocumentSignatureInformation > aSignInfo,
+ const ::com::sun::star::uno::Sequence<
+ ::com::sun::star::security::DocumentSignatureInformation >
+ aSignInfo,
com::sun::star::uno::Sequence<
com::sun::star::uno::Reference<
com::sun::star::task::XInteractionContinuation > > const &
- rContinuations
- )
+ rContinuations)
SAL_THROW((com::sun::star::uno::RuntimeException));
void
handleFutureDocumentVersionUpdateRequest(
- const ::com::sun::star::task::FutureDocumentVersionProductUpdateRequest& _rRequest,
+ const ::com::sun::star::task::FutureDocumentVersionProductUpdateRequest&
+ _rRequest,
com::sun::star::uno::Sequence<
com::sun::star::uno::Reference<
com::sun::star::task::XInteractionContinuation > > const &
- rContinuations
- )
+ rContinuations)
SAL_THROW((com::sun::star::uno::RuntimeException));
void
handleBrokenPackageRequest(
- std::vector< rtl::OUString > const & rArguments,
- ::com::sun::star::uno::Sequence<
- ::com::sun::star::uno::Reference<
- ::com::sun::star::task::XInteractionContinuation > > const &
- rContinuations,
- bool bObtainErrorStringOnly,
- bool & bHasErrorString,
- rtl::OUString & rErrorString)
+ std::vector< rtl::OUString > const & rArguments,
+ ::com::sun::star::uno::Sequence<
+ ::com::sun::star::uno::Reference<
+ ::com::sun::star::task::XInteractionContinuation > > const &
+ rContinuations,
+ bool bObtainErrorStringOnly,
+ bool & bHasErrorString,
+ rtl::OUString & rErrorString)
SAL_THROW((::com::sun::star::uno::RuntimeException));
- bool handleMessageboxRequests(
- ::com::sun::star::uno::Reference<
- ::com::sun::star::task::XInteractionRequest > const &
- rRequest,
- bool bObtainErrorStringOnly,
- bool & bHasErrorString,
- rtl::OUString & rErrorString);
-
- bool handleDialogRequests(
- ::com::sun::star::uno::Reference<
- ::com::sun::star::task::XInteractionRequest > const &
- rRequest);
-
- bool handleErrorHandlerRequests(
- ::com::sun::star::uno::Reference<
- ::com::sun::star::task::XInteractionRequest > const &
- rRequest,
- bool bObtainErrorStringOnly,
- bool & bHasErrorString,
- rtl::OUString & rErrorString);
-
- void handleLockedDocumentRequest(
- const ::rtl::OUString& aDocumentURL,
- const ::rtl::OUString& aInfo,
- ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference<
- ::com::sun::star::task::XInteractionContinuation > > const &
- rContinuations,
- sal_uInt16 nMode )
+ bool handleLockedDocumentRequest(
+ com::sun::star::uno::Reference<
+ com::sun::star::task::XInteractionRequest > const & rRequest)
SAL_THROW((::com::sun::star::uno::RuntimeException));
- void handleChangedByOthersRequest(
- ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference<
- ::com::sun::star::task::XInteractionContinuation > > const &
- rContinuations )
+ bool handleChangedByOthersRequest(
+ com::sun::star::uno::Reference<
+ com::sun::star::task::XInteractionRequest > const & rRequest)
SAL_THROW((::com::sun::star::uno::RuntimeException));
- void handleLockFileIgnoreRequest(
- ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference<
- ::com::sun::star::task::XInteractionContinuation > > const &
- rContinuations )
+ bool handleLockFileIgnoreRequest(
+ com::sun::star::uno::Reference<
+ com::sun::star::task::XInteractionRequest > const & rRequest)
SAL_THROW((::com::sun::star::uno::RuntimeException));
+ bool handleCustomRequest(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionRequest >& i_rRequest,
+ const ::rtl::OUString& i_rServiceName
+ ) const;
+};
+
+class ErrorResource: private Resource
+{
+public:
+ inline ErrorResource(ResId & rResId) SAL_THROW(()): Resource(rResId) {}
+
+ inline ~ErrorResource() SAL_THROW(()) { FreeResource(); }
+
+ bool getString(ErrCode nErrorCode, rtl::OUString * pString) const
+ SAL_THROW(());
+};
+
+/*
+class InteractionRequest
+{
+public:
+ InteractionRequest(
+ com::sun::star::uno::Reference<
+ com::sun::star::task::XInteractionRequest > const & rRequest)
+ : m_aRequest( rRequest ) {}
+
+ virtual bool toString( rtl::OUString & rString ) = 0;
+ virtual bool handle( rtl::OUString & rString ) = 0;
+
+private:
+ com::sun::star::uno::Reference<
+ com::sun::star::task::XInteractionRequest > m_aRequest;
};
+*/
#endif // UUI_IAHNDL_HXX
diff --git a/uui/source/ids.hrc b/uui/source/ids.hrc
index 08624a3dda4e..9bf5856bc270 100644
--- a/uui/source/ids.hrc
+++ b/uui/source/ids.hrc
@@ -2,13 +2,10 @@
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
- * Copyright 2008 by Sun Microsystems, Inc.
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: ids.hrc,v $
- * $Revision: 1.26.22.1 $
- *
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
@@ -32,7 +29,7 @@
#define UUI_IDS_HRC
#ifndef _SOLAR_HRC
-#include "svtools/solar.hrc"
+#include "svl/solar.hrc"
#endif
#ifndef _ERRCODE_HXX
#include "tools/errcode.hxx"
@@ -149,6 +146,10 @@
#define ERRCODE_UUI_CONFIGURATION_BACKENDMISSING_WITHRECOVER (ERRCODE_AREA_UUI + 56)
#define ERRCODE_UUI_INVALID_XFORMS_SUBMISSION_DATA (ERRCODE_AREA_UUI + 57)
#define ERRCODE_UUI_IO_MODULESIZEEXCEEDED (ERRCODE_AREA_UUI + 58)
+#define ERRCODE_UUI_LOCKING_LOCKED (ERRCODE_AREA_UUI + 59)
+#define ERRCODE_UUI_LOCKING_LOCKED_SELF (ERRCODE_AREA_UUI + 60)
+#define ERRCODE_UUI_LOCKING_NOT_LOCKED (ERRCODE_AREA_UUI + 61)
+#define ERRCODE_UUI_LOCKING_LOCK_EXPIRED (ERRCODE_AREA_UUI + 62)
#define ERRCODE_AREA_UUI_UNKNOWNAUTH 25000
#define SSLWARN_TYPE_DOMAINMISMATCH 10
diff --git a/uui/source/ids.src b/uui/source/ids.src
index fc82161bbb81..378b513b2e42 100644
--- a/uui/source/ids.src
+++ b/uui/source/ids.src
@@ -2,13 +2,10 @@
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
- * Copyright 2008 by Sun Microsystems, Inc.
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: ids.src,v $
- * $Revision: 1.69 $
- *
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
@@ -351,6 +348,27 @@ Resource RID_UUI_ERRHDL
Text [ en-US ] = "The form contains invalid data. Do you still want to continue?";
};
+ String (ERRCODE_UUI_LOCKING_LOCKED & ERRCODE_RES_MASK)
+ {
+ Text [ en-US ] = "The file $(ARG1) is locked by another user. Currently, another write access to this file cannot be granted.";
+
+ };
+
+ String (ERRCODE_UUI_LOCKING_LOCKED_SELF & ERRCODE_RES_MASK)
+ {
+ Text [ en-US ] = "The file $(ARG1) is locked by yourself. Currently, another write access to this file cannot be granted.";
+ };
+
+ String (ERRCODE_UUI_LOCKING_NOT_LOCKED & ERRCODE_RES_MASK)
+ {
+ Text [ en-US ] = "The file $(ARG1) is currently not locked by yourself.";
+ };
+
+ String (ERRCODE_UUI_LOCKING_LOCK_EXPIRED & ERRCODE_RES_MASK)
+ {
+ Text [ en-US ] = "The previously obtained lock for file $(ARG1) has expired.\nThis can happen due to problems on the server managing the file lock. It cannot be guaranteed that write operations on this file will not overwrite changes done by other users!";
+ };
+
STRING (ERRCODE_UUI_UNKNOWNAUTH_UNTRUSTED)
{
Text [ en-US ] = "Unable to verify the identity of $(ARG1) site.\n\nBefore accepting this certificate, you should examine this site's certificate carefully. Are you willing to accept this certificate for the purpose of identifying the Web site $(ARG1)?";
diff --git a/uui/source/interactionhandler.cxx b/uui/source/interactionhandler.cxx
index 87b510964d8e..ef4b3f7b0a71 100644
--- a/uui/source/interactionhandler.cxx
+++ b/uui/source/interactionhandler.cxx
@@ -2,13 +2,10 @@
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
- * Copyright 2008 by Sun Microsystems, Inc.
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: interactionhandler.cxx,v $
- * $Revision: 1.3 $
- *
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
diff --git a/uui/source/interactionhandler.hxx b/uui/source/interactionhandler.hxx
index 5f3216f5d20b..d470a07c9795 100644
--- a/uui/source/interactionhandler.hxx
+++ b/uui/source/interactionhandler.hxx
@@ -2,13 +2,10 @@
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
- * Copyright 2008 by Sun Microsystems, Inc.
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: interactionhandler.hxx,v $
- * $Revision: 1.3 $
- *
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
diff --git a/uui/source/lockfailed.cxx b/uui/source/lockfailed.cxx
index 20a3ff4798bd..7591deaff1c8 100644
--- a/uui/source/lockfailed.cxx
+++ b/uui/source/lockfailed.cxx
@@ -2,13 +2,10 @@
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
- * Copyright 2008 by Sun Microsystems, Inc.
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: openlocked.cxx,v $
- * $Revision: 1.3 $
- *
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
diff --git a/uui/source/lockfailed.hxx b/uui/source/lockfailed.hxx
index 9d368037475d..2336d366ba80 100644
--- a/uui/source/lockfailed.hxx
+++ b/uui/source/lockfailed.hxx
@@ -2,13 +2,10 @@
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
- * Copyright 2008 by Sun Microsystems, Inc.
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: openlocked.hxx,v $
- * $Revision: 1.3 $
- *
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
diff --git a/uui/source/lockfailed.src b/uui/source/lockfailed.src
index 6b21d6fc6448..1a3e1534d0ff 100644
--- a/uui/source/lockfailed.src
+++ b/uui/source/lockfailed.src
@@ -2,13 +2,10 @@
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
- * Copyright 2008 by Sun Microsystems, Inc.
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: openlocked.src,v $
- * $Revision: 1.3 $
- *
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
@@ -40,7 +37,7 @@ String STR_LOCKFAILED_TITLE
};
String STR_LOCKFAILED_MSG
{
- Text [ en-US ] = "The file could not be locked for exclusive access by %PRODUCTNAME, due to missing permission to created a lock file on that file location.";
+ Text [ en-US ] = "The file could not be locked for exclusive access by %PRODUCTNAME, due to missing permission to create a lock file on that file location.";
};
String STR_LOCKFAILED_DONTSHOWAGAIN
{
diff --git a/uui/source/logindlg.cxx b/uui/source/logindlg.cxx
index 195dcaaf2648..53ea243c9577 100644
--- a/uui/source/logindlg.cxx
+++ b/uui/source/logindlg.cxx
@@ -2,13 +2,10 @@
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
- * Copyright 2008 by Sun Microsystems, Inc.
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: logindlg.cxx,v $
- * $Revision: 1.8 $
- *
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
diff --git a/uui/source/logindlg.hrc b/uui/source/logindlg.hrc
index a9c1ff853d85..68162fb620cd 100644
--- a/uui/source/logindlg.hrc
+++ b/uui/source/logindlg.hrc
@@ -2,13 +2,10 @@
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
- * Copyright 2008 by Sun Microsystems, Inc.
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: logindlg.hrc,v $
- * $Revision: 1.4 $
- *
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
diff --git a/uui/source/logindlg.hxx b/uui/source/logindlg.hxx
index c88bc7a93aad..0a4637d89251 100644
--- a/uui/source/logindlg.hxx
+++ b/uui/source/logindlg.hxx
@@ -2,13 +2,10 @@
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
- * Copyright 2008 by Sun Microsystems, Inc.
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: logindlg.hxx,v $
- * $Revision: 1.4 $
- *
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
diff --git a/uui/source/logindlg.src b/uui/source/logindlg.src
index 7450a389e7e5..ce998f4945be 100644
--- a/uui/source/logindlg.src
+++ b/uui/source/logindlg.src
@@ -2,13 +2,10 @@
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
- * Copyright 2008 by Sun Microsystems, Inc.
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: logindlg.src,v $
- * $Revision: 1.42 $
- *
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
diff --git a/uui/source/loginerr.hxx b/uui/source/loginerr.hxx
index 6fc00c3b1eac..c8cbba96564b 100644
--- a/uui/source/loginerr.hxx
+++ b/uui/source/loginerr.hxx
@@ -2,13 +2,10 @@
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
- * Copyright 2008 by Sun Microsystems, Inc.
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: loginerr.hxx,v $
- * $Revision: 1.3 $
- *
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
diff --git a/uui/source/makefile.mk b/uui/source/makefile.mk
index 95b998ffd36d..5c20e593046a 100644
--- a/uui/source/makefile.mk
+++ b/uui/source/makefile.mk
@@ -1,15 +1,11 @@
#*************************************************************************
#
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2008 by Sun Microsystems, Inc.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
#
# OpenOffice.org - a multi-platform office productivity suite
#
-# $RCSfile: makefile.mk,v $
-#
-# $Revision: 1.12.22.1 $
-#
# This file is part of OpenOffice.org.
#
# OpenOffice.org is free software: you can redistribute it and/or modify
@@ -39,6 +35,13 @@ ENABLE_EXCEPTIONS = true
SLOFILES = \
$(SLO)$/cookiedg.obj \
$(SLO)$/iahndl.obj \
+ $(SLO)$/iahndl-authentication.obj \
+ $(SLO)$/iahndl-ssl.obj \
+ $(SLO)$/iahndl-cookies.obj \
+ $(SLO)$/iahndl-filter.obj \
+ $(SLO)$/iahndl-locking.obj \
+ $(SLO)$/iahndl-ioexceptions.obj \
+ $(SLO)$/iahndl-errorhandler.obj \
$(SLO)$/logindlg.obj \
$(SLO)$/services.obj \
$(SLO)$/masterpassworddlg.obj \
@@ -46,17 +49,18 @@ SLOFILES = \
$(SLO)$/openlocked.obj \
$(SLO)$/passworddlg.obj \
$(SLO)$/passcrtdlg.obj \
- $(SLO)$/fltdlg.obj\
- $(SLO)$/interactionhandler.obj\
- $(SLO)$/requeststringresolver.obj\
- $(SLO)$/unknownauthdlg.obj\
- $(SLO)$/sslwarndlg.obj\
- $(SLO)$/secmacrowarnings.obj\
- $(SLO)$/filechanged.obj\
- $(SLO)$/alreadyopen.obj\
- $(SLO)$/lockfailed.obj\
- $(SLO)$/trylater.obj\
- $(SLO)$/newerverwarn.obj
+ $(SLO)$/fltdlg.obj \
+ $(SLO)$/interactionhandler.obj \
+ $(SLO)$/requeststringresolver.obj \
+ $(SLO)$/unknownauthdlg.obj \
+ $(SLO)$/sslwarndlg.obj \
+ $(SLO)$/secmacrowarnings.obj \
+ $(SLO)$/filechanged.obj \
+ $(SLO)$/alreadyopen.obj \
+ $(SLO)$/lockfailed.obj \
+ $(SLO)$/trylater.obj \
+ $(SLO)$/newerverwarn.obj \
+ $(SLO)$/passwordcontainer.obj
SRS1NAME=$(TARGET)
SRC1FILES = \
diff --git a/uui/source/masterpasscrtdlg.cxx b/uui/source/masterpasscrtdlg.cxx
index bec0d36e0acb..af2ef194f22e 100644
--- a/uui/source/masterpasscrtdlg.cxx
+++ b/uui/source/masterpasscrtdlg.cxx
@@ -2,13 +2,10 @@
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
- * Copyright 2008 by Sun Microsystems, Inc.
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: masterpasscrtdlg.cxx,v $
- * $Revision: 1.4 $
- *
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
diff --git a/uui/source/masterpasscrtdlg.hrc b/uui/source/masterpasscrtdlg.hrc
index 1c10e849fb5b..ff84830b5842 100644
--- a/uui/source/masterpasscrtdlg.hrc
+++ b/uui/source/masterpasscrtdlg.hrc
@@ -2,13 +2,10 @@
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
- * Copyright 2008 by Sun Microsystems, Inc.
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: masterpasscrtdlg.hrc,v $
- * $Revision: 1.3 $
- *
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
diff --git a/uui/source/masterpasscrtdlg.hxx b/uui/source/masterpasscrtdlg.hxx
index 26d130a7a737..29134b6b8fbc 100644
--- a/uui/source/masterpasscrtdlg.hxx
+++ b/uui/source/masterpasscrtdlg.hxx
@@ -2,13 +2,10 @@
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
- * Copyright 2008 by Sun Microsystems, Inc.
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: masterpasscrtdlg.hxx,v $
- * $Revision: 1.3 $
- *
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
diff --git a/uui/source/masterpasscrtdlg.src b/uui/source/masterpasscrtdlg.src
index e11d9abd166d..870cc8a2456f 100644
--- a/uui/source/masterpasscrtdlg.src
+++ b/uui/source/masterpasscrtdlg.src
@@ -2,13 +2,10 @@
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
- * Copyright 2008 by Sun Microsystems, Inc.
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: masterpasscrtdlg.src,v $
- * $Revision: 1.12 $
- *
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
diff --git a/uui/source/masterpassworddlg.cxx b/uui/source/masterpassworddlg.cxx
index 0f2b8018d8ad..a5e35eaf755b 100644
--- a/uui/source/masterpassworddlg.cxx
+++ b/uui/source/masterpassworddlg.cxx
@@ -2,13 +2,10 @@
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
- * Copyright 2008 by Sun Microsystems, Inc.
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: masterpassworddlg.cxx,v $
- * $Revision: 1.5 $
- *
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
diff --git a/uui/source/masterpassworddlg.hrc b/uui/source/masterpassworddlg.hrc
index 7732d0cf1189..7263b577a8cf 100644
--- a/uui/source/masterpassworddlg.hrc
+++ b/uui/source/masterpassworddlg.hrc
@@ -2,13 +2,10 @@
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
- * Copyright 2008 by Sun Microsystems, Inc.
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: masterpassworddlg.hrc,v $
- * $Revision: 1.3 $
- *
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
diff --git a/uui/source/masterpassworddlg.hxx b/uui/source/masterpassworddlg.hxx
index 3dcabbabb1b0..a78cb6eb50b8 100644
--- a/uui/source/masterpassworddlg.hxx
+++ b/uui/source/masterpassworddlg.hxx
@@ -2,13 +2,10 @@
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
- * Copyright 2008 by Sun Microsystems, Inc.
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: masterpassworddlg.hxx,v $
- * $Revision: 1.3 $
- *
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
diff --git a/uui/source/masterpassworddlg.src b/uui/source/masterpassworddlg.src
index ad0f025febea..c7bc835d92ee 100644
--- a/uui/source/masterpassworddlg.src
+++ b/uui/source/masterpassworddlg.src
@@ -2,13 +2,10 @@
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
- * Copyright 2008 by Sun Microsystems, Inc.
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: masterpassworddlg.src,v $
- * $Revision: 1.11 $
- *
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
diff --git a/uui/source/mphndl.hxx b/uui/source/mphndl.hxx
index e8ea809899eb..855b4b67f778 100644
--- a/uui/source/mphndl.hxx
+++ b/uui/source/mphndl.hxx
@@ -2,13 +2,10 @@
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
- * Copyright 2008 by Sun Microsystems, Inc.
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: mphndl.hxx,v $
- * $Revision: 1.4 $
- *
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
diff --git a/uui/source/newerverwarn.cxx b/uui/source/newerverwarn.cxx
index e70faa2477c1..f5d735b38d5b 100644
--- a/uui/source/newerverwarn.cxx
+++ b/uui/source/newerverwarn.cxx
@@ -2,13 +2,10 @@
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
- * Copyright 2008 by Sun Microsystems, Inc.
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: newerverwarn.cxx,v $
- * $Revision: 1.1.2.1 $
- *
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
diff --git a/uui/source/newerverwarn.hrc b/uui/source/newerverwarn.hrc
index 29dd8999edcb..9097cf026b08 100644
--- a/uui/source/newerverwarn.hrc
+++ b/uui/source/newerverwarn.hrc
@@ -2,13 +2,10 @@
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
- * Copyright 2008 by Sun Microsystems, Inc.
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: newerverwarn.hrc,v $
- * $Revision: 1.1.2.1 $
- *
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
diff --git a/uui/source/newerverwarn.hxx b/uui/source/newerverwarn.hxx
index 8cc2525eed9d..574f3587daee 100644
--- a/uui/source/newerverwarn.hxx
+++ b/uui/source/newerverwarn.hxx
@@ -2,13 +2,10 @@
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
- * Copyright 2008 by Sun Microsystems, Inc.
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: newerverwarn.hxx,v $
- * $Revision: 1.1.2.1 $
- *
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
diff --git a/uui/source/newerverwarn.src b/uui/source/newerverwarn.src
index 22c6916eadab..3de289d69baa 100644
--- a/uui/source/newerverwarn.src
+++ b/uui/source/newerverwarn.src
@@ -2,13 +2,10 @@
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
- * Copyright 2008 by Sun Microsystems, Inc.
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: newerverwarn.src,v $
- * $Revision: 1.1.2.1 $
- *
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
diff --git a/uui/source/openlocked.cxx b/uui/source/openlocked.cxx
index fa54eea1bc09..6112f157ca27 100644
--- a/uui/source/openlocked.cxx
+++ b/uui/source/openlocked.cxx
@@ -2,13 +2,10 @@
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
- * Copyright 2008 by Sun Microsystems, Inc.
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: openlocked.cxx,v $
- * $Revision: 1.3 $
- *
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
diff --git a/uui/source/openlocked.hxx b/uui/source/openlocked.hxx
index 7114e814a838..c72704848fcc 100644
--- a/uui/source/openlocked.hxx
+++ b/uui/source/openlocked.hxx
@@ -2,13 +2,10 @@
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
- * Copyright 2008 by Sun Microsystems, Inc.
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: openlocked.hxx,v $
- * $Revision: 1.3 $
- *
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
diff --git a/uui/source/openlocked.src b/uui/source/openlocked.src
index 58d65f54a4d3..9ec075774352 100644
--- a/uui/source/openlocked.src
+++ b/uui/source/openlocked.src
@@ -2,13 +2,10 @@
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
- * Copyright 2008 by Sun Microsystems, Inc.
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: openlocked.src,v $
- * $Revision: 1.3 $
- *
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
diff --git a/uui/source/passcrtdlg.cxx b/uui/source/passcrtdlg.cxx
index a6db44697918..1fc6024bcd19 100644
--- a/uui/source/passcrtdlg.cxx
+++ b/uui/source/passcrtdlg.cxx
@@ -2,13 +2,10 @@
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
- * Copyright 2008 by Sun Microsystems, Inc.
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: passcrtdlg.cxx,v $
- * $Revision: 1.6 $
- *
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
diff --git a/uui/source/passcrtdlg.hrc b/uui/source/passcrtdlg.hrc
index c36bec4bc9a6..5a999aa99209 100644
--- a/uui/source/passcrtdlg.hrc
+++ b/uui/source/passcrtdlg.hrc
@@ -2,13 +2,10 @@
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
- * Copyright 2008 by Sun Microsystems, Inc.
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: passcrtdlg.hrc,v $
- * $Revision: 1.4 $
- *
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
diff --git a/uui/source/passcrtdlg.hxx b/uui/source/passcrtdlg.hxx
index b4f0f61644d6..8ad19c59924d 100644
--- a/uui/source/passcrtdlg.hxx
+++ b/uui/source/passcrtdlg.hxx
@@ -2,13 +2,10 @@
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
- * Copyright 2008 by Sun Microsystems, Inc.
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: passcrtdlg.hxx,v $
- * $Revision: 1.4 $
- *
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
diff --git a/uui/source/passcrtdlg.src b/uui/source/passcrtdlg.src
index 81629d955343..a74752ed589e 100644
--- a/uui/source/passcrtdlg.src
+++ b/uui/source/passcrtdlg.src
@@ -2,13 +2,10 @@
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
- * Copyright 2008 by Sun Microsystems, Inc.
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: passcrtdlg.src,v $
- * $Revision: 1.22 $
- *
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
diff --git a/uui/source/passwordcontainer.cxx b/uui/source/passwordcontainer.cxx
new file mode 100644
index 000000000000..26d22b320d8a
--- /dev/null
+++ b/uui/source/passwordcontainer.cxx
@@ -0,0 +1,470 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#include "cppuhelper/factory.hxx"
+
+#include "com/sun/star/lang/XMultiServiceFactory.hpp"
+#include "com/sun/star/task/NoMasterException.hpp"
+#include "com/sun/star/task/XInteractionHandler.hpp"
+#include "com/sun/star/task/XPasswordContainer.hpp"
+#include "com/sun/star/task/XUrlContainer.hpp"
+#include "com/sun/star/ucb/AuthenticationRequest.hpp"
+#include "com/sun/star/ucb/URLAuthenticationRequest.hpp"
+#include "com/sun/star/ucb/XInteractionSupplyAuthentication.hpp"
+#include "com/sun/star/ucb/XInteractionSupplyAuthentication2.hpp"
+
+#include "passwordcontainer.hxx"
+
+using namespace com::sun::star;
+
+namespace {
+
+//=========================================================================
+bool fillContinuation(
+ bool bUseSystemCredentials,
+ const ucb::AuthenticationRequest & rRequest,
+ const task::UrlRecord & aRec,
+ const uno::Reference< ucb::XInteractionSupplyAuthentication > &
+ xSupplyAuthentication,
+ const uno::Reference< ucb::XInteractionSupplyAuthentication2 > &
+ xSupplyAuthentication2,
+ bool bCanUseSystemCredentials,
+ bool bCheckForEqualPasswords )
+{
+ if ( bUseSystemCredentials )
+ {
+ // "use system creds" record found.
+ // Wants client that we use it?
+ if ( xSupplyAuthentication2.is() && bCanUseSystemCredentials )
+ {
+ xSupplyAuthentication2->setUseSystemCredentials( sal_True );
+ return true;
+ }
+ return false;
+ }
+ else if (aRec.UserList.getLength() != 0)
+ {
+ if (aRec.UserList[0].Passwords.getLength() == 0)
+ {
+ // Password sequence can be empty, for instance if master
+ // password was not given (e.g. master pw dialog canceled)
+ // pw container does not throw NoMasterException in this case.
+ // bug???
+ return false;
+ }
+
+ // "user/pass" record found.
+ if (!bCheckForEqualPasswords || !rRequest.HasPassword
+ || rRequest.Password != aRec.UserList[0].Passwords[0]) // failed login attempt?
+ {
+ if (xSupplyAuthentication->canSetUserName())
+ xSupplyAuthentication->
+ setUserName(aRec.UserList[0].UserName.getStr());
+
+ if (xSupplyAuthentication->canSetPassword())
+ xSupplyAuthentication->
+ setPassword(aRec.UserList[0].Passwords[0].getStr());
+ if (aRec.UserList[0].Passwords.getLength() > 1)
+ {
+ if (rRequest.HasRealm)
+ {
+ if (xSupplyAuthentication->canSetRealm())
+ xSupplyAuthentication->
+ setRealm(aRec.UserList[0].Passwords[1].
+ getStr());
+ }
+ else if (xSupplyAuthentication->canSetAccount())
+ xSupplyAuthentication->
+ setAccount(aRec.UserList[0].Passwords[1].
+ getStr());
+ }
+
+ if ( xSupplyAuthentication2.is() && bCanUseSystemCredentials )
+ xSupplyAuthentication2->setUseSystemCredentials( sal_False );
+
+ return true;
+ }
+ }
+ return false;
+}
+
+} // namespace
+
+namespace uui {
+
+//=========================================================================
+PasswordContainerHelper::PasswordContainerHelper(
+ uno::Reference< lang::XMultiServiceFactory > const & xServiceFactory )
+{
+ OSL_ENSURE(xServiceFactory.is(), "no service factory given!");
+ if (xServiceFactory.is())
+ try
+ {
+ m_xPasswordContainer
+ = uno::Reference< task::XPasswordContainer >(
+ xServiceFactory->
+ createInstance(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.task.PasswordContainer"))),
+ uno::UNO_QUERY);
+ }
+ catch (uno::Exception const &)
+ {}
+ OSL_ENSURE(m_xPasswordContainer.is(),
+ "unable to instanciate password container service");
+}
+
+//=========================================================================
+bool PasswordContainerHelper::handleAuthenticationRequest(
+ ucb::AuthenticationRequest const & rRequest,
+ uno::Reference< ucb::XInteractionSupplyAuthentication > const &
+ xSupplyAuthentication,
+ rtl::OUString const & rURL,
+ uno::Reference< task::XInteractionHandler > const & xIH )
+ SAL_THROW((uno::RuntimeException))
+{
+ // Is continuation even a XInteractionSupplyAuthentication2, which
+ // is derived from XInteractionSupplyAuthentication?
+ uno::Reference< ucb::XInteractionSupplyAuthentication2 >
+ xSupplyAuthentication2(xSupplyAuthentication, uno::UNO_QUERY);
+
+ sal_Bool bCanUseSystemCredentials = sal_False;
+ if (xSupplyAuthentication2.is())
+ {
+ sal_Bool bDefaultUseSystemCredentials;
+ bCanUseSystemCredentials
+ = xSupplyAuthentication2->canUseSystemCredentials(
+ bDefaultUseSystemCredentials );
+ }
+
+ uno::Reference< task::XPasswordContainer > xContainer(
+ m_xPasswordContainer );
+ uno::Reference< task::XUrlContainer > xUrlContainer(
+ m_xPasswordContainer, uno::UNO_QUERY );
+ OSL_ENSURE( xUrlContainer.is(), "Got no XUrlContainer!" );
+
+ if ( !xContainer.is() || !xUrlContainer.is() )
+ return false;
+
+ if ( bCanUseSystemCredentials )
+ {
+ // Runtime / Persistent info avail for current auth request?
+
+ rtl::OUString aResult = xUrlContainer->findUrl(
+ rURL.getLength() ? rURL : rRequest.ServerName );
+ if ( aResult.getLength() > 0 )
+ {
+ if ( fillContinuation( true,
+ rRequest,
+ task::UrlRecord(),
+ xSupplyAuthentication,
+ xSupplyAuthentication2,
+ bCanUseSystemCredentials,
+ false ) )
+ {
+ return true;
+ }
+ }
+ }
+
+ // xContainer works with userName passwdSequences pairs:
+ if (rRequest.HasUserName && rRequest.HasPassword)
+ {
+ try
+ {
+ if (rRequest.UserName.getLength() == 0)
+ {
+ task::UrlRecord aRec;
+ if ( rURL.getLength() )
+ aRec = xContainer->find(rURL, xIH);
+
+ if ( aRec.UserList.getLength() == 0 )
+ {
+ // compat: try server name.
+ aRec = xContainer->find(rRequest.ServerName, xIH);
+ }
+
+ if ( fillContinuation( false,
+ rRequest,
+ aRec,
+ xSupplyAuthentication,
+ xSupplyAuthentication2,
+ bCanUseSystemCredentials,
+ false ) )
+ {
+ return true;
+ }
+ }
+ else
+ {
+ task::UrlRecord aRec;
+ if ( rURL.getLength() )
+ aRec = xContainer->findForName(
+ rURL, rRequest.UserName, xIH);
+
+ if ( aRec.UserList.getLength() == 0 )
+ {
+ // compat: try server name.
+ aRec = xContainer->findForName(
+ rRequest.ServerName, rRequest.UserName, xIH);
+ }
+
+ if ( fillContinuation( false,
+ rRequest,
+ aRec,
+ xSupplyAuthentication,
+ xSupplyAuthentication2,
+ bCanUseSystemCredentials,
+ true ) )
+ {
+ return true;
+ }
+ }
+ }
+ catch (task::NoMasterException const &)
+ {} // user did not enter master password
+ }
+ return false;
+}
+
+//=========================================================================
+bool PasswordContainerHelper::addRecord(
+ rtl::OUString const & rURL,
+ rtl::OUString const & rUsername,
+ uno::Sequence< rtl::OUString > const & rPasswords,
+ uno::Reference< task::XInteractionHandler > const & xIH,
+ bool bPersist )
+ SAL_THROW((uno::RuntimeException))
+{
+ try
+ {
+ if ( rUsername.getLength() )
+ {
+ OSL_ENSURE( m_xPasswordContainer.is(),
+ "Got no XPasswordContainer!" );
+ if ( !m_xPasswordContainer.is() )
+ return false;
+
+ if ( bPersist )
+ m_xPasswordContainer->addPersistent( rURL,
+ rUsername,
+ rPasswords,
+ xIH );
+ else
+ m_xPasswordContainer->add( rURL,
+ rUsername,
+ rPasswords,
+ xIH );
+ }
+ else
+ {
+ uno::Reference< task::XUrlContainer >
+ xContainer( m_xPasswordContainer, uno::UNO_QUERY );
+ OSL_ENSURE( xContainer.is(), "Got no XUrlContainer!" );
+ if ( !xContainer.is() )
+ return false;
+
+ xContainer->addUrl( rURL, bPersist );
+ }
+ }
+ catch ( task::NoMasterException const & )
+ {
+ // user did not enter master password
+ return false;
+ }
+ return true;
+}
+
+//=========================================================================
+//=========================================================================
+//=========================================================================
+
+PasswordContainerInteractionHandler::PasswordContainerInteractionHandler(
+ const uno::Reference< lang::XMultiServiceFactory >& xSMgr )
+: m_aPwContainerHelper( xSMgr )
+{
+}
+
+//=========================================================================
+// virtual
+PasswordContainerInteractionHandler::~PasswordContainerInteractionHandler()
+{
+}
+
+//=========================================================================
+//
+// XServiceInfo methods.
+//
+//=========================================================================
+
+// virtual
+::rtl::OUString SAL_CALL
+PasswordContainerInteractionHandler::getImplementationName()
+ throw ( uno::RuntimeException )
+{
+ return getImplementationName_Static();
+}
+
+//=========================================================================
+// virtual
+sal_Bool SAL_CALL
+PasswordContainerInteractionHandler::supportsService(
+ const ::rtl::OUString& ServiceName )
+ throw ( uno::RuntimeException )
+{
+ uno::Sequence< rtl::OUString > aSNL = getSupportedServiceNames();
+ const rtl::OUString * pArray = aSNL.getConstArray();
+ for ( sal_Int32 i = 0; i < aSNL.getLength(); i++ )
+ {
+ if ( pArray[ i ] == ServiceName )
+ return sal_True;
+ }
+ return sal_False;
+}
+
+//=========================================================================
+// virtual
+uno::Sequence< ::rtl::OUString > SAL_CALL
+PasswordContainerInteractionHandler::getSupportedServiceNames()
+ throw ( uno::RuntimeException )
+{
+ return getSupportedServiceNames_Static();
+}
+
+//=========================================================================
+// static
+rtl::OUString
+PasswordContainerInteractionHandler::getImplementationName_Static()
+{
+ return rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.comp.uui.PasswordContainerInteractionHandler" ) );
+}
+
+//=========================================================================
+// static
+uno::Sequence< rtl::OUString >
+PasswordContainerInteractionHandler::getSupportedServiceNames_Static()
+{
+ uno::Sequence< rtl::OUString > aSNS( 1 );
+ aSNS.getArray()[ 0 ]
+ = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.task.PasswordContainerInteractionHandler" ) );
+ return aSNS;
+}
+
+//=========================================================================
+//
+// XInteractionHandler methods.
+//
+//=========================================================================
+
+// virtual
+void SAL_CALL
+PasswordContainerInteractionHandler::handle(
+ const uno::Reference< task::XInteractionRequest >& rRequest )
+ throw ( uno::RuntimeException )
+{
+ if ( !rRequest.is() )
+ return;
+
+ uno::Any aAnyRequest( rRequest->getRequest() );
+
+ ucb::AuthenticationRequest aAuthenticationRequest;
+ if ( !( aAnyRequest >>= aAuthenticationRequest ) )
+ return;
+
+ rtl::OUString aURL;
+ ucb::URLAuthenticationRequest aURLAuthenticationRequest;
+ if ( aAnyRequest >>= aURLAuthenticationRequest )
+ aURL = aURLAuthenticationRequest.URL;
+
+ uno::Sequence< uno::Reference< task::XInteractionContinuation > >
+ rContinuations = rRequest->getContinuations();
+
+ uno::Reference< ucb::XInteractionSupplyAuthentication >
+ xSupplyAuthentication;
+
+ for ( sal_Int32 i = 0; i < rContinuations.getLength(); ++i )
+ {
+ xSupplyAuthentication
+ = uno::Reference< ucb::XInteractionSupplyAuthentication >(
+ rContinuations[i], uno::UNO_QUERY );
+ if( xSupplyAuthentication.is() )
+ break;
+ }
+
+ if ( !xSupplyAuthentication.is() )
+ return;
+
+ // Try to obatin credentials from password container.
+ if ( m_aPwContainerHelper.
+ handleAuthenticationRequest( aAuthenticationRequest,
+ xSupplyAuthentication,
+ aURL,
+ // @@@ FIXME: this not able to
+ // handle master pw request!
+ // master pw request is never
+ // solvabe without UI!
+ this ) )
+ {
+ // successfully handled
+ xSupplyAuthentication->select();
+ }
+}
+
+//=========================================================================
+//
+// Service factory implementation.
+//
+//=========================================================================
+
+static uno::Reference< uno::XInterface > SAL_CALL
+PasswordContainerInteractionHandler_CreateInstance(
+ const uno::Reference< lang::XMultiServiceFactory> & rSMgr )
+ throw( uno::Exception )
+{
+ lang::XServiceInfo * pX = static_cast< lang::XServiceInfo * >(
+ new PasswordContainerInteractionHandler( rSMgr ) );
+ return uno::Reference< uno::XInterface >::query( pX );
+}
+
+//=========================================================================
+// static
+uno::Reference< lang::XSingleServiceFactory >
+PasswordContainerInteractionHandler::createServiceFactory(
+ const uno::Reference< lang::XMultiServiceFactory >& rxServiceMgr )
+{
+ return uno::Reference< lang::XSingleServiceFactory >(
+ cppu::createOneInstanceFactory(
+ rxServiceMgr,
+ PasswordContainerInteractionHandler::getImplementationName_Static(),
+ PasswordContainerInteractionHandler_CreateInstance,
+ PasswordContainerInteractionHandler::getSupportedServiceNames_Static() ) );
+}
+
+} // namespace uui
diff --git a/uui/source/passwordcontainer.hxx b/uui/source/passwordcontainer.hxx
new file mode 100644
index 000000000000..aafcd1c4c1dd
--- /dev/null
+++ b/uui/source/passwordcontainer.hxx
@@ -0,0 +1,197 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef INCLUDED_UUI_PASSWORDCONTAINER_HXX
+#define INCLUDED_UUI_PASSWORDCONTAINER_HXX
+
+#include "cppuhelper/implbase2.hxx"
+
+#include "com/sun/star/lang/XServiceInfo.hpp"
+#include "com/sun/star/lang/XSingleServiceFactory.hpp"
+#include "com/sun/star/task/XInteractionHandler.hpp"
+#include "com/sun/star/task/XPasswordContainer.hpp"
+
+namespace com {
+ namespace sun {
+ namespace star {
+ namespace lang {
+ class XMultiServiceFactory;
+ }
+ namespace ucb {
+ class AuthenticationRequest;
+ class XInteractionSupplyAuthentication;
+} } } }
+
+namespace uui {
+
+// ============================================================================
+
+/** Passwordcontainer UNO service (com.sun.star.task.PasswordContainer) helper.
+ */
+class PasswordContainerHelper
+{
+public:
+ PasswordContainerHelper(
+ com::sun::star::uno::Reference<
+ com::sun::star::lang::XMultiServiceFactory > const &
+ xServiceFactory );
+
+ // ------------------------------------------------------------------------
+
+ /** This member function tries to handle an authentication interaction
+ request by looking up credentials for the given URL in the password
+ container service.
+
+ In case of success the given interaction continuation
+ (XInteractionSupplyAuthentication) is filled with the credentials found
+ in the password container.
+
+ Please note the the continuation gets not "selected" by this
+ implementation. "Selecting" the continuation is up to the caller (e.g.
+ an implementation of XInteractionHandler::handle) of this function.
+
+ @param rRequest
+ The authentication request.
+
+ @param xSupplyAuthentication
+ The "supply authentication" interaction continuation.
+
+ @param rURL
+ The URL to lookup credentials for.
+
+ @param xIH
+ The interaction handler to use, for example if a master password is
+ needed to access the password container.
+
+ @return
+ True, if the authentication request was handled successfully.
+ False, otherwise.
+ */
+ bool handleAuthenticationRequest(
+ com::sun::star::ucb::AuthenticationRequest const & rRequest,
+ com::sun::star::uno::Reference<
+ com::sun::star::ucb::XInteractionSupplyAuthentication > const &
+ xSupplyAuthentication,
+ rtl::OUString const & rURL,
+ com::sun::star::uno::Reference<
+ com::sun::star::task::XInteractionHandler > const & xIH )
+ SAL_THROW( (com::sun::star::uno::RuntimeException) );
+
+ /** This member function adds credentials for the given URL to the password
+ container.
+
+ @param rURL
+ The URL the credentials are valid for. rURL must not be empty.
+
+ @param rUsername
+ The user name.
+
+ @param rPasswords
+ This list of passwords.
+
+ @param xIH
+ The interaction handler to use, for example if a master password is
+ needed to access the password container.
+
+ @param bPersist
+ True, the record will get stored persistently; restored upon
+ password container initialization
+ False, the record will be stored until password container instance
+ gets destroyed.
+
+ @return
+ True, if the record was added successfully.
+ False, otherwise.
+
+ */
+ bool addRecord( rtl::OUString const & rURL,
+ rtl::OUString const & rUsername,
+ com::sun::star::uno::Sequence< rtl::OUString > const &
+ rPasswords,
+ com::sun::star::uno::Reference<
+ com::sun::star::task::XInteractionHandler > const & xIH,
+ bool bPersist )
+ SAL_THROW( (com::sun::star::uno::RuntimeException) );
+
+ // ------------------------------------------------------------------------
+
+private:
+ com::sun::star::uno::Reference<
+ com::sun::star::task::XPasswordContainer > m_xPasswordContainer;
+};
+
+// ============================================================================
+
+class PasswordContainerInteractionHandler :
+ public cppu::WeakImplHelper2< com::sun::star::lang::XServiceInfo,
+ com::sun::star::task::XInteractionHandler >
+{
+public:
+ PasswordContainerInteractionHandler(
+ const com::sun::star::uno::Reference<
+ com::sun::star::lang::XMultiServiceFactory >& rXSMgr );
+ virtual ~PasswordContainerInteractionHandler();
+
+ // XServiceInfo
+ virtual ::rtl::OUString SAL_CALL getImplementationName()
+ throw ( com::sun::star::uno::RuntimeException );
+
+ virtual sal_Bool SAL_CALL
+ supportsService( const ::rtl::OUString& ServiceName )
+ throw ( com::sun::star::uno::RuntimeException );
+
+ virtual com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL
+ getSupportedServiceNames()
+ throw ( com::sun::star::uno::RuntimeException );
+
+ // XInteractionHandler
+ virtual void SAL_CALL
+ handle( const ::com::sun::star::uno::Reference<
+ ::com::sun::star::task::XInteractionRequest >& Request )
+ throw (::com::sun::star::uno::RuntimeException);
+
+ // Non-UNO interfaces
+ static rtl::OUString
+ getImplementationName_Static();
+
+ static com::sun::star::uno::Sequence< rtl::OUString >
+ getSupportedServiceNames_Static();
+
+ static com::sun::star::uno::Reference<
+ com::sun::star::lang::XSingleServiceFactory >
+ createServiceFactory( const com::sun::star::uno::Reference<
+ com::sun::star::lang::XMultiServiceFactory > & rxServiceMgr );
+
+private:
+ //com::sun::star::uno::Reference<
+ // com::sun::star::lang::XMultiServiceFactory > m_xSMgr;
+ PasswordContainerHelper m_aPwContainerHelper;
+};
+
+} // namespace uui
+
+#endif
diff --git a/uui/source/passworddlg.cxx b/uui/source/passworddlg.cxx
index 4a2c584cf123..4962563601c3 100644
--- a/uui/source/passworddlg.cxx
+++ b/uui/source/passworddlg.cxx
@@ -2,13 +2,10 @@
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
- * Copyright 2008 by Sun Microsystems, Inc.
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: passworddlg.cxx,v $
- * $Revision: 1.7 $
- *
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
diff --git a/uui/source/passworddlg.hrc b/uui/source/passworddlg.hrc
index 95a5e8a78673..ad7517b7a62b 100644
--- a/uui/source/passworddlg.hrc
+++ b/uui/source/passworddlg.hrc
@@ -2,13 +2,10 @@
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
- * Copyright 2008 by Sun Microsystems, Inc.
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: passworddlg.hrc,v $
- * $Revision: 1.5 $
- *
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
diff --git a/uui/source/passworddlg.hxx b/uui/source/passworddlg.hxx
index 75f65b456ac7..d07399012616 100644
--- a/uui/source/passworddlg.hxx
+++ b/uui/source/passworddlg.hxx
@@ -2,13 +2,10 @@
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
- * Copyright 2008 by Sun Microsystems, Inc.
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: passworddlg.hxx,v $
- * $Revision: 1.5 $
- *
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
diff --git a/uui/source/passworddlg.src b/uui/source/passworddlg.src
index c9b8dfe0847e..96863ad9ca32 100644
--- a/uui/source/passworddlg.src
+++ b/uui/source/passworddlg.src
@@ -2,13 +2,10 @@
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
- * Copyright 2008 by Sun Microsystems, Inc.
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: passworddlg.src,v $
- * $Revision: 1.42 $
- *
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
diff --git a/uui/source/passworderrs.src b/uui/source/passworderrs.src
index 90aa5688610e..fe631257c9d2 100644
--- a/uui/source/passworderrs.src
+++ b/uui/source/passworderrs.src
@@ -2,13 +2,10 @@
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
- * Copyright 2008 by Sun Microsystems, Inc.
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: passworderrs.src,v $
- * $Revision: 1.13 $
- *
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
diff --git a/uui/source/requeststringresolver.cxx b/uui/source/requeststringresolver.cxx
index 066f820bbcbd..319109bd45df 100644
--- a/uui/source/requeststringresolver.cxx
+++ b/uui/source/requeststringresolver.cxx
@@ -2,13 +2,10 @@
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
- * Copyright 2008 by Sun Microsystems, Inc.
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: requeststringresolver.cxx,v $
- * $Revision: 1.3 $
- *
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
diff --git a/uui/source/requeststringresolver.hxx b/uui/source/requeststringresolver.hxx
index b640e18aa395..b021bcebeb88 100644
--- a/uui/source/requeststringresolver.hxx
+++ b/uui/source/requeststringresolver.hxx
@@ -2,13 +2,10 @@
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
- * Copyright 2008 by Sun Microsystems, Inc.
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: requeststringresolver.hxx,v $
- * $Revision: 1.3 $
- *
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
diff --git a/uui/source/secmacrowarnings.cxx b/uui/source/secmacrowarnings.cxx
index 776c3b4385f2..e283ca27d93f 100644
--- a/uui/source/secmacrowarnings.cxx
+++ b/uui/source/secmacrowarnings.cxx
@@ -2,13 +2,10 @@
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
- * Copyright 2008 by Sun Microsystems, Inc.
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: secmacrowarnings.cxx,v $
- * $Revision: 1.3 $
- *
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
diff --git a/uui/source/secmacrowarnings.hrc b/uui/source/secmacrowarnings.hrc
index 171615e91b7f..38e8974a3d2c 100644
--- a/uui/source/secmacrowarnings.hrc
+++ b/uui/source/secmacrowarnings.hrc
@@ -2,13 +2,10 @@
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
- * Copyright 2008 by Sun Microsystems, Inc.
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: secmacrowarnings.hrc,v $
- * $Revision: 1.3 $
- *
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
diff --git a/uui/source/secmacrowarnings.hxx b/uui/source/secmacrowarnings.hxx
index 17280ecbbac1..4e229eebb0c6 100644
--- a/uui/source/secmacrowarnings.hxx
+++ b/uui/source/secmacrowarnings.hxx
@@ -2,13 +2,10 @@
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
- * Copyright 2008 by Sun Microsystems, Inc.
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: secmacrowarnings.hxx,v $
- * $Revision: 1.3 $
- *
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
@@ -33,7 +30,7 @@
#include <vcl/dialog.hxx>
#include <svtools/stdctrl.hxx>
-#include <svtools/securityoptions.hxx>
+#include <unotools/securityoptions.hxx>
#include <vcl/button.hxx>
namespace com {
diff --git a/uui/source/secmacrowarnings.src b/uui/source/secmacrowarnings.src
index 8819a2f3292b..6d0039da7746 100644
--- a/uui/source/secmacrowarnings.src
+++ b/uui/source/secmacrowarnings.src
@@ -2,13 +2,10 @@
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
- * Copyright 2008 by Sun Microsystems, Inc.
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: secmacrowarnings.src,v $
- * $Revision: 1.3 $
- *
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
diff --git a/uui/source/services.cxx b/uui/source/services.cxx
index 824c3f895b7d..95d4d65b6faf 100644
--- a/uui/source/services.cxx
+++ b/uui/source/services.cxx
@@ -2,13 +2,10 @@
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
- * Copyright 2008 by Sun Microsystems, Inc.
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: services.cxx,v $
- * $Revision: 1.8 $
- *
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
@@ -37,6 +34,7 @@
#include "interactionhandler.hxx"
#include "requeststringresolver.hxx"
+#include "passwordcontainer.hxx"
using namespace rtl;
using namespace com::sun::star::uno;
@@ -46,18 +44,18 @@ using namespace com::sun::star::registry;
namespace {
sal_Bool writeInfo( void * pRegistryKey,
- const char * pImplementationName,
+ const OUString & rImplementationName,
Sequence< OUString > const & rServiceNames )
{
OUString aKeyName( OUString::createFromAscii( "/" ) );
- aKeyName += OUString::createFromAscii( pImplementationName );
+ aKeyName += rImplementationName;
aKeyName += OUString::createFromAscii( "/UNO/SERVICES" );
Reference< XRegistryKey > xKey;
try
{
- xKey = static_cast< XRegistryKey * >(
- pRegistryKey )->createKey( aKeyName );
+ xKey = static_cast< XRegistryKey * >(
+ pRegistryKey )->createKey( aKeyName );
}
catch ( InvalidRegistryException const & )
{
@@ -65,21 +63,21 @@ sal_Bool writeInfo( void * pRegistryKey,
if ( !xKey.is() )
{
- return sal_False;
+ return sal_False;
}
sal_Bool bSuccess = sal_True;
for ( sal_Int32 n = 0; n < rServiceNames.getLength(); ++n )
{
- try
- {
- xKey->createKey( rServiceNames[ n ] );
- }
- catch ( InvalidRegistryException const & )
- {
- bSuccess = sal_False;
- break;
- }
+ try
+ {
+ xKey->createKey( rServiceNames[ n ] );
+ }
+ catch ( InvalidRegistryException const & )
+ {
+ bSuccess = sal_False;
+ break;
+ }
}
return bSuccess;
}
@@ -114,16 +112,26 @@ extern "C" sal_Bool SAL_CALL component_writeInfo(void *, void * pRegistryKey)
//////////////////////////////////////////////////////////////////////
writeInfo( pRegistryKey,
- UUIInteractionHandler::m_aImplementationName,
- UUIInteractionHandler::getSupportedServiceNames_static() ) &&
+ OUString::createFromAscii(
+ UUIInteractionHandler::m_aImplementationName ),
+ UUIInteractionHandler::getSupportedServiceNames_static() ) &&
//////////////////////////////////////////////////////////////////////
// UUI Interaction Request String Resolver.
//////////////////////////////////////////////////////////////////////
writeInfo( pRegistryKey,
- UUIInteractionRequestStringResolver::m_aImplementationName,
- UUIInteractionRequestStringResolver::getSupportedServiceNames_static() );
+ OUString::createFromAscii(
+ UUIInteractionRequestStringResolver::m_aImplementationName ),
+ UUIInteractionRequestStringResolver::getSupportedServiceNames_static() ) &&
+
+ //////////////////////////////////////////////////////////////////////
+ // UUI Password Container Interaction Handler.
+ //////////////////////////////////////////////////////////////////////
+
+ writeInfo( pRegistryKey,
+ uui::PasswordContainerInteractionHandler::getImplementationName_Static(),
+ uui::PasswordContainerInteractionHandler::getSupportedServiceNames_Static() );
}
//============================================================================
@@ -142,7 +150,7 @@ extern "C" void * SAL_CALL component_getFactory(sal_Char const * pImplName,
void * pRet = 0;
Reference< XMultiServiceFactory > xSMgr(
- reinterpret_cast< XMultiServiceFactory * >( pServiceManager ) );
+ reinterpret_cast< XMultiServiceFactory * >( pServiceManager ) );
Reference< XSingleServiceFactory > xFactory;
//////////////////////////////////////////////////////////////////////
@@ -153,10 +161,9 @@ extern "C" void * SAL_CALL component_getFactory(sal_Char const * pImplName,
UUIInteractionHandler::m_aImplementationName)
== 0)
{
- xFactory =
+ xFactory =
cppu::createSingleFactory(
- static_cast< XMultiServiceFactory * >(
- pServiceManager),
+ static_cast< XMultiServiceFactory * >(pServiceManager),
OUString::createFromAscii(
UUIInteractionHandler::m_aImplementationName),
&UUIInteractionHandler::createInstance,
@@ -171,10 +178,9 @@ extern "C" void * SAL_CALL component_getFactory(sal_Char const * pImplName,
UUIInteractionRequestStringResolver::m_aImplementationName)
== 0)
{
- xFactory =
+ xFactory =
cppu::createSingleFactory(
- static_cast< XMultiServiceFactory * >(
- pServiceManager),
+ static_cast< XMultiServiceFactory * >(pServiceManager),
OUString::createFromAscii(
UUIInteractionRequestStringResolver::m_aImplementationName),
&UUIInteractionRequestStringResolver::createInstance,
@@ -182,11 +188,22 @@ extern "C" void * SAL_CALL component_getFactory(sal_Char const * pImplName,
}
//////////////////////////////////////////////////////////////////////
+ // UUI Password Container Interaction Handler.
+ //////////////////////////////////////////////////////////////////////
+
+ else if ( uui::PasswordContainerInteractionHandler::getImplementationName_Static().
+ compareToAscii( pImplName ) == 0 )
+ {
+ xFactory =
+ uui::PasswordContainerInteractionHandler::createServiceFactory( xSMgr );
+ }
+
+ //////////////////////////////////////////////////////////////////////
if ( xFactory.is() )
{
- xFactory->acquire();
- pRet = xFactory.get();
+ xFactory->acquire();
+ pRet = xFactory.get();
}
return pRet;
diff --git a/uui/source/sslwarndlg.cxx b/uui/source/sslwarndlg.cxx
index 5e820452cdb5..bed776e7f3de 100644
--- a/uui/source/sslwarndlg.cxx
+++ b/uui/source/sslwarndlg.cxx
@@ -2,13 +2,10 @@
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
- * Copyright 2008 by Sun Microsystems, Inc.
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: sslwarndlg.cxx,v $
- * $Revision: 1.3 $
- *
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
diff --git a/uui/source/sslwarndlg.hrc b/uui/source/sslwarndlg.hrc
index e8e0f32fcbf0..f5bbf00c6f37 100644
--- a/uui/source/sslwarndlg.hrc
+++ b/uui/source/sslwarndlg.hrc
@@ -2,13 +2,10 @@
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
- * Copyright 2008 by Sun Microsystems, Inc.
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: sslwarndlg.hrc,v $
- * $Revision: 1.3 $
- *
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
diff --git a/uui/source/sslwarndlg.hxx b/uui/source/sslwarndlg.hxx
index d9b465309486..cf8aa0a5511c 100644
--- a/uui/source/sslwarndlg.hxx
+++ b/uui/source/sslwarndlg.hxx
@@ -2,13 +2,10 @@
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
- * Copyright 2008 by Sun Microsystems, Inc.
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: sslwarndlg.hxx,v $
- * $Revision: 1.3 $
- *
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
diff --git a/uui/source/sslwarndlg.src b/uui/source/sslwarndlg.src
index 51953968491d..acae9453a971 100644
--- a/uui/source/sslwarndlg.src
+++ b/uui/source/sslwarndlg.src
@@ -2,13 +2,10 @@
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
- * Copyright 2008 by Sun Microsystems, Inc.
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: sslwarndlg.src,v $
- * $Revision: 1.3 $
- *
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
diff --git a/uui/source/trylater.cxx b/uui/source/trylater.cxx
index 9e7857dfc886..893455d134de 100644
--- a/uui/source/trylater.cxx
+++ b/uui/source/trylater.cxx
@@ -2,13 +2,10 @@
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
- * Copyright 2008 by Sun Microsystems, Inc.
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: openlocked.cxx,v $
- * $Revision: 1.3 $
- *
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
diff --git a/uui/source/trylater.hxx b/uui/source/trylater.hxx
index 64140966fb3e..cb8082b4a6a9 100644
--- a/uui/source/trylater.hxx
+++ b/uui/source/trylater.hxx
@@ -2,13 +2,10 @@
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
- * Copyright 2008 by Sun Microsystems, Inc.
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: openlocked.hxx,v $
- * $Revision: 1.3 $
- *
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
diff --git a/uui/source/trylater.src b/uui/source/trylater.src
index 945ac8c74153..4f328fed7c02 100644
--- a/uui/source/trylater.src
+++ b/uui/source/trylater.src
@@ -2,13 +2,10 @@
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
- * Copyright 2008 by Sun Microsystems, Inc.
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: openlocked.src,v $
- * $Revision: 1.3 $
- *
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
diff --git a/uui/source/unknownauthdlg.cxx b/uui/source/unknownauthdlg.cxx
index 02315bae6c3b..3a58d69842ea 100644
--- a/uui/source/unknownauthdlg.cxx
+++ b/uui/source/unknownauthdlg.cxx
@@ -2,13 +2,10 @@
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
- * Copyright 2008 by Sun Microsystems, Inc.
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: unknownauthdlg.cxx,v $
- * $Revision: 1.3 $
- *
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
diff --git a/uui/source/unknownauthdlg.hrc b/uui/source/unknownauthdlg.hrc
index f026da8094f0..e9cc84fc1896 100644
--- a/uui/source/unknownauthdlg.hrc
+++ b/uui/source/unknownauthdlg.hrc
@@ -2,13 +2,10 @@
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
- * Copyright 2008 by Sun Microsystems, Inc.
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: unknownauthdlg.hrc,v $
- * $Revision: 1.3 $
- *
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
diff --git a/uui/source/unknownauthdlg.hxx b/uui/source/unknownauthdlg.hxx
index 7541f324c763..0d1f3ba1540b 100644
--- a/uui/source/unknownauthdlg.hxx
+++ b/uui/source/unknownauthdlg.hxx
@@ -2,13 +2,10 @@
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
- * Copyright 2008 by Sun Microsystems, Inc.
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: unknownauthdlg.hxx,v $
- * $Revision: 1.3 $
- *
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
diff --git a/uui/source/unknownauthdlg.src b/uui/source/unknownauthdlg.src
index ce24ffac099e..d20a28a00704 100644
--- a/uui/source/unknownauthdlg.src
+++ b/uui/source/unknownauthdlg.src
@@ -2,13 +2,10 @@
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
- * Copyright 2008 by Sun Microsystems, Inc.
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: unknownauthdlg.src,v $
- * $Revision: 1.3 $
- *
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify