Add file:// to list of things recognized as URL.

Fixes: lp:1785879
* https://bugs.launchpad.net/kicad/+bug/1785879
This commit is contained in:
Jeff Young 2018-08-08 12:41:38 +01:00
parent 5f31ce03f7
commit 8884298f29
1 changed files with 2 additions and 2 deletions

View File

@ -176,7 +176,7 @@ bool FIELDS_GRID_TABLE<T>::CanSetValueAs( int aRow, int aCol, const wxString& aT
template <class T> template <class T>
wxGridCellAttr* FIELDS_GRID_TABLE<T>::GetAttr( int aRow, int aCol, wxGridCellAttr::wxAttrKind ) wxGridCellAttr* FIELDS_GRID_TABLE<T>::GetAttr( int aRow, int aCol, wxGridCellAttr::wxAttrKind )
{ {
static wxRegEx httpPrefix( wxT( "https?:\/\/" ) ); static wxRegEx urlPrefix( wxT( "((https?)|(file)):\/\/" ) );
switch( aCol ) switch( aCol )
{ {
@ -227,7 +227,7 @@ wxGridCellAttr* FIELDS_GRID_TABLE<T>::GetAttr( int aRow, int aCol, wxGridCellAtt
m_urlAttr->IncRef(); m_urlAttr->IncRef();
return m_urlAttr; return m_urlAttr;
} }
else if( httpPrefix.Matches( GetValue( aRow, aCol ) ) ) else if( urlPrefix.Matches( GetValue( aRow, aCol ) ) )
{ {
// Treat any user-defined field that starts with http:// or https:// as a URL // Treat any user-defined field that starts with http:// or https:// as a URL
m_urlAttr->IncRef(); m_urlAttr->IncRef();