[ooo-build-commit] Branch 'ooo/master' - 2 commits - sfx2/source svx/source xmloff/inc xmloff/source

Jan Holesovsky kendy at kemper.freedesktop.org
Mon Sep 7 18:09:14 PDT 2009


 sfx2/source/appl/appopen.cxx         |  112 +++++++++++++++++------------------
 sfx2/source/dialog/filedlghelper.cxx |  104 +++++++++++++-------------------
 svx/source/cui/webconninfo.cxx       |   13 +---
 xmloff/inc/xmloff/nmspmap.hxx        |    5 +
 xmloff/inc/xmloff/xmlaustp.hxx       |    4 +
 xmloff/source/style/impastp3.cxx     |   40 ++++++++++++
 xmloff/source/style/impastp4.cxx     |   41 ++++++++++++
 xmloff/source/style/impastpl.hxx     |    8 ++
 xmloff/source/style/xmlaustp.cxx     |    7 ++
 9 files changed, 211 insertions(+), 123 deletions(-)

New commits:
commit 47ba649c43ed59963c33b6786b7dde30864e298e
Author: Oliver Bolte <obo at openoffice.org>
Date:   Mon Sep 7 15:38:19 2009 +0000

    CWS-TOOLING: integrate CWS calcsheetdata
    2009-08-13 16:18:48 +0200 nn  r274950 : #i102616# shared/remote files, better handling of formula results
    2009-08-12 11:17:30 +0200 nn  r274884 : CWS-TOOLING: rebase CWS calcsheetdata to trunk at 274622 (milestone: DEV300:m54)
    2009-08-12 10:30:47 +0200 nn  r274881 : #i102616# some clean-up
    2009-08-11 19:01:18 +0200 nn  r274876 : #i102616# store loaded namespaces, so prefixes remain valid
    2009-08-11 19:00:49 +0200 nn  r274875 : #i102616# store loaded namespaces, so prefixes remain valid
    2009-08-10 19:12:04 +0200 nn  r274835 : #i102616# detective, notes, encoding, error handling
    2009-08-07 11:18:46 +0200 nn  r274751 : #i102616# use new method SvXMLAutoStylePoolP::AddNamed
    2009-08-07 11:18:15 +0200 nn  r274750 : #i102616# new method SvXMLAutoStylePoolP::AddNamed
    2009-08-06 18:02:42 +0200 nn  r274740 : #i102616# modification: shapes, notes, pending row heights; skip sheets in export iterator
    2009-08-05 18:41:59 +0200 nn  r274694 : #i102616# handle text styles in notes
    2009-08-03 18:55:59 +0200 nn  r274594 : #i102616# handle text styles in cells
    2009-07-31 19:00:06 +0200 nn  r274548 : #i102616# handle styles for notes
    2009-07-28 16:46:20 +0200 nn  r274414 : missed a conflict
    2009-07-28 14:01:56 +0200 nn  r274404 : CWS-TOOLING: rebase CWS calcsheetdata to trunk at 274203 (milestone: DEV300:m53)
    2009-07-23 18:28:47 +0200 nn  r274278 : #i102616# handle table styles
    2009-07-22 15:40:24 +0200 nn  r274244 : #i102616# handle row styles
    2009-07-21 20:09:37 +0200 nn  r274211 : #i102616# handle column styles
    2009-07-16 13:00:18 +0200 nn  r274043 : #i102616# invalidate all stream positions when inserting/deleting sheets
    2009-07-15 17:41:15 +0200 nn  r274021 : #i102616# don't collect cell styles twice for copied sheets
    2009-07-14 18:36:11 +0200 nn  r273985 : #i102616# allow to query stream position, clear buffer
    2009-07-14 18:32:10 +0200 nn  r273984 : #i102616# allow to specify a name for an autostyle
    2009-07-09 22:01:23 +0200 nn  r273870 : #i102616# copy stream for unchanged sheets
    2009-07-08 18:11:42 +0200 nn  r273844 : #i102616# store stream positions of sheets
    2009-06-24 19:08:18 +0200 nn  r273363 : #i102616# detect changed sheets since loading
    2009-06-09 15:53:32 +0200 nn  r272774 : #i102616# store automatic cell style information after loading

diff --git a/xmloff/inc/xmloff/nmspmap.hxx b/xmloff/inc/xmloff/nmspmap.hxx
index baa8eb6..9c221bc 100644
--- a/xmloff/inc/xmloff/nmspmap.hxx
+++ b/xmloff/inc/xmloff/nmspmap.hxx
@@ -152,6 +152,11 @@ public:
     sal_uInt16 GetFirstKey() const;
     sal_uInt16 GetNextKey( sal_uInt16 nOldKey ) const;
 
+    /* Give access to all namespace definitions, including multiple entries
+       for the same key (needed for saving sheets separately in Calc).
+       This might be replaced by a better interface later. */
+    const NameSpaceHash& GetAllEntries() const { return aNameHash; }
+
     static sal_Bool NormalizeOasisURN( ::rtl::OUString& rName );
     static sal_Bool NormalizeW3URI( ::rtl::OUString& rName );
     static sal_Bool NormalizeURI( ::rtl::OUString& rName );
diff --git a/xmloff/inc/xmloff/xmlaustp.hxx b/xmloff/inc/xmloff/xmlaustp.hxx
index 0593199..36bb8e8 100644
--- a/xmloff/inc/xmloff/xmlaustp.hxx
+++ b/xmloff/inc/xmloff/xmlaustp.hxx
@@ -112,6 +112,10 @@ public:
     sal_Bool		Add( ::rtl::OUString& rName, sal_Int32 nFamily, const ::std::vector< XMLPropertyState >& rProperties );
     sal_Bool		Add( ::rtl::OUString& rName, sal_Int32 nFamily, const ::rtl::OUString& rParent, const ::std::vector< XMLPropertyState >& rProperties );
 
+    /// Add an item set with a pre-defined name (needed for saving sheets separately in Calc).
+    sal_Bool        AddNamed( const ::rtl::OUString& rName, sal_Int32 nFamily, const ::rtl::OUString& rParent,
+                              const ::std::vector< XMLPropertyState >& rProperties );
+
     /// Find an item set's name.
     ::rtl::OUString Find( sal_Int32 nFamily, const ::std::vector< XMLPropertyState >& rProperties ) const;
     ::rtl::OUString Find( sal_Int32 nFamily, const ::rtl::OUString& rParent, const ::std::vector< XMLPropertyState >& rProperties ) const;
diff --git a/xmloff/source/style/impastp3.cxx b/xmloff/source/style/impastp3.cxx
index 87338c4..e6c8b8f 100644
--- a/xmloff/source/style/impastp3.cxx
+++ b/xmloff/source/style/impastp3.cxx
@@ -98,6 +98,46 @@ sal_Bool SvXMLAutoStylePoolParentP_Impl::Add( XMLFamilyData_Impl* pFamilyData, c
 
 ///////////////////////////////////////////////////////////////////////////////
 //
+// Adds a array of XMLPropertyState ( vector< XMLPropertyState > ) with a given name.
+// If the name exists already, nothing is done. If a style with a different name and
+// the same properties exists, a new one is added (like with bDontSeek).
+//
+
+sal_Bool SvXMLAutoStylePoolParentP_Impl::AddNamed( XMLFamilyData_Impl* pFamilyData, const vector< XMLPropertyState >& rProperties, const OUString& rName )
+{
+    sal_Bool bAdded = sal_False;
+    sal_uInt32 i = 0;
+    sal_Int32 nProperties = rProperties.size();
+    sal_uInt32 nCount = maPropertiesList.Count();
+
+    for( i = 0; i < nCount; i++ )
+    {
+        SvXMLAutoStylePoolPropertiesP_Impl *pIS = maPropertiesList.GetObject( i );
+        if( nProperties > (sal_Int32)pIS->GetProperties().size() )
+        {
+            continue;
+        }
+        else if( nProperties < (sal_Int32)pIS->GetProperties().size() )
+        {
+            break;
+        }
+    }
+
+    if( !pFamilyData->mpNameList->Seek_Entry( &rName, 0 ) )
+    {
+        SvXMLAutoStylePoolPropertiesP_Impl* pProperties =
+                new SvXMLAutoStylePoolPropertiesP_Impl( pFamilyData, rProperties );
+        // ignore the generated name
+        pProperties->SetName( rName );
+        maPropertiesList.Insert( pProperties, i );
+        bAdded = sal_True;
+    }
+
+    return bAdded;
+}
+
+///////////////////////////////////////////////////////////////////////////////
+//
 // Search for a array of XMLPropertyState ( vector< XMLPropertyState > ) in list
 //
 
diff --git a/xmloff/source/style/impastp4.cxx b/xmloff/source/style/impastp4.cxx
index bd25f22..daec835 100644
--- a/xmloff/source/style/impastp4.cxx
+++ b/xmloff/source/style/impastp4.cxx
@@ -235,6 +235,47 @@ sal_Bool SvXMLAutoStylePoolP_Impl::Add(OUString& rName, sal_Int32 nFamily,
     return bRet;
 }
 
+sal_Bool SvXMLAutoStylePoolP_Impl::AddNamed(const OUString& rName, sal_Int32 nFamily,
+                const OUString& rParent, const ::std::vector< XMLPropertyState >& rProperties )
+{
+    // get family and parent the same way as in Add()
+    sal_Bool bRet(sal_False);
+    ULONG nPos;
+
+    XMLFamilyData_Impl *pFamily = 0;
+    XMLFamilyData_Impl aTemporary( nFamily );
+    if( maFamilyList.Seek_Entry( &aTemporary, &nPos ) )
+    {
+        pFamily = maFamilyList.GetObject( nPos );
+    }
+
+    DBG_ASSERT( pFamily, "SvXMLAutoStylePool_Impl::Add: unknown family" );
+    if( pFamily )
+    {
+        SvXMLAutoStylePoolParentP_Impl aTmp( rParent );
+        SvXMLAutoStylePoolParentP_Impl *pParent = 0;
+
+        SvXMLAutoStylePoolParentsP_Impl *pParents = pFamily->mpParentList;
+        if( pParents->Seek_Entry( &aTmp, &nPos ) )
+        {
+            pParent = pParents->GetObject( nPos );
+        }
+        else
+        {
+            pParent = new SvXMLAutoStylePoolParentP_Impl( rParent );
+            pParents->Insert( pParent );
+        }
+
+        if( pParent->AddNamed( pFamily, rProperties, rName ) )
+        {
+            pFamily->mnCount++;
+            bRet = sal_True;
+        }
+    }
+
+    return bRet;
+}
+
 OUString SvXMLAutoStylePoolP_Impl::AddToCache( sal_Int32 nFamily,
                                          const OUString& rParent )
 {
diff --git a/xmloff/source/style/impastpl.hxx b/xmloff/source/style/impastpl.hxx
index f9fd80c..64aca01 100644
--- a/xmloff/source/style/impastpl.hxx
+++ b/xmloff/source/style/impastpl.hxx
@@ -124,6 +124,8 @@ public:
     const ::rtl::OUString& GetName() const { return msName; }
     const ::std::vector< XMLPropertyState >& GetProperties() const { return maProperties; }
     sal_uInt32 GetPos() const { return mnPos; }
+
+    void SetName( const ::rtl::OUString& rNew ) { msName = rNew; }
 };
 
 typedef SvXMLAutoStylePoolPropertiesP_Impl *SvXMLAutoStylePoolPropertiesPPtr;
@@ -150,6 +152,8 @@ public:
 
     sal_Bool Add( XMLFamilyData_Impl* pFamilyData, const ::std::vector< XMLPropertyState >& rProperties, ::rtl::OUString& rName, bool bDontSeek = false );
 
+    sal_Bool AddNamed( XMLFamilyData_Impl* pFamilyData, const ::std::vector< XMLPropertyState >& rProperties, const ::rtl::OUString& rName );
+
     ::rtl::OUString Find( const XMLFamilyData_Impl* pFamilyData, const ::std::vector< XMLPropertyState >& rProperties ) const;
 
     const ::rtl::OUString& GetParent() const { return msParent; }
@@ -197,6 +201,10 @@ public:
                 const ::std::vector< XMLPropertyState >& rProperties,
                 sal_Bool bCache = sal_False,
                 bool bDontSeek = false );
+    sal_Bool AddNamed( const ::rtl::OUString& rName, sal_Int32 nFamily,
+                const ::rtl::OUString& rParent,
+                const ::std::vector< XMLPropertyState >& rProperties );
+
     ::rtl::OUString AddToCache( sal_Int32 nFamily,
                                 const ::rtl::OUString& rParent );
     ::rtl::OUString Find( sal_Int32 nFamily, const ::rtl::OUString& rParent,
diff --git a/xmloff/source/style/xmlaustp.cxx b/xmloff/source/style/xmlaustp.cxx
index 1d5204a..4ed59fd 100644
--- a/xmloff/source/style/xmlaustp.cxx
+++ b/xmloff/source/style/xmlaustp.cxx
@@ -381,6 +381,13 @@ sal_Bool SvXMLAutoStylePoolP::Add(OUString& rName, sal_Int32 nFamily, const OUSt
     return pImpl->Add(rName, nFamily, rParent, rProperties);
 }
 
+sal_Bool SvXMLAutoStylePoolP::AddNamed( const OUString& rName, sal_Int32 nFamily, const OUString& rParent,
+                                        const ::std::vector< XMLPropertyState >& rProperties )
+
+{
+    return pImpl->AddNamed(rName, nFamily, rParent, rProperties);
+}
+
 OUString SvXMLAutoStylePoolP::AddAndCache( sal_Int32 nFamily,
                                   const vector< XMLPropertyState >& rProperties )
 {
commit 9fc697a9453d8334a9d923c70ec30ef23fd16e16
Author: Oliver Bolte <obo at openoffice.org>
Date:   Mon Sep 7 14:41:16 2009 +0000

    CWS-TOOLING: integrate CWS dr72
    2009-08-26 10:24:00 +0200 dr  r275402 : #i92645# CODEPAGE is encrypted...
    2009-08-24 14:37:36 +0200 dr  r275316 : #i10000# enable exceptions for xlroot.cxx
    2009-08-24 14:33:15 +0200 dr  r275313 : #i10000# link openssl under solaris correctly
    2009-08-21 17:41:16 +0200 dr  r275267 : #i10000# unxlngi6 warning
    2009-08-21 15:35:56 +0200 dr  r275265 : #i10000# remove files again, already deleted in previous milestone...
    2009-08-21 11:24:57 +0200 dr  r275227 : #160401# port to DEV300
    2009-08-21 09:53:45 +0200 dr  r275221 : #i92645# full support for encrypted Word2007 files
    2009-08-21 09:50:52 +0200 dr  r275219 : #i92645# final changes for decryption
    2009-08-20 19:48:40 +0200 dr  r275195 : #i104370# missing parentheses, patch from cmc
    2009-08-20 18:28:22 +0200 dr  r275193 : #i92645# rework package decryption to repair 'Reload Document' functionality
    2009-08-20 13:55:14 +0200 dr  r275179 : #i92645# add new property names
    2009-08-19 19:24:21 +0200 dr  r275159 : #160401# open writeprotected files read-only, merged to DEV300
    2009-08-18 14:41:47 +0200 dr  r275109 : #i92645# add 'Aborted' property
    2009-08-18 11:20:34 +0200 dr  r275084 : #i92645# write back password to medium
    2009-08-17 17:52:51 +0200 dr  r275066 : #i92645# detect Word2007 docs with oox detection impl, this adds support of encryped Word2007; correct detection of templates and macro-enabled docs
    2009-08-17 17:51:31 +0200 dr  r275065 : #i92645# detect Word2007 docs with oox detection impl, this adds support of encryped Word2007; correct detection of templates and macro-enabled docs
    2009-08-17 11:06:39 +0200 dr  r275035 : #i92645# more password handling
    2009-08-17 11:05:21 +0200 dr  r275034 : #i92645# use new password input mechanism for BIFF filter and dumper in oox
    2009-08-14 16:33:53 +0200 nn  r274996 : #i104228# DelBroadcastAreasInRange: remove area from hash_set before deleting
    2009-08-14 16:27:12 +0200 nn  r274995 : #i104059# restore a change lost in the integration of fhawfixes1
    2009-08-14 16:24:00 +0200 dr  r274994 : #i92645# adapt BIFF import to latest changes
    2009-08-14 16:21:30 +0200 dr  r274993 : #i92645# adapt BIFF import to latest changes
    2009-08-14 16:20:43 +0200 dr  r274992 : #i92645# do not add default passwords to media descriptor
    2009-08-13 19:20:45 +0200 dr  r274965 : #i92645# add a helper to request a document password
    2009-08-13 19:09:35 +0200 dr  r274964 : #i92645# add a helper to request a document password
    2009-08-13 19:09:03 +0200 dr  r274963 : #i92645# add a helper to request a document password
    2009-08-13 14:35:01 +0200 dr  r274946 : #i92645# comment typo
    2009-08-13 14:33:47 +0200 dr  r274945 : #i92645# add a helper to request a document password
    2009-08-13 14:04:47 +0200 dr  r274941 : #i92645# add a helper to request a document password
    2009-08-13 14:04:22 +0200 dr  r274940 : #i92645# add a helper to request a document password
    2009-08-13 11:16:27 +0200 dr  r274927 : #i42303# show quick help if field name too long for button
    2009-08-13 10:55:48 +0200 dr  r274925 : #i31600# cut field name and add ellipsis, if too long for button
    2009-08-12 18:47:26 +0200 dr  r274914 : #i92645# ask user for a password
    2009-08-12 18:02:39 +0200 dr  r274909 : #i104183# move svtools/DocPasswordRequest to comphelper to be able to use it in oox
    2009-08-12 16:59:11 +0200 dr  r274906 : #i104183# move svtools/DocPasswordRequest to comphelper to be able to use it in oox
    2009-08-12 16:41:18 +0200 dr  r274905 : #i104183# move svtools/DocPasswordRequest to comphelper to be able to use it in oox
    2009-08-12 16:40:33 +0200 dr  r274904 : #i104183# move svtools/DocPasswordRequest to comphelper to be able to use it in oox
    2009-08-12 16:40:08 +0200 dr  r274903 : #i104183# move svtools/DocPasswordRequest to comphelper to be able to use it in oox
    2009-08-12 16:39:30 +0200 dr  r274902 : #i104183# move svtools/DocPasswordRequest to comphelper to be able to use it in oox
    2009-08-12 16:15:28 +0200 dr  r274899 : #i104183# move svtools/DocPasswordRequest to comphelper to be able to use it in oox
    2009-08-11 19:51:12 +0200 dr  r274877 : #i92645# open encrypted MSOOXML package protected with standard XL password 'VelvetSweatshop'

diff --git a/sfx2/source/appl/appopen.cxx b/sfx2/source/appl/appopen.cxx
index 1351b21..669a76b 100644
--- a/sfx2/source/appl/appopen.cxx
+++ b/sfx2/source/appl/appopen.cxx
@@ -1,7 +1,7 @@
 /*************************************************************************
  *
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- * 
+ *
  * Copyright 2008 by Sun Microsystems, Inc.
  *
  * OpenOffice.org - a multi-platform office productivity suite
@@ -48,7 +48,6 @@
 #include <com/sun/star/system/SystemShellExecuteFlags.hpp>
 #include <com/sun/star/document/MacroExecMode.hpp>
 #include <com/sun/star/document/UpdateDocMode.hpp>
-#include <com/sun/star/task/XInteractionRequest.hpp>
 #include <com/sun/star/task/ErrorCodeRequest.hpp>
 #include <com/sun/star/beans/XPropertySet.hpp>
 #include <com/sun/star/embed/ElementModes.hpp>
@@ -81,7 +80,7 @@
 #include <svtools/templdlg.hxx>
 #include <osl/file.hxx>
 #include <svtools/extendedsecurityoptions.hxx>
-#include <svtools/docpasswdrequest.hxx>
+#include <comphelper/docpasswordhelper.hxx>
 #include <vcl/svapp.hxx>
 
 #include <vos/mutex.hxx>
@@ -247,6 +246,50 @@ void SetTemplate_Impl( const String &rFileName,
 
 //--------------------------------------------------------------------
 
+class SfxDocPasswordVerifier : public ::comphelper::IDocPasswordVerifier
+{
+public:
+    inline explicit     SfxDocPasswordVerifier( const Reference< embed::XStorage >& rxStorage ) :
+                            mxStorage( rxStorage ) {}
+
+    virtual ::comphelper::DocPasswordVerifierResult
+                        verifyPassword( const ::rtl::OUString& rPassword );
+
+private:
+    Reference< embed::XStorage > mxStorage;
+};
+
+::comphelper::DocPasswordVerifierResult SfxDocPasswordVerifier::verifyPassword( const ::rtl::OUString& rPassword )
+{
+    ::comphelper::DocPasswordVerifierResult eResult = ::comphelper::DocPasswordVerifierResult_WRONG_PASSWORD;
+    try
+    {
+        // check the password
+        // if the password correct is the stream will be opened successfuly
+        // and immediatelly closed
+        ::comphelper::OStorageHelper::SetCommonStoragePassword( mxStorage, rPassword );
+
+        mxStorage->openStreamElement(
+                ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "content.xml" ) ),
+                embed::ElementModes::READ | embed::ElementModes::NOCREATE );
+
+        // no exception -> success
+        eResult = ::comphelper::DocPasswordVerifierResult_OK;
+    }
+    catch( const packages::WrongPasswordException& )
+    {
+        eResult = ::comphelper::DocPasswordVerifierResult_WRONG_PASSWORD;
+    }
+    catch( const uno::Exception& )
+    {
+        // unknown error, do not try to ask again
+        eResult = ::comphelper::DocPasswordVerifierResult_ABORT;
+    }
+    return eResult;
+}
+
+//--------------------------------------------------------------------
+
 sal_uInt32 CheckPasswd_Impl
 (
     //Window *pWin,             // Parent des Dialogs
@@ -302,56 +345,13 @@ sal_uInt32 CheckPasswd_Impl
                         Reference< ::com::sun::star::task::XInteractionHandler > xInteractionHandler = pFile->GetInteractionHandler();
                         if( xInteractionHandler.is() )
                         {
-                            sal_Bool bRetry = sal_True;
-                            sal_Bool bGotPasswd = sal_False;
-                            ::rtl::OUString aPassword;
-                            ::com::sun::star::task::PasswordRequestMode nDlgMode = ::com::sun::star::task::PasswordRequestMode_PASSWORD_ENTER;
-
-                            while( bRetry )
-                            {
-                                bRetry = sal_False;
-
-                                RequestDocumentPassword* pPasswordRequest = new RequestDocumentPassword( nDlgMode,
-                                    INetURLObject( pFile->GetOrigURL() ).GetMainURL( INetURLObject::DECODE_WITH_CHARSET ) );
-
-                                Reference< XInteractionRequest > rRequest( pPasswordRequest );
-                                xInteractionHandler->handle( rRequest );
-
-                                if ( pPasswordRequest->isPassword() )
-                                {
-                                    aPassword = pPasswordRequest->getPassword();
-                                    bGotPasswd = sal_True;
-
-                                    try
-                                    {
-                                        // check the password
-                                        // if the password correct is the stream will be opened successfuly
-                                        // and immediatelly closed
-                                        ::comphelper::OStorageHelper::SetCommonStoragePassword(
-                                                                        xStorage,
-                                                                        aPassword );
-
-                                        xStorage->openStreamElement(
-                                                ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "content.xml" ) ),
-                                                embed::ElementModes::READ | embed::ElementModes::NOCREATE );
-                                    }
-                                    catch( const packages::WrongPasswordException& )
-                                    {
-                                        // reask for the password
-                                        nDlgMode = ::com::sun::star::task::PasswordRequestMode_PASSWORD_REENTER;
-                                        bRetry = sal_True;
-                                    }
-                                    catch( const uno::Exception& )
-                                    {
-                                        // do nothing special
-                                        // the error will be detected by loading
-                                    }
-                                }
-                                else
-                                    bGotPasswd = sal_False;
-                            }
+                            // use the comphelper password helper to request a password
+                            ::rtl::OUString aDocumentName = INetURLObject( pFile->GetOrigURL() ).GetMainURL( INetURLObject::DECODE_WITH_CHARSET );
+                            SfxDocPasswordVerifier aVerifier( xStorage );
+                            ::rtl::OUString aPassword = ::comphelper::DocPasswordHelper::requestAndVerifyDocPassword(
+                                aVerifier, ::rtl::OUString(), xInteractionHandler, aDocumentName, comphelper::DocPasswordRequestType_STANDARD );
 
-                            if ( bGotPasswd )
+                            if ( aPassword.getLength() > 0 )
                             {
                                 pSet->Put( SfxStringItem( SID_PASSWORD, aPassword ) );
 
@@ -893,7 +893,7 @@ void SfxApplication::OpenDocExec_Impl( SfxRequest& rReq )
             nDialog = pSystemDialogItem->GetValue() ? SFX2_IMPL_DIALOG_SYSTEM : SFX2_IMPL_DIALOG_OOO;
 
         String sStandardDir;
-        
+
         SFX_REQUEST_ARG( rReq, pStandardDirItem, SfxStringItem, SID_STANDARD_DIR, FALSE );
         if ( pStandardDirItem )
             sStandardDir = pStandardDirItem->GetValue();
@@ -1188,19 +1188,19 @@ void SfxApplication::OpenDocExec_Impl( SfxRequest& rReq )
 
                         return;
                     }
-                    else 
+                    else
                     {
                         // check for "internal" protocols that should not be forwarded to the system
                         Sequence < ::rtl::OUString > aProtocols(2);
 
-                        // add special protocols that always should be treated as internal					
+                        // add special protocols that always should be treated as internal
                         aProtocols[0] = ::rtl::OUString::createFromAscii("private:*");
                         aProtocols[1] = ::rtl::OUString::createFromAscii("vnd.sun.star.*");
 
                         try
                         {
                             // get registered protocol handlers from configuration
-                            Reference < XNameAccess > xAccess( ::comphelper::ConfigurationHelper::openConfig( ::comphelper::getProcessServiceFactory(), 
+                            Reference < XNameAccess > xAccess( ::comphelper::ConfigurationHelper::openConfig( ::comphelper::getProcessServiceFactory(),
                                 ::rtl::OUString::createFromAscii("org.openoffice.Office.ProtocolHandler/HandlerSet"), ::comphelper::ConfigurationHelper::E_READONLY ), UNO_QUERY );
                             if ( xAccess.is() )
                             {
diff --git a/sfx2/source/dialog/filedlghelper.cxx b/sfx2/source/dialog/filedlghelper.cxx
index adb6b58..bd5136a 100644
--- a/sfx2/source/dialog/filedlghelper.cxx
+++ b/sfx2/source/dialog/filedlghelper.cxx
@@ -1,7 +1,7 @@
 /*************************************************************************
  *
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- * 
+ *
  * Copyright 2008 by Sun Microsystems, Inc.
  *
  * OpenOffice.org - a multi-platform office productivity suite
@@ -45,9 +45,7 @@
 #include <com/sun/star/ui/dialogs/XFilePreview.hpp>
 #include <com/sun/star/ui/dialogs/XFilterManager.hpp>
 #include <com/sun/star/ui/dialogs/XFilterGroupManager.hpp>
-#ifndef _COM_SUN_STAR_UI_DIALOGS_XFOLDERPICKER_HDL_
 #include <com/sun/star/ui/dialogs/XFolderPicker.hpp>
-#endif
 #include <com/sun/star/ui/dialogs/XFilePicker2.hpp>
 #include <com/sun/star/ui/dialogs/XAsynchronousExecutableDialog.hpp>
 #include <com/sun/star/lang/XServiceInfo.hpp>
@@ -82,12 +80,9 @@
 #include <svtools/filter.hxx>
 #include <svtools/viewoptions.hxx>
 #include <svtools/moduleoptions.hxx>
-#ifndef _SVT_HELPID_HRC
 #include <svtools/helpid.hrc>
-#endif
 #include <svtools/pickerhelper.hxx>
-#include <svtools/docpasswdrequest.hxx>
-#include <svtools/docmspasswdrequest.hxx>
+#include <comphelper/docpasswordrequest.hxx>
 #include <ucbhelper/content.hxx>
 #include <ucbhelper/commandenvironment.hxx>
 #include <comphelper/storagehelper.hxx>
@@ -99,13 +94,9 @@
 #include <sfx2/passwd.hxx>
 #include "sfxresid.hxx"
 #include <sfx2/sfxsids.hrc>
-#ifndef _SFX_FILEDLGHELPER_HRC
 #include "filedlghelper.hrc"
-#endif
 #include "filtergrouping.hxx"
-#ifndef SFX2_REQUEST_HXX
 #include <sfx2/request.hxx>
-#endif
 #include "filedlgimpl.hxx"
 
 #include <sfxlocal.hrc>
@@ -557,13 +548,15 @@ void FileDialogHelper_Impl::updateSelectionBox()
 }
 
 // ------------------------------------------------------------------------
-struct CheckMSPasswordCapability
+
+namespace {
+
+bool lclCheckMSPasswordCapability( const String rFilterName )
 {
-    sal_Bool operator() ( const String rFilterName )
-    {
-        return rFilterName.EqualsAscii("MS Word 97");
-    }
-};
+    return rFilterName.EqualsAscii("MS Word 97");
+}
+
+} // namespace
 
 // ------------------------------------------------------------------------
 struct CheckPasswordCapability
@@ -575,7 +568,7 @@ struct CheckPasswordCapability
 
 #if 0 // to be enabled in the future
         if (_pFilter->GetFilterName().EqualsAscii("MS Excel 97"))
-            // For now, we eanble password protection for Excel 97 as a 
+            // For now, we eanble password protection for Excel 97 as a
             // special case.  If we start having more filters supporting
             // export encryption with password, we should probably switch to
             // using a filter flag instead.
@@ -583,8 +576,8 @@ struct CheckPasswordCapability
 #endif
 
         return  ( _pFilter->IsOwnFormat() && _pFilter->UsesStorage()
-            &&	( SOFFICE_FILEFORMAT_60 <= _pFilter->GetVersion() )	)	
-            || CheckMSPasswordCapability()( _pFilter->GetFilterName() );
+            &&	( SOFFICE_FILEFORMAT_60 <= _pFilter->GetVersion() )	)
+            || lclCheckMSPasswordCapability( _pFilter->GetFilterName() );
     }
 };
 
@@ -927,14 +920,14 @@ sal_Bool lcl_isSystemFilePicker( const uno::Reference< XFilePicker >& _rxFP )
 // -----------		FileDialogHelper_Impl		---------------------------
 // ------------------------------------------------------------------------
 
-FileDialogHelper_Impl::FileDialogHelper_Impl( 
-    FileDialogHelper* _pAntiImpl, 
-    sal_Int16 nDialogType, 
-    sal_Int64 nFlags, 
-    sal_Int16 nDialog, 
-    Window* _pPreferredParentWindow, 
+FileDialogHelper_Impl::FileDialogHelper_Impl(
+    FileDialogHelper* _pAntiImpl,
+    sal_Int16 nDialogType,
+    sal_Int64 nFlags,
+    sal_Int16 nDialog,
+    Window* _pPreferredParentWindow,
     const String& sStandardDir,
-    const ::com::sun::star::uno::Sequence< ::rtl::OUString >& rBlackList 
+    const ::com::sun::star::uno::Sequence< ::rtl::OUString >& rBlackList
     )
     :m_nDialogType			( nDialogType )
     ,meContext				( FileDialogHelper::UNKNOWN_CONTEXT )
@@ -1092,8 +1085,8 @@ FileDialogHelper_Impl::FileDialogHelper_Impl(
                 DBG_ERRORFILE( "FileDialogHelper::ctor with unknown type" );
                 break;
         }
-        
-        
+
+
 
         //Sequence < Any > aInitArguments( mbSystemPicker || !mpPreferredParentWindow ? 1 : 3 );
         Sequence < Any > aInitArguments( !mpPreferredParentWindow ? 3 : 4 );
@@ -1115,7 +1108,7 @@ FileDialogHelper_Impl::FileDialogHelper_Impl(
                                 );
 
             ::rtl::OUString sStandardDirTemp = ::rtl::OUString( sStandardDir );
-            
+
             aInitArguments[1] <<= NamedValue(
                                     ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "StandardDir" ) ),
                                     makeAny( sStandardDirTemp )
@@ -1133,7 +1126,7 @@ FileDialogHelper_Impl::FileDialogHelper_Impl(
                                         makeAny( VCLUnoHelper::GetInterface( mpPreferredParentWindow ) )
                                     );
 
-            
+
         }
 
         try
@@ -1197,7 +1190,7 @@ FileDialogHelper_Impl::~FileDialogHelper_Impl()
 
     if ( mbDeleteMatcher )
         delete mpMatcher;
-    
+
     maPreViewTimer.SetTimeoutHdl( Link() );
 
     ::comphelper::disposeComponent( mxFileDlg );
@@ -1525,7 +1518,7 @@ void FileDialogHelper_Impl::implGetAndCacheFiles(const uno::Reference< XInterfac
         if ( nFiles > 1 )
         {
             rpURLList = new SvStringsDtor;
-        
+
             INetURLObject aPath( lFiles[0] );
             aPath.setFinalSlash();
 
@@ -1655,7 +1648,7 @@ ErrCode FileDialogHelper_Impl::execute( SvStringsDtor*& rpURLList,
         implGetAndCacheFiles(mxFileDlg, rpURLList, getCurentSfxFilter());
         if ( rpURLList == NULL || rpURLList->GetObject(0) == NULL )
             return ERRCODE_ABORT;
- 
+
         // check, wether or not we have to display a password box
         if ( mbHasPassword && mbIsPwdEnabled && xCtrlAccess.is() )
         {
@@ -1671,30 +1664,21 @@ ErrCode FileDialogHelper_Impl::execute( SvStringsDtor*& rpURLList,
                     if( xInteractionHandler.is() )
                     {
                         // TODO: find out a way to set the 1-15 char limits on MS Excel 97 filter.
-                        if ( CheckMSPasswordCapability()( rFilter ) )
-                        {
-                            RequestMSDocumentPassword* pMSPasswordRequest = new RequestMSDocumentPassword(
-                                ::com::sun::star::task::PasswordRequestMode_PASSWORD_CREATE, *(rpURLList->GetObject(0)) );
-     
-                            uno::Reference< com::sun::star::task::XInteractionRequest > rRequest( pMSPasswordRequest );
-                            xInteractionHandler->handle( rRequest );
-                            if ( pMSPasswordRequest->isPassword() )
-                                rpSet->Put( SfxStringItem( SID_PASSWORD, pMSPasswordRequest->getPassword() ) );
-                            else
-                                return ERRCODE_ABORT;
-                        }
+
+                        bool bMSType = lclCheckMSPasswordCapability( rFilter );
+                        ::comphelper::DocPasswordRequestType eType = bMSType ?
+                            ::comphelper::DocPasswordRequestType_MS :
+                            ::comphelper::DocPasswordRequestType_STANDARD;
+
+                        ::comphelper::DocPasswordRequest* pPasswordRequest = new ::comphelper::DocPasswordRequest(
+                            eType, ::com::sun::star::task::PasswordRequestMode_PASSWORD_CREATE, *(rpURLList->GetObject(0)) );
+
+                        uno::Reference< com::sun::star::task::XInteractionRequest > rRequest( pPasswordRequest );
+                        xInteractionHandler->handle( rRequest );
+                        if ( pPasswordRequest->isPassword() )
+                            rpSet->Put( SfxStringItem( SID_PASSWORD, pPasswordRequest->getPassword() ) );
                         else
-                        {
-                            RequestDocumentPassword* pPasswordRequest = new RequestDocumentPassword(
-                                ::com::sun::star::task::PasswordRequestMode_PASSWORD_CREATE, *(rpURLList->GetObject(0)) );
- 
-                            uno::Reference< com::sun::star::task::XInteractionRequest > rRequest( pPasswordRequest );
-                            xInteractionHandler->handle( rRequest );
-                            if ( pPasswordRequest->isPassword() )
-                                rpSet->Put( SfxStringItem( SID_PASSWORD, pPasswordRequest->getPassword() ) );
-                            else
-                                return ERRCODE_ABORT;
-                        }
+                            return ERRCODE_ABORT;
                     }
                 }
             }
@@ -2607,7 +2591,7 @@ Sequence < OUString > FileDialogHelper::GetMPath() const
 {
     if ( mpImp->mlLastURLs.size() > 0)
         return mpImp->mlLastURLs.getAsConstList();
-    
+
     if ( mpImp->mxFileDlg.is() )
         return mpImp->mxFileDlg->getFiles();
     else
@@ -2636,7 +2620,7 @@ Sequence< ::rtl::OUString > FileDialogHelper::GetSelectedFiles() const
         if ( nFiles > 1 )
         {
             aResultSeq = Sequence< ::rtl::OUString >( nFiles-1 );
-            
+
             INetURLObject aPath( lFiles[0] );
             aPath.setFinalSlash();
 
@@ -2653,7 +2637,7 @@ Sequence< ::rtl::OUString > FileDialogHelper::GetSelectedFiles() const
         else
             aResultSeq = lFiles;
     }
-    
+
     return aResultSeq;
 }
 
diff --git a/svx/source/cui/webconninfo.cxx b/svx/source/cui/webconninfo.cxx
index c370c38..0298a8f 100644
--- a/svx/source/cui/webconninfo.cxx
+++ b/svx/source/cui/webconninfo.cxx
@@ -1,7 +1,7 @@
 /*************************************************************************
  *
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- * 
+ *
  * Copyright 2008 by Sun Microsystems, Inc.
  *
  * OpenOffice.org - a multi-platform office productivity suite
@@ -46,7 +46,7 @@
 #include <com/sun/star/task/XMasterPasswordHandling.hpp>
 
 #include <comphelper/processfactory.hxx>
-#include <svtools/docpasswdrequest.hxx>
+#include <comphelper/docpasswordrequest.hxx>
 
 #include "webconninfo.hxx"
 #include "webconninfo.hrc"
@@ -290,16 +290,15 @@ IMPL_LINK( WebConnectionInfoDialog, ChangePasswordHdl, PushButton*, EMPTYARG )
                 rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "com.sun.star.task.InteractionHandler" ) ) ),
             uno::UNO_QUERY_THROW );
 
-        
+
         SvLBoxEntry* pEntry = m_aPasswordsLB.GetCurEntry();
         if ( pEntry )
         {
             ::rtl::OUString aURL = m_aPasswordsLB.GetEntryText( pEntry, 0 );
             ::rtl::OUString aUserName = m_aPasswordsLB.GetEntryText( pEntry, 1 );
 
-            RequestDocumentPassword* pPasswordRequest = new RequestDocumentPassword(
-                                                               task::PasswordRequestMode_PASSWORD_CREATE,
-                                                               aURL );
+            ::comphelper::DocPasswordRequest* pPasswordRequest = new ::comphelper::DocPasswordRequest(
+                ::comphelper::DocPasswordRequestType_STANDARD, task::PasswordRequestMode_PASSWORD_CREATE, aURL );
 
             uno::Reference< task::XInteractionRequest > rRequest( pPasswordRequest );
             xInteractionHandler->handle( rRequest );
@@ -317,7 +316,7 @@ IMPL_LINK( WebConnectionInfoDialog, ChangePasswordHdl, PushButton*, EMPTYARG )
 
     return 0;
 }
-     
+
 // -----------------------------------------------------------------------
 IMPL_LINK( WebConnectionInfoDialog, EntrySelectedHdl, void*, EMPTYARG )
 {


More information about the ooo-build-commit mailing list