Skip to content

Commit

Permalink
MITAB: don't write field width for integer fields in .mif, which is i…
Browse files Browse the repository at this point in the history
…ncompatible with MapInfo (#3853)

git-svn-id: https://svn.osgeo.org/gdal/trunk/gdal@27525 f0d54148-0727-0410-94bb-9a71ac55c965
  • Loading branch information
rouault committed Jul 12, 2014
1 parent a13fcef commit 352bebd
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions ogr/ogrsf_frmts/mitab/mitab_miffile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1104,13 +1104,8 @@ int MIFFile::WriteMIFHeader()
switch(m_paeFieldType[iField])
{
case TABFInteger:
if (poFieldDefn->GetWidth() == 0)
m_poMIFFile->WriteLine(" %s Integer\n",
poFieldDefn->GetNameRef());
else
m_poMIFFile->WriteLine(" %s Integer(%d)\n",
poFieldDefn->GetNameRef(),
poFieldDefn->GetWidth());
m_poMIFFile->WriteLine(" %s Integer\n",
poFieldDefn->GetNameRef());
break;
case TABFSmallInt:
m_poMIFFile->WriteLine(" %s SmallInt\n",
Expand Down Expand Up @@ -1778,7 +1773,7 @@ int MIFFile::AddFieldNative(const char *pszName, TABFieldType eMapInfoType,
*----------------------------------------------------------------*/
if (eMapInfoType == TABFDecimal && nWidth == 0)
nWidth=20;
else if (nWidth == 0)
else if (eMapInfoType == TABFChar && nWidth == 0)
nWidth=254; /* char fields */

/*-----------------------------------------------------------------
Expand Down

0 comments on commit 352bebd

Please sign in to comment.