From cb28e48bfd7e8727797435dc05bdfe1652fb34f0 Mon Sep 17 00:00:00 2001 From: Mike Kaganski Date: Thu, 20 Jun 2019 23:07:30 +1000 Subject: Drop INetURLObject::GetName and INetURLObject::GetExtension They are just synonyms for GetLastName and GetFileExtension resp. Change-Id: Ic498c7025cc421b830394ed94d64529fd74fe7dd Reviewed-on: https://gerrit.libreoffice.org/74448 Tested-by: Jenkins Reviewed-by: Mike Kaganski --- sw/qa/extras/ooxmlexport/ooxmllinks.cxx | 5 +++-- sw/source/core/doc/docglbl.cxx | 2 +- sw/source/core/fields/docufld.cxx | 2 +- sw/source/core/unocore/swunohelper.cxx | 2 +- sw/source/filter/writer/writer.cxx | 2 +- sw/source/filter/ww8/ww8par.cxx | 3 ++- sw/source/uibase/dbui/dbmgr.cxx | 4 ++-- 7 files changed, 11 insertions(+), 9 deletions(-) (limited to 'sw') diff --git a/sw/qa/extras/ooxmlexport/ooxmllinks.cxx b/sw/qa/extras/ooxmlexport/ooxmllinks.cxx index 146497c23957..5b03e7ddf532 100644 --- a/sw/qa/extras/ooxmlexport/ooxmllinks.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmllinks.cxx @@ -42,8 +42,9 @@ bool bOk = aOriginalURL.setFSysPath(sOriginalFileName, FSysStyle::Detect); \ if (!bOk) \ aOriginalURL = INetURLObject(sOriginalFileName); \ - OUString sFileName \ - = aOriginalURL.GetName().isEmpty() ? sOriginalFileName : aOriginalURL.GetName(); \ + OUString sFileName = aOriginalURL.GetLastName().isEmpty() \ + ? sOriginalFileName \ + : aOriginalURL.GetLastName(); \ \ /* Get temp path */ \ OUString sTempDir = utl::TempFile::CreateTempName(); \ diff --git a/sw/source/core/doc/docglbl.cxx b/sw/source/core/doc/docglbl.cxx index 10521aa6ae54..d4522f54714e 100644 --- a/sw/source/core/doc/docglbl.cxx +++ b/sw/source/core/doc/docglbl.cxx @@ -411,7 +411,7 @@ bool SwDoc::SplitDoc( sal_uInt16 eDocType, const OUString& rPath, bool bOutline, default: { - const OUString sNm( INetURLObject( sFileName ).GetName() ); + const OUString sNm(INetURLObject(sFileName).GetLastName()); SwSectionData aSectData( FILE_LINK_SECTION, GetUniqueSectionName( &sNm )); SwSectionFormat* pFormat = MakeSectionFormat(); diff --git a/sw/source/core/fields/docufld.cxx b/sw/source/core/fields/docufld.cxx index 53e9097279eb..f8dcbd0d7e3f 100644 --- a/sw/source/core/fields/docufld.cxx +++ b/sw/source/core/fields/docufld.cxx @@ -607,7 +607,7 @@ OUString SwTemplNameFieldType::Expand(sal_uLong nFormat) const { INetURLObject aPathName( xDocProps->getTemplateURL() ); if( FF_NAME == nFormat ) - aRet = aPathName.GetName(URL_DECODE); + aRet = aPathName.GetLastName(URL_DECODE); else if( FF_NAME_NOEXT == nFormat ) aRet = aPathName.GetBase(); else diff --git a/sw/source/core/unocore/swunohelper.cxx b/sw/source/core/unocore/swunohelper.cxx index 29e76e9bd554..fe657d36fc53 100644 --- a/sw/source/core/unocore/swunohelper.cxx +++ b/sw/source/core/unocore/swunohelper.cxx @@ -80,7 +80,7 @@ bool UCB_MoveFile( const OUString& rURL, const OUString& rNewURL ) try { INetURLObject aURL( rNewURL ); - const OUString sName( aURL.GetName() ); + const OUString sName(aURL.GetLastName()); aURL.removeSegment(); const OUString sMainURL( aURL.GetMainURL(INetURLObject::DecodeMechanism::NONE) ); diff --git a/sw/source/filter/writer/writer.cxx b/sw/source/filter/writer/writer.cxx index be4fbe67571a..b67f6b928056 100644 --- a/sw/source/filter/writer/writer.cxx +++ b/sw/source/filter/writer/writer.cxx @@ -330,7 +330,7 @@ bool Writer::CopyLocalFileToINet( OUString& rFileNm ) OUString aSrc = rFileNm; OUString aDest = aTargetUrl.GetPartBeforeLastName(); - aDest += aFileUrl.GetName(); + aDest += aFileUrl.GetLastName(); SfxMedium aSrcFile( aSrc, StreamMode::READ ); SfxMedium aDstFile( aDest, StreamMode::WRITE | StreamMode::SHARE_DENYNONE ); diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx index 77fe6fae93c7..e81e395179ca 100644 --- a/sw/source/filter/ww8/ww8par.cxx +++ b/sw/source/filter/ww8/ww8par.cxx @@ -5551,7 +5551,8 @@ namespace { ::comphelper::DocPasswordRequest* pRequest = new ::comphelper::DocPasswordRequest( ::comphelper::DocPasswordRequestType::MS, task::PasswordRequestMode_PASSWORD_ENTER, - INetURLObject( rMedium.GetOrigURL() ).GetName( INetURLObject::DecodeMechanism::WithCharset ) ); + INetURLObject(rMedium.GetOrigURL()) + .GetLastName(INetURLObject::DecodeMechanism::WithCharset)); uno::Reference< task::XInteractionRequest > xRequest( pRequest ); xHandler->handle( xRequest ); diff --git a/sw/source/uibase/dbui/dbmgr.cxx b/sw/source/uibase/dbui/dbmgr.cxx index ec31fdc6a500..3b1adf7ea7ba 100644 --- a/sw/source/uibase/dbui/dbmgr.cxx +++ b/sw/source/uibase/dbui/dbmgr.cxx @@ -2622,7 +2622,7 @@ namespace sw { DBConnURIType GetDBunoType(const INetURLObject &rURL) { - OUString sExt(rURL.GetExtension()); + OUString sExt(rURL.GetFileExtension()); DBConnURIType type = DBConnURIType::UNKNOWN; if (sExt == "odb") @@ -2754,7 +2754,7 @@ Optionally add a prefix to the registered DB name. OUString LoadAndRegisterDataSource_Impl(DBConnURIType type, const uno::Reference< beans::XPropertySet > *pSettings, const INetURLObject &rURL, const OUString *pDestDir, SfxObjectShell* pDocShell) { - OUString sExt(rURL.GetExtension()); + OUString sExt(rURL.GetFileExtension()); uno::Any aTableFilterAny; uno::Any aSuppressVersionsAny; uno::Any aInfoAny; -- cgit