diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2016-12-05 08:47:18 +0200 |
---|---|---|
committer | Ashod Nakashian <ashod.nakashian@collabora.co.uk> | 2017-12-18 01:07:53 -0500 |
commit | 3c4333c24882d6699b65d109f2cfbf7daf3122c6 (patch) | |
tree | 739dacdd38ddd2053aaa3ad7f0ffc053eb515d52 /sw | |
parent | 6b631a02d36aa09f7c06793e8b4482d3b67ab258 (diff) |
convert DecodeMechanism to scoped enum
(cherry picked from commit bfde4866e07746eafa2f0d6173c29d805cc35ad0)
(cherry picked from commit 3de922d4a695e253d4ca2d42b70e0b35b52e9b7c)
Change-Id: I5c56634b1bca8e37fa73d02d2428645301b6c547
Diffstat (limited to 'sw')
46 files changed, 92 insertions, 92 deletions
diff --git a/sw/qa/core/uwriter.cxx b/sw/qa/core/uwriter.cxx index ee0704824c2d..19133a595774 100644 --- a/sw/qa/core/uwriter.cxx +++ b/sw/qa/core/uwriter.cxx @@ -186,7 +186,7 @@ void SwDocTest::testFileNameFields() aTempFile.EnableKillingFile(); INetURLObject aTempFileURL(aTempFile.GetURL()); - OUString sFileURL = aTempFileURL.GetMainURL(INetURLObject::NO_DECODE); + OUString sFileURL = aTempFileURL.GetMainURL(INetURLObject::DecodeMechanism::NONE); SfxMedium aDstMed(sFileURL, StreamMode::STD_READWRITE); std::shared_ptr<SfxFilter> pFilter(new SfxFilter( @@ -205,7 +205,7 @@ void SwDocTest::testFileNameFields() { OUString sResult(aNameField.Expand(FF_NAME)); OUString sExpected(rUrlObj.getName(INetURLObject::LAST_SEGMENT, - true,INetURLObject::DECODE_WITH_CHARSET)); + true,INetURLObject::DecodeMechanism::WithCharset)); CPPUNIT_ASSERT_EQUAL_MESSAGE("Expected Readable FileName", sExpected, sResult); } @@ -226,7 +226,7 @@ void SwDocTest::testFileNameFields() { OUString sResult(aNameField.Expand(FF_NAME_NOEXT)); OUString sExpected(rUrlObj.getName(INetURLObject::LAST_SEGMENT, - true,INetURLObject::DECODE_WITH_CHARSET)); + true,INetURLObject::DecodeMechanism::WithCharset)); //Chop off .tmp sExpected = sExpected.copy(0, sExpected.getLength() - 4); CPPUNIT_ASSERT_EQUAL_MESSAGE("Expected Readable FileName", sExpected, sResult); diff --git a/sw/source/core/doc/DocumentLinksAdministrationManager.cxx b/sw/source/core/doc/DocumentLinksAdministrationManager.cxx index 1255eccc5433..ccbe757d2323 100644 --- a/sw/source/core/doc/DocumentLinksAdministrationManager.cxx +++ b/sw/source/core/doc/DocumentLinksAdministrationManager.cxx @@ -450,7 +450,7 @@ bool DocumentLinksAdministrationManager::SelectServerObj( const OUString& rStr, rpRange = nullptr; OUString sItem( INetURLObject::decode( rStr, - INetURLObject::DECODE_WITH_CHARSET )); + INetURLObject::DecodeMechanism::WithCharset )); sal_Int32 nPos = sItem.indexOf( cMarkSeparator ); diff --git a/sw/source/core/doc/docglbl.cxx b/sw/source/core/doc/docglbl.cxx index 5cccd88b1c69..479a7611a172 100644 --- a/sw/source/core/doc/docglbl.cxx +++ b/sw/source/core/doc/docglbl.cxx @@ -234,7 +234,7 @@ bool SwDoc::SplitDoc( sal_uInt16 eDocType, const OUString& rPath, bool bOutline, INetURLObject aEntry(rPath); OUString sLeading(aEntry.GetBase()); aEntry.removeSegment(); - OUString sPath = aEntry.GetMainURL( INetURLObject::NO_DECODE ); + OUString sPath = aEntry.GetMainURL( INetURLObject::DecodeMechanism::NONE ); utl::TempFile aTemp(sLeading, true, &sExt, &sPath); aTemp.EnableKillingFile(); diff --git a/sw/source/core/doc/notxtfrm.cxx b/sw/source/core/doc/notxtfrm.cxx index dcc23cc8942e..4050bf353df1 100644 --- a/sw/source/core/doc/notxtfrm.cxx +++ b/sw/source/core/doc/notxtfrm.cxx @@ -86,7 +86,7 @@ inline bool GetRealURL( const SwGrfNode& rNd, OUString& rText ) bool bRet = rNd.GetFileFilterNms( &rText, nullptr ); if( bRet ) rText = URIHelper::removePassword( rText, INetURLObject::EncodeMechanism::WasEncoded, - INetURLObject::DECODE_UNAMBIGUOUS); + INetURLObject::DecodeMechanism::Unambiguous); if (rText.startsWith("data:image")) rText = "inline image"; return bRet; diff --git a/sw/source/core/doc/visiturl.cxx b/sw/source/core/doc/visiturl.cxx index 7555205b64c8..fad1ebc57a83 100644 --- a/sw/source/core/doc/visiturl.cxx +++ b/sw/source/core/doc/visiturl.cxx @@ -46,7 +46,7 @@ void SwURLStateChanged::Notify( SfxBroadcaster& , const SfxHint& rHint ) { // This URL has been changed: const INetURLObject* pIURL = static_cast<const INetURLHistoryHint&>(rHint).GetObject(); - OUString sURL( pIURL->GetMainURL( INetURLObject::NO_DECODE ) ), sBkmk; + OUString sURL( pIURL->GetMainURL( INetURLObject::DecodeMechanism::NONE ) ), sBkmk; SwEditShell* pESh = pDoc->GetEditShell(); diff --git a/sw/source/core/draw/dpage.cxx b/sw/source/core/draw/dpage.cxx index 08b039fc934e..bea0588ea495 100644 --- a/sw/source/core/draw/dpage.cxx +++ b/sw/source/core/draw/dpage.cxx @@ -199,14 +199,14 @@ bool SwDPage::RequestHelp( vcl::Window* pWindow, SdrView* pView, if ( sText.isEmpty() ) sText = URIHelper::removePassword( pTmpObj->GetURL(), INetURLObject::EncodeMechanism::WasEncoded, - INetURLObject::DECODE_UNAMBIGUOUS); + INetURLObject::DecodeMechanism::Unambiguous); } } else if ( !rURL.GetURL().isEmpty() ) { sText = URIHelper::removePassword( rURL.GetURL(), INetURLObject::EncodeMechanism::WasEncoded, - INetURLObject::DECODE_UNAMBIGUOUS); + INetURLObject::DecodeMechanism::Unambiguous); if( rURL.IsServerMap() ) { diff --git a/sw/source/core/edit/edglss.cxx b/sw/source/core/edit/edglss.cxx index e4ba47455677..48ee031537c8 100644 --- a/sw/source/core/edit/edglss.cxx +++ b/sw/source/core/edit/edglss.cxx @@ -53,7 +53,7 @@ sal_uInt16 SwEditShell::MakeGlossary( SwTextBlocks& rBlks, const OUString& rName if(bSaveRelFile) { INetURLObject aURL( rBlks.GetFileName() ); - sBase = aURL.GetMainURL( INetURLObject::NO_DECODE ); + sBase = aURL.GetMainURL( INetURLObject::DecodeMechanism::NONE ); } rBlks.SetBaseURL( sBase ); @@ -87,7 +87,7 @@ sal_uInt16 SwEditShell::SaveGlossaryDoc( SwTextBlocks& rBlock, if(bSaveRelFile) { INetURLObject aURL( rBlock.GetFileName() ); - sBase = aURL.GetMainURL( INetURLObject::NO_DECODE ); + sBase = aURL.GetMainURL( INetURLObject::DecodeMechanism::NONE ); } rBlock.SetBaseURL( sBase ); sal_uInt16 nRet = USHRT_MAX; diff --git a/sw/source/core/fields/docufld.cxx b/sw/source/core/fields/docufld.cxx index bfca45b5a043..d38569b5ce59 100644 --- a/sw/source/core/fields/docufld.cxx +++ b/sw/source/core/fields/docufld.cxx @@ -99,7 +99,7 @@ #include <calbck.hxx> #include <docary.hxx> -#define URL_DECODE INetURLObject::DECODE_UNAMBIGUOUS +#define URL_DECODE INetURLObject::DecodeMechanism::Unambiguous using namespace ::com::sun::star; using namespace ::com::sun::star::uno; @@ -433,7 +433,7 @@ OUString SwFileNameFieldType::Expand(sal_uLong nFormat) const else { aRet = URIHelper::removePassword( - rURLObj.GetMainURL( INetURLObject::NO_DECODE ), + rURLObj.GetMainURL( INetURLObject::DecodeMechanism::NONE ), INetURLObject::EncodeMechanism::WasEncoded, URL_DECODE ); const sal_Int32 nPos = aRet.indexOf(rURLObj.GetLastName( URL_DECODE )); if (nPos>=0) @@ -445,7 +445,7 @@ OUString SwFileNameFieldType::Expand(sal_uLong nFormat) const break; case FF_NAME: - aRet = rURLObj.GetLastName( INetURLObject::DECODE_WITH_CHARSET ); + aRet = rURLObj.GetLastName( INetURLObject::DecodeMechanism::WithCharset ); break; case FF_NAME_NOEXT: @@ -457,7 +457,7 @@ OUString SwFileNameFieldType::Expand(sal_uLong nFormat) const aRet = rURLObj.GetFull(); else aRet = URIHelper::removePassword( - rURLObj.GetMainURL( INetURLObject::NO_DECODE ), + rURLObj.GetMainURL( INetURLObject::DecodeMechanism::NONE ), INetURLObject::EncodeMechanism::WasEncoded, URL_DECODE ); } } diff --git a/sw/source/core/graphic/ndgrf.cxx b/sw/source/core/graphic/ndgrf.cxx index a1c1ed456783..eb4a590370c0 100644 --- a/sw/source/core/graphic/ndgrf.cxx +++ b/sw/source/core/graphic/ndgrf.cxx @@ -128,7 +128,7 @@ SwGrfNode::SwGrfNode( const SwNodeIndex & rWhere, { INetURLObject aUrl( rGrfName ); if( INetProtocol::File == aUrl.GetProtocol() && - FStatHelper::IsDocument( aUrl.GetMainURL( INetURLObject::NO_DECODE ) )) + FStatHelper::IsDocument( aUrl.GetMainURL( INetURLObject::DecodeMechanism::NONE ) )) { // file exists, so create connection without an update static_cast<SwBaseLink*>( refLink.get() )->Connect(); diff --git a/sw/source/core/swg/SwXMLTextBlocks.cxx b/sw/source/core/swg/SwXMLTextBlocks.cxx index ef2181437ee5..e2561c511ad7 100644 --- a/sw/source/core/swg/SwXMLTextBlocks.cxx +++ b/sw/source/core/swg/SwXMLTextBlocks.cxx @@ -512,7 +512,7 @@ bool SwXMLTextBlocks::IsFileUCBStorage( const OUString & rFileName) OUString aURL; osl::FileBase::getFileURLFromSystemPath( aName, aURL ); aObj.SetURL( aURL ); - aName = aObj.GetMainURL( INetURLObject::NO_DECODE ); + aName = aObj.GetMainURL( INetURLObject::DecodeMechanism::NONE ); } SvStream * pStm = ::utl::UcbStreamHelper::CreateStream( aName, StreamMode::STD_READ ); diff --git a/sw/source/core/swg/swblocks.cxx b/sw/source/core/swg/swblocks.cxx index 9176f503cbbc..99f0751a41cb 100644 --- a/sw/source/core/swg/swblocks.cxx +++ b/sw/source/core/swg/swblocks.cxx @@ -236,7 +236,7 @@ SwTextBlocks::SwTextBlocks( const OUString& rFile ) : pImp( nullptr ), nErr( 0 ) { INetURLObject aObj(rFile); - const OUString sFileName = aObj.GetMainURL( INetURLObject::NO_DECODE ); + const OUString sFileName = aObj.GetMainURL( INetURLObject::DecodeMechanism::NONE ); switch( SwImpBlocks::GetFileType( rFile ) ) { case SwImpBlocks::FileType::XML: pImp = new SwXMLTextBlocks( sFileName ); break; diff --git a/sw/source/core/text/EnhancedPDFExportHelper.cxx b/sw/source/core/text/EnhancedPDFExportHelper.cxx index 993935d2e265..4be605774be9 100644 --- a/sw/source/core/text/EnhancedPDFExportHelper.cxx +++ b/sw/source/core/text/EnhancedPDFExportHelper.cxx @@ -1648,7 +1648,7 @@ void SwEnhancedPDFExportHelper::EnhancedPDFExport() // than one link to this destination: OUString aURL( INetURLObject::decode( p->rINetAttr.GetINetFormat().GetValue(), - INetURLObject::DECODE_UNAMBIGUOUS ) ); + INetURLObject::DecodeMechanism::Unambiguous ) ); // We have to distinguish between intern and real URLs const bool bIntern = '#' == aURL[0]; diff --git a/sw/source/core/unocore/swunohelper.cxx b/sw/source/core/unocore/swunohelper.cxx index 75d286148d5c..3e947d1cbde2 100644 --- a/sw/source/core/unocore/swunohelper.cxx +++ b/sw/source/core/unocore/swunohelper.cxx @@ -91,7 +91,7 @@ bool UCB_CopyFile( const OUString& rURL, const OUString& rNewURL, bool bCopyIsMo INetURLObject aURL( rNewURL ); const OUString sName( aURL.GetName() ); aURL.removeSegment(); - const OUString sMainURL( aURL.GetMainURL(INetURLObject::NO_DECODE) ); + const OUString sMainURL( aURL.GetMainURL(INetURLObject::DecodeMechanism::NONE) ); ucbhelper::Content aTempContent( sMainURL, css::uno::Reference< css::ucb::XCommandEnvironment >(), @@ -120,11 +120,11 @@ bool UCB_IsCaseSensitiveFileName( const OUString& rURL ) INetURLObject aTempObj( rURL ); aTempObj.SetBase( aTempObj.GetBase().toAsciiLowerCase() ); css::uno::Reference< css::ucb::XContentIdentifier > xRef1 = new - ucbhelper::ContentIdentifier( aTempObj.GetMainURL( INetURLObject::NO_DECODE )); + ucbhelper::ContentIdentifier( aTempObj.GetMainURL( INetURLObject::DecodeMechanism::NONE )); aTempObj.SetBase(aTempObj.GetBase().toAsciiUpperCase()); css::uno::Reference< css::ucb::XContentIdentifier > xRef2 = new - ucbhelper::ContentIdentifier( aTempObj.GetMainURL( INetURLObject::NO_DECODE )); + ucbhelper::ContentIdentifier( aTempObj.GetMainURL( INetURLObject::DecodeMechanism::NONE )); css::uno::Reference< css::ucb::XUniversalContentBroker > xUcb = css::ucb::UniversalContentBroker::create(comphelper::getProcessComponentContext()); diff --git a/sw/source/filter/basflt/iodetect.cxx b/sw/source/filter/basflt/iodetect.cxx index 4409dbfa70d4..de5e38f4f7c7 100644 --- a/sw/source/filter/basflt/iodetect.cxx +++ b/sw/source/filter/basflt/iodetect.cxx @@ -161,7 +161,7 @@ std::shared_ptr<const SfxFilter> SwIoSystem::GetFileFilter(const OUString& rFile INetURLObject aObj; aObj.SetSmartProtocol( INetProtocol::File ); aObj.SetSmartURL( rFileName ); - SfxMedium aMedium(aObj.GetMainURL(INetURLObject::NO_DECODE), StreamMode::STD_READ); + SfxMedium aMedium(aObj.GetMainURL(INetURLObject::DecodeMechanism::NONE), StreamMode::STD_READ); // templates should not get precedence over "normal" filters (#i35508, #i33168) std::shared_ptr<const SfxFilter> pTemplateFilter; diff --git a/sw/source/filter/basflt/shellio.cxx b/sw/source/filter/basflt/shellio.cxx index f8333f856ef9..504201be24c5 100644 --- a/sw/source/filter/basflt/shellio.cxx +++ b/sw/source/filter/basflt/shellio.cxx @@ -461,7 +461,7 @@ SwDoc* Reader::GetTemplateDoc() else { INetURLObject aTDir( aTemplateNm ); - const OUString aFileName = aTDir.GetMainURL( INetURLObject::NO_DECODE ); + const OUString aFileName = aTDir.GetMainURL( INetURLObject::DecodeMechanism::NONE ); OSL_ENSURE( !aTDir.HasError(), "No absolute path for template name!" ); DateTime aCurrDateTime( DateTime::SYSTEM ); bool bLoad = false; @@ -472,7 +472,7 @@ SwDoc* Reader::GetTemplateDoc() Date aTstDate( Date::EMPTY ); tools::Time aTstTime( tools::Time::EMPTY ); if( FStatHelper::GetModifiedDateTimeOfFile( - aTDir.GetMainURL( INetURLObject::NO_DECODE ), + aTDir.GetMainURL( INetURLObject::DecodeMechanism::NONE ), &aTstDate, &aTstTime ) && ( !pTemplate || aDStamp != aTstDate || aTStamp != aTstTime )) { diff --git a/sw/source/filter/html/SwAppletImpl.cxx b/sw/source/filter/html/SwAppletImpl.cxx index bfeb6e888a01..3df4e8a6a847 100644 --- a/sw/source/filter/html/SwAppletImpl.cxx +++ b/sw/source/filter/html/SwAppletImpl.cxx @@ -125,7 +125,7 @@ void SwApplet_Impl::CreateApplet( const OUString& rCode, const OUString& rName, INetURLObject aUrlBase(rDocumentBaseURL); aUrlBase.removeSegment(); - OUString sDocBase = aUrlBase.GetMainURL(INetURLObject::NO_DECODE); + OUString sDocBase = aUrlBase.GetMainURL(INetURLObject::DecodeMechanism::NONE); uno::Reference < beans::XPropertySet > xSet( xApplet->getComponent(), uno::UNO_QUERY ); if ( xSet.is() ) { diff --git a/sw/source/filter/html/htmlgrin.cxx b/sw/source/filter/html/htmlgrin.cxx index 2485f1123c95..72078ba85754 100644 --- a/sw/source/filter/html/htmlgrin.cxx +++ b/sw/source/filter/html/htmlgrin.cxx @@ -1158,7 +1158,7 @@ ANCHOR_SETEVENT: if( !aName.isEmpty() ) { OUString sDecoded( INetURLObject::decode( aName, - INetURLObject::DECODE_UNAMBIGUOUS )); + INetURLObject::DecodeMechanism::Unambiguous )); sal_Int32 nPos = sDecoded.lastIndexOf( cMarkSeparator ); if( nPos != -1 ) { diff --git a/sw/source/filter/html/htmlplug.cxx b/sw/source/filter/html/htmlplug.cxx index 468ba55f2a97..0a6294360536 100644 --- a/sw/source/filter/html/htmlplug.cxx +++ b/sw/source/filter/html/htmlplug.cxx @@ -886,7 +886,7 @@ void SwHTMLParser::InsertFloatingFrame() bool bHasBorder = aFrameDesc.HasFrameBorder(); Size aMargin = aFrameDesc.GetMargin(); - xSet->setPropertyValue("FrameURL", uno::makeAny( OUString( aFrameDesc.GetURL().GetMainURL( INetURLObject::NO_DECODE ) ) ) ); + xSet->setPropertyValue("FrameURL", uno::makeAny( OUString( aFrameDesc.GetURL().GetMainURL( INetURLObject::DecodeMechanism::NONE ) ) ) ); xSet->setPropertyValue("FrameName", uno::makeAny( aName ) ); if ( eScroll == ScrollingAuto ) diff --git a/sw/source/filter/html/wrthtml.cxx b/sw/source/filter/html/wrthtml.cxx index 147d17532208..09627bdf8985 100644 --- a/sw/source/filter/html/wrthtml.cxx +++ b/sw/source/filter/html/wrthtml.cxx @@ -1208,7 +1208,7 @@ OUString SwHTMLWriter::convertHyperlinkHRefValue(const OUString& rURL) { // Link is not started from "#", so looks like external link. Encode this URL. INetURLObject aURL(sURL); - sURL = aURL.GetMainURL(INetURLObject::NO_DECODE); + sURL = aURL.GetMainURL(INetURLObject::DecodeMechanism::NONE); } return URIHelper::simpleNormalizedMakeRelative( GetBaseURL(), sURL ); } diff --git a/sw/source/filter/ww8/wrtw8esh.cxx b/sw/source/filter/ww8/wrtw8esh.cxx index dbcbba0fe921..5cc7259a38b5 100644 --- a/sw/source/filter/ww8/wrtw8esh.cxx +++ b/sw/source/filter/ww8/wrtw8esh.cxx @@ -151,7 +151,7 @@ OUString SwBasicEscherEx::BuildFileName(sal_uInt16& rnLevel, bool& rbRel, const // try to convert to relative file name OUString aTmpName( aDosName ); aDosName = INetURLObject::GetRelURL( GetBasePath(), rUrl, - INetURLObject::EncodeMechanism::WasEncoded, INetURLObject::DECODE_WITH_CHARSET ); + INetURLObject::EncodeMechanism::WasEncoded, INetURLObject::DecodeMechanism::WithCharset ); if (aDosName.startsWith(INET_FILE_SCHEME)) { diff --git a/sw/source/filter/ww8/wrtw8nds.cxx b/sw/source/filter/ww8/wrtw8nds.cxx index 2d3bfb107cbe..1765fbc373ad 100644 --- a/sw/source/filter/ww8/wrtw8nds.cxx +++ b/sw/source/filter/ww8/wrtw8nds.cxx @@ -949,8 +949,8 @@ bool AttributeOutputBase::AnalyzeURL( const OUString& rUrl, const OUString& /*rT else { INetURLObject aURL( rUrl, INetProtocol::NotValid ); - sURL = aURL.GetURLNoMark( INetURLObject::DECODE_UNAMBIGUOUS ); - sMark = aURL.GetMark( INetURLObject::DECODE_UNAMBIGUOUS ); + sURL = aURL.GetURLNoMark( INetURLObject::DecodeMechanism::Unambiguous ); + sMark = aURL.GetMark( INetURLObject::DecodeMechanism::Unambiguous ); } if ( !sMark.isEmpty() && sURL.isEmpty() ) @@ -1156,7 +1156,7 @@ OUString BookmarkToWord(const OUString &rBookmark) OUString BookmarkToWriter(const OUString &rBookmark) { return INetURLObject::decode(rBookmark, - INetURLObject::DECODE_UNAMBIGUOUS, RTL_TEXTENCODING_ASCII_US); + INetURLObject::DecodeMechanism::Unambiguous, RTL_TEXTENCODING_ASCII_US); } void SwWW8AttrIter::OutSwFormatRefMark(const SwFormatRefMark& rAttr, bool) diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx index 216150651009..c8dd83267387 100644 --- a/sw/source/filter/ww8/ww8par.cxx +++ b/sw/source/filter/ww8/ww8par.cxx @@ -199,7 +199,7 @@ void lclGetAbsPath(OUString& rPath, sal_uInt16 nLevel, SwDocShell* pDocShell) if (!aTmpStr.isEmpty()) { bool bWasAbs = false; - rPath = pDocShell->GetMedium()->GetURLObject().smartRel2Abs( aTmpStr, bWasAbs ).GetMainURL( INetURLObject::NO_DECODE ); + rPath = pDocShell->GetMedium()->GetURLObject().smartRel2Abs( aTmpStr, bWasAbs ).GetMainURL( INetURLObject::DecodeMechanism::NONE ); // full path as stored in SvxURLField must be encoded } } @@ -4829,7 +4829,7 @@ void SwWW8ImplReader::ReadDocInfo() { OUString aName = pMedium->GetName(); INetURLObject aURL( aName ); - sTemplateURL = aURL.GetMainURL(INetURLObject::DECODE_TO_IURI); + sTemplateURL = aURL.GetMainURL(INetURLObject::DecodeMechanism::ToIUri); if ( !sTemplateURL.isEmpty() ) xDocProps->setTemplateURL( sTemplateURL ); } @@ -5612,7 +5612,7 @@ namespace { ::comphelper::DocPasswordRequest* pRequest = new ::comphelper::DocPasswordRequest( ::comphelper::DocPasswordRequestType::MS, task::PasswordRequestMode_PASSWORD_ENTER, - INetURLObject( rMedium.GetOrigURL() ).GetName( INetURLObject::DECODE_WITH_CHARSET ) ); + INetURLObject( rMedium.GetOrigURL() ).GetName( INetURLObject::DecodeMechanism::WithCharset ) ); uno::Reference< task::XInteractionRequest > xRequest( pRequest ); xHandler->handle( xRequest ); diff --git a/sw/source/filter/xml/xmltexti.cxx b/sw/source/filter/xml/xmltexti.cxx index 06a6bbe6aeb3..3cc7372f8986 100644 --- a/sw/source/filter/xml/xmltexti.cxx +++ b/sw/source/filter/xml/xmltexti.cxx @@ -575,7 +575,7 @@ uno::Reference< XPropertySet > SwXMLTextImportHelper::createAndInsertOOoLink( uno::Sequence< beans::PropertyValue > aMediaDescriptor( 1 ); aMediaDescriptor[0].Name = "URL"; - aMediaDescriptor[0].Value <<= OUString( aURLObj.GetMainURL( INetURLObject::NO_DECODE ) ); + aMediaDescriptor[0].Value <<= OUString( aURLObj.GetMainURL( INetURLObject::DecodeMechanism::NONE ) ); if ( pDoc->GetDocShell() && pDoc->GetDocShell()->GetMedium() ) { uno::Reference< task::XInteractionHandler > xInteraction = @@ -721,7 +721,7 @@ uno::Reference< XPropertySet > SwXMLTextImportHelper::createAndInsertPlugin( { if( bValidURL ) xSet->setPropertyValue("PluginURL", - makeAny( OUString( aURLObj.GetMainURL( INetURLObject::NO_DECODE ) ) ) ); + makeAny( OUString( aURLObj.GetMainURL( INetURLObject::DecodeMechanism::NONE ) ) ) ); if( bValidMimeType ) xSet->setPropertyValue("PluginMimeType", makeAny( OUString( rMimeType ) ) ); diff --git a/sw/source/ui/chrdlg/chardlg.cxx b/sw/source/ui/chrdlg/chardlg.cxx index 660d769aa340..5eb7cbce9f60 100644 --- a/sw/source/ui/chrdlg/chardlg.cxx +++ b/sw/source/ui/chrdlg/chardlg.cxx @@ -210,7 +210,7 @@ void SwCharURLPage::Reset(const SfxItemSet* rSet) { const SwFormatINetFormat* pINetFormat = static_cast<const SwFormatINetFormat*>( pItem); m_pURLED->SetText(INetURLObject::decode(pINetFormat->GetValue(), - INetURLObject::DECODE_UNAMBIGUOUS)); + INetURLObject::DecodeMechanism::Unambiguous)); m_pURLED->SaveValue(); m_pNameED->SetText(pINetFormat->GetName()); diff --git a/sw/source/ui/dbui/addresslistdialog.cxx b/sw/source/ui/dbui/addresslistdialog.cxx index 682e5b76035a..617957d5c7a6 100644 --- a/sw/source/ui/dbui/addresslistdialog.cxx +++ b/sw/source/ui/dbui/addresslistdialog.cxx @@ -385,7 +385,7 @@ IMPL_LINK(SwAddressListDialog, CreateHdl_Impl, Button*, pButton, void) INetURLObject aTempURL(aURL); aTempURL.removeSegment(); aTempURL.removeFinalSlash(); - const OUString sDBURL("sdbc:flat:" + aTempURL.GetMainURL(INetURLObject::NO_DECODE)); + const OUString sDBURL("sdbc:flat:" + aTempURL.GetMainURL(INetURLObject::DecodeMechanism::NONE)); xDataProperties->setPropertyValue("URL", Any(sDBURL)); //set the filter to the file name without extension uno::Sequence<OUString> aFilters { sNewName }; diff --git a/sw/source/ui/dbui/createaddresslistdialog.cxx b/sw/source/ui/dbui/createaddresslistdialog.cxx index 27086a9338f0..7c87d4875fd6 100644 --- a/sw/source/ui/dbui/createaddresslistdialog.cxx +++ b/sw/source/ui/dbui/createaddresslistdialog.cxx @@ -636,7 +636,7 @@ IMPL_LINK_NOARG(SwCreateAddressListDialog, OkHdl_Impl, Button*, void) m_sURL = xFP->getSelectedFiles().getConstArray()[0]; INetURLObject aResult( m_sURL ); aResult.setExtension("csv"); - m_sURL = aResult.GetMainURL(INetURLObject::NO_DECODE); + m_sURL = aResult.GetMainURL(INetURLObject::DecodeMechanism::NONE); } } if(!m_sURL.isEmpty()) diff --git a/sw/source/ui/dbui/mmresultdialogs.cxx b/sw/source/ui/dbui/mmresultdialogs.cxx index 509f6bb329a7..78836ebaf028 100644 --- a/sw/source/ui/dbui/mmresultdialogs.cxx +++ b/sw/source/ui/dbui/mmresultdialogs.cxx @@ -165,7 +165,7 @@ SwSaveWarningBox_Impl::SwSaveWarningBox_Impl(vcl::Window* pParent, const OUStrin INetURLObject aTmp(rFileName); m_pPrimaryMessage->SetText(m_pPrimaryMessage->GetText().replaceAll("%1", aTmp.getName( - INetURLObject::LAST_SEGMENT, true, INetURLObject::DECODE_WITH_CHARSET))); + INetURLObject::LAST_SEGMENT, true, INetURLObject::DecodeMechanism::WithCharset))); ModifyHdl(*m_pEdit); } @@ -429,7 +429,7 @@ void SwMMResultEmailDialog::FillInEmailSettings() { INetURLObject aTmp(pDocShell->GetMedium()->GetName()); m_pAttachmentED->SetText(aTmp.getName( - INetURLObject::LAST_SEGMENT, true, INetURLObject::DECODE_WITH_CHARSET )); + INetURLObject::LAST_SEGMENT, true, INetURLObject::DecodeMechanism::WithCharset )); } } @@ -713,7 +713,7 @@ IMPL_LINK(SwMMResultSaveDialog, SaveOutputHdl_Impl, Button*, pButton, void) documentStartPageNumber(xConfigItem.get(), nDoc), documentEndPageNumber(xConfigItem.get(), nDoc)); pTargetView->GetWrtShell().EndAction(); //then save it - OUString sOutPath = aURL.GetMainURL(INetURLObject::DECODE_TO_IURI); + OUString sOutPath = aURL.GetMainURL(INetURLObject::DecodeMechanism::ToIUri); OUString sCounter = "_" + OUString::number(nDoc); sOutPath = sOutPath.replaceAt( sOutPath.getLength() - sExtension.getLength() - 1, 0, sCounter); diff --git a/sw/source/ui/dialog/uiregionsw.cxx b/sw/source/ui/dialog/uiregionsw.cxx index 496654aaeb76..722ec47ca64c 100644 --- a/sw/source/ui/dialog/uiregionsw.cxx +++ b/sw/source/ui/dialog/uiregionsw.cxx @@ -204,7 +204,7 @@ SectRepr::SectRepr( size_t nPos, SwSection& rSect ) void SectRepr::SetFile( const OUString& rFile ) { OUString sNewFile( INetURLObject::decode( rFile, - INetURLObject::DECODE_UNAMBIGUOUS )); + INetURLObject::DecodeMechanism::Unambiguous )); const OUString sOldFileName( m_SectionData.GetLinkFileName() ); const OUString sSub( sOldFileName.getToken( 2, sfx2::cTokenSeparator ) ); @@ -289,7 +289,7 @@ OUString SectRepr::GetFile() const .replaceFirst( OUStringLiteral1(sfx2::cTokenSeparator), " ", &n ); } return INetURLObject::decode( sLinkFile.getToken( 0, sfx2::cTokenSeparator ), - INetURLObject::DECODE_UNAMBIGUOUS ); + INetURLObject::DecodeMechanism::Unambiguous ); } OUString SectRepr::GetSubRegion() const @@ -1319,7 +1319,7 @@ IMPL_LINK( SwEditRegionDlg, DlgClosedHdl, sfx2::FileDialogHelper *, _pFileDlg, v std::unique_ptr<SfxMedium> pMedium(m_pDocInserter->CreateMedium("sglobal")); if ( pMedium ) { - sFileName = pMedium->GetURLObject().GetMainURL( INetURLObject::NO_DECODE ); + sFileName = pMedium->GetURLObject().GetMainURL( INetURLObject::DecodeMechanism::NONE ); sFilterName = pMedium->GetFilter()->GetFilterName(); const SfxPoolItem* pItem; if ( SfxItemState::SET == pMedium->GetItemSet()->GetItemState( SID_PASSWORD, false, &pItem ) ) @@ -1358,7 +1358,7 @@ IMPL_LINK( SwEditRegionDlg, SubRegionEventHdl, VclWindowEvent&, rEvent, void ) //load file and set the shell SfxMedium aMedium( sFileName, StreamMode::STD_READ ); - sFileName = aMedium.GetURLObject().GetMainURL( INetURLObject::NO_DECODE ); + sFileName = aMedium.GetURLObject().GetMainURL( INetURLObject::DecodeMechanism::NONE ); ::lcl_ReadSections(aMedium, *m_pSubRegionED); } else @@ -1786,13 +1786,13 @@ IMPL_LINK( SwInsertSectionTabPage, DlgClosedHdl, sfx2::FileDialogHelper *, _pFil std::unique_ptr<SfxMedium> pMedium(m_pDocInserter->CreateMedium("sglobal")); if ( pMedium ) { - m_sFileName = pMedium->GetURLObject().GetMainURL( INetURLObject::NO_DECODE ); + m_sFileName = pMedium->GetURLObject().GetMainURL( INetURLObject::DecodeMechanism::NONE ); m_sFilterName = pMedium->GetFilter()->GetFilterName(); const SfxPoolItem* pItem; if ( SfxItemState::SET == pMedium->GetItemSet()->GetItemState( SID_PASSWORD, false, &pItem ) ) m_sFilePasswd = static_cast<const SfxStringItem*>(pItem)->GetValue(); m_pFileNameED->SetText( INetURLObject::decode( - m_sFileName, INetURLObject::DECODE_UNAMBIGUOUS ) ); + m_sFileName, INetURLObject::DecodeMechanism::Unambiguous ) ); ::lcl_ReadSections(*pMedium, *m_pSubRegionED); } } diff --git a/sw/source/ui/frmdlg/frmpage.cxx b/sw/source/ui/frmdlg/frmpage.cxx index 800b95018813..14f50e134a7a 100644 --- a/sw/source/ui/frmdlg/frmpage.cxx +++ b/sw/source/ui/frmdlg/frmpage.cxx @@ -2589,7 +2589,7 @@ IMPL_LINK_NOARG(SwGrfExtPage, BrowseHdl, Button*, void) { // remember selected filter aFilterName = pGrfDlg->GetCurrentFilter(); aNewGrfName = INetURLObject::decode( pGrfDlg->GetPath(), - INetURLObject::DECODE_UNAMBIGUOUS ); + INetURLObject::DecodeMechanism::Unambiguous ); m_pConnectED->SetModifyFlag(); m_pConnectED->SetText( aNewGrfName ); //reset mirrors because maybe a Bitmap was swapped with @@ -2781,7 +2781,7 @@ void SwFrameURLPage::Reset( const SfxItemSet *rSet ) { const SwFormatURL* pFormatURL = static_cast<const SwFormatURL*>(pItem); pURLED->SetText( INetURLObject::decode( pFormatURL->GetURL(), - INetURLObject::DECODE_UNAMBIGUOUS )); + INetURLObject::DecodeMechanism::Unambiguous )); pNameED->SetText( pFormatURL->GetName()); pClientCB->Enable( pFormatURL->GetMap() != nullptr ); diff --git a/sw/source/ui/index/cnttab.cxx b/sw/source/ui/index/cnttab.cxx index db83e1cc0ba7..25197fbfd13d 100644 --- a/sw/source/ui/index/cnttab.cxx +++ b/sw/source/ui/index/cnttab.cxx @@ -1264,7 +1264,7 @@ void SwTOXSelectTabPage::Reset( const SfxItemSet* ) m_pTypeLB->SelectEntryPos(m_pTypeLB->GetEntryPos(reinterpret_cast<void*>(nData))); sAutoMarkURL = INetURLObject::decode( rSh.GetTOIAutoMarkURL(), - INetURLObject::DECODE_UNAMBIGUOUS ); + INetURLObject::DecodeMechanism::Unambiguous ); m_pFromFileCB->Check( !sAutoMarkURL.isEmpty() ); m_pCaptionSequenceLB->Clear(); diff --git a/sw/source/ui/misc/glosbib.cxx b/sw/source/ui/misc/glosbib.cxx index fa2804d0ffbf..85ec9bfdc5f9 100644 --- a/sw/source/ui/misc/glosbib.cxx +++ b/sw/source/ui/misc/glosbib.cxx @@ -79,7 +79,7 @@ SwGlossaryGroupDlg::SwGlossaryGroupDlg(vcl::Window * pParent, for (size_t i = 0; i < rPathArr.size(); ++i) { INetURLObject aTempURL(rPathArr[i]); - const OUString sPath = aTempURL.GetMainURL(INetURLObject::DECODE_WITH_CHARSET ); + const OUString sPath = aTempURL.GetMainURL(INetURLObject::DecodeMechanism::WithCharset ); m_pPathLB->InsertEntry(sPath); sal_uLong nCaseReadonly = 0; utl::TempFile aTempFile(&sPath); diff --git a/sw/source/ui/vba/vbatemplate.cxx b/sw/source/ui/vba/vbatemplate.cxx index 69ff6ee85fea..a23735a9c8ec 100644 --- a/sw/source/ui/vba/vbatemplate.cxx +++ b/sw/source/ui/vba/vbatemplate.cxx @@ -74,7 +74,7 @@ SwVbaTemplate::getPath() throw ( css::uno::RuntimeException, std::exception ) if( !msFullUrl.isEmpty() ) { INetURLObject aURL( msFullUrl ); - OUString sURL( aURL.GetMainURL( INetURLObject::DECODE_TO_IURI ) ); + OUString sURL( aURL.GetMainURL( INetURLObject::DecodeMechanism::ToIUri ) ); sURL = sURL.copy( 0, sURL.getLength() - aURL.GetLastName().getLength() - 1 ); ::osl::File::getSystemPathFromFileURL( sURL, sPath ); } diff --git a/sw/source/uibase/app/docsh.cxx b/sw/source/uibase/app/docsh.cxx index 9af6ebac308e..0412b11d3baa 100644 --- a/sw/source/uibase/app/docsh.cxx +++ b/sw/source/uibase/app/docsh.cxx @@ -430,7 +430,7 @@ bool SwDocShell::SaveAs( SfxMedium& rMedium ) const INetURLObject& rOldURLObject = GetMedium()->GetURLObject(); OUString aURL = "vnd.sun.star.pkg://"; - aURL += INetURLObject::encode(rOldURLObject.GetMainURL(INetURLObject::DECODE_WITH_CHARSET), INetURLObject::PART_AUTHORITY, INetURLObject::EncodeMechanism::All); + aURL += INetURLObject::encode(rOldURLObject.GetMainURL(INetURLObject::DecodeMechanism::WithCharset), INetURLObject::PART_AUTHORITY, INetURLObject::EncodeMechanism::All); aURL += "/" + INetURLObject::encode(m_pDoc->GetDBManager()->getEmbeddedName(), INetURLObject::PART_FPATH, INetURLObject::EncodeMechanism::All); uno::Reference<sdb::XDocumentDataSource> xDataSource(xDatabaseContext->getByName(aURL), uno::UNO_QUERY); diff --git a/sw/source/uibase/app/docsh2.cxx b/sw/source/uibase/app/docsh2.cxx index 2fb1557bbd41..ebdefb402a27 100644 --- a/sw/source/uibase/app/docsh2.cxx +++ b/sw/source/uibase/app/docsh2.cxx @@ -1629,7 +1629,7 @@ int SwFindDocShell( SfxObjectShellRef& xDocSh, // 2. Open the file ourselves std::unique_ptr<SfxMedium> xMed(new SfxMedium( aTmpObj.GetMainURL( - INetURLObject::NO_DECODE ), StreamMode::READ )); + INetURLObject::DecodeMechanism::NONE ), StreamMode::READ )); if( INetProtocol::File == aTmpObj.GetProtocol() ) xMed->Download(); // Touch the medium (download it) diff --git a/sw/source/uibase/config/uinums.cxx b/sw/source/uibase/config/uinums.cxx index a3943a968111..9d2772a32998 100644 --- a/sw/source/uibase/config/uinums.cxx +++ b/sw/source/uibase/config/uinums.cxx @@ -58,7 +58,7 @@ void SwChapterNumRules::Save() aURL.setFinalSlash(); aURL.Append(CHAPTER_FILENAME); - SfxMedium aMedium( aURL.GetMainURL(INetURLObject::NO_DECODE), StreamMode::WRITE ); + SfxMedium aMedium( aURL.GetMainURL(INetURLObject::DecodeMechanism::NONE), StreamMode::WRITE ); SvStream* pStream = aMedium.GetOutStream(); bool bRet = (pStream && pStream->GetError() == 0); if (bRet) diff --git a/sw/source/uibase/dbui/dbmgr.cxx b/sw/source/uibase/dbui/dbmgr.cxx index 57604f77780d..14e9c52833e0 100644 --- a/sw/source/uibase/dbui/dbmgr.cxx +++ b/sw/source/uibase/dbui/dbmgr.cxx @@ -270,7 +270,7 @@ void SAL_CALL SwDataSourceRemovedListener::revokedDatabaseLocation(const sdb::Da if (!pDocShell) return; - OUString aOwnURL = pDocShell->GetMedium()->GetURLObject().GetMainURL(INetURLObject::DECODE_WITH_CHARSET); + OUString aOwnURL = pDocShell->GetMedium()->GetURLObject().GetMainURL(INetURLObject::DecodeMechanism::WithCharset); OUString sTmpName = "vnd.sun.star.pkg://"; sTmpName += INetURLObject::encode(aOwnURL, INetURLObject::PART_AUTHORITY, INetURLObject::EncodeMechanism::All); sTmpName += "/" + m_pDBManager->getEmbeddedName(); @@ -865,7 +865,7 @@ static void lcl_SaveDebugDoc( SfxObjectShell *xTargetDocShell, if( aTempDir.IsValid() ) { INetURLObject aTempDirURL( aTempDir.GetURL() ); - sTempDirURL = aTempDirURL.GetMainURL( INetURLObject::NO_DECODE ); + sTempDirURL = aTempDirURL.GetMainURL( INetURLObject::DecodeMechanism::NONE ); SAL_INFO( "sw.mailmerge", "Dump directory: " << sTempDirURL ); } } @@ -880,7 +880,7 @@ static void lcl_SaveDebugDoc( SfxObjectShell *xTargetDocShell, utl::TempFile aTempFile( basename, true, &sExt, &sTempDirURL ); INetURLObject aTempFileURL( aTempFile.GetURL() ); SfxMedium* pDstMed = new SfxMedium( - aTempFileURL.GetMainURL( INetURLObject::NO_DECODE ), + aTempFileURL.GetMainURL( INetURLObject::DecodeMechanism::NONE ), StreamMode::STD_READWRITE ); bool bAnyError = !xTargetDocShell->DoSaveAs( *pDstMed ); // xObjectShell->DoSaveCompleted crashes the mail merge unit tests, so skip it @@ -902,7 +902,7 @@ static bool lcl_SaveDoc( SwWrtShell& rWorkShell, OUString * const decodedURL = nullptr ) { - OUString url = pFileURL->GetMainURL( INetURLObject::NO_DECODE ); + OUString url = pFileURL->GetMainURL( INetURLObject::DecodeMechanism::NONE ); if( decodedURL ) (*decodedURL) = url; @@ -1213,7 +1213,7 @@ bool SwDBManager::MergeMailFiles(SwWrtShell* pSourceShell, // setup the output format std::shared_ptr<const SfxFilter> pStoreToFilter = SwIoSystem::GetFileFilter( - pSourceDocSh->GetMedium()->GetURLObject().GetMainURL(INetURLObject::NO_DECODE)); + pSourceDocSh->GetMedium()->GetURLObject().GetMainURL(INetURLObject::DecodeMechanism::NONE)); SfxFilterContainer* pFilterContainer = SwDocShell::Factory().GetFilterContainer(); const OUString* pStoreToFilterOptions = nullptr; @@ -1381,7 +1381,7 @@ bool SwDBManager::MergeMailFiles(SwWrtShell* pSourceShell, INetURLObject aEntry( sPrefix ); sLeading = aEntry.GetBase(); aEntry.removeSegment(); - sPrefix = aEntry.GetMainURL( INetURLObject::NO_DECODE ); + sPrefix = aEntry.GetMainURL( INetURLObject::DecodeMechanism::NONE ); } OUString sExt(comphelper::string::stripStart(pStoreToFilter->GetDefaultExtension(), '*')); @@ -2654,7 +2654,7 @@ SwDBManager::DBConnURITypes SwDBManager::GetDBunoURI(const OUString &rURI, uno:: || sExt.equalsIgnoreAsciiCase("xlsx")) { OUString sDBURL("sdbc:calc:"); - sDBURL += aURL.GetMainURL(INetURLObject::NO_DECODE); + sDBURL += aURL.GetMainURL(INetURLObject::DecodeMechanism::NONE); aURLAny <<= sDBURL; type = DBCONN_CALC; } @@ -2670,7 +2670,7 @@ SwDBManager::DBConnURITypes SwDBManager::GetDBunoURI(const OUString &rURI, uno:: aURL.removeSegment(); aURL.removeFinalSlash(); OUString sDBURL("sdbc:dbase:"); - sDBURL += aURL.GetMainURL(INetURLObject::NO_DECODE); + sDBURL += aURL.GetMainURL(INetURLObject::DecodeMechanism::NONE); aURLAny <<= sDBURL; type = DBCONN_DBASE; } @@ -2680,7 +2680,7 @@ SwDBManager::DBConnURITypes SwDBManager::GetDBunoURI(const OUString &rURI, uno:: aURL.removeFinalSlash(); OUString sDBURL("sdbc:flat:"); //only the 'path' has to be added - sDBURL += aURL.GetMainURL(INetURLObject::NO_DECODE); + sDBURL += aURL.GetMainURL(INetURLObject::DecodeMechanism::NONE); aURLAny <<= sDBURL; type = DBCONN_FLAT; } @@ -2712,7 +2712,7 @@ OUString lcl_getOwnURL(SwDocShell* pDocShell) return aRet; const INetURLObject& rURLObject = pDocShell->GetMedium()->GetURLObject(); - aRet = rURLObject.GetMainURL(INetURLObject::DECODE_WITH_CHARSET); + aRet = rURLObject.GetMainURL(INetURLObject::DecodeMechanism::WithCharset); return aRet; } @@ -2754,7 +2754,7 @@ OUString SwDBManager::LoadAndRegisterDataSource(const DBConnURITypes type, const uno::Reference<sdb::XDatabaseContext> xDBContext = sdb::DatabaseContext::create(xContext); OUString sNewName = INetURLObject::decode( aURL.getName(), - INetURLObject::DECODE_UNAMBIGUOUS ); + INetURLObject::DecodeMechanism::Unambiguous ); sal_Int32 nExtLen = aURL.GetExtension().getLength(); sNewName = sNewName.replaceAt( sNewName.getLength() - nExtLen - 1, nExtLen + 1, "" ); if (pPrefix) @@ -2773,7 +2773,7 @@ OUString SwDBManager::LoadAndRegisterDataSource(const DBConnURITypes type, const if(!bStore) { //odb-file - uno::Any aDataSource = xDBContext->getByName(aURL.GetMainURL(INetURLObject::NO_DECODE)); + uno::Any aDataSource = xDBContext->getByName(aURL.GetMainURL(INetURLObject::DecodeMechanism::NONE)); aDataSource >>= xNewInstance; } else @@ -2885,7 +2885,7 @@ void SwDBManager::LoadAndRegisterEmbeddedDataSource(const SwDBData& rData, const // Encode the stream name and the real path into a single URL. const INetURLObject& rURLObject = rDocShell.GetMedium()->GetURLObject(); OUString aURL = "vnd.sun.star.pkg://"; - aURL += INetURLObject::encode(rURLObject.GetMainURL(INetURLObject::DECODE_WITH_CHARSET), INetURLObject::PART_AUTHORITY, INetURLObject::EncodeMechanism::All); + aURL += INetURLObject::encode(rURLObject.GetMainURL(INetURLObject::DecodeMechanism::WithCharset), INetURLObject::PART_AUTHORITY, INetURLObject::EncodeMechanism::All); aURL += "/" + INetURLObject::encode(m_sEmbeddedName, INetURLObject::PART_FPATH, INetURLObject::EncodeMechanism::All); uno::Reference<uno::XInterface> xDataSource(xDatabaseContext->getByName(aURL), uno::UNO_QUERY); diff --git a/sw/source/uibase/dochdl/gloshdl.cxx b/sw/source/uibase/dochdl/gloshdl.cxx index 07b5a7a4e415..fe066e0ab13b 100644 --- a/sw/source/uibase/dochdl/gloshdl.cxx +++ b/sw/source/uibase/dochdl/gloshdl.cxx @@ -115,7 +115,7 @@ void SwGlossaryHdl::SetCurGroup(const OUString &rGrp, bool bApi, bool bAlwaysCre INetURLObject aTemp( pCurGrp->GetFileName() ); const OUString sCurBase = aTemp.getBase(); aTemp.removeSegment(); - const OUString sCurEntryPath = aTemp.GetMainURL(INetURLObject::NO_DECODE); + const OUString sCurEntryPath = aTemp.GetMainURL(INetURLObject::DecodeMechanism::NONE); const std::vector<OUString> & rPathArr = rStatGlossaries.GetPathArray(); sal_uInt16 nCurrentPath = USHRT_MAX; for (size_t nPath = 0; nPath < rPathArr.size(); ++nPath) diff --git a/sw/source/uibase/dochdl/swdtflvr.cxx b/sw/source/uibase/dochdl/swdtflvr.cxx index 1dd926abd808..9d042ce618c3 100644 --- a/sw/source/uibase/dochdl/swdtflvr.cxx +++ b/sw/source/uibase/dochdl/swdtflvr.cxx @@ -227,9 +227,9 @@ SwTransferable::SwTransferable( SwWrtShell& rSh ) { const INetURLObject& rURLObj = pDShell->GetMedium()->GetURLObject(); m_aObjDesc.maDisplayName = URIHelper::removePassword( - rURLObj.GetMainURL( INetURLObject::NO_DECODE ), + rURLObj.GetMainURL( INetURLObject::DecodeMechanism::NONE ), INetURLObject::EncodeMechanism::WasEncoded, - INetURLObject::DECODE_UNAMBIGUOUS ); + INetURLObject::DecodeMechanism::Unambiguous ); } PrepareOLE( m_aObjDesc ); @@ -2503,7 +2503,7 @@ bool SwTransferable::PasteAsHyperlink( TransferableDataHelper& rData, INetURLObject aURL; aURL.SetSmartProtocol( INetProtocol::File ); aURL.SetSmartURL( sFile ); - sFile = aURL.GetMainURL( INetURLObject::NO_DECODE ); + sFile = aURL.GetMainURL( INetURLObject::DecodeMechanism::NONE ); switch( rSh.GetObjCntTypeOfSelection() ) { @@ -2553,7 +2553,7 @@ bool SwTransferable::PasteFileName( TransferableDataHelper& rData, INetURLObject aMediaURL; aMediaURL.SetSmartURL( sFile ); - const OUString aMediaURLStr( aMediaURL.GetMainURL( INetURLObject::NO_DECODE ) ); + const OUString aMediaURLStr( aMediaURL.GetMainURL( INetURLObject::DecodeMechanism::NONE ) ); if( ::avmedia::MediaWindow::isMediaURL( aMediaURLStr, ""/*TODO?*/ ) ) { @@ -2597,7 +2597,7 @@ bool SwTransferable::PasteFileName( TransferableDataHelper& rData, INetURLObject aURL; aURL.SetSmartProtocol( INetProtocol::File ); aURL.SetSmartURL( sFile ); - sFile = aURL.GetMainURL( INetURLObject::NO_DECODE ); + sFile = aURL.GetMainURL( INetURLObject::DecodeMechanism::NONE ); switch( rSh.GetObjCntTypeOfSelection() ) { diff --git a/sw/source/uibase/docvw/edtwin2.cxx b/sw/source/uibase/docvw/edtwin2.cxx index f0f65e1ae090..ea84cdd7fd8c 100644 --- a/sw/source/uibase/docvw/edtwin2.cxx +++ b/sw/source/uibase/docvw/edtwin2.cxx @@ -169,7 +169,7 @@ void SwEditWin::RequestHelp(const HelpEvent &rEvt) sText = static_cast<const SfxStringItem*>(aContentAtPos.aFnd.pAttr)->GetValue(); sText = URIHelper::removePassword( sText, INetURLObject::EncodeMechanism::WasEncoded, - INetURLObject::DECODE_UNAMBIGUOUS); + INetURLObject::DecodeMechanism::Unambiguous); //#i63832# remove the link target type sal_Int32 nFound = sText.indexOf(cMarkSeparator); if( nFound != -1 && (++nFound) < sText.getLength() ) diff --git a/sw/source/uibase/shells/grfsh.cxx b/sw/source/uibase/shells/grfsh.cxx index 9d101211db5d..acc79e9fd85e 100644 --- a/sw/source/uibase/shells/grfsh.cxx +++ b/sw/source/uibase/shells/grfsh.cxx @@ -341,7 +341,7 @@ void SwGrfShell::Execute(SfxRequest &rReq) if( !sGrfNm.isEmpty() ) { aSet.Put( SvxBrushItem( INetURLObject::decode( sGrfNm, - INetURLObject::DECODE_UNAMBIGUOUS ), + INetURLObject::DecodeMechanism::Unambiguous ), sFilterNm, GPOS_LT, SID_ATTR_GRAF_GRAPHIC )); } diff --git a/sw/source/uibase/uiview/view2.cxx b/sw/source/uibase/uiview/view2.cxx index c32e469a1951..155cd1738aad 100644 --- a/sw/source/uibase/uiview/view2.cxx +++ b/sw/source/uibase/uiview/view2.cxx @@ -266,7 +266,7 @@ int SwView::InsertGraphic( const OUString &rPath, const OUString &rFilter, SwDocShell* pDocSh = GetDocShell(); INetURLObject aTemp( pDocSh->HasName() ? - pDocSh->GetMedium()->GetURLObject().GetMainURL( INetURLObject::NO_DECODE ) : + pDocSh->GetMedium()->GetURLObject().GetMainURL( INetURLObject::DecodeMechanism::NONE ) : OUString()); OUString sURL = URIHelper::SmartRel2Abs( @@ -1928,7 +1928,7 @@ bool SwView::JumpToSwMark( const OUString& rMark ) const SwFormatINetFormat* pINet; OUString sCmp; OUString sMark( INetURLObject::decode( rMark, - INetURLObject::DECODE_WITH_CHARSET )); + INetURLObject::DecodeMechanism::WithCharset )); sal_Int32 nLastPos, nPos = sMark.indexOf( cMarkSeparator ); if( -1 != nPos ) diff --git a/sw/source/uibase/uno/unoatxt.cxx b/sw/source/uibase/uno/unoatxt.cxx index 47a09f94c807..69c9e2e3a52a 100644 --- a/sw/source/uibase/uno/unoatxt.cxx +++ b/sw/source/uibase/uno/unoatxt.cxx @@ -380,7 +380,7 @@ uno::Reference< text::XAutoTextEntry > SwXAutoTextGroup::insertNewByName(const if(rCfg.IsSaveRelFile()) { INetURLObject aTemp(pGlosGroup->GetFileName()); - pGlosGroup->SetBaseURL( aTemp.GetMainURL(INetURLObject::NO_DECODE)); + pGlosGroup->SetBaseURL( aTemp.GetMainURL(INetURLObject::DecodeMechanism::NONE)); } else pGlosGroup->SetBaseURL( OUString() ); diff --git a/sw/source/uibase/uno/unomailmerge.cxx b/sw/source/uibase/uno/unomailmerge.cxx index ce881d741c00..223a57c1f356 100644 --- a/sw/source/uibase/uno/unomailmerge.cxx +++ b/sw/source/uibase/uno/unomailmerge.cxx @@ -718,7 +718,7 @@ uno::Any SAL_CALL SwXMailMerge::execute( if (aCurOutputURL.isEmpty()) { aURLObj.removeSegment(); - aCurOutputURL = aURLObj.GetMainURL( INetURLObject::DECODE_TO_IURI ); + aCurOutputURL = aURLObj.GetMainURL( INetURLObject::DecodeMechanism::ToIUri ); } } else // default empty document without URL @@ -728,7 +728,7 @@ uno::Any SAL_CALL SwXMailMerge::execute( } aURLObj.SetSmartURL( aCurOutputURL ); - OUString aPath = aURLObj.GetMainURL( INetURLObject::DECODE_TO_IURI ); + OUString aPath = aURLObj.GetMainURL( INetURLObject::DecodeMechanism::ToIUri ); const OUString aDelim( "/" ); if (!aPath.isEmpty() && !aPath.endsWith(aDelim)) diff --git a/sw/source/uibase/utlui/content.cxx b/sw/source/uibase/utlui/content.cxx index ed5cb8159904..3a3974c79358 100644 --- a/sw/source/uibase/utlui/content.cxx +++ b/sw/source/uibase/utlui/content.cxx @@ -165,7 +165,7 @@ namespace p->sText, INetURLObject::decode( p->rINetAttr.GetINetFormat().GetValue(), - INetURLObject::DECODE_UNAMBIGUOUS ), + INetURLObject::DecodeMechanism::Unambiguous ), &p->rINetAttr, n ); pMember->insert( pCnt ); @@ -568,7 +568,7 @@ void SwContentType::FillMemberList(bool* pbLevelOrVisibilityChanged) pWrtShell->GetGrfNms( &sLink, nullptr, static_cast<const SwFlyFrameFormat*>( pFrameFormat)); pCnt = new SwGraphicContent(this, sFrameName, INetURLObject::decode( sLink, - INetURLObject::DECODE_UNAMBIGUOUS ), + INetURLObject::DecodeMechanism::Unambiguous ), pFrameFormat->FindLayoutRect(false, &aNullPt).Top()); } else diff --git a/sw/source/uibase/utlui/glbltree.cxx b/sw/source/uibase/utlui/glbltree.cxx index 06f44efccf7f..267711b580d5 100644 --- a/sw/source/uibase/utlui/glbltree.cxx +++ b/sw/source/uibase/utlui/glbltree.cxx @@ -732,7 +732,7 @@ void SwGlobalTree::InsertRegion( const SwGlblDocContent* pCont, const OUString* aFileNames.realloc(1); INetURLObject aFileName; aFileName.SetSmartURL( *pFileName ); - aFileNames.getArray()[0] = aFileName.GetMainURL( INetURLObject::NO_DECODE ); + aFileNames.getArray()[0] = aFileName.GetMainURL( INetURLObject::DecodeMechanism::NONE ); InsertRegion( pCont, aFileNames ); } } @@ -944,7 +944,7 @@ void SwGlobalTree::ExecuteContextMenuAction( sal_uInt16 nSelectedPopupEntry ) SID_SAVEASDOC, SfxCallMode::SYNCHRON )); SfxObjectShell& rObj = *pViewFrame->GetObjectShell(); const SfxMedium* pMedium = rObj.GetMedium(); - OUString sNewFile(pMedium->GetURLObject().GetMainURL(INetURLObject::DECODE_TO_IURI)); + OUString sNewFile(pMedium->GetURLObject().GetMainURL(INetURLObject::DecodeMechanism::ToIUri)); // Insert the area with the Doc-Name // Bring the own Doc in the foreground if(aFrameListener.IsValid() && !sNewFile.isEmpty()) @@ -1170,7 +1170,7 @@ void SwGlobalTree::OpenDoc(const SwGlblDocContent* pCont) while( !bFound && pCurr ) { if(pCurr->GetMedium() && - pCurr->GetMedium()->GetURLObject().GetMainURL(INetURLObject::DECODE_TO_IURI) == sFileName) + pCurr->GetMedium()->GetURLObject().GetMainURL(INetURLObject::DecodeMechanism::ToIUri) == sFileName) { bFound = true; SwGlobalTree::SetShowShell(pCurr); @@ -1307,7 +1307,7 @@ void SwGlobalTree::InsertRegion( const SwGlblDocContent* _pContent, const Sequen INetURLObject aFileUrl; aFileUrl.SetSmartURL( sFileName ); OUString sSectionName(aFileUrl.GetLastName( - INetURLObject::DECODE_UNAMBIGUOUS).getToken(0, sfx2::cTokenSeparator)); + INetURLObject::DecodeMechanism::Unambiguous).getToken(0, sfx2::cTokenSeparator)); sal_uInt16 nSectCount = rSh.GetSectionFormatCount(); OUString sTempSectionName(sSectionName); sal_uInt16 nAddNumber = 0; @@ -1365,7 +1365,7 @@ IMPL_LINK( SwGlobalTree, DialogClosedHdl, sfx2::FileDialogHelper*, _pFileDlg, vo sal_Int32 nPos = 0; for (SfxMedium* pMed : *pMedList) { - OUString sFileName = pMed->GetURLObject().GetMainURL( INetURLObject::NO_DECODE ) + OUString sFileName = pMed->GetURLObject().GetMainURL( INetURLObject::DecodeMechanism::NONE ) + OUStringLiteral1(sfx2::cTokenSeparator) + pMed->GetFilter()->GetFilterName() + OUStringLiteral1(sfx2::cTokenSeparator); diff --git a/sw/source/uibase/utlui/navipi.cxx b/sw/source/uibase/utlui/navipi.cxx index 6204b0e098a9..90aa8da023d0 100644 --- a/sw/source/uibase/utlui/navipi.cxx +++ b/sw/source/uibase/utlui/navipi.cxx @@ -1035,7 +1035,7 @@ OUString SwNavigationPI::CreateDropFileName( TransferableDataHelper& rData ) } if( !sFileName.isEmpty() ) { - sFileName = INetURLObject( sFileName ).GetMainURL( INetURLObject::NO_DECODE ); + sFileName = INetURLObject( sFileName ).GetMainURL( INetURLObject::DecodeMechanism::NONE ); } return sFileName; } |