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 /cui/source/dialogs | |
parent | 0b4965bcd7ec911951e7ca3a4cd48062843b2634 (diff) |
Change INetProtocol to scoped enumeration
...and fix o3tl::enumarray::operator [] const overload
Change-Id: I749b1b9d68686b03a97074253478d9d2d9d32b0b
Diffstat (limited to 'cui/source/dialogs')
-rw-r--r-- | cui/source/dialogs/cuigaldlg.cxx | 2 | ||||
-rw-r--r-- | cui/source/dialogs/cuihyperdlg.cxx | 16 | ||||
-rw-r--r-- | cui/source/dialogs/hldocntp.cxx | 10 | ||||
-rw-r--r-- | cui/source/dialogs/hldoctp.cxx | 6 | ||||
-rw-r--r-- | cui/source/dialogs/hlinettp.cxx | 14 | ||||
-rw-r--r-- | cui/source/dialogs/hlmailtp.cxx | 12 | ||||
-rw-r--r-- | cui/source/dialogs/hltpbase.cxx | 8 | ||||
-rw-r--r-- | cui/source/dialogs/insdlg.cxx | 6 | ||||
-rw-r--r-- | cui/source/dialogs/linkdlg.cxx | 6 |
9 files changed, 40 insertions, 40 deletions
diff --git a/cui/source/dialogs/cuigaldlg.cxx b/cui/source/dialogs/cuigaldlg.cxx index b1b045158301..9996a86811c4 100644 --- a/cui/source/dialogs/cuigaldlg.cxx +++ b/cui/source/dialogs/cuigaldlg.cxx @@ -145,7 +145,7 @@ void SearchThread::ImplSearch( const INetURLObject& rStartURL, while( xResultSet->next() && schedule() ) { INetURLObject aFoundURL( xContentAccess->queryContentIdentifierString() ); - DBG_ASSERT( aFoundURL.GetProtocol() != INET_PROT_NOT_VALID, "invalid URL" ); + DBG_ASSERT( aFoundURL.GetProtocol() != INetProtocol::NOT_VALID, "invalid URL" ); bool bFolder = xRow->getBoolean( 1 ); // property "IsFolder" if ( xRow->wasNull() ) diff --git a/cui/source/dialogs/cuihyperdlg.cxx b/cui/source/dialogs/cuihyperdlg.cxx index d1107873e9e9..2daa9e51f186 100644 --- a/cui/source/dialogs/cuihyperdlg.cxx +++ b/cui/source/dialogs/cuihyperdlg.cxx @@ -305,17 +305,17 @@ sal_uInt16 SvxHpLinkDlg::SetPage ( SvxHyperlinkItem* pItem ) switch ( eProtocolTyp ) { - case INET_PROT_HTTP : - case INET_PROT_FTP : + case INetProtocol::HTTP : + case INetProtocol::FTP : nPageId = RID_SVXPAGE_HYPERLINK_INTERNET; break; - case INET_PROT_FILE : - case INET_PROT_POP3 : - case INET_PROT_IMAP : + case INetProtocol::FILE : + case INetProtocol::POP3 : + case INetProtocol::IMAP : nPageId = RID_SVXPAGE_HYPERLINK_DOCUMENT; break; - case INET_PROT_MAILTO : - case INET_PROT_NEWS : + case INetProtocol::MAILTO : + case INetProtocol::NEWS : nPageId = RID_SVXPAGE_HYPERLINK_MAIL; break; default : @@ -323,7 +323,7 @@ sal_uInt16 SvxHpLinkDlg::SetPage ( SvxHyperlinkItem* pItem ) nPageId = RID_SVXPAGE_HYPERLINK_DOCUMENT; else { - eProtocolTyp = INET_PROT_NOT_VALID; + eProtocolTyp = INetProtocol::NOT_VALID; nPageId = GetCurPageId(); } break; diff --git a/cui/source/dialogs/hldocntp.cxx b/cui/source/dialogs/hldocntp.cxx index 2686b482c54c..f74809b8a640 100644 --- a/cui/source/dialogs/hldocntp.cxx +++ b/cui/source/dialogs/hldocntp.cxx @@ -64,7 +64,7 @@ bool SvxHyperlinkNewDocTp::ImplGetURLObject( const OUString& rPath, const OUStri if ( bIsValidURL ) { aURLObject.SetURL( rPath ); - if ( aURLObject.GetProtocol() == INET_PROT_NOT_VALID ) // test if the source is already a valid url + if ( aURLObject.GetProtocol() == INetProtocol::NOT_VALID ) // test if the source is already a valid url { // if not we have to create a url from a physical file name bool wasAbs; INetURLObject base(rBase); @@ -73,7 +73,7 @@ bool SvxHyperlinkNewDocTp::ImplGetURLObject( const OUString& rPath, const OUStri rPath, wasAbs, true, INetURLObject::ENCODE_ALL, RTL_TEXTENCODING_UTF8, true); } - bIsValidURL = aURLObject.GetProtocol() != INET_PROT_NOT_VALID; + bIsValidURL = aURLObject.GetProtocol() != INetProtocol::NOT_VALID; if ( bIsValidURL ) { OUString aBase( aURLObject.getName( INetURLObject::LAST_SEGMENT, false ) ); @@ -103,7 +103,7 @@ SvxHyperlinkNewDocTp::SvxHyperlinkNewDocTp ( vcl::Window *pParent, IconChoiceDia get(m_pRbtEditNow, "editnow"); get(m_pRbtEditLater, "editlater"); get(m_pCbbPath, "path"); - m_pCbbPath->SetSmartProtocol(INET_PROT_FILE); + m_pCbbPath->SetSmartProtocol(INetProtocol::FILE); get(m_pBtCreate, "create"); m_pBtCreate->SetModeImage(Image(CUI_RES(RID_SVXBMP_NEWDOC))); get(m_pLbDocTypes, "types"); @@ -417,7 +417,7 @@ IMPL_LINK_NOARG(SvxHyperlinkNewDocTp, ClickNewHdl_Impl) { sal_Char const sSlash[] = "/"; - INetURLObject aURL( aStrURL, INET_PROT_FILE ); + INetURLObject aURL( aStrURL, INetProtocol::FILE ); OUString aStrName; if( bHandleFileName ) aStrName = bZeroPath? aTempStrURL : OUString(aURL.getName()); @@ -442,7 +442,7 @@ IMPL_LINK_NOARG(SvxHyperlinkNewDocTp, ClickNewHdl_Impl) aNewURL.setExtension( static_cast<DocumentTypeData*>(m_pLbDocTypes->GetEntryData( nPos ))->aStrExt ); } - if( aNewURL.GetProtocol() == INET_PROT_FILE ) + if( aNewURL.GetProtocol() == INetProtocol::FILE ) { utl::LocalFileHelper::ConvertURLToSystemPath( aNewURL.GetMainURL( INetURLObject::NO_DECODE ), aStrTmp ); } diff --git a/cui/source/dialogs/hldoctp.cxx b/cui/source/dialogs/hldoctp.cxx index 2f5b8f7efb1a..12d73d1966ad 100644 --- a/cui/source/dialogs/hldoctp.cxx +++ b/cui/source/dialogs/hldoctp.cxx @@ -39,7 +39,7 @@ SvxHyperlinkDocTp::SvxHyperlinkDocTp ( vcl::Window *pParent, IconChoiceDialog* p mbMarkWndOpen ( false ) { get(m_pCbbPath, "path"); - m_pCbbPath->SetSmartProtocol(INET_PROT_FILE); + m_pCbbPath->SetSmartProtocol(INetProtocol::FILE); get(m_pBtFileopen, "fileopen"); m_pBtFileopen->SetModeImage(Image(CUI_RES(RID_SVXBMP_FILEOPEN))); get(m_pEdTarget, "target"); @@ -113,7 +113,7 @@ OUString SvxHyperlinkDocTp::GetCurrentURL () if ( aStrPath != aEmptyStr ) { INetURLObject aURL( aStrPath ); - if ( aURL.GetProtocol() != INET_PROT_NOT_VALID ) // maybe the path is already a valid + if ( aURL.GetProtocol() != INetProtocol::NOT_VALID ) // maybe the path is already a valid aStrURL = aStrPath; // hyperlink, then we can use this path directly else utl::LocalFileHelper::ConvertSystemPathToURL( aStrPath, aBaseURL, aStrURL ); @@ -341,7 +341,7 @@ void SvxHyperlinkDocTp::SetMarkStr ( const OUString& aStrMark ) SvxHyperlinkDocTp::EPathType SvxHyperlinkDocTp::GetPathType ( const OUString& rStrPath ) { - INetURLObject aURL( rStrPath, INET_PROT_FILE ); + INetURLObject aURL( rStrPath, INetProtocol::FILE ); if( aURL.HasError() ) return Type_Invalid; diff --git a/cui/source/dialogs/hlinettp.cxx b/cui/source/dialogs/hlinettp.cxx index 76088ba157d9..0471571facf9 100644 --- a/cui/source/dialogs/hlinettp.cxx +++ b/cui/source/dialogs/hlinettp.cxx @@ -44,7 +44,7 @@ SvxHyperlinkInternetTp::SvxHyperlinkInternetTp ( vcl::Window *pParent, get(m_pRbtLinktypInternet, "linktyp_internet"); get(m_pRbtLinktypFTP, "linktyp_ftp"); get(m_pCbbTarget, "target"); - m_pCbbTarget->SetSmartProtocol(INET_PROT_HTTP); + m_pCbbTarget->SetSmartProtocol(INetProtocol::HTTP); get(m_pBtBrowse, "browse"); m_pBtBrowse->SetModeImage(Image(CUI_RES (RID_SVXBMP_BROWSE))); get(m_pFtLogin, "login_label"); @@ -111,7 +111,7 @@ void SvxHyperlinkInternetTp::FillDlgFields(const OUString& rStrURL) // set URL-field // Show the scheme, #72740 - if ( aURL.GetProtocol() != INET_PROT_NOT_VALID ) + if ( aURL.GetProtocol() != INetProtocol::NOT_VALID ) m_pCbbTarget->SetText( aURL.GetMainURL( INetURLObject::DECODE_UNAMBIGUOUS ) ); else m_pCbbTarget->SetText(rStrURL); // #77696# @@ -165,17 +165,17 @@ OUString SvxHyperlinkInternetTp::CreateAbsoluteURL() const INetURLObject aURL(aStrURL); - if( aURL.GetProtocol() == INET_PROT_NOT_VALID ) + if( aURL.GetProtocol() == INetProtocol::NOT_VALID ) { aURL.SetSmartProtocol( GetSmartProtocolFromButtons() ); aURL.SetSmartURL(aStrURL); } // username and password for ftp-url - if( aURL.GetProtocol() == INET_PROT_FTP && !m_pEdLogin->GetText().isEmpty() ) + if( aURL.GetProtocol() == INetProtocol::FTP && !m_pEdLogin->GetText().isEmpty() ) aURL.SetUserAndPass ( m_pEdLogin->GetText(), m_pEdPassword->GetText() ); - if ( aURL.GetProtocol() != INET_PROT_NOT_VALID ) + if ( aURL.GetProtocol() != INetProtocol::NOT_VALID ) return aURL.GetMainURL( INetURLObject::DECODE_TO_IURI ); else //#105788# always create a URL even if it is not valid return aStrURL; @@ -321,9 +321,9 @@ INetProtocol SvxHyperlinkInternetTp::GetSmartProtocolFromButtons() const { if( m_pRbtLinktypFTP->IsChecked() ) { - return INET_PROT_FTP; + return INetProtocol::FTP; } - return INET_PROT_HTTP; + return INetProtocol::HTTP; } /************************************************************************* diff --git a/cui/source/dialogs/hlmailtp.cxx b/cui/source/dialogs/hlmailtp.cxx index de79f64a3d12..60d8142b028f 100644 --- a/cui/source/dialogs/hlmailtp.cxx +++ b/cui/source/dialogs/hlmailtp.cxx @@ -44,7 +44,7 @@ SvxHyperlinkMailTp::SvxHyperlinkMailTp ( vcl::Window *pParent, IconChoiceDialog* get(m_pRbtMail, "linktyp_mail"); get(m_pRbtNews, "linktyp_news"); get(m_pCbbReceiver, "receiver"); - m_pCbbReceiver->SetSmartProtocol(INET_PROT_MAILTO); + m_pCbbReceiver->SetSmartProtocol(INetProtocol::MAILTO); get(m_pBtAdrBook, "adressbook"); m_pBtAdrBook->SetModeImage(Image(CUI_RES(RID_SVXBMP_ADRESSBOOK))); get(m_pFtSubject, "subject_label"); @@ -139,14 +139,14 @@ OUString SvxHyperlinkMailTp::CreateAbsoluteURL() const OUString aStrURL = m_pCbbReceiver->GetText(); INetURLObject aURL(aStrURL); - if( aURL.GetProtocol() == INET_PROT_NOT_VALID ) + if( aURL.GetProtocol() == INetProtocol::NOT_VALID ) { aURL.SetSmartProtocol( GetSmartProtocolFromButtons() ); aURL.SetSmartURL(aStrURL); } // subject for EMail-url - if( aURL.GetProtocol() == INET_PROT_MAILTO ) + if( aURL.GetProtocol() == INetProtocol::MAILTO ) { if ( m_pEdSubject->GetText() != OUString(aEmptyStr) ) { @@ -156,7 +156,7 @@ OUString SvxHyperlinkMailTp::CreateAbsoluteURL() const } } - if ( aURL.GetProtocol() != INET_PROT_NOT_VALID ) + if ( aURL.GetProtocol() != INetProtocol::NOT_VALID ) return aURL.GetMainURL( INetURLObject::DECODE_WITH_CHARSET ); else //#105788# always create a URL even if it is not valid return aStrURL; @@ -238,9 +238,9 @@ INetProtocol SvxHyperlinkMailTp::GetSmartProtocolFromButtons() const { if( m_pRbtNews->IsChecked() ) { - return INET_PROT_NEWS; + return INetProtocol::NEWS; } - return INET_PROT_MAILTO; + return INetProtocol::MAILTO; } /************************************************************************* diff --git a/cui/source/dialogs/hltpbase.cxx b/cui/source/dialogs/hltpbase.cxx index 92c9703cc7f5..fcaaed8f7f75 100644 --- a/cui/source/dialogs/hltpbase.cxx +++ b/cui/source/dialogs/hltpbase.cxx @@ -43,7 +43,7 @@ SvxHyperURLBox::SvxHyperURLBox( vcl::Window* pParent, INetProtocol eSmart ) extern "C" SAL_DLLPUBLIC_EXPORT vcl::Window* SAL_CALL makeSvxHyperURLBox(vcl::Window *pParent, VclBuilder::stringmap &) { - return new SvxHyperURLBox(pParent, INET_PROT_HTTP); + return new SvxHyperURLBox(pParent, INetProtocol::HTTP); } sal_Int8 SvxHyperURLBox::AcceptDrop( const AcceptDropEvent& /* rEvt */ ) @@ -383,7 +383,7 @@ OUString SvxHyperlinkTabPageBase::GetSchemeFromURL( const OUString& rStrURL ) // #77696# // our new INetUrlObject now has the ability // to detect if an Url is valid or not :-( - if ( aProtocol == INET_PROT_NOT_VALID ) + if ( aProtocol == INetProtocol::NOT_VALID ) { if ( rStrURL.startsWithIgnoreAsciiCase( INET_HTTP_SCHEME ) ) { @@ -474,10 +474,10 @@ OUString SvxHyperlinkTabPageBase::CreateUiNameFromURL( const OUString& aStrURL ) switch(aURLObj.GetProtocol()) { - case INET_PROT_FILE: + case INetProtocol::FILE: utl::LocalFileHelper::ConvertURLToSystemPath( aURLObj.GetMainURL(INetURLObject::NO_DECODE), aStrUiURL ); break; - case INET_PROT_FTP : + case INetProtocol::FTP : { //remove password from name INetURLObject aTmpURL(aURLObj); diff --git a/cui/source/dialogs/insdlg.cxx b/cui/source/dialogs/insdlg.cxx index 84c2fd7296dc..b8cd08bc29aa 100644 --- a/cui/source/dialogs/insdlg.cxx +++ b/cui/source/dialogs/insdlg.cxx @@ -295,7 +295,7 @@ short SvInsertOleDlg::Execute() { aFileName = GetFilePath(); INetURLObject aURL; - aURL.SetSmartProtocol( INET_PROT_FILE ); + aURL.SetSmartProtocol( INetProtocol::FILE ); aURL.SetSmartURL( aFileName ); aFileName = aURL.GetMainURL( INetURLObject::NO_DECODE ); bool bLink = IsLinked(); @@ -433,7 +433,7 @@ short SvInsertPlugInDialog::Execute() OUString aURL = GetPlugInFile(); // URL can be a valid and absolute URL or a system file name - m_pURL->SetSmartProtocol( INET_PROT_FILE ); + m_pURL->SetSmartProtocol( INetProtocol::FILE ); if ( aURL.isEmpty() || m_pURL->SetSmartURL( aURL ) ) { // create a plugin object @@ -618,7 +618,7 @@ short SfxInsertFloatingFrameDialog::Execute() { // URL can be a valid and absolute URL or a system file name INetURLObject aObj; - aObj.SetSmartProtocol( INET_PROT_FILE ); + aObj.SetSmartProtocol( INetProtocol::FILE ); if ( aObj.SetSmartURL( m_pEDURL->GetText() ) ) aURL = aObj.GetMainURL( INetURLObject::NO_DECODE ); } diff --git a/cui/source/dialogs/linkdlg.cxx b/cui/source/dialogs/linkdlg.cxx index fc0c4d67cf58..bde358525512 100644 --- a/cui/source/dialogs/linkdlg.cxx +++ b/cui/source/dialogs/linkdlg.cxx @@ -361,7 +361,7 @@ IMPL_LINK( SvBaseLinksDlg, ChangeSourceClickHdl, PushButton *, pPushButton ) SvBaseLink* pLink = static_cast<SvBaseLink*>(pEntry->GetUserData()); pLinkMgr->GetDisplayNames( pLink, &sType, &sFile, 0, 0 ); INetURLObject aUrl(sFile); - if(aUrl.GetProtocol() == INET_PROT_FILE) + if(aUrl.GetProtocol() == INetProtocol::FILE) { OUString sOldPath(aUrl.PathToFileName()); sal_Int32 nLen = aUrl.GetName().getLength(); @@ -386,7 +386,7 @@ IMPL_LINK( SvBaseLinksDlg, ChangeSourceClickHdl, PushButton *, pPushButton ) continue; pLinkMgr->GetDisplayNames( pLink, &sType, &sFile, &sLinkName, &sFilter ); INetURLObject aUrl_(sFile); - INetURLObject aUrl2(aPath, INET_PROT_FILE); + INetURLObject aUrl2(aPath, INetProtocol::FILE); aUrl2.insertName( aUrl_.getName() ); OUString sNewLinkName; MakeLnkName( sNewLinkName, 0 , @@ -639,7 +639,7 @@ void SvBaseLinksDlg::InsertEntry( const SvBaseLink& rLink, sal_uLong nPos, bool long nWidthPixel = m_pTbLinks->GetLogicTab( 2 ) - m_pTbLinks->GetLogicTab( 1 ); nWidthPixel -= SV_TAB_BORDER; OUString aTxt = m_pTbLinks->GetEllipsisString( sFileNm, nWidthPixel, TEXT_DRAW_PATHELLIPSIS ); - INetURLObject aPath( sFileNm, INET_PROT_FILE ); + INetURLObject aPath( sFileNm, INetProtocol::FILE ); OUString aFileName = aPath.getName(); aFileName = INetURLObject::decode(aFileName, '%', INetURLObject::DECODE_UNAMBIGUOUS); |