[Libreoffice-commits] core.git: offapi/com sc/source sfx2/source uui/source

Tomofumi Yagi yagit at mknada.sakura.ne.jp
Tue Oct 20 02:42:40 PDT 2015


 offapi/com/sun/star/task/DocumentMSPasswordRequest.idl |    2 +-
 offapi/com/sun/star/task/DocumentPasswordRequest.idl   |    2 +-
 sc/source/filter/ftools/fapihelper.cxx                 |    2 +-
 sfx2/source/appl/appopen.cxx                           |    2 +-
 uui/source/passworddlg.cxx                             |    7 +++++--
 5 files changed, 9 insertions(+), 6 deletions(-)

New commits:
commit 7660e4dcecfb19ad8e9e21e5fe53637bd1b9dc6c
Author: Tomofumi Yagi <yagit at mknada.sakura.ne.jp>
Date:   Sat Feb 28 17:43:00 2015 +0900

    tdf#89694 Password dialog for opening OOXML shows url-encoded path
    
    We need to convert a path string to decoded it for OOXML with a password as ODF
    is so. This patch adds the converting process for OOXML.
    
    In addition, this patch moves the decoded-point of URL into
    css.task.Document[MS]PasswordRequest ctor from the outside. This decoded-point of
    URL into ctor is common for OOXML and ODF.
    
    (notes: Strange to say, css.task.Document[MS]PasswordRequest ctor needs "aDocURL",
        but methods in interaction-handler use "aDocumentName" as the parameter.
        Probably this will be fixed in near future.)
    
    Change-Id: I0ecfddf0f70ea5810df52d9ca8637f483a26df2f
    Reviewed-on: https://gerrit.libreoffice.org/14677
    Reviewed-by: Stephan Bergmann <sbergman at redhat.com>
    Tested-by: Stephan Bergmann <sbergman at redhat.com>

diff --git a/offapi/com/sun/star/task/DocumentMSPasswordRequest.idl b/offapi/com/sun/star/task/DocumentMSPasswordRequest.idl
index 9df88fa..a7a95a9 100644
--- a/offapi/com/sun/star/task/DocumentMSPasswordRequest.idl
+++ b/offapi/com/sun/star/task/DocumentMSPasswordRequest.idl
@@ -37,7 +37,7 @@ module com { module sun { module star { module task {
 */
 published exception DocumentMSPasswordRequest: PasswordRequest
 {
-    /** the name of the document
+    /** the name of the document (more properly, the URL of the document)
     */
     string Name;
 
diff --git a/offapi/com/sun/star/task/DocumentPasswordRequest.idl b/offapi/com/sun/star/task/DocumentPasswordRequest.idl
index 762dd4a..0829d24 100644
--- a/offapi/com/sun/star/task/DocumentPasswordRequest.idl
+++ b/offapi/com/sun/star/task/DocumentPasswordRequest.idl
@@ -37,7 +37,7 @@ module com { module sun { module star { module task {
 */
 published exception DocumentPasswordRequest: PasswordRequest
 {
-    /** the name of the document
+    /** the name of the document (more properly, the URL of the document)
     */
     string Name;
 
diff --git a/sc/source/filter/ftools/fapihelper.cxx b/sc/source/filter/ftools/fapihelper.cxx
index 210215c..121491a 100644
--- a/sc/source/filter/ftools/fapihelper.cxx
+++ b/sc/source/filter/ftools/fapihelper.cxx
@@ -114,7 +114,7 @@ uno::Sequence< beans::NamedValue > ScfApiHelper::QueryEncryptionDataForMedium( S
     if ( pPasswordItem )
         aPassword = pPasswordItem->GetValue();
 
-    OUString aDocName = INetURLObject( rMedium.GetOrigURL() ).GetName( INetURLObject::DECODE_WITH_CHARSET );
+    OUString aDocName = rMedium.GetOrigURL();
 
     bool bIsDefaultPassword = false;
     aEncryptionData = ::comphelper::DocPasswordHelper::requestAndVerifyDocPassword(
diff --git a/sfx2/source/appl/appopen.cxx b/sfx2/source/appl/appopen.cxx
index 3cddd76..04c729e 100644
--- a/sfx2/source/appl/appopen.cxx
+++ b/sfx2/source/appl/appopen.cxx
@@ -241,7 +241,7 @@ sal_uInt32 CheckPasswd_Impl
                             if ( pEncryptionDataItem )
                                 pEncryptionDataItem->GetValue() >>= aEncryptionData;
 
-                            OUString aDocumentName = INetURLObject( pFile->GetOrigURL() ).GetMainURL( INetURLObject::DECODE_WITH_CHARSET );
+                            OUString aDocumentName = pFile->GetOrigURL();
 
                             SfxDocPasswordVerifier aVerifier( xStorage );
                             aEncryptionData = ::comphelper::DocPasswordHelper::requestAndVerifyDocPassword(
diff --git a/uui/source/passworddlg.cxx b/uui/source/passworddlg.cxx
index 3485a3c..4831bd3 100644
--- a/uui/source/passworddlg.cxx
+++ b/uui/source/passworddlg.cxx
@@ -20,6 +20,7 @@
 #include "passworddlg.hxx"
 #include "ids.hrc"
 
+#include <tools/urlobj.hxx>
 #include <vcl/layout.hxx>
 
 using namespace ::com::sun::star;
@@ -71,8 +72,10 @@ PasswordDialog::PasswordDialog(vcl::Window* _pParent,
     SetText( aTitle );
 
     sal_uInt16 nStrId = bOpenToModify ? STR_ENTER_PASSWORD_TO_MODIFY : STR_ENTER_PASSWORD_TO_OPEN;
-    m_pFTPassword->SetText(ResId(nStrId, *pResourceMgr).toString());
-    m_pFTPassword->SetText( m_pFTPassword->GetText() + aDocURL );
+    OUString aMessage(ResId(nStrId, *pResourceMgr).toString());
+    aMessage += INetURLObject(aDocURL).GetMainURL(INetURLObject::DECODE_UNAMBIGUOUS);
+    m_pFTPassword->SetText(aMessage);
+
     if (bIsSimplePasswordRequest)
     {
         DBG_ASSERT( aDocURL.isEmpty(), "A simple password request should not have a document URL! Use document password request instead." );


More information about the Libreoffice-commits mailing list