diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2015-04-02 15:58:06 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2015-04-02 16:30:34 +0200 |
commit | 44b3e56bb4a4df59f53447c4ca4d8e02fe926206 (patch) | |
tree | 71a9efde3a6a2a00688e8feb8e3086cb32eceb4f /sw | |
parent | 0b4965bcd7ec911951e7ca3a4cd48062843b2634 (diff) |
Change INetProtocol to scoped enumeration
...and fix o3tl::enumarray::operator [] const overload
Change-Id: I749b1b9d68686b03a97074253478d9d2d9d32b0b
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/core/doc/DocumentLinksAdministrationManager.cxx | 4 | ||||
-rw-r--r-- | sw/source/core/doc/acmplwrd.cxx | 2 | ||||
-rw-r--r-- | sw/source/core/fields/docufld.cxx | 4 | ||||
-rw-r--r-- | sw/source/core/graphic/ndgrf.cxx | 2 | ||||
-rw-r--r-- | sw/source/core/swg/SwXMLTextBlocks.cxx | 2 | ||||
-rw-r--r-- | sw/source/core/unocore/unofield.cxx | 4 | ||||
-rw-r--r-- | sw/source/filter/basflt/iodetect.cxx | 2 | ||||
-rw-r--r-- | sw/source/filter/html/htmlgrin.cxx | 2 | ||||
-rw-r--r-- | sw/source/filter/ww8/wrtw8esh.cxx | 4 | ||||
-rw-r--r-- | sw/source/filter/ww8/wrtw8nds.cxx | 10 | ||||
-rw-r--r-- | sw/source/filter/ww8/ww8par.cxx | 4 | ||||
-rw-r--r-- | sw/source/ui/envelp/mailmrge.cxx | 4 | ||||
-rw-r--r-- | sw/source/ui/fldui/javaedit.cxx | 4 | ||||
-rw-r--r-- | sw/source/ui/vba/vbadocument.cxx | 2 | ||||
-rw-r--r-- | sw/source/ui/vba/vbadocuments.cxx | 2 | ||||
-rw-r--r-- | sw/source/ui/vba/vbasystem.cxx | 2 | ||||
-rw-r--r-- | sw/source/uibase/app/docsh2.cxx | 2 | ||||
-rw-r--r-- | sw/source/uibase/dochdl/swdtflvr.cxx | 4 | ||||
-rw-r--r-- | sw/source/uibase/shells/textsh.cxx | 2 | ||||
-rw-r--r-- | sw/source/uibase/uno/unomailmerge.cxx | 2 | ||||
-rw-r--r-- | sw/source/uibase/uno/unomod.cxx | 2 |
21 files changed, 33 insertions, 33 deletions
diff --git a/sw/source/core/doc/DocumentLinksAdministrationManager.cxx b/sw/source/core/doc/DocumentLinksAdministrationManager.cxx index c336871bea49..45733f588737 100644 --- a/sw/source/core/doc/DocumentLinksAdministrationManager.cxx +++ b/sw/source/core/doc/DocumentLinksAdministrationManager.cxx @@ -77,8 +77,8 @@ namespace rLnkMgr.GetDisplayNames( xLink, 0, &sFName, 0, 0 ); INetURLObject aURL( sFName ); - if( INET_PROT_FILE == aURL.GetProtocol() || - INET_PROT_CID == aURL.GetProtocol() ) + if( INetProtocol::FILE == aURL.GetProtocol() || + INetProtocol::CID == aURL.GetProtocol() ) return pLnk; } } diff --git a/sw/source/core/doc/acmplwrd.cxx b/sw/source/core/doc/acmplwrd.cxx index 8a4749e86857..1170ef387d63 100644 --- a/sw/source/core/doc/acmplwrd.cxx +++ b/sw/source/core/doc/acmplwrd.cxx @@ -242,7 +242,7 @@ bool SwAutoCompleteWord::InsertWord( const OUString& rWord, SwDoc& rDoc ) if( pMedium ) { const INetURLObject& rURL = pMedium->GetURLObject(); - if ( rURL.GetProtocol() == INET_PROT_VND_SUN_STAR_HELP ) + if ( rURL.GetProtocol() == INetProtocol::VND_SUN_STAR_HELP ) return false; } diff --git a/sw/source/core/fields/docufld.cxx b/sw/source/core/fields/docufld.cxx index 34d147b9aa7f..efae9eed545e 100644 --- a/sw/source/core/fields/docufld.cxx +++ b/sw/source/core/fields/docufld.cxx @@ -422,7 +422,7 @@ OUString SwFileNameFieldType::Expand(sal_uLong nFmt) const { case FF_PATH: { - if( INET_PROT_FILE == rURLObj.GetProtocol() ) + if( INetProtocol::FILE == rURLObj.GetProtocol() ) { INetURLObject aTemp(rURLObj); aTemp.removeSegment(); @@ -452,7 +452,7 @@ OUString SwFileNameFieldType::Expand(sal_uLong nFmt) const break; default: - if( INET_PROT_FILE == rURLObj.GetProtocol() ) + if( INetProtocol::FILE == rURLObj.GetProtocol() ) aRet = rURLObj.GetFull(); else aRet = URIHelper::removePassword( diff --git a/sw/source/core/graphic/ndgrf.cxx b/sw/source/core/graphic/ndgrf.cxx index 228e61ba4169..2d38b75cc2a9 100644 --- a/sw/source/core/graphic/ndgrf.cxx +++ b/sw/source/core/graphic/ndgrf.cxx @@ -127,7 +127,7 @@ SwGrfNode::SwGrfNode( const SwNodeIndex & rWhere, if( IsLinkedFile() ) { INetURLObject aUrl( rGrfName ); - if( INET_PROT_FILE == aUrl.GetProtocol() && + if( INetProtocol::FILE == aUrl.GetProtocol() && FStatHelper::IsDocument( aUrl.GetMainURL( INetURLObject::NO_DECODE ) )) { // file exists, so create connection without an update diff --git a/sw/source/core/swg/SwXMLTextBlocks.cxx b/sw/source/core/swg/SwXMLTextBlocks.cxx index 4154767253e9..75186b277a18 100644 --- a/sw/source/core/swg/SwXMLTextBlocks.cxx +++ b/sw/source/core/swg/SwXMLTextBlocks.cxx @@ -523,7 +523,7 @@ bool SwXMLTextBlocks::IsFileUCBStorage( const OUString & rFileName) { OUString aName( rFileName ); INetURLObject aObj( aName ); - if ( aObj.GetProtocol() == INET_PROT_NOT_VALID ) + if ( aObj.GetProtocol() == INetProtocol::NOT_VALID ) { OUString aURL; ::utl::LocalFileHelper::ConvertPhysicalNameToURL( aName, aURL ); diff --git a/sw/source/core/unocore/unofield.cxx b/sw/source/core/unocore/unofield.cxx index b5faf4192354..3b37e31c82a7 100644 --- a/sw/source/core/unocore/unofield.cxx +++ b/sw/source/core/unocore/unofield.cxx @@ -886,7 +886,7 @@ throw (beans::UnknownPropertyException, lang::WrappedTargetException, // a non-empty string. INetURLObject aObj; aObj.SetURL( aDataSource ); - bool bIsURL = aObj.GetProtocol() != INET_PROT_NOT_VALID; + bool bIsURL = aObj.GetProtocol() != INetProtocol::NOT_VALID; if (bIsURL && rPropertyName == UNO_NAME_DATA_BASE_URL) pStr = &aDataSource; // DataBaseURL else if (!bIsURL && rPropertyName == UNO_NAME_DATA_BASE_NAME) @@ -925,7 +925,7 @@ throw (beans::UnknownPropertyException, lang::WrappedTargetException, // only one of these properties returns a non-empty string. INetURLObject aObj; aObj.SetURL(m_pImpl->m_sParam5); // SetSmartURL - bool bIsURL = aObj.GetProtocol() != INET_PROT_NOT_VALID; + bool bIsURL = aObj.GetProtocol() != INetProtocol::NOT_VALID; if (bIsURL && rPropertyName == UNO_NAME_DATA_BASE_URL) aRet <<= m_pImpl->m_sParam5; // DataBaseURL else if ( rPropertyName == UNO_NAME_DATA_BASE_NAME) diff --git a/sw/source/filter/basflt/iodetect.cxx b/sw/source/filter/basflt/iodetect.cxx index e9bb306c9310..af2f911f987b 100644 --- a/sw/source/filter/basflt/iodetect.cxx +++ b/sw/source/filter/basflt/iodetect.cxx @@ -158,7 +158,7 @@ const SfxFilter* SwIoSystem::GetFileFilter(const OUString& rFileName) // package storage or OLEStorage based format SotStorageRef xStg; INetURLObject aObj; - aObj.SetSmartProtocol( INET_PROT_FILE ); + aObj.SetSmartProtocol( INetProtocol::FILE ); aObj.SetSmartURL( rFileName ); SfxMedium aMedium(aObj.GetMainURL(INetURLObject::NO_DECODE), STREAM_STD_READ); diff --git a/sw/source/filter/html/htmlgrin.cxx b/sw/source/filter/html/htmlgrin.cxx index 38f06b0af863..fb5b960ab38c 100644 --- a/sw/source/filter/html/htmlgrin.cxx +++ b/sw/source/filter/html/htmlgrin.cxx @@ -466,7 +466,7 @@ IMAGE_SETEVENT: Graphic aGraphic; INetURLObject aGraphicURL( sGrfNm ); - if( aGraphicURL.GetProtocol() == INET_PROT_DATA ) + if( aGraphicURL.GetProtocol() == INetProtocol::DATA ) { std::unique_ptr<SvMemoryStream> const pStream(aGraphicURL.getData()); if (pStream) diff --git a/sw/source/filter/ww8/wrtw8esh.cxx b/sw/source/filter/ww8/wrtw8esh.cxx index 0e03963d58b0..40977d4dbe6e 100644 --- a/sw/source/filter/ww8/wrtw8esh.cxx +++ b/sw/source/filter/ww8/wrtw8esh.cxx @@ -219,7 +219,7 @@ void SwBasicEscherEx::WriteHyperlinkWithinFly( SvMemoryStream& rStrm, const SwFm } // file link or URL - if (eProtocol == INET_PROT_FILE || (eProtocol == INET_PROT_NOT_VALID && rUrl[0] != '#')) + if (eProtocol == INetProtocol::FILE || (eProtocol == INetProtocol::NOT_VALID && rUrl[0] != '#')) { sal_uInt16 nLevel; bool bRel; @@ -242,7 +242,7 @@ void SwBasicEscherEx::WriteHyperlinkWithinFly( SvMemoryStream& rStrm, const SwFm tmpStrm.WriteUInt16( 0x0003 ); SwWW8Writer::WriteString16(tmpStrm, aFileName, false); } - else if( eProtocol != INET_PROT_NOT_VALID ) + else if( eProtocol != INetProtocol::NOT_VALID ) { tmpStrm.Write( maGuidUrlMoniker,sizeof(maGuidUrlMoniker) ); SwWW8Writer::WriteLong(tmpStrm, 2*(rUrl.getLength()+1)); diff --git a/sw/source/filter/ww8/wrtw8nds.cxx b/sw/source/filter/ww8/wrtw8nds.cxx index 49d2a80b1c22..ed3f07edf3e0 100644 --- a/sw/source/filter/ww8/wrtw8nds.cxx +++ b/sw/source/filter/ww8/wrtw8nds.cxx @@ -877,7 +877,7 @@ bool AttributeOutputBase::AnalyzeURL( const OUString& rUrl, const OUString& /*rT } else { - INetURLObject aURL( rUrl, INET_PROT_NOT_VALID ); + INetURLObject aURL( rUrl, INetProtocol::NOT_VALID ); sURL = aURL.GetURLNoMark( INetURLObject::DECODE_UNAMBIGUOUS ); sMark = aURL.GetMark( INetURLObject::DECODE_UNAMBIGUOUS ); } @@ -993,7 +993,7 @@ bool WW8AttributeOutput::StartURL( const OUString &rUrl, const OUString &rTarget SwWW8Writer::WriteLong( *m_rWW8Export.pDataStrm, nFlag ); INetProtocol eProto = aURL.GetProtocol(); - if ( eProto == INET_PROT_FILE || eProto == INET_PROT_SMB ) + if ( eProto == INetProtocol::FILE || eProto == INetProtocol::SMB ) { // version 1 (for a document) @@ -1011,7 +1011,7 @@ bool WW8AttributeOutput::StartURL( const OUString &rUrl, const OUString &rTarget // save the links to files as relative sURL = URIHelper::simpleNormalizedMakeRelative( m_rWW8Export.GetWriter().GetBaseURL(), sURL ); - if ( eProto == INET_PROT_FILE && sURL.startsWith( "/" ) ) + if ( eProto == INetProtocol::FILE && sURL.startsWith( "/" ) ) sURL = aURL.PathToFileName(); // special case for the absolute windows names @@ -1028,7 +1028,7 @@ bool WW8AttributeOutput::StartURL( const OUString &rUrl, const OUString &rTarget // n#261623 convert smb notation to '\\' const char pSmb[] = "smb://"; - if ( eProto == INET_PROT_SMB && sURL.startsWith( pSmb ) ) + if ( eProto == INetProtocol::SMB && sURL.startsWith( pSmb ) ) { sURL = sURL.copy( sizeof(pSmb)-3 ).replaceAll( "/", "\\" ); } @@ -1044,7 +1044,7 @@ bool WW8AttributeOutput::StartURL( const OUString &rUrl, const OUString &rTarget SwWW8Writer::WriteShort( *m_rWW8Export.pDataStrm, 3 ); SwWW8Writer::WriteString16( *m_rWW8Export.pDataStrm, sURL, false ); } - else if ( eProto != INET_PROT_NOT_VALID ) + else if ( eProto != INetProtocol::NOT_VALID ) { // version 2 (simple url) // an write some data to the data stream, but dont ask diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx index e2446d1c2ef3..615b2af56e2e 100644 --- a/sw/source/filter/ww8/ww8par.cxx +++ b/sw/source/filter/ww8/ww8par.cxx @@ -4743,7 +4743,7 @@ static void lcl_createTemplateToProjectEntry( const uno::Reference< container::X { INetURLObject aObj; aObj.SetURL( sTemplatePathOrURL ); - bool bIsURL = aObj.GetProtocol() != INET_PROT_NOT_VALID; + bool bIsURL = aObj.GetProtocol() != INetProtocol::NOT_VALID; OUString aURL; if ( bIsURL ) aURL = sTemplatePathOrURL; @@ -4828,7 +4828,7 @@ bool SwWW8ImplReader::ReadGlobalTemplateSettings( const OUString& sCreatedFrom, { INetURLObject aObj; aObj.SetURL( sGlobalTemplates[ i ] ); - bool bIsURL = aObj.GetProtocol() != INET_PROT_NOT_VALID; + bool bIsURL = aObj.GetProtocol() != INetProtocol::NOT_VALID; OUString aURL; if ( bIsURL ) aURL = sGlobalTemplates[ i ]; diff --git a/sw/source/ui/envelp/mailmrge.cxx b/sw/source/ui/envelp/mailmrge.cxx index 7316fb8022b3..592f643645ad 100644 --- a/sw/source/ui/envelp/mailmrge.cxx +++ b/sw/source/ui/envelp/mailmrge.cxx @@ -314,7 +314,7 @@ SwMailMergeDlg::SwMailMergeDlg(vcl::Window* pParent, SwWrtShell& rShell, sPath = aPathOpt.GetWorkPath(); } INetURLObject aURL(sPath); - if(aURL.GetProtocol() == INET_PROT_FILE) + if(aURL.GetProtocol() == INetProtocol::FILE) m_pPathED->SetText(aURL.PathToFileName()); else m_pPathED->SetText(aURL.GetFull()); @@ -605,7 +605,7 @@ IMPL_LINK_NOARG(SwMailMergeDlg, InsertPathHdl) if( xFP->execute() == RET_OK ) { INetURLObject aURL(xFP->getDirectory()); - if(aURL.GetProtocol() == INET_PROT_FILE) + if(aURL.GetProtocol() == INetProtocol::FILE) m_pPathED->SetText(aURL.PathToFileName()); else m_pPathED->SetText(aURL.GetFull()); diff --git a/sw/source/ui/fldui/javaedit.cxx b/sw/source/ui/fldui/javaedit.cxx index 0e270865bf2e..2271593839c9 100644 --- a/sw/source/ui/fldui/javaedit.cxx +++ b/sw/source/ui/fldui/javaedit.cxx @@ -161,7 +161,7 @@ void SwJavaEditDialog::CheckTravel() if(!sURL.isEmpty()) { INetURLObject aINetURL(sURL); - if(INET_PROT_FILE == aINetURL.GetProtocol()) + if(INetProtocol::FILE == aINetURL.GetProtocol()) sURL = aINetURL.PathToFileName(); } m_pUrlED->SetText(sURL); @@ -267,7 +267,7 @@ IMPL_LINK_NOARG(SwJavaEditDialog, DlgClosedHdl) if ( !sFileName.isEmpty() ) { INetURLObject aINetURL( sFileName ); - if ( INET_PROT_FILE == aINetURL.GetProtocol() ) + if ( INetProtocol::FILE == aINetURL.GetProtocol() ) sFileName = aINetURL.PathToFileName(); } m_pUrlED->SetText( sFileName ); diff --git a/sw/source/ui/vba/vbadocument.cxx b/sw/source/ui/vba/vbadocument.cxx index b3979f5be7e8..912cf162c9bb 100644 --- a/sw/source/ui/vba/vbadocument.cxx +++ b/sw/source/ui/vba/vbadocument.cxx @@ -270,7 +270,7 @@ SwVbaDocument::setAttachedTemplate( const css::uno::Any& _attachedtemplate ) thr OUString aURL; INetURLObject aObj; aObj.SetURL( sTemplate ); - bool bIsURL = aObj.GetProtocol() != INET_PROT_NOT_VALID; + bool bIsURL = aObj.GetProtocol() != INetProtocol::NOT_VALID; if ( bIsURL ) aURL = sTemplate; else diff --git a/sw/source/ui/vba/vbadocuments.cxx b/sw/source/ui/vba/vbadocuments.cxx index 87ad6169eaf4..d2b4e6b6f6ee 100644 --- a/sw/source/ui/vba/vbadocuments.cxx +++ b/sw/source/ui/vba/vbadocuments.cxx @@ -132,7 +132,7 @@ SwVbaDocuments::Open( const OUString& Filename, const uno::Any& /*ConfirmConvers OUString aURL; INetURLObject aObj; aObj.SetURL( Filename ); - bool bIsURL = aObj.GetProtocol() != INET_PROT_NOT_VALID; + bool bIsURL = aObj.GetProtocol() != INetProtocol::NOT_VALID; if ( bIsURL ) aURL = Filename; else diff --git a/sw/source/ui/vba/vbasystem.cxx b/sw/source/ui/vba/vbasystem.cxx index b2de217a8d2d..6e2fd2f6c203 100644 --- a/sw/source/ui/vba/vbasystem.cxx +++ b/sw/source/ui/vba/vbasystem.cxx @@ -249,7 +249,7 @@ SwVbaSystem::PrivateProfileString( const OUString& rFilename, const OUString& rS { INetURLObject aObj; aObj.SetURL( rFilename ); - bool bIsURL = aObj.GetProtocol() != INET_PROT_NOT_VALID; + bool bIsURL = aObj.GetProtocol() != INetProtocol::NOT_VALID; if ( bIsURL ) sFileUrl = rFilename; else diff --git a/sw/source/uibase/app/docsh2.cxx b/sw/source/uibase/app/docsh2.cxx index 1ed665765e68..4df243b2500c 100644 --- a/sw/source/uibase/app/docsh2.cxx +++ b/sw/source/uibase/app/docsh2.cxx @@ -1542,7 +1542,7 @@ int SwFindDocShell( SfxObjectShellRef& xDocSh, // 2. Open the file ourselves SfxMedium* pMed = new SfxMedium( aTmpObj.GetMainURL( INetURLObject::NO_DECODE ), StreamMode::READ ); - if( INET_PROT_FILE == aTmpObj.GetProtocol() ) + if( INetProtocol::FILE == aTmpObj.GetProtocol() ) pMed->Download(); // Touch the medium (download it) const SfxFilter* pSfxFlt = 0; diff --git a/sw/source/uibase/dochdl/swdtflvr.cxx b/sw/source/uibase/dochdl/swdtflvr.cxx index ed4c180dcb47..f354333a4d05 100644 --- a/sw/source/uibase/dochdl/swdtflvr.cxx +++ b/sw/source/uibase/dochdl/swdtflvr.cxx @@ -2500,7 +2500,7 @@ bool SwTransferable::_PasteAsHyperlink( TransferableDataHelper& rData, // first, make the URL absolute INetURLObject aURL; - aURL.SetSmartProtocol( INET_PROT_FILE ); + aURL.SetSmartProtocol( INetProtocol::FILE ); aURL.SetSmartURL( sFile ); sFile = aURL.GetMainURL( INetURLObject::NO_DECODE ); @@ -2594,7 +2594,7 @@ bool SwTransferable::_PasteFileName( TransferableDataHelper& rData, // first, make the URL absolute INetURLObject aURL; - aURL.SetSmartProtocol( INET_PROT_FILE ); + aURL.SetSmartProtocol( INetProtocol::FILE ); aURL.SetSmartURL( sFile ); sFile = aURL.GetMainURL( INetURLObject::NO_DECODE ); diff --git a/sw/source/uibase/shells/textsh.cxx b/sw/source/uibase/shells/textsh.cxx index 2ef122b9e8f9..d4761633bc5f 100644 --- a/sw/source/uibase/shells/textsh.cxx +++ b/sw/source/uibase/shells/textsh.cxx @@ -251,7 +251,7 @@ void SwTextShell::ExecInsert(SfxRequest &rReq) INetURLObject(), aStrURL, URIHelper::GetMaybeFileHdl() ); INetURLObject url; - url.SetSmartProtocol( INET_PROT_FILE ); + url.SetSmartProtocol( INetProtocol::FILE ); if ( url.SetURL( aStrURL, INetURLObject::WAS_ENCODED ) ) { diff --git a/sw/source/uibase/uno/unomailmerge.cxx b/sw/source/uibase/uno/unomailmerge.cxx index 9ffed3a8af84..1af660cb393d 100644 --- a/sw/source/uibase/uno/unomailmerge.cxx +++ b/sw/source/uibase/uno/unomailmerge.cxx @@ -703,7 +703,7 @@ uno::Any SAL_CALL SwXMailMerge::execute( case MailMergeType::MAIL: { INetURLObject aURLObj; - aURLObj.SetSmartProtocol( INET_PROT_FILE ); + aURLObj.SetSmartProtocol( INetProtocol::FILE ); if (!aCurDocumentURL.isEmpty()) { diff --git a/sw/source/uibase/uno/unomod.cxx b/sw/source/uibase/uno/unomod.cxx index b66cf6e1a7bb..6c9fcb187baf 100644 --- a/sw/source/uibase/uno/unomod.cxx +++ b/sw/source/uibase/uno/unomod.cxx @@ -729,7 +729,7 @@ void SwXViewSettings::_setSingleValue( const comphelper::PropertyInfo & rInfo, c throw IllegalArgumentException(); INetURLObject aHID( sHelpURL ); - if ( aHID.GetProtocol() == INET_PROT_HID ) + if ( aHID.GetProtocol() == INetProtocol::HID ) pView->GetEditWin().SetHelpId( OUStringToOString( aHID.GetURLPath(), RTL_TEXTENCODING_UTF8 ) ); else throw IllegalArgumentException (); |