[Libreoffice-commits] core.git: cui/source fpicker/source svtools/source svx/source sw/source

Stephan Bergmann (via logerrit) logerrit at kemper.freedesktop.org
Wed Aug 21 18:02:06 UTC 2019


 cui/source/dialogs/linkdlg.cxx              |    4 ++--
 fpicker/source/office/RemoteFilesDialog.cxx |    2 +-
 svtools/source/dialogs/PlaceEditDialog.cxx  |    6 ++----
 svx/source/form/fmpage.cxx                  |    2 +-
 sw/source/uibase/dbui/dbmgr.cxx             |    4 ++--
 5 files changed, 8 insertions(+), 10 deletions(-)

New commits:
commit eaf9565c84017ae3f162b3b6fd229b9772bf513e
Author:     Stephan Bergmann <sbergman at redhat.com>
AuthorDate: Wed Aug 21 16:55:47 2019 +0200
Commit:     Stephan Bergmann <sbergman at redhat.com>
CommitDate: Wed Aug 21 20:00:47 2019 +0200

    Avoid extra calls to INetURLObject::decode
    
    Change-Id: I700c4093213395a12342534fb7685969b5e5b220
    Reviewed-on: https://gerrit.libreoffice.org/77891
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <sbergman at redhat.com>

diff --git a/cui/source/dialogs/linkdlg.cxx b/cui/source/dialogs/linkdlg.cxx
index be1f5e288f27..33f7529516da 100644
--- a/cui/source/dialogs/linkdlg.cxx
+++ b/cui/source/dialogs/linkdlg.cxx
@@ -559,8 +559,8 @@ void SvBaseLinksDlg::InsertEntry(const SvBaseLink& rLink, int nPos, bool bSelect
     auto nWidthPixel = m_xTbLinks->get_column_width(0);
     OUString aTxt = m_xVirDev->GetEllipsisString(sFileNm, nWidthPixel, DrawTextFlags::PathEllipsis);
     INetURLObject aPath( sFileNm, INetProtocol::File );
-    OUString aFileName = aPath.getName();
-    aFileName = INetURLObject::decode(aFileName, INetURLObject::DecodeMechanism::Unambiguous);
+    OUString aFileName = aPath.getName(
+        INetURLObject::LAST_SEGMENT, true, INetURLObject::DecodeMechanism::Unambiguous);
 
     if( aFileName.getLength() > aTxt.getLength() )
         aTxt = aFileName;
diff --git a/fpicker/source/office/RemoteFilesDialog.cxx b/fpicker/source/office/RemoteFilesDialog.cxx
index d23969aa574d..94649c6abb93 100644
--- a/fpicker/source/office/RemoteFilesDialog.cxx
+++ b/fpicker/source/office/RemoteFilesDialog.cxx
@@ -988,7 +988,7 @@ IMPL_LINK_NOARG( RemoteFilesDialog, SelectHdl, SvTreeListBox*, void )
 
                 m_sPath = aURL.GetMainURL( INetURLObject::DecodeMechanism::NONE );
 
-                m_pName_ed->SetText( INetURLObject::decode( aURL.GetLastName(), INetURLObject::DecodeMechanism::WithCharset ) );
+                m_pName_ed->SetText( aURL.GetLastName(INetURLObject::DecodeMechanism::WithCharset) );
             }
             else
             {
diff --git a/svtools/source/dialogs/PlaceEditDialog.cxx b/svtools/source/dialogs/PlaceEditDialog.cxx
index d26bec4c58e6..b832bd608e6b 100644
--- a/svtools/source/dialogs/PlaceEditDialog.cxx
+++ b/svtools/source/dialogs/PlaceEditDialog.cxx
@@ -134,10 +134,8 @@ PlaceEditDialog::PlaceEditDialog(weld::Window* pParent, const std::shared_ptr<Pl
             // Fill the Username field
             if ( rUrl.HasUserData( ) )
             {
-                m_xEDUsername->set_text( INetURLObject::decode( rUrl.GetUser( ),
-                                                              INetURLObject::DecodeMechanism::WithCharset ) );
-                m_aDetailsContainers[i]->setUsername( INetURLObject::decode( rUrl.GetUser( ),
-                                                              INetURLObject::DecodeMechanism::WithCharset ) );
+                m_xEDUsername->set_text( rUrl.GetUser(INetURLObject::DecodeMechanism::WithCharset) );
+                m_aDetailsContainers[i]->setUsername( rUrl.GetUser(INetURLObject::DecodeMechanism::WithCharset) );
             }
 
             m_xLBServerType->set_active(i);
diff --git a/svx/source/form/fmpage.cxx b/svx/source/form/fmpage.cxx
index 8b4718ae2da4..5fc8df9195c8 100644
--- a/svx/source/form/fmpage.cxx
+++ b/svx/source/form/fmpage.cxx
@@ -140,7 +140,7 @@ bool FmFormPage::RequestHelp( vcl::Window* pWindow, SdrView const * pView,
             for (const INetProtocol& i : s_aQuickHelpSupported)
                 if (i == aProtocol)
                 {
-                    aHelpText = INetURLObject::decode(aUrl.GetURLNoPass(), INetURLObject::DecodeMechanism::Unambiguous);
+                    aHelpText = aUrl.GetURLNoPass(INetURLObject::DecodeMechanism::Unambiguous);
                     break;
                 }
         }
diff --git a/sw/source/uibase/dbui/dbmgr.cxx b/sw/source/uibase/dbui/dbmgr.cxx
index 5a0c51b370c6..da555637fa6d 100644
--- a/sw/source/uibase/dbui/dbmgr.cxx
+++ b/sw/source/uibase/dbui/dbmgr.cxx
@@ -2779,8 +2779,8 @@ OUString LoadAndRegisterDataSource_Impl(DBConnURIType type, const uno::Reference
         uno::Reference<uno::XComponentContext> xContext(::comphelper::getProcessComponentContext());
         uno::Reference<sdb::XDatabaseContext> xDBContext = sdb::DatabaseContext::create(xContext);
 
-        OUString sNewName = INetURLObject::decode(rURL.getName(),
-            INetURLObject::DecodeMechanism::Unambiguous);
+        OUString sNewName = rURL.getName(
+            INetURLObject::LAST_SEGMENT, true, INetURLObject::DecodeMechanism::Unambiguous);
         sal_Int32 nExtLen = sExt.getLength();
         sNewName = sNewName.replaceAt(sNewName.getLength() - nExtLen - 1, nExtLen + 1, "");
 


More information about the Libreoffice-commits mailing list