Opened 21 years ago

Closed 14 years ago

#305 closed defect (duplicate)

MAPINFO : 'GetStyleString' returns dot delimited id list

Reported by: dev@… Owned by: Daniel Morissette
Priority: high Milestone:
Component: OGR_SF Version: unspecified
Severity: normal Keywords:
Cc: Mateusz Łoskot

Description (last modified by Mateusz Łoskot)

The style string returned by 'GetStyleString' for Mapinfo files
contains pens, brushes and symbols ids separated by dots instead
of commas.
For example :
       PEN(id:"mapinfo-pen-14.ogr-pen-6")
should be
       PEN(id:"mapinfo-pen-14,ogr-pen-6")

The error is located in mitab_feature.cpp in GetPenStyleString, 
GetBrushStyleString and GetSymbolStyleString.

mitab_feature.cpp

const char *ITABFeaturePen::GetPenStyleString()
{
...

    if (strlen(szPattern) != 0)
      pszStyle =CPLSPrintf("PEN(w:%dpx,c:#%6.6x,id:\"mapinfo-pen-%d."
                           "ogr-pen-%d\",p:\"%spx\")",
                           GetPenWidthPixel(),
                           m_sPenDef.rgbColor,GetPenPattern(),nOGRStyle,
                           szPattern);
    else
      pszStyle =CPLSPrintf("PEN(w:%dpx,c:#%6.6x,id:\"mapinfo-pen-%d.ogr-pen-%
d\")",
                           GetPenWidthPixel(),
                           m_sPenDef.rgbColor,GetPenPattern(),nOGRStyle);
...
}

const char *ITABFeatureBrush::GetBrushStyleString()
{
...

    pszStyle =CPLSPrintf("BRUSH(fc:#%6.6x,bc:#%6.6x,id:\"mapinfo-brush-%d.ogr-
brush-%d\")",
                         m_sBrushDef.rgbFGColor,
                         m_sBrushDef.rgbBGColor,
                         m_sBrushDef.nFillPattern,nOGRStyle);
     
...
}

const char *ITABFeatureSymbol::GetSymbolStyleString(double dfAngle)
{
...

    pszStyle=CPLSPrintf("SYMBOL(a:%d,c:#%6.6x,s:%dpt,id:\"mapinfo-sym-%d.ogr-
sym-%d\")",
                        nAngle,
                        m_sSymbolDef.rgbColor,
                        m_sSymbolDef.nPointSize,
                        m_sSymbolDef.nSymbolNo,
                        nOGRStyle);

...
}

Change History (2)

comment:1 by Mateusz Łoskot, 16 years ago

Cc: Mateusz Łoskot added
Description: modified (diff)

comment:2 by Even Rouault, 14 years ago

Resolution: duplicate
Status: newclosed

Fixed by #3571

Note: See TracTickets for help on using tickets.