[mapguide-commits] r5565 - in sandbox/adsk/2.3r/Common/MdfParser: . Common PrintLayout

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Fri Feb 25 16:46:04 EST 2011


Author: brucedechant
Date: 2011-02-25 13:46:04 -0800 (Fri, 25 Feb 2011)
New Revision: 5565

Modified:
   sandbox/adsk/2.3r/Common/MdfParser/Common/IOColor.cpp
   sandbox/adsk/2.3r/Common/MdfParser/Common/IOColor.h
   sandbox/adsk/2.3r/Common/MdfParser/Common/IOExtent3D.cpp
   sandbox/adsk/2.3r/Common/MdfParser/Common/IOExtent3D.h
   sandbox/adsk/2.3r/Common/MdfParser/Common/IOPoint3D.cpp
   sandbox/adsk/2.3r/Common/MdfParser/Common/IOPoint3D.h
   sandbox/adsk/2.3r/Common/MdfParser/Common/IOSize2D.cpp
   sandbox/adsk/2.3r/Common/MdfParser/Common/IOSize2D.h
   sandbox/adsk/2.3r/Common/MdfParser/Common/IOStringObjectCollection.cpp
   sandbox/adsk/2.3r/Common/MdfParser/Common/IOStringObjectCollection.h
   sandbox/adsk/2.3r/Common/MdfParser/Common/IOVector3D.cpp
   sandbox/adsk/2.3r/Common/MdfParser/Common/IOVector3D.h
   sandbox/adsk/2.3r/Common/MdfParser/FSDSAX2Parser.cpp
   sandbox/adsk/2.3r/Common/MdfParser/IOAreaRule.cpp
   sandbox/adsk/2.3r/Common/MdfParser/IOAreaRule.h
   sandbox/adsk/2.3r/Common/MdfParser/IOAreaSymbolization2D.cpp
   sandbox/adsk/2.3r/Common/MdfParser/IOAreaSymbolization2D.h
   sandbox/adsk/2.3r/Common/MdfParser/IOAreaTypeStyle.cpp
   sandbox/adsk/2.3r/Common/MdfParser/IOAreaTypeStyle.h
   sandbox/adsk/2.3r/Common/MdfParser/IOAreaUsage.cpp
   sandbox/adsk/2.3r/Common/MdfParser/IOAreaUsage.h
   sandbox/adsk/2.3r/Common/MdfParser/IOAttributeRelate.cpp
   sandbox/adsk/2.3r/Common/MdfParser/IOAttributeRelate.h
   sandbox/adsk/2.3r/Common/MdfParser/IOBaseMapDefinition.cpp
   sandbox/adsk/2.3r/Common/MdfParser/IOBaseMapDefinition.h
   sandbox/adsk/2.3r/Common/MdfParser/IOBaseMapLayer.cpp
   sandbox/adsk/2.3r/Common/MdfParser/IOBaseMapLayer.h
   sandbox/adsk/2.3r/Common/MdfParser/IOBaseMapLayerGroup.cpp
   sandbox/adsk/2.3r/Common/MdfParser/IOBaseMapLayerGroup.h
   sandbox/adsk/2.3r/Common/MdfParser/IOBlockSymbol.cpp
   sandbox/adsk/2.3r/Common/MdfParser/IOBlockSymbol.h
   sandbox/adsk/2.3r/Common/MdfParser/IOCalculatedProperty.cpp
   sandbox/adsk/2.3r/Common/MdfParser/IOCalculatedProperty.h
   sandbox/adsk/2.3r/Common/MdfParser/IOChannelBand.cpp
   sandbox/adsk/2.3r/Common/MdfParser/IOChannelBand.h
   sandbox/adsk/2.3r/Common/MdfParser/IOCompositeRule.cpp
   sandbox/adsk/2.3r/Common/MdfParser/IOCompositeRule.h
   sandbox/adsk/2.3r/Common/MdfParser/IOCompositeSymbolization.cpp
   sandbox/adsk/2.3r/Common/MdfParser/IOCompositeSymbolization.h
   sandbox/adsk/2.3r/Common/MdfParser/IOCompositeTypeStyle.cpp
   sandbox/adsk/2.3r/Common/MdfParser/IOCompositeTypeStyle.h
   sandbox/adsk/2.3r/Common/MdfParser/IOCompoundSymbolDefinition.cpp
   sandbox/adsk/2.3r/Common/MdfParser/IOCompoundSymbolDefinition.h
   sandbox/adsk/2.3r/Common/MdfParser/IODrawingLayerDefinition.cpp
   sandbox/adsk/2.3r/Common/MdfParser/IODrawingLayerDefinition.h
   sandbox/adsk/2.3r/Common/MdfParser/IOElevationSettings.cpp
   sandbox/adsk/2.3r/Common/MdfParser/IOElevationSettings.h
   sandbox/adsk/2.3r/Common/MdfParser/IOExtension.cpp
   sandbox/adsk/2.3r/Common/MdfParser/IOExtension.h
   sandbox/adsk/2.3r/Common/MdfParser/IOExtra.cpp
   sandbox/adsk/2.3r/Common/MdfParser/IOExtra.h
   sandbox/adsk/2.3r/Common/MdfParser/IOFeatureSource.cpp
   sandbox/adsk/2.3r/Common/MdfParser/IOFeatureSource.h
   sandbox/adsk/2.3r/Common/MdfParser/IOFill.cpp
   sandbox/adsk/2.3r/Common/MdfParser/IOFill.h
   sandbox/adsk/2.3r/Common/MdfParser/IOFontSymbol.cpp
   sandbox/adsk/2.3r/Common/MdfParser/IOFontSymbol.h
   sandbox/adsk/2.3r/Common/MdfParser/IOGraphicElement.cpp
   sandbox/adsk/2.3r/Common/MdfParser/IOGraphicElement.h
   sandbox/adsk/2.3r/Common/MdfParser/IOGraphicElementCollection.cpp
   sandbox/adsk/2.3r/Common/MdfParser/IOGraphicElementCollection.h
   sandbox/adsk/2.3r/Common/MdfParser/IOGridColor.cpp
   sandbox/adsk/2.3r/Common/MdfParser/IOGridColor.h
   sandbox/adsk/2.3r/Common/MdfParser/IOGridColorBands.cpp
   sandbox/adsk/2.3r/Common/MdfParser/IOGridColorRule.cpp
   sandbox/adsk/2.3r/Common/MdfParser/IOGridColorRule.h
   sandbox/adsk/2.3r/Common/MdfParser/IOGridColorStyle.cpp
   sandbox/adsk/2.3r/Common/MdfParser/IOGridColorStyle.h
   sandbox/adsk/2.3r/Common/MdfParser/IOGridLayerDefinition.cpp
   sandbox/adsk/2.3r/Common/MdfParser/IOGridLayerDefinition.h
   sandbox/adsk/2.3r/Common/MdfParser/IOGridScaleRange.cpp
   sandbox/adsk/2.3r/Common/MdfParser/IOGridScaleRange.h
   sandbox/adsk/2.3r/Common/MdfParser/IOGridSurfaceStyle.cpp
   sandbox/adsk/2.3r/Common/MdfParser/IOGridSurfaceStyle.h
   sandbox/adsk/2.3r/Common/MdfParser/IOHillShade.cpp
   sandbox/adsk/2.3r/Common/MdfParser/IOHillShade.h
   sandbox/adsk/2.3r/Common/MdfParser/IOImage.cpp
   sandbox/adsk/2.3r/Common/MdfParser/IOImage.h
   sandbox/adsk/2.3r/Common/MdfParser/IOImageSymbol.cpp
   sandbox/adsk/2.3r/Common/MdfParser/IOImageSymbol.h
   sandbox/adsk/2.3r/Common/MdfParser/IOLabel.cpp
   sandbox/adsk/2.3r/Common/MdfParser/IOLabel.h
   sandbox/adsk/2.3r/Common/MdfParser/IOLineRule.cpp
   sandbox/adsk/2.3r/Common/MdfParser/IOLineRule.h
   sandbox/adsk/2.3r/Common/MdfParser/IOLineSymbolization2D.cpp
   sandbox/adsk/2.3r/Common/MdfParser/IOLineSymbolization2D.h
   sandbox/adsk/2.3r/Common/MdfParser/IOLineTypeStyle.cpp
   sandbox/adsk/2.3r/Common/MdfParser/IOLineTypeStyle.h
   sandbox/adsk/2.3r/Common/MdfParser/IOLineUsage.cpp
   sandbox/adsk/2.3r/Common/MdfParser/IOLineUsage.h
   sandbox/adsk/2.3r/Common/MdfParser/IOMapDefinition.cpp
   sandbox/adsk/2.3r/Common/MdfParser/IOMapDefinition.h
   sandbox/adsk/2.3r/Common/MdfParser/IOMapLayer.cpp
   sandbox/adsk/2.3r/Common/MdfParser/IOMapLayer.h
   sandbox/adsk/2.3r/Common/MdfParser/IOMapLayerCommon.cpp
   sandbox/adsk/2.3r/Common/MdfParser/IOMapLayerCommon.h
   sandbox/adsk/2.3r/Common/MdfParser/IOMapLayerGroup.cpp
   sandbox/adsk/2.3r/Common/MdfParser/IOMapLayerGroup.h
   sandbox/adsk/2.3r/Common/MdfParser/IOMapLayerGroupCommon.cpp
   sandbox/adsk/2.3r/Common/MdfParser/IOMapLayerGroupCommon.h
   sandbox/adsk/2.3r/Common/MdfParser/IOMarkSymbol.cpp
   sandbox/adsk/2.3r/Common/MdfParser/IOMarkSymbol.h
   sandbox/adsk/2.3r/Common/MdfParser/IONameStringPair.cpp
   sandbox/adsk/2.3r/Common/MdfParser/IONameStringPair.h
   sandbox/adsk/2.3r/Common/MdfParser/IOOverride.cpp
   sandbox/adsk/2.3r/Common/MdfParser/IOOverride.h
   sandbox/adsk/2.3r/Common/MdfParser/IOOverrideCollection.cpp
   sandbox/adsk/2.3r/Common/MdfParser/IOOverrideCollection.h
   sandbox/adsk/2.3r/Common/MdfParser/IOParameter.cpp
   sandbox/adsk/2.3r/Common/MdfParser/IOParameter.h
   sandbox/adsk/2.3r/Common/MdfParser/IOParameterCollection.cpp
   sandbox/adsk/2.3r/Common/MdfParser/IOParameterCollection.h
   sandbox/adsk/2.3r/Common/MdfParser/IOPath.cpp
   sandbox/adsk/2.3r/Common/MdfParser/IOPath.h
   sandbox/adsk/2.3r/Common/MdfParser/IOPointRule.cpp
   sandbox/adsk/2.3r/Common/MdfParser/IOPointRule.h
   sandbox/adsk/2.3r/Common/MdfParser/IOPointSymbolization2D.cpp
   sandbox/adsk/2.3r/Common/MdfParser/IOPointSymbolization2D.h
   sandbox/adsk/2.3r/Common/MdfParser/IOPointTypeStyle.cpp
   sandbox/adsk/2.3r/Common/MdfParser/IOPointTypeStyle.h
   sandbox/adsk/2.3r/Common/MdfParser/IOPointUsage.cpp
   sandbox/adsk/2.3r/Common/MdfParser/IOPointUsage.h
   sandbox/adsk/2.3r/Common/MdfParser/IORelateProperty.cpp
   sandbox/adsk/2.3r/Common/MdfParser/IORelateProperty.h
   sandbox/adsk/2.3r/Common/MdfParser/IOResizeBox.cpp
   sandbox/adsk/2.3r/Common/MdfParser/IOResizeBox.h
   sandbox/adsk/2.3r/Common/MdfParser/IOResourceRef.cpp
   sandbox/adsk/2.3r/Common/MdfParser/IOResourceRef.h
   sandbox/adsk/2.3r/Common/MdfParser/IOSimpleSymbol.cpp
   sandbox/adsk/2.3r/Common/MdfParser/IOSimpleSymbol.h
   sandbox/adsk/2.3r/Common/MdfParser/IOSimpleSymbolDefinition.cpp
   sandbox/adsk/2.3r/Common/MdfParser/IOSimpleSymbolDefinition.h
   sandbox/adsk/2.3r/Common/MdfParser/IOStroke.cpp
   sandbox/adsk/2.3r/Common/MdfParser/IOStroke.h
   sandbox/adsk/2.3r/Common/MdfParser/IOSupplementalSpatialContextInfo.cpp
   sandbox/adsk/2.3r/Common/MdfParser/IOSupplementalSpatialContextInfo.h
   sandbox/adsk/2.3r/Common/MdfParser/IOSymbol.cpp
   sandbox/adsk/2.3r/Common/MdfParser/IOSymbol.h
   sandbox/adsk/2.3r/Common/MdfParser/IOSymbolInstance.cpp
   sandbox/adsk/2.3r/Common/MdfParser/IOSymbolInstance.h
   sandbox/adsk/2.3r/Common/MdfParser/IOText.cpp
   sandbox/adsk/2.3r/Common/MdfParser/IOText.h
   sandbox/adsk/2.3r/Common/MdfParser/IOTextFrame.cpp
   sandbox/adsk/2.3r/Common/MdfParser/IOTextFrame.h
   sandbox/adsk/2.3r/Common/MdfParser/IOThemeLabel.cpp
   sandbox/adsk/2.3r/Common/MdfParser/IOThemeLabel.h
   sandbox/adsk/2.3r/Common/MdfParser/IOTileWatermarkPosition.cpp
   sandbox/adsk/2.3r/Common/MdfParser/IOTileWatermarkPosition.h
   sandbox/adsk/2.3r/Common/MdfParser/IOUnknown.cpp
   sandbox/adsk/2.3r/Common/MdfParser/IOUnknown.h
   sandbox/adsk/2.3r/Common/MdfParser/IOUtil.cpp
   sandbox/adsk/2.3r/Common/MdfParser/IOUtil.h
   sandbox/adsk/2.3r/Common/MdfParser/IOVectorLayerDefinition.cpp
   sandbox/adsk/2.3r/Common/MdfParser/IOVectorLayerDefinition.h
   sandbox/adsk/2.3r/Common/MdfParser/IOVectorScaleRange.cpp
   sandbox/adsk/2.3r/Common/MdfParser/IOVectorScaleRange.h
   sandbox/adsk/2.3r/Common/MdfParser/IOW2DSymbol.cpp
   sandbox/adsk/2.3r/Common/MdfParser/IOW2DSymbol.h
   sandbox/adsk/2.3r/Common/MdfParser/IOWatermarkAppearance.cpp
   sandbox/adsk/2.3r/Common/MdfParser/IOWatermarkAppearance.h
   sandbox/adsk/2.3r/Common/MdfParser/IOWatermarkDefinition.cpp
   sandbox/adsk/2.3r/Common/MdfParser/IOWatermarkDefinition.h
   sandbox/adsk/2.3r/Common/MdfParser/IOWatermarkInstance.cpp
   sandbox/adsk/2.3r/Common/MdfParser/IOWatermarkInstance.h
   sandbox/adsk/2.3r/Common/MdfParser/IOWatermarkOffsetUnit.cpp
   sandbox/adsk/2.3r/Common/MdfParser/IOWatermarkOffsetUnit.h
   sandbox/adsk/2.3r/Common/MdfParser/IOWatermarkXOffset.cpp
   sandbox/adsk/2.3r/Common/MdfParser/IOWatermarkXOffset.h
   sandbox/adsk/2.3r/Common/MdfParser/IOWatermarkYOffset.cpp
   sandbox/adsk/2.3r/Common/MdfParser/IOWatermarkYOffset.h
   sandbox/adsk/2.3r/Common/MdfParser/IOXYWatermarkPosition.cpp
   sandbox/adsk/2.3r/Common/MdfParser/IOXYWatermarkPosition.h
   sandbox/adsk/2.3r/Common/MdfParser/PrintLayout/IODataConfiguration.cpp
   sandbox/adsk/2.3r/Common/MdfParser/PrintLayout/IODataConfiguration.h
   sandbox/adsk/2.3r/Common/MdfParser/PrintLayout/IOMapView.cpp
   sandbox/adsk/2.3r/Common/MdfParser/PrintLayout/IOMapView.h
   sandbox/adsk/2.3r/Common/MdfParser/PrintLayout/IOMapViewportDefinition.cpp
   sandbox/adsk/2.3r/Common/MdfParser/PrintLayout/IOMapViewportDefinition.h
   sandbox/adsk/2.3r/Common/MdfParser/PrintLayout/IOPrintLayoutDefinition.cpp
   sandbox/adsk/2.3r/Common/MdfParser/PrintLayout/IOPrintLayoutDefinition.h
   sandbox/adsk/2.3r/Common/MdfParser/PrintLayout/IOPrintLayoutElementCollection.cpp
   sandbox/adsk/2.3r/Common/MdfParser/PrintLayout/IOPrintLayoutElementCollection.h
   sandbox/adsk/2.3r/Common/MdfParser/PrintLayout/IOPrintLayoutElementDefinition.cpp
   sandbox/adsk/2.3r/Common/MdfParser/PrintLayout/IOPrintLayoutElementDefinition.h
   sandbox/adsk/2.3r/Common/MdfParser/PrintLayout/IOPrintLayoutElementStyle.cpp
   sandbox/adsk/2.3r/Common/MdfParser/PrintLayout/IOPrintLayoutElementStyle.h
   sandbox/adsk/2.3r/Common/MdfParser/PrintLayout/IOPropertyMappingCollection.cpp
   sandbox/adsk/2.3r/Common/MdfParser/PrintLayout/IOPropertyMappingCollection.h
   sandbox/adsk/2.3r/Common/MdfParser/PrintLayout/IOStylizationConfiguration.cpp
   sandbox/adsk/2.3r/Common/MdfParser/PrintLayout/IOStylizationConfiguration.h
   sandbox/adsk/2.3r/Common/MdfParser/PrintLayout/IOThickness.cpp
   sandbox/adsk/2.3r/Common/MdfParser/PrintLayout/IOThickness.h
   sandbox/adsk/2.3r/Common/MdfParser/SAX2Parser.cpp
   sandbox/adsk/2.3r/Common/MdfParser/stdafx.h
Log:
Fix for trac ticket 1609 - MdfParser uses global tab methods that are not thread safe
http://trac.osgeo.org/mapguide/ticket/1609

Notes:
- Created an MgTab object that replaces the global tab methods


Modified: sandbox/adsk/2.3r/Common/MdfParser/Common/IOColor.cpp
===================================================================
--- sandbox/adsk/2.3r/Common/MdfParser/Common/IOColor.cpp	2011-02-22 07:43:02 UTC (rev 5564)
+++ sandbox/adsk/2.3r/Common/MdfParser/Common/IOColor.cpp	2011-02-25 21:46:04 UTC (rev 5565)
@@ -84,33 +84,33 @@
     }
 }
 
-void IOColor::Write(MdfStream& fd, Color* color, Version* version, const std::string& name)
+void IOColor::Write(MdfStream& fd, Color* color, Version* version, const std::string& name, MgTab& tab)
 {
     _ASSERT(NULL != color);
 
-    fd << tab() << startStr(name) << std::endl;
-    inctab();
+    fd << tab.tab() << startStr(name) << std::endl;
+    tab.inctab();
 
     // Property: Red
-    fd << tab() << startStr(sRed);
+    fd << tab.tab() << startStr(sRed);
     fd << IntToStr(color->GetRed());
     fd << endStr(sRed) << std::endl;
 
     // Property: Green
-    fd << tab() << startStr(sGreen);
+    fd << tab.tab() << startStr(sGreen);
     fd << IntToStr(color->GetGreen());
     fd << endStr(sGreen) << std::endl;
 
     // Property: Blue
-    fd << tab() << startStr(sBlue);
+    fd << tab.tab() << startStr(sBlue);
     fd << IntToStr(color->GetBlue());
     fd << endStr(sBlue) << std::endl;
 
     // Property: Alpha
-    fd << tab() << startStr(sAlpha);
+    fd << tab.tab() << startStr(sAlpha);
     fd << IntToStr(color->GetAlpha());
     fd << endStr(sAlpha) << std::endl;
 
-    dectab();
-    fd << tab() << endStr(name) << std::endl;
+    tab.dectab();
+    fd << tab.tab() << endStr(name) << std::endl;
 }

Modified: sandbox/adsk/2.3r/Common/MdfParser/Common/IOColor.h
===================================================================
--- sandbox/adsk/2.3r/Common/MdfParser/Common/IOColor.h	2011-02-22 07:43:02 UTC (rev 5564)
+++ sandbox/adsk/2.3r/Common/MdfParser/Common/IOColor.h	2011-02-25 21:46:04 UTC (rev 5565)
@@ -33,7 +33,7 @@
     virtual void ElementChars(const wchar_t* ch);
     virtual void EndElement(const wchar_t* name, HandlerStack* handlerStack);
 
-    static void Write(MdfStream& fd, Color* color, Version* version, const std::string& name);
+    static void Write(MdfStream& fd, Color* color, Version* version, const std::string& name, MgTab& tab);
 
 private:
     // Hidden default/copy constructors and assignment operator.

Modified: sandbox/adsk/2.3r/Common/MdfParser/Common/IOExtent3D.cpp
===================================================================
--- sandbox/adsk/2.3r/Common/MdfParser/Common/IOExtent3D.cpp	2011-02-22 07:43:02 UTC (rev 5564)
+++ sandbox/adsk/2.3r/Common/MdfParser/Common/IOExtent3D.cpp	2011-02-25 21:46:04 UTC (rev 5565)
@@ -81,19 +81,19 @@
     }
 }
 
-void IOExtent3D::Write(MdfStream& fd, Extent3D* extent, Version* version)
+void IOExtent3D::Write(MdfStream& fd, Extent3D* extent, Version* version, MgTab& tab)
 {
     _ASSERT(NULL != extent);
 
-    fd << tab() << startStr(sExtent) << std::endl;
-    inctab();
+    fd << tab.tab() << startStr(sExtent) << std::endl;
+    tab.inctab();
 
     // Property: Min
-    IOPoint3D::Write(fd, extent->GetMinimumPoint(), version, sMin);
+    IOPoint3D::Write(fd, extent->GetMinimumPoint(), version, sMin, tab);
 
     // Property: Max
-    IOPoint3D::Write(fd, extent->GetMaximumPoint(), version, sMax);
+    IOPoint3D::Write(fd, extent->GetMaximumPoint(), version, sMax, tab);
 
-    dectab();
-    fd << tab() << endStr(sExtent) << std::endl;
+    tab.dectab();
+    fd << tab.tab() << endStr(sExtent) << std::endl;
 }

Modified: sandbox/adsk/2.3r/Common/MdfParser/Common/IOExtent3D.h
===================================================================
--- sandbox/adsk/2.3r/Common/MdfParser/Common/IOExtent3D.h	2011-02-22 07:43:02 UTC (rev 5564)
+++ sandbox/adsk/2.3r/Common/MdfParser/Common/IOExtent3D.h	2011-02-25 21:46:04 UTC (rev 5565)
@@ -33,7 +33,7 @@
     virtual void ElementChars(const wchar_t* ch);
     virtual void EndElement(const wchar_t* name, HandlerStack* handlerStack);
 
-    static void Write(MdfStream& fd, Extent3D* extent, Version* version);
+    static void Write(MdfStream& fd, Extent3D* extent, Version* version, MgTab& tab);
 
 private:
     // Hidden default/copy constructors and assignment operator.

Modified: sandbox/adsk/2.3r/Common/MdfParser/Common/IOPoint3D.cpp
===================================================================
--- sandbox/adsk/2.3r/Common/MdfParser/Common/IOPoint3D.cpp	2011-02-22 07:43:02 UTC (rev 5564)
+++ sandbox/adsk/2.3r/Common/MdfParser/Common/IOPoint3D.cpp	2011-02-25 21:46:04 UTC (rev 5565)
@@ -85,28 +85,28 @@
     }
 }
 
-void IOPoint3D::Write(MdfStream& fd, Point3D* point, Version* version, const std::string& name)
+void IOPoint3D::Write(MdfStream& fd, Point3D* point, Version* version, const std::string& name, MgTab& tab)
 {
     _ASSERT(NULL != point);
 
-    fd << tab() << startStr(name) << std::endl;
-    inctab();
+    fd << tab.tab() << startStr(name) << std::endl;
+    tab.inctab();
 
     // Property: X
-    fd << tab() << startStr(sX);
+    fd << tab.tab() << startStr(sX);
     fd << DoubleToStr(point->GetX());
     fd << endStr(sX) << std::endl;
 
     // Property: Y
-    fd << tab() << startStr(sY);
+    fd << tab.tab() << startStr(sY);
     fd << DoubleToStr(point->GetY());
     fd << endStr(sY) << std::endl;
 
     // Property: Z
-    fd << tab() << startStr(sZ);
+    fd << tab.tab() << startStr(sZ);
     fd << DoubleToStr(point->GetZ());
     fd << endStr(sZ) << std::endl;
 
-    dectab();
-    fd << tab() << endStr(name) << std::endl;
+    tab.dectab();
+    fd << tab.tab() << endStr(name) << std::endl;
 }

Modified: sandbox/adsk/2.3r/Common/MdfParser/Common/IOPoint3D.h
===================================================================
--- sandbox/adsk/2.3r/Common/MdfParser/Common/IOPoint3D.h	2011-02-22 07:43:02 UTC (rev 5564)
+++ sandbox/adsk/2.3r/Common/MdfParser/Common/IOPoint3D.h	2011-02-25 21:46:04 UTC (rev 5565)
@@ -33,7 +33,7 @@
     virtual void ElementChars(const wchar_t* ch);
     virtual void EndElement(const wchar_t* name, HandlerStack* handlerStack);
 
-    static void Write(MdfStream& fd, Point3D* point, Version* version, const std::string& name);
+    static void Write(MdfStream& fd, Point3D* point, Version* version, const std::string& name, MgTab& tab);
 
 private:
     // Hidden default/copy constructors and assignment operator.

Modified: sandbox/adsk/2.3r/Common/MdfParser/Common/IOSize2D.cpp
===================================================================
--- sandbox/adsk/2.3r/Common/MdfParser/Common/IOSize2D.cpp	2011-02-22 07:43:02 UTC (rev 5564)
+++ sandbox/adsk/2.3r/Common/MdfParser/Common/IOSize2D.cpp	2011-02-25 21:46:04 UTC (rev 5565)
@@ -74,23 +74,23 @@
     }
 }
 
-void IOSize2D::Write(MdfStream& fd, Size2D* size, Version* version, const std::string& name)
+void IOSize2D::Write(MdfStream& fd, Size2D* size, Version* version, const std::string& name, MgTab& tab)
 {
     _ASSERT(NULL != size);
 
-    fd << tab() << startStr(name) << std::endl;
-    inctab();
+    fd << tab.tab() << startStr(name) << std::endl;
+    tab.inctab();
 
     // Property: Width
-    fd << tab() << startStr(sWidth);
+    fd << tab.tab() << startStr(sWidth);
     fd << DoubleToStr(size->GetWidth());
     fd << endStr(sWidth) << std::endl;
 
     // Property: Height
-    fd << tab() << startStr(sHeight);
+    fd << tab.tab() << startStr(sHeight);
     fd << DoubleToStr(size->GetHeight());
     fd << endStr(sHeight) << std::endl;
 
-    dectab();
-    fd << tab() << endStr(name) << std::endl;
+    tab.dectab();
+    fd << tab.tab() << endStr(name) << std::endl;
 }

Modified: sandbox/adsk/2.3r/Common/MdfParser/Common/IOSize2D.h
===================================================================
--- sandbox/adsk/2.3r/Common/MdfParser/Common/IOSize2D.h	2011-02-22 07:43:02 UTC (rev 5564)
+++ sandbox/adsk/2.3r/Common/MdfParser/Common/IOSize2D.h	2011-02-25 21:46:04 UTC (rev 5565)
@@ -33,7 +33,7 @@
     virtual void ElementChars(const wchar_t* ch);
     virtual void EndElement(const wchar_t* name, HandlerStack* handlerStack);
 
-    static void Write(MdfStream& fd, Size2D* size, Version* version, const std::string& name);
+    static void Write(MdfStream& fd, Size2D* size, Version* version, const std::string& name, MgTab& tab);
 
 private:
     // Hidden default/copy constructors and assignment operator.

Modified: sandbox/adsk/2.3r/Common/MdfParser/Common/IOStringObjectCollection.cpp
===================================================================
--- sandbox/adsk/2.3r/Common/MdfParser/Common/IOStringObjectCollection.cpp	2011-02-22 07:43:02 UTC (rev 5564)
+++ sandbox/adsk/2.3r/Common/MdfParser/Common/IOStringObjectCollection.cpp	2011-02-25 21:46:04 UTC (rev 5565)
@@ -61,23 +61,23 @@
     }
 }
 
-void IOStringObjectCollection::Write(MdfStream& fd, StringObjectCollection* strCol, Version* version, const std::string& colName, const std::string& strName)
+void IOStringObjectCollection::Write(MdfStream& fd, StringObjectCollection* strCol, Version* version, const std::string& colName, const std::string& strName, MgTab& tab)
 {
     _ASSERT(NULL != strCol);
 
-    fd << tab() << startStr(colName) << std::endl;
-    inctab();
+    fd << tab.tab() << startStr(colName) << std::endl;
+    tab.inctab();
 
     for (int i = 0; i < strCol->GetCount(); ++i)
     {
         StringObject* strObj = dynamic_cast<StringObject*>(strCol->GetAt(i));
         _ASSERT(NULL != strObj);
 
-        fd << tab() << startStr(strName);
+        fd << tab.tab() << startStr(strName);
         fd << EncodeString(strObj->GetString());
         fd << endStr(strName) << std::endl;
     }
 
-    dectab();
-    fd << tab() << endStr(colName) << std::endl;
+    tab.dectab();
+    fd << tab.tab() << endStr(colName) << std::endl;
 }

Modified: sandbox/adsk/2.3r/Common/MdfParser/Common/IOStringObjectCollection.h
===================================================================
--- sandbox/adsk/2.3r/Common/MdfParser/Common/IOStringObjectCollection.h	2011-02-22 07:43:02 UTC (rev 5564)
+++ sandbox/adsk/2.3r/Common/MdfParser/Common/IOStringObjectCollection.h	2011-02-25 21:46:04 UTC (rev 5565)
@@ -33,7 +33,7 @@
     virtual void ElementChars(const wchar_t* ch);
     virtual void EndElement(const wchar_t* name, HandlerStack* handlerStack);
 
-    static void Write(MdfStream& fd, StringObjectCollection* strCol, Version* version, const std::string& colName, const std::string& strName);
+    static void Write(MdfStream& fd, StringObjectCollection* strCol, Version* version, const std::string& colName, const std::string& strName, MgTab& tab);
 
 private:
     // Hidden default/copy constructors and assignment operator.

Modified: sandbox/adsk/2.3r/Common/MdfParser/Common/IOVector3D.cpp
===================================================================
--- sandbox/adsk/2.3r/Common/MdfParser/Common/IOVector3D.cpp	2011-02-22 07:43:02 UTC (rev 5564)
+++ sandbox/adsk/2.3r/Common/MdfParser/Common/IOVector3D.cpp	2011-02-25 21:46:04 UTC (rev 5565)
@@ -79,28 +79,28 @@
     }
 }
 
-void IOVector3D::Write(MdfStream& fd, Vector3D* vector, Version* version)
+void IOVector3D::Write(MdfStream& fd, Vector3D* vector, Version* version, MgTab& tab)
 {
     _ASSERT(NULL != vector);
 
-    fd << tab() << startStr(sViewDirection) << std::endl;
-    inctab();
+    fd << tab.tab() << startStr(sViewDirection) << std::endl;
+    tab.inctab();
 
     // Property: X
-    fd << tab() << startStr(sX);
+    fd << tab.tab() << startStr(sX);
     fd << DoubleToStr(vector->GetX());
     fd << endStr(sX) << std::endl;
 
     // Property: Y
-    fd << tab() << startStr(sY);
+    fd << tab.tab() << startStr(sY);
     fd << DoubleToStr(vector->GetY());
     fd << endStr(sY) << std::endl;
 
     // Property: Z
-    fd << tab() << startStr(sZ);
+    fd << tab.tab() << startStr(sZ);
     fd << DoubleToStr(vector->GetZ());
     fd << endStr(sZ) << std::endl;
 
-    dectab();
-    fd << tab() << endStr(sViewDirection) << std::endl;
+    tab.dectab();
+    fd << tab.tab() << endStr(sViewDirection) << std::endl;
 }

Modified: sandbox/adsk/2.3r/Common/MdfParser/Common/IOVector3D.h
===================================================================
--- sandbox/adsk/2.3r/Common/MdfParser/Common/IOVector3D.h	2011-02-22 07:43:02 UTC (rev 5564)
+++ sandbox/adsk/2.3r/Common/MdfParser/Common/IOVector3D.h	2011-02-25 21:46:04 UTC (rev 5565)
@@ -33,7 +33,7 @@
     virtual void ElementChars(const wchar_t* ch);
     virtual void EndElement(const wchar_t* name, HandlerStack* handlerStack);
 
-    static void Write(MdfStream& fd, Vector3D* vector, Version* version);
+    static void Write(MdfStream& fd, Vector3D* vector, Version* version, MgTab& tab);
 
 private:
     // Hidden default/copy constructors and assignment operator.

Modified: sandbox/adsk/2.3r/Common/MdfParser/FSDSAX2Parser.cpp
===================================================================
--- sandbox/adsk/2.3r/Common/MdfParser/FSDSAX2Parser.cpp	2011-02-22 07:43:02 UTC (rev 5564)
+++ sandbox/adsk/2.3r/Common/MdfParser/FSDSAX2Parser.cpp	2011-02-25 21:46:04 UTC (rev 5565)
@@ -68,7 +68,7 @@
 
 void FSDSAX2Parser::DisableTabs()
 {
-    disableTabs();
+    MgTab::disableTabs();
 }
 
 
@@ -178,11 +178,11 @@
     fd.open(name.c_str());
     if (fd.is_open())
     {
-        zerotab();
-        fd << tab() << "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" << std::endl; // NOXLATE
+        MgTab tab;
+        fd << tab.tab() << "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" << std::endl; // NOXLATE
 
         if (NULL != featureSource)
-            IOFeatureSource::Write(fd, featureSource, version);
+            IOFeatureSource::Write(fd, featureSource, version, tab);
     }
     fd.close();
 }
@@ -191,9 +191,10 @@
 std::string FSDSAX2Parser::SerializeToXML(FeatureSource* featureSource, Version* version)
 {
     MdfStringStream fd;
+    MgTab tab;
 
     if (NULL != featureSource)
-        IOFeatureSource::Write(fd, featureSource, version);
+        IOFeatureSource::Write(fd, featureSource, version, tab);
 
     return fd.str();
 }

Modified: sandbox/adsk/2.3r/Common/MdfParser/IOAreaRule.cpp
===================================================================
--- sandbox/adsk/2.3r/Common/MdfParser/IOAreaRule.cpp	2011-02-22 07:43:02 UTC (rev 5564)
+++ sandbox/adsk/2.3r/Common/MdfParser/IOAreaRule.cpp	2011-02-25 21:46:04 UTC (rev 5565)
@@ -127,34 +127,34 @@
 }
 
 
-void IOAreaRule::Write(MdfStream& fd, AreaRule* areaRule, Version* version)
+void IOAreaRule::Write(MdfStream& fd, AreaRule* areaRule, Version* version, MgTab& tab)
 {
-    fd << tab() << startStr(sAreaRule) << std::endl;
-    inctab();
+    fd << tab.tab() << startStr(sAreaRule) << std::endl;
+    tab.inctab();
 
     // Property: LegendLabel
-    fd << tab() << startStr(sLegendLabel);
+    fd << tab.tab() << startStr(sLegendLabel);
     fd << EncodeString(areaRule->GetLegendLabel());
     fd << endStr(sLegendLabel) << std::endl;
 
     // Property: Filter
     if (!areaRule->GetFilter().empty())
     {
-        fd << tab() << startStr(sFilter);
+        fd << tab.tab() << startStr(sFilter);
         fd << EncodeString(areaRule->GetFilter());
         fd << endStr(sFilter) << std::endl;
     }
 
     // Property: Label
     if (areaRule->GetLabel() && areaRule->GetLabel()->GetSymbol())
-        IOLabel::Write(fd, areaRule->GetLabel(), version);
+        IOLabel::Write(fd, areaRule->GetLabel(), version, tab);
 
     // Property: Symbolization
-    IOAreaSymbolization2D::Write(fd, areaRule->GetSymbolization(), version);
+    IOAreaSymbolization2D::Write(fd, areaRule->GetSymbolization(), version, tab);
 
     // Write any unknown XML / extended data
-    IOUnknown::Write(fd, areaRule->GetUnknownXml(), version);
+    IOUnknown::Write(fd, areaRule->GetUnknownXml(), version, tab);
 
-    dectab();
-    fd << tab() << endStr(sAreaRule) << std::endl;
+    tab.dectab();
+    fd << tab.tab() << endStr(sAreaRule) << std::endl;
 }

Modified: sandbox/adsk/2.3r/Common/MdfParser/IOAreaRule.h
===================================================================
--- sandbox/adsk/2.3r/Common/MdfParser/IOAreaRule.h	2011-02-22 07:43:02 UTC (rev 5564)
+++ sandbox/adsk/2.3r/Common/MdfParser/IOAreaRule.h	2011-02-25 21:46:04 UTC (rev 5565)
@@ -39,7 +39,7 @@
         virtual void ElementChars(const wchar_t* ch);
         virtual void EndElement(const wchar_t* name, HandlerStack* handlerStack);
 
-        static void Write(MdfStream& fd, AreaRule* areaRule, Version* version);
+        static void Write(MdfStream& fd, AreaRule* areaRule, Version* version, MgTab& tab);
 
     private:
         AreaRule* m_areaRule;

Modified: sandbox/adsk/2.3r/Common/MdfParser/IOAreaSymbolization2D.cpp
===================================================================
--- sandbox/adsk/2.3r/Common/MdfParser/IOAreaSymbolization2D.cpp	2011-02-22 07:43:02 UTC (rev 5564)
+++ sandbox/adsk/2.3r/Common/MdfParser/IOAreaSymbolization2D.cpp	2011-02-25 21:46:04 UTC (rev 5565)
@@ -121,25 +121,25 @@
 }
 
 
-void IOAreaSymbolization2D::Write(MdfStream& fd, AreaSymbolization2D* areaSymbolization, Version* version)
+void IOAreaSymbolization2D::Write(MdfStream& fd, AreaSymbolization2D* areaSymbolization, Version* version, MgTab& tab)
 {
-    fd << tab() << startStr(sAreaSymbolization2D) << std::endl;
-    inctab();
+    fd << tab.tab() << startStr(sAreaSymbolization2D) << std::endl;
+    tab.inctab();
 
     if (areaSymbolization)
     {
         // Property: Fill
         if (areaSymbolization->GetFill())
-            IOFill::Write(fd, areaSymbolization->GetFill(), version);
+            IOFill::Write(fd, areaSymbolization->GetFill(), version, tab);
 
         // Property: Stroke
         if (areaSymbolization->GetEdge())
-            IOStroke::Write(fd, areaSymbolization->GetEdge(), sStroke, version);
+            IOStroke::Write(fd, areaSymbolization->GetEdge(), sStroke, version, tab);
 
         // Write any unknown XML / extended data
-        IOUnknown::Write(fd, areaSymbolization->GetUnknownXml(), version);
+        IOUnknown::Write(fd, areaSymbolization->GetUnknownXml(), version, tab);
     }
 
-    dectab();
-    fd << tab() << endStr(sAreaSymbolization2D) << std::endl;
+    tab.dectab();
+    fd << tab.tab() << endStr(sAreaSymbolization2D) << std::endl;
 }

Modified: sandbox/adsk/2.3r/Common/MdfParser/IOAreaSymbolization2D.h
===================================================================
--- sandbox/adsk/2.3r/Common/MdfParser/IOAreaSymbolization2D.h	2011-02-22 07:43:02 UTC (rev 5564)
+++ sandbox/adsk/2.3r/Common/MdfParser/IOAreaSymbolization2D.h	2011-02-25 21:46:04 UTC (rev 5565)
@@ -39,7 +39,7 @@
         virtual void ElementChars(const wchar_t* ch);
         virtual void EndElement(const wchar_t* name, HandlerStack* handlerStack);
 
-        static void Write(MdfStream& fd, AreaSymbolization2D* areaSymbolization, Version* version);
+        static void Write(MdfStream& fd, AreaSymbolization2D* areaSymbolization, Version* version, MgTab& tab);
 
     private:
         AreaSymbolization2D* m_areaSymbolization;

Modified: sandbox/adsk/2.3r/Common/MdfParser/IOAreaTypeStyle.cpp
===================================================================
--- sandbox/adsk/2.3r/Common/MdfParser/IOAreaTypeStyle.cpp	2011-02-22 07:43:02 UTC (rev 5564)
+++ sandbox/adsk/2.3r/Common/MdfParser/IOAreaTypeStyle.cpp	2011-02-25 21:46:04 UTC (rev 5565)
@@ -108,38 +108,38 @@
 }
 
 
-void IOAreaTypeStyle::Write(MdfStream& fd, AreaTypeStyle* areaTypeStyle, Version* version)
+void IOAreaTypeStyle::Write(MdfStream& fd, AreaTypeStyle* areaTypeStyle, Version* version, MgTab& tab)
 {
-    fd << tab() << startStr(sAreaTypeStyle) << std::endl;
-    inctab();
+    fd << tab.tab() << startStr(sAreaTypeStyle) << std::endl;
+    tab.inctab();
 
     MdfStringStream fdExtData;
 
     // Property: Rules
     for (int i=0; i<areaTypeStyle->GetRules()->GetCount(); ++i)
-        IOAreaRule::Write(fd, static_cast<AreaRule*>(areaTypeStyle->GetRules()->GetAt(i)), version);
+        IOAreaRule::Write(fd, static_cast<AreaRule*>(areaTypeStyle->GetRules()->GetAt(i)), version, tab);
 
     // Property: ShowInLegend
     if (!version || (*version >= Version(1, 3, 0)))
     {
         // version 1.3.0 has a ShowInLegend Property
-        fd << tab() << startStr(sShowInLegend);
+        fd << tab.tab() << startStr(sShowInLegend);
         fd << BoolToStr(areaTypeStyle->IsShowInLegend());
         fd << endStr(sShowInLegend) << std::endl;
     }
     else if (*version >= Version(1, 0, 0))
     {
         // save ShowInLegend as extended data for LDF versions 1.0.0, 1.1.0, and 1.2.0
-        inctab();
-        fdExtData << tab() << startStr(sShowInLegend);
+        tab.inctab();
+        fdExtData << tab.tab() << startStr(sShowInLegend);
         fdExtData << BoolToStr(areaTypeStyle->IsShowInLegend());
         fdExtData << endStr(sShowInLegend) << std::endl;
-        dectab();
+        tab.dectab();
     }
 
     // Write any unknown XML / extended data
-    IOUnknown::Write(fd, areaTypeStyle->GetUnknownXml(), fdExtData.str(), version);
+    IOUnknown::Write(fd, areaTypeStyle->GetUnknownXml(), fdExtData.str(), version, tab);
 
-    dectab();
-    fd << tab() << endStr(sAreaTypeStyle) << std::endl;
+    tab.dectab();
+    fd << tab.tab() << endStr(sAreaTypeStyle) << std::endl;
 }

Modified: sandbox/adsk/2.3r/Common/MdfParser/IOAreaTypeStyle.h
===================================================================
--- sandbox/adsk/2.3r/Common/MdfParser/IOAreaTypeStyle.h	2011-02-22 07:43:02 UTC (rev 5564)
+++ sandbox/adsk/2.3r/Common/MdfParser/IOAreaTypeStyle.h	2011-02-25 21:46:04 UTC (rev 5565)
@@ -39,7 +39,7 @@
         virtual void ElementChars(const wchar_t* ch);
         virtual void EndElement(const wchar_t* name, HandlerStack* handlerStack);
 
-        static void Write(MdfStream& fd, AreaTypeStyle* areaTypeStyle, Version* version);
+        static void Write(MdfStream& fd, AreaTypeStyle* areaTypeStyle, Version* version, MgTab& tab);
 
     private:
         AreaTypeStyle* m_areaTypeStyle;

Modified: sandbox/adsk/2.3r/Common/MdfParser/IOAreaUsage.cpp
===================================================================
--- sandbox/adsk/2.3r/Common/MdfParser/IOAreaUsage.cpp	2011-02-22 07:43:02 UTC (rev 5564)
+++ sandbox/adsk/2.3r/Common/MdfParser/IOAreaUsage.cpp	2011-02-25 21:46:04 UTC (rev 5565)
@@ -84,24 +84,24 @@
 }
 
 
-void IOAreaUsage::Write(MdfStream& fd, AreaUsage* areaUsage, Version* version)
+void IOAreaUsage::Write(MdfStream& fd, AreaUsage* areaUsage, Version* version, MgTab& tab)
 {
-    fd << tab() << "<AreaUsage>" << std::endl; // NOXLATE
-    inctab();
+    fd << tab.tab() << "<AreaUsage>" << std::endl; // NOXLATE
+    tab.inctab();
 
-    EMIT_STRING_PROPERTY(fd, areaUsage, AngleControl, true, AreaUsage::sAngleControlDefault)
-    EMIT_STRING_PROPERTY(fd, areaUsage, OriginControl, true, AreaUsage::sOriginControlDefault)
-    EMIT_STRING_PROPERTY(fd, areaUsage, ClippingControl, true, AreaUsage::sClippingControlDefault)
-    EMIT_DOUBLE_PROPERTY(fd, areaUsage, Angle, true, 0.0)       // default is 0.0
-    EMIT_DOUBLE_PROPERTY(fd, areaUsage, OriginX, true, 0.0)     // default is 0.0
-    EMIT_DOUBLE_PROPERTY(fd, areaUsage, OriginY, true, 0.0)     // default is 0.0
-    EMIT_DOUBLE_PROPERTY(fd, areaUsage, RepeatX, true, 0.0)     // default is 0.0
-    EMIT_DOUBLE_PROPERTY(fd, areaUsage, RepeatY, true, 0.0)     // default is 0.0
-    EMIT_DOUBLE_PROPERTY(fd, areaUsage, BufferWidth, true, 0.0) // default is 0.0
+    EMIT_STRING_PROPERTY(fd, areaUsage, AngleControl, true, AreaUsage::sAngleControlDefault, tab)
+    EMIT_STRING_PROPERTY(fd, areaUsage, OriginControl, true, AreaUsage::sOriginControlDefault, tab)
+    EMIT_STRING_PROPERTY(fd, areaUsage, ClippingControl, true, AreaUsage::sClippingControlDefault, tab)
+    EMIT_DOUBLE_PROPERTY(fd, areaUsage, Angle, true, 0.0, tab)       // default is 0.0
+    EMIT_DOUBLE_PROPERTY(fd, areaUsage, OriginX, true, 0.0, tab)     // default is 0.0
+    EMIT_DOUBLE_PROPERTY(fd, areaUsage, OriginY, true, 0.0, tab)     // default is 0.0
+    EMIT_DOUBLE_PROPERTY(fd, areaUsage, RepeatX, true, 0.0, tab)     // default is 0.0
+    EMIT_DOUBLE_PROPERTY(fd, areaUsage, RepeatY, true, 0.0, tab)     // default is 0.0
+    EMIT_DOUBLE_PROPERTY(fd, areaUsage, BufferWidth, true, 0.0, tab) // default is 0.0
 
     // Write any unknown XML / extended data
-    IOUnknown::Write(fd, areaUsage->GetUnknownXml(), version);
+    IOUnknown::Write(fd, areaUsage->GetUnknownXml(), version, tab);
 
-    dectab();
-    fd << tab() << "</AreaUsage>" << std::endl; // NOXLATE
+    tab.dectab();
+    fd << tab.tab() << "</AreaUsage>" << std::endl; // NOXLATE
 }

Modified: sandbox/adsk/2.3r/Common/MdfParser/IOAreaUsage.h
===================================================================
--- sandbox/adsk/2.3r/Common/MdfParser/IOAreaUsage.h	2011-02-22 07:43:02 UTC (rev 5564)
+++ sandbox/adsk/2.3r/Common/MdfParser/IOAreaUsage.h	2011-02-25 21:46:04 UTC (rev 5565)
@@ -37,7 +37,7 @@
         virtual void ElementChars(const wchar_t* ch);
         virtual void EndElement(const wchar_t* name, HandlerStack* handlerStack);
 
-        static void Write(MdfStream& fd, AreaUsage* areaUsage, Version* version);
+        static void Write(MdfStream& fd, AreaUsage* areaUsage, Version* version, MgTab& tab);
 
     private:
         SimpleSymbolDefinition* m_symbolDefinition;

Modified: sandbox/adsk/2.3r/Common/MdfParser/IOAttributeRelate.cpp
===================================================================
--- sandbox/adsk/2.3r/Common/MdfParser/IOAttributeRelate.cpp	2011-02-22 07:43:02 UTC (rev 5564)
+++ sandbox/adsk/2.3r/Common/MdfParser/IOAttributeRelate.cpp	2011-02-25 21:46:04 UTC (rev 5565)
@@ -176,48 +176,48 @@
 }
 
 
-void IOAttributeRelate::Write(MdfStream& fd, AttributeRelate* attributeRelate, Version* version)
+void IOAttributeRelate::Write(MdfStream& fd, AttributeRelate* attributeRelate, Version* version, MgTab& tab)
 {
-    fd << tab() << startStr(sAttributeRelate) << std::endl;
-    inctab();
+    fd << tab.tab() << startStr(sAttributeRelate) << std::endl;
+    tab.inctab();
 
     // Property: RelateProperties
     for (int i=0; i<attributeRelate->GetRelateProperties()->GetCount(); ++i)
-        IORelateProperty::Write(fd, attributeRelate->GetRelateProperties()->GetAt(i), version);
+        IORelateProperty::Write(fd, attributeRelate->GetRelateProperties()->GetAt(i), version, tab);
 
     // Property: AttributeClass
-    fd << tab() << startStr(sAttributeClass);
+    fd << tab.tab() << startStr(sAttributeClass);
     fd << EncodeString(attributeRelate->GetAttributeClass());
     fd << endStr(sAttributeClass) << std::endl;
 
     // Property: ResourceId
-    fd << tab() << startStr(sResourceId);
+    fd << tab.tab() << startStr(sResourceId);
     fd << EncodeString(attributeRelate->GetResourceId());
     fd << endStr(sResourceId) << std::endl;
 
     // Property: Name
-    fd << tab() << startStr(sName);
+    fd << tab.tab() << startStr(sName);
     fd << EncodeString(attributeRelate->GetName());
     fd << endStr(sName) << std::endl;
 
     // Property: AttributeNameDelimiter
-    fd << tab() << startStr(sAttributeNameDelimiter);
+    fd << tab.tab() << startStr(sAttributeNameDelimiter);
     fd << EncodeString(attributeRelate->GetAttributeNameDelimiter());
     fd << endStr(sAttributeNameDelimiter) << std::endl;
 
     // Property: RelateType
-    fd << tab() << startStr(sRelateType);
+    fd << tab.tab() << startStr(sRelateType);
     IOAttributeRelate::WriteType(fd, attributeRelate);
     fd << endStr(sRelateType) << std::endl;
 
     // Property: ForceOneToOne
-    fd << tab() << startStr(sForceOneToOne);
+    fd << tab.tab() << startStr(sForceOneToOne);
     fd << BoolToStr(attributeRelate->GetForceOneToOne());
     fd << endStr(sForceOneToOne) << std::endl;
 
     // Write any unknown XML / extended data
-    IOUnknown::Write(fd, attributeRelate->GetUnknownXml(), version);
+    IOUnknown::Write(fd, attributeRelate->GetUnknownXml(), version, tab);
 
-    dectab();
-    fd << tab() << endStr(sAttributeRelate) << std::endl;
+    tab.dectab();
+    fd << tab.tab() << endStr(sAttributeRelate) << std::endl;
 }

Modified: sandbox/adsk/2.3r/Common/MdfParser/IOAttributeRelate.h
===================================================================
--- sandbox/adsk/2.3r/Common/MdfParser/IOAttributeRelate.h	2011-02-22 07:43:02 UTC (rev 5564)
+++ sandbox/adsk/2.3r/Common/MdfParser/IOAttributeRelate.h	2011-02-25 21:46:04 UTC (rev 5565)
@@ -39,7 +39,7 @@
         virtual void ElementChars(const wchar_t* ch);
         virtual void EndElement(const wchar_t* name, HandlerStack* handlerStack);
 
-        static void Write(MdfStream& fd, AttributeRelate* attributeRelate, Version* version);
+        static void Write(MdfStream& fd, AttributeRelate* attributeRelate, Version* version, MgTab& tab);
 
     private:
         static void WriteType(MdfStream& fd, AttributeRelate* attributeRelate);

Modified: sandbox/adsk/2.3r/Common/MdfParser/IOBaseMapDefinition.cpp
===================================================================
--- sandbox/adsk/2.3r/Common/MdfParser/IOBaseMapDefinition.cpp	2011-02-22 07:43:02 UTC (rev 5564)
+++ sandbox/adsk/2.3r/Common/MdfParser/IOBaseMapDefinition.cpp	2011-02-25 21:46:04 UTC (rev 5565)
@@ -89,16 +89,16 @@
 }
 
 
-void IOBaseMapDefinition::Write(MdfStream& fd, MapDefinition* map, Version* version)
+void IOBaseMapDefinition::Write(MdfStream& fd, MapDefinition* map, Version* version, MgTab& tab)
 {
-    fd << tab() << "<BaseMapDefinition>" << std::endl; // NOXLATE
-    inctab();
+    fd << tab.tab() << "<BaseMapDefinition>" << std::endl; // NOXLATE
+    tab.inctab();
 
     // Property: FiniteDisplayScales
     DisplayScaleCollection* finiteDisplayScales = map->GetFiniteDisplayScales();
     for (int i=0; i<finiteDisplayScales->GetCount(); ++i)
     {
-        fd << tab() << "<FiniteDisplayScale>"; // NOXLATE
+        fd << tab.tab() << "<FiniteDisplayScale>"; // NOXLATE
         fd << DoubleToStr((static_cast<DisplayScale*>(finiteDisplayScales->GetAt(i)))->GetValue());
         fd << "</FiniteDisplayScale>" << std::endl; // NOXLATE
     }
@@ -106,8 +106,8 @@
     // Property: BaseMapLayerGroups
     BaseMapLayerGroupCollection* baseMapGroups = map->GetBaseMapLayerGroups();
     for (int i=0; i<baseMapGroups->GetCount(); ++i)
-        IOBaseMapLayerGroup::Write(fd, static_cast<BaseMapLayerGroup*>(baseMapGroups->GetAt(i)), version);
+        IOBaseMapLayerGroup::Write(fd, static_cast<BaseMapLayerGroup*>(baseMapGroups->GetAt(i)), version, tab);
 
-    dectab();
-    fd << tab() << "</BaseMapDefinition>" << std::endl; // NOXLATE
+    tab.dectab();
+    fd << tab.tab() << "</BaseMapDefinition>" << std::endl; // NOXLATE
 }

Modified: sandbox/adsk/2.3r/Common/MdfParser/IOBaseMapDefinition.h
===================================================================
--- sandbox/adsk/2.3r/Common/MdfParser/IOBaseMapDefinition.h	2011-02-22 07:43:02 UTC (rev 5564)
+++ sandbox/adsk/2.3r/Common/MdfParser/IOBaseMapDefinition.h	2011-02-25 21:46:04 UTC (rev 5565)
@@ -42,7 +42,7 @@
         virtual void ElementChars(const wchar_t* ch);
         virtual void EndElement(const wchar_t* name, HandlerStack* handlerStack);
 
-        static void Write(MdfStream& fd, MapDefinition* map, Version* version);
+        static void Write(MdfStream& fd, MapDefinition* map, Version* version, MgTab& tab);
 
     private:
         MapDefinition* m_map;

Modified: sandbox/adsk/2.3r/Common/MdfParser/IOBaseMapLayer.cpp
===================================================================
--- sandbox/adsk/2.3r/Common/MdfParser/IOBaseMapLayer.cpp	2011-02-22 07:43:02 UTC (rev 5564)
+++ sandbox/adsk/2.3r/Common/MdfParser/IOBaseMapLayer.cpp	2011-02-25 21:46:04 UTC (rev 5565)
@@ -91,17 +91,17 @@
 }
 
 
-void IOBaseMapLayer::Write(MdfStream& fd, BaseMapLayer* baseMapLayer, Version* version)
+void IOBaseMapLayer::Write(MdfStream& fd, BaseMapLayer* baseMapLayer, Version* version, MgTab& tab)
 {
-    fd << tab() << startStr(sBaseMapLayer) << std::endl;
-    inctab();
+    fd << tab.tab() << startStr(sBaseMapLayer) << std::endl;
+    tab.inctab();
 
-    IOMapLayerCommon::Write(fd, baseMapLayer, version);
+    IOMapLayerCommon::Write(fd, baseMapLayer, version, tab);
 
     // Write any unknown XML / extended data
     if (!version || (*version >= Version(2, 3, 0)))
-        IOUnknown::Write(fd, baseMapLayer->GetUnknownXml(), version);
+        IOUnknown::Write(fd, baseMapLayer->GetUnknownXml(), version, tab);
 
-    dectab();
-    fd << tab() << endStr(sBaseMapLayer) << std::endl;
+    tab.dectab();
+    fd << tab.tab() << endStr(sBaseMapLayer) << std::endl;
 }

Modified: sandbox/adsk/2.3r/Common/MdfParser/IOBaseMapLayer.h
===================================================================
--- sandbox/adsk/2.3r/Common/MdfParser/IOBaseMapLayer.h	2011-02-22 07:43:02 UTC (rev 5564)
+++ sandbox/adsk/2.3r/Common/MdfParser/IOBaseMapLayer.h	2011-02-25 21:46:04 UTC (rev 5565)
@@ -39,7 +39,7 @@
         virtual void StartElement(const wchar_t* name, HandlerStack* handlerStack);
         virtual void EndElement(const wchar_t* name, HandlerStack* handlerStack);
 
-        static void Write(MdfStream& fd, BaseMapLayer* baseMapLayer, Version* version);
+        static void Write(MdfStream& fd, BaseMapLayer* baseMapLayer, Version* version, MgTab& tab);
 
     private:
         BaseMapLayerCollection* m_baseMapLayers;

Modified: sandbox/adsk/2.3r/Common/MdfParser/IOBaseMapLayerGroup.cpp
===================================================================
--- sandbox/adsk/2.3r/Common/MdfParser/IOBaseMapLayerGroup.cpp	2011-02-22 07:43:02 UTC (rev 5564)
+++ sandbox/adsk/2.3r/Common/MdfParser/IOBaseMapLayerGroup.cpp	2011-02-25 21:46:04 UTC (rev 5565)
@@ -101,22 +101,22 @@
 }
 
 
-void IOBaseMapLayerGroup::Write(MdfStream& fd, BaseMapLayerGroup* baseMapLayerGroup, Version* version)
+void IOBaseMapLayerGroup::Write(MdfStream& fd, BaseMapLayerGroup* baseMapLayerGroup, Version* version, MgTab& tab)
 {
-    fd << tab() << startStr(sBaseMapLayerGroup) << std::endl;
-    inctab();
+    fd << tab.tab() << startStr(sBaseMapLayerGroup) << std::endl;
+    tab.inctab();
 
-    IOMapLayerGroupCommon::Write(fd, baseMapLayerGroup, version);
+    IOMapLayerGroupCommon::Write(fd, baseMapLayerGroup, version, tab);
 
     // Property: Layers
     BaseMapLayerCollection* baseMapLayers = baseMapLayerGroup->GetLayers();
     for (int i=0; i<baseMapLayers->GetCount(); ++i)
-        IOBaseMapLayer::Write(fd, static_cast<BaseMapLayer*>(baseMapLayers->GetAt(i)), version);
+        IOBaseMapLayer::Write(fd, static_cast<BaseMapLayer*>(baseMapLayers->GetAt(i)), version, tab);
 
     // Write any unknown XML / extended data
     if (!version || (*version >= Version(2, 3, 0)))
-        IOUnknown::Write(fd, baseMapLayerGroup->GetUnknownXml(), version);
+        IOUnknown::Write(fd, baseMapLayerGroup->GetUnknownXml(), version, tab);
 
-    dectab();
-    fd << tab() << endStr(sBaseMapLayerGroup) << std::endl;
+    tab.dectab();
+    fd << tab.tab() << endStr(sBaseMapLayerGroup) << std::endl;
 }

Modified: sandbox/adsk/2.3r/Common/MdfParser/IOBaseMapLayerGroup.h
===================================================================
--- sandbox/adsk/2.3r/Common/MdfParser/IOBaseMapLayerGroup.h	2011-02-22 07:43:02 UTC (rev 5564)
+++ sandbox/adsk/2.3r/Common/MdfParser/IOBaseMapLayerGroup.h	2011-02-25 21:46:04 UTC (rev 5565)
@@ -39,7 +39,7 @@
         virtual void StartElement(const wchar_t* name, HandlerStack* handlerStack);
         virtual void EndElement(const wchar_t* name, HandlerStack* handlerStack);
 
-        static void Write(MdfStream& fd, BaseMapLayerGroup* baseMapLayerGroup, Version* version);
+        static void Write(MdfStream& fd, BaseMapLayerGroup* baseMapLayerGroup, Version* version, MgTab& tab);
 };
 
 END_NAMESPACE_MDFPARSER

Modified: sandbox/adsk/2.3r/Common/MdfParser/IOBlockSymbol.cpp
===================================================================
--- sandbox/adsk/2.3r/Common/MdfParser/IOBlockSymbol.cpp	2011-02-22 07:43:02 UTC (rev 5564)
+++ sandbox/adsk/2.3r/Common/MdfParser/IOBlockSymbol.cpp	2011-02-25 21:46:04 UTC (rev 5565)
@@ -118,27 +118,27 @@
 }
 
 
-void IOBlockSymbol::Write(MdfStream& fd, BlockSymbol* symbol, Version* version)
+void IOBlockSymbol::Write(MdfStream& fd, BlockSymbol* symbol, Version* version, MgTab& tab)
 {
-    fd << tab() << startStr(sBlock) << std::endl;
-    inctab();
+    fd << tab.tab() << startStr(sBlock) << std::endl;
+    tab.inctab();
 
-    IOSymbol::Write(fd, symbol, version);
+    IOSymbol::Write(fd, symbol, version, tab);
 
     // Property: SymbolLibrary
-    fd << tab() << startStr(sDrawingName);
+    fd << tab.tab() << startStr(sDrawingName);
     fd << EncodeString(symbol->GetDrawingName());
     fd << endStr(sDrawingName) << std::endl;
 
     // Property: SymbolName
-    fd << tab() << startStr(sBlockName);
+    fd << tab.tab() << startStr(sBlockName);
     fd << EncodeString(symbol->GetBlockName());
     fd << endStr(sBlockName) << std::endl;
 
     // Property: BlockColor
     if (!symbol->GetBlockColor().empty())
     {
-        fd << tab() << startStr(sBlockColor);
+        fd << tab.tab() << startStr(sBlockColor);
         fd << EncodeString(symbol->GetBlockColor());
         fd << endStr(sBlockColor) << std::endl;
     }
@@ -146,14 +146,14 @@
     // Property: LayerColor
     if (!symbol->GetLayerColor().empty())
     {
-        fd << tab() << startStr(sLayerColor);
+        fd << tab.tab() << startStr(sLayerColor);
         fd << EncodeString(symbol->GetLayerColor());
         fd << endStr(sLayerColor) << std::endl;
     }
 
     // Write any unknown XML / extended data
-    IOUnknown::Write(fd, symbol->GetUnknownXml(), version);
+    IOUnknown::Write(fd, symbol->GetUnknownXml(), version, tab);
 
-    dectab();
-    fd << tab() << endStr(sBlock) << std::endl;
+    tab.dectab();
+    fd << tab.tab() << endStr(sBlock) << std::endl;
 }

Modified: sandbox/adsk/2.3r/Common/MdfParser/IOBlockSymbol.h
===================================================================
--- sandbox/adsk/2.3r/Common/MdfParser/IOBlockSymbol.h	2011-02-22 07:43:02 UTC (rev 5564)
+++ sandbox/adsk/2.3r/Common/MdfParser/IOBlockSymbol.h	2011-02-25 21:46:04 UTC (rev 5565)
@@ -35,7 +35,7 @@
         virtual void ElementChars(const wchar_t* ch);
         virtual void EndElement(const wchar_t* name, HandlerStack* handlerStack);
 
-        static void Write(MdfStream& fd, BlockSymbol* blockSymbol, Version* version);
+        static void Write(MdfStream& fd, BlockSymbol* blockSymbol, Version* version, MgTab& tab);
 };
 
 END_NAMESPACE_MDFPARSER

Modified: sandbox/adsk/2.3r/Common/MdfParser/IOCalculatedProperty.cpp
===================================================================
--- sandbox/adsk/2.3r/Common/MdfParser/IOCalculatedProperty.cpp	2011-02-22 07:43:02 UTC (rev 5564)
+++ sandbox/adsk/2.3r/Common/MdfParser/IOCalculatedProperty.cpp	2011-02-25 21:46:04 UTC (rev 5565)
@@ -106,24 +106,24 @@
 }
 
 
-void IOCalculatedProperty::Write(MdfStream& fd, CalculatedProperty* calculatedProperty, Version* version)
+void IOCalculatedProperty::Write(MdfStream& fd, CalculatedProperty* calculatedProperty, Version* version, MgTab& tab)
 {
-    fd << tab() << startStr(sCalculatedProperty) << std::endl;
-    inctab();
+    fd << tab.tab() << startStr(sCalculatedProperty) << std::endl;
+    tab.inctab();
 
     // Property: Name
-    fd << tab() << startStr(sName);
+    fd << tab.tab() << startStr(sName);
     fd << EncodeString(calculatedProperty->GetName());
     fd << endStr(sName) << std::endl;
 
     // Property: Expression
-    fd << tab() << startStr(sExpression);
+    fd << tab.tab() << startStr(sExpression);
     fd << EncodeString(calculatedProperty->GetExpression());
     fd << endStr(sExpression) << std::endl;
 
     // Write any unknown XML / extended data
-    IOUnknown::Write(fd, calculatedProperty->GetUnknownXml(), version);
+    IOUnknown::Write(fd, calculatedProperty->GetUnknownXml(), version, tab);
 
-    dectab();
-    fd << tab() << endStr(sCalculatedProperty) << std::endl;
+    tab.dectab();
+    fd << tab.tab() << endStr(sCalculatedProperty) << std::endl;
 }

Modified: sandbox/adsk/2.3r/Common/MdfParser/IOCalculatedProperty.h
===================================================================
--- sandbox/adsk/2.3r/Common/MdfParser/IOCalculatedProperty.h	2011-02-22 07:43:02 UTC (rev 5564)
+++ sandbox/adsk/2.3r/Common/MdfParser/IOCalculatedProperty.h	2011-02-25 21:46:04 UTC (rev 5565)
@@ -39,7 +39,7 @@
         virtual void ElementChars(const wchar_t* ch);
         virtual void EndElement(const wchar_t* name, HandlerStack* handlerStack);
 
-        static void Write(MdfStream& fd, CalculatedProperty* calculatedProperty, Version* version);
+        static void Write(MdfStream& fd, CalculatedProperty* calculatedProperty, Version* version, MgTab& tab);
 
     private:
         CalculatedProperty* m_calculatedProperty;

Modified: sandbox/adsk/2.3r/Common/MdfParser/IOChannelBand.cpp
===================================================================
--- sandbox/adsk/2.3r/Common/MdfParser/IOChannelBand.cpp	2011-02-22 07:43:02 UTC (rev 5564)
+++ sandbox/adsk/2.3r/Common/MdfParser/IOChannelBand.cpp	2011-02-25 21:46:04 UTC (rev 5565)
@@ -125,32 +125,32 @@
 }
 
 
-void IOChannelBand::Write(MdfStream& fd, const ChannelBand* channel, std::string name, Version* version)
+void IOChannelBand::Write(MdfStream& fd, const ChannelBand* channel, std::string name, Version* version, MgTab& tab)
 {
-    fd << tab() << startStr(name) << std::endl;
-    inctab();
+    fd << tab.tab() << startStr(name) << std::endl;
+    tab.inctab();
 
     // Property: Band
-    fd << tab() << startStr(sBand);
+    fd << tab.tab() << startStr(sBand);
     fd << EncodeString(channel->GetBand());
     fd << endStr(sBand) << std::endl;
 
     // Property: LowBand
     // TODO: this is optional - it defaults to the low value in the band
-    fd << tab() << startStr(sLowBand);
+    fd << tab.tab() << startStr(sLowBand);
     fd << DoubleToStr(channel->GetLowBand());
     fd << endStr(sLowBand) << std::endl;
 
     // Property: HighBand
     // TODO: this is optional - it defaults to the high value in the band
-    fd << tab() << startStr(sHighBand);
+    fd << tab.tab() << startStr(sHighBand);
     fd << DoubleToStr(channel->GetHighBand());
     fd << endStr(sHighBand) << std::endl;
 
     // Property: LowChannel (optional)
     if (channel->GetLowChannel() != 0)
     {
-        fd << tab() << startStr(sLowChannel);
+        fd << tab.tab() << startStr(sLowChannel);
         fd << DoubleToStr(channel->GetLowChannel());
         fd << endStr(sLowChannel) << std::endl;
     }
@@ -158,14 +158,14 @@
     // Property: HighChannel (optional)
     if (channel->GetHighChannel() != 255)
     {
-        fd << tab() << startStr(sHighChannel);
+        fd << tab.tab() << startStr(sHighChannel);
         fd << DoubleToStr(channel->GetHighChannel());
         fd << endStr(sHighChannel) << std::endl;
     }
 
     // Write any unknown XML / extended data
-    IOUnknown::Write(fd, channel->GetUnknownXml(), version);
+    IOUnknown::Write(fd, channel->GetUnknownXml(), version, tab);
 
-    dectab();
-    fd << tab() << endStr(name) << std::endl;
+    tab.dectab();
+    fd << tab.tab() << endStr(name) << std::endl;
 }

Modified: sandbox/adsk/2.3r/Common/MdfParser/IOChannelBand.h
===================================================================
--- sandbox/adsk/2.3r/Common/MdfParser/IOChannelBand.h	2011-02-22 07:43:02 UTC (rev 5564)
+++ sandbox/adsk/2.3r/Common/MdfParser/IOChannelBand.h	2011-02-25 21:46:04 UTC (rev 5565)
@@ -38,7 +38,7 @@
         virtual void ElementChars(const wchar_t* ch);
         virtual void EndElement(const wchar_t* name, HandlerStack* handlerStack);
 
-        static void Write(MdfStream& fd, const ChannelBand* channel, std::string name, Version* version);
+        static void Write(MdfStream& fd, const ChannelBand* channel, std::string name, Version* version, MgTab& tab);
 
     private:
         ChannelBand* m_channel;

Modified: sandbox/adsk/2.3r/Common/MdfParser/IOCompositeRule.cpp
===================================================================
--- sandbox/adsk/2.3r/Common/MdfParser/IOCompositeRule.cpp	2011-02-22 07:43:02 UTC (rev 5564)
+++ sandbox/adsk/2.3r/Common/MdfParser/IOCompositeRule.cpp	2011-02-25 21:46:04 UTC (rev 5565)
@@ -89,19 +89,19 @@
 }
 
 
-void IOCompositeRule::Write(MdfStream& fd, CompositeRule* compositeRule, Version* version)
+void IOCompositeRule::Write(MdfStream& fd, CompositeRule* compositeRule, Version* version, MgTab& tab)
 {
-    fd << tab() << "<CompositeRule>" << std::endl; // NOXLATE
-    inctab();
+    fd << tab.tab() << "<CompositeRule>" << std::endl; // NOXLATE
+    tab.inctab();
 
-    EMIT_STRING_PROPERTY(fd, compositeRule, LegendLabel, false, NULL)
-    EMIT_STRING_PROPERTY(fd, compositeRule, Filter, true, L"") // default is empty string
+    EMIT_STRING_PROPERTY(fd, compositeRule, LegendLabel, false, NULL, tab)
+    EMIT_STRING_PROPERTY(fd, compositeRule, Filter, true, L"", tab) // default is empty string
 
-    IOCompositeSymbolization::Write(fd, compositeRule->GetSymbolization(), version);
+    IOCompositeSymbolization::Write(fd, compositeRule->GetSymbolization(), version, tab);
 
     // Write any unknown XML / extended data
-    IOUnknown::Write(fd, compositeRule->GetUnknownXml(), version);
+    IOUnknown::Write(fd, compositeRule->GetUnknownXml(), version, tab);
 
-    dectab();
-    fd << tab() << "</CompositeRule>" << std::endl; // NOXLATE
+    tab.dectab();
+    fd << tab.tab() << "</CompositeRule>" << std::endl; // NOXLATE
 }

Modified: sandbox/adsk/2.3r/Common/MdfParser/IOCompositeRule.h
===================================================================
--- sandbox/adsk/2.3r/Common/MdfParser/IOCompositeRule.h	2011-02-22 07:43:02 UTC (rev 5564)
+++ sandbox/adsk/2.3r/Common/MdfParser/IOCompositeRule.h	2011-02-25 21:46:04 UTC (rev 5565)
@@ -38,7 +38,7 @@
         virtual void ElementChars(const wchar_t* ch);
         virtual void EndElement(const wchar_t* name, HandlerStack* handlerStack);
 
-        static void Write(MdfStream& fd, CompositeRule* compositeRule, Version* version);
+        static void Write(MdfStream& fd, CompositeRule* compositeRule, Version* version, MgTab& tab);
 
     private:
         CompositeTypeStyle* m_compositeTypeStyle;

Modified: sandbox/adsk/2.3r/Common/MdfParser/IOCompositeSymbolization.cpp
===================================================================
--- sandbox/adsk/2.3r/Common/MdfParser/IOCompositeSymbolization.cpp	2011-02-22 07:43:02 UTC (rev 5564)
+++ sandbox/adsk/2.3r/Common/MdfParser/IOCompositeSymbolization.cpp	2011-02-25 21:46:04 UTC (rev 5565)
@@ -87,22 +87,22 @@
 }
 
 
-void IOCompositeSymbolization::Write(MdfStream& fd, CompositeSymbolization* compositeSymbolization, Version* version)
+void IOCompositeSymbolization::Write(MdfStream& fd, CompositeSymbolization* compositeSymbolization, Version* version, MgTab& tab)
 {
-    fd << tab() << "<CompositeSymbolization>" << std::endl; // NOXLATE
-    inctab();
+    fd << tab.tab() << "<CompositeSymbolization>" << std::endl; // NOXLATE
+    tab.inctab();
 
     SymbolInstanceCollection* instanceCollection = compositeSymbolization->GetSymbolCollection();
     int numInstances = instanceCollection->GetCount();
     for (int i=0; i<numInstances; ++i)
     {
         SymbolInstance* instance = instanceCollection->GetAt(i);
-        IOSymbolInstance::Write(fd, instance, version);
+        IOSymbolInstance::Write(fd, instance, version, tab);
     }
 
     // Write any unknown XML / extended data
-    IOUnknown::Write(fd, compositeSymbolization->GetUnknownXml(), version);
+    IOUnknown::Write(fd, compositeSymbolization->GetUnknownXml(), version, tab);
 
-    dectab();
-    fd << tab() << "</CompositeSymbolization>" << std::endl; // NOXLATE
+    tab.dectab();
+    fd << tab.tab() << "</CompositeSymbolization>" << std::endl; // NOXLATE
 }

Modified: sandbox/adsk/2.3r/Common/MdfParser/IOCompositeSymbolization.h
===================================================================
--- sandbox/adsk/2.3r/Common/MdfParser/IOCompositeSymbolization.h	2011-02-22 07:43:02 UTC (rev 5564)
+++ sandbox/adsk/2.3r/Common/MdfParser/IOCompositeSymbolization.h	2011-02-25 21:46:04 UTC (rev 5565)
@@ -38,7 +38,7 @@
         virtual void ElementChars(const wchar_t* ch);
         virtual void EndElement(const wchar_t* name, HandlerStack* handlerStack);
 
-        static void Write(MdfStream& fd, CompositeSymbolization* compositeSymbolization, Version* version);
+        static void Write(MdfStream& fd, CompositeSymbolization* compositeSymbolization, Version* version, MgTab& tab);
 
     private:
         CompositeRule* m_compositeRule;

Modified: sandbox/adsk/2.3r/Common/MdfParser/IOCompositeTypeStyle.cpp
===================================================================
--- sandbox/adsk/2.3r/Common/MdfParser/IOCompositeTypeStyle.cpp	2011-02-22 07:43:02 UTC (rev 5564)
+++ sandbox/adsk/2.3r/Common/MdfParser/IOCompositeTypeStyle.cpp	2011-02-25 21:46:04 UTC (rev 5565)
@@ -104,15 +104,15 @@
 }
 
 
-void IOCompositeTypeStyle::Write(MdfStream& fd, CompositeTypeStyle* compositeTypeStyle, Version* version)
+void IOCompositeTypeStyle::Write(MdfStream& fd, CompositeTypeStyle* compositeTypeStyle, Version* version, MgTab& tab)
 {
     // the schema currently requires at least one rule
     RuleCollection* ruleCollection = compositeTypeStyle->GetRules();
     int numElements = ruleCollection->GetCount();
     _ASSERT(numElements > 0);
 
-    fd << tab() << startStr(sCompositeTypeStyle) << std::endl;
-    inctab();
+    fd << tab.tab() << startStr(sCompositeTypeStyle) << std::endl;
+    tab.inctab();
 
     MdfStringStream fdExtData;
 
@@ -120,30 +120,30 @@
     {
         CompositeRule* compositeRule = dynamic_cast<CompositeRule*>(ruleCollection->GetAt(i));
         if (compositeRule)
-            IOCompositeRule::Write(fd, compositeRule, version);
+            IOCompositeRule::Write(fd, compositeRule, version, tab);
     }
 
     // Property: ShowInLegend
     if (!version || (*version >= Version(1, 3, 0)))
     {
         // version 1.3.0 has a ShowInLegend Property
-        fd << tab() << startStr(sShowInLegend);
+        fd << tab.tab() << startStr(sShowInLegend);
         fd << BoolToStr(compositeTypeStyle->IsShowInLegend());
         fd << endStr(sShowInLegend) << std::endl;
     }
     else if (*version >= Version(1, 0, 0))
     {
         // save ShowInLegend as extended data for LDF versions 1.0.0, 1.1.0, and 1.2.0
-        inctab();
-        fdExtData << tab() << startStr(sShowInLegend);
+        tab.inctab();
+        fdExtData << tab.tab() << startStr(sShowInLegend);
         fdExtData << BoolToStr(compositeTypeStyle->IsShowInLegend());
         fdExtData << endStr(sShowInLegend) << std::endl;
-        dectab();
+        tab.dectab();
     }
 
     // Write any unknown XML / extended data
-    IOUnknown::Write(fd, compositeTypeStyle->GetUnknownXml(), fdExtData.str(), version);
+    IOUnknown::Write(fd, compositeTypeStyle->GetUnknownXml(), fdExtData.str(), version, tab);
 
-    dectab();
-    fd << tab() << endStr(sCompositeTypeStyle) << std::endl;
+    tab.dectab();
+    fd << tab.tab() << endStr(sCompositeTypeStyle) << std::endl;
 }

Modified: sandbox/adsk/2.3r/Common/MdfParser/IOCompositeTypeStyle.h
===================================================================
--- sandbox/adsk/2.3r/Common/MdfParser/IOCompositeTypeStyle.h	2011-02-22 07:43:02 UTC (rev 5564)
+++ sandbox/adsk/2.3r/Common/MdfParser/IOCompositeTypeStyle.h	2011-02-25 21:46:04 UTC (rev 5565)
@@ -38,7 +38,7 @@
         virtual void ElementChars(const wchar_t* ch);
         virtual void EndElement(const wchar_t* name, HandlerStack* handlerStack);
 
-        static void Write(MdfStream& fd, CompositeTypeStyle* compositeTypeStyle, Version* version);
+        static void Write(MdfStream& fd, CompositeTypeStyle* compositeTypeStyle, Version* version, MgTab& tab);
 
     private:
         VectorScaleRange* m_vectorScaleRange;

Modified: sandbox/adsk/2.3r/Common/MdfParser/IOCompoundSymbolDefinition.cpp
===================================================================
--- sandbox/adsk/2.3r/Common/MdfParser/IOCompoundSymbolDefinition.cpp	2011-02-22 07:43:02 UTC (rev 5564)
+++ sandbox/adsk/2.3r/Common/MdfParser/IOCompoundSymbolDefinition.cpp	2011-02-25 21:46:04 UTC (rev 5565)
@@ -80,7 +80,7 @@
 }
 
 
-void IOCompoundSymbolDefinition::Write(MdfStream& fd, CompoundSymbolDefinition* symbolDefinition, bool writeAsRootElement, Version* version)
+void IOCompoundSymbolDefinition::Write(MdfStream& fd, CompoundSymbolDefinition* symbolDefinition, bool writeAsRootElement, Version* version, MgTab& tab)
 {
     if (writeAsRootElement)
     {
@@ -107,23 +107,23 @@
             strVersion = L"1.1.0";
         }
 
-        fd << tab() << "<CompoundSymbolDefinition xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"SymbolDefinition-" << EncodeString(strVersion) << ".xsd\" version=\"" << EncodeString(strVersion) << "\">" << std::endl; // NOXLATE
+        fd << tab.tab() << "<CompoundSymbolDefinition xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"SymbolDefinition-" << EncodeString(strVersion) << ".xsd\" version=\"" << EncodeString(strVersion) << "\">" << std::endl; // NOXLATE
     }
     else
-        fd << tab() << "<CompoundSymbolDefinition>" << std::endl; // NOXLATE
-    inctab();
+        fd << tab.tab() << "<CompoundSymbolDefinition>" << std::endl; // NOXLATE
+    tab.inctab();
 
-    EMIT_STRING_PROPERTY(fd, symbolDefinition, Name, false, NULL)
-    EMIT_STRING_PROPERTY(fd, symbolDefinition, Description, true, L"") // default is empty string
+    EMIT_STRING_PROPERTY(fd, symbolDefinition, Name, false, NULL, tab)
+    EMIT_STRING_PROPERTY(fd, symbolDefinition, Description, true, L"", tab) // default is empty string
 
     SimpleSymbolCollection* symbolCollection = symbolDefinition->GetSymbols();
     int numElements = symbolCollection->GetCount();
     for (int i=0; i<numElements; ++i)
-        IOSimpleSymbol::Write(fd, symbolCollection->GetAt(i), version);
+        IOSimpleSymbol::Write(fd, symbolCollection->GetAt(i), version, tab);
 
     // Write any unknown XML / extended data
-    IOUnknown::Write(fd, symbolDefinition->GetUnknownXml(), version);
+    IOUnknown::Write(fd, symbolDefinition->GetUnknownXml(), version, tab);
 
-    dectab();
-    fd << tab() << "</CompoundSymbolDefinition>" << std::endl; // NOXLATE
+    tab.dectab();
+    fd << tab.tab() << "</CompoundSymbolDefinition>" << std::endl; // NOXLATE
 }

Modified: sandbox/adsk/2.3r/Common/MdfParser/IOCompoundSymbolDefinition.h
===================================================================
--- sandbox/adsk/2.3r/Common/MdfParser/IOCompoundSymbolDefinition.h	2011-02-22 07:43:02 UTC (rev 5564)
+++ sandbox/adsk/2.3r/Common/MdfParser/IOCompoundSymbolDefinition.h	2011-02-25 21:46:04 UTC (rev 5565)
@@ -36,7 +36,7 @@
         virtual void ElementChars(const wchar_t* ch);
         virtual void EndElement(const wchar_t* name, HandlerStack* handlerStack);
 
-        static void Write(MdfStream& fd, CompoundSymbolDefinition* symbolDefinition, bool writeAsRootElement, Version* version);
+        static void Write(MdfStream& fd, CompoundSymbolDefinition* symbolDefinition, bool writeAsRootElement, Version* version, MgTab& tab);
 
     private:
         CompoundSymbolDefinition* m_symbolDefinition;

Modified: sandbox/adsk/2.3r/Common/MdfParser/IODrawingLayerDefinition.cpp
===================================================================
--- sandbox/adsk/2.3r/Common/MdfParser/IODrawingLayerDefinition.cpp	2011-02-22 07:43:02 UTC (rev 5564)
+++ sandbox/adsk/2.3r/Common/MdfParser/IODrawingLayerDefinition.cpp	2011-02-25 21:46:04 UTC (rev 5565)
@@ -150,7 +150,7 @@
 }
 
 
-void IODrawingLayerDefinition::Write(MdfStream& fd, DrawingLayerDefinition* drawingLayer, Version* version)
+void IODrawingLayerDefinition::Write(MdfStream& fd, DrawingLayerDefinition* drawingLayer, Version* version, MgTab& tab)
 {
     // verify the LDF version
     MdfString strVersion;
@@ -180,23 +180,23 @@
         strVersion = L"2.3.0";
     }
 
-    fd << tab() << "<LayerDefinition xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"LayerDefinition-" << EncodeString(strVersion) << ".xsd\" version=\"" << EncodeString(strVersion) << "\">" << std::endl; // NOXLATE
-    inctab();
+    fd << tab.tab() << "<LayerDefinition xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"LayerDefinition-" << EncodeString(strVersion) << ".xsd\" version=\"" << EncodeString(strVersion) << "\">" << std::endl; // NOXLATE
+    tab.inctab();
 
-    fd << tab() << startStr(sDrawingLayerDefinition) << std::endl;
-    inctab();
+    fd << tab.tab() << startStr(sDrawingLayerDefinition) << std::endl;
+    tab.inctab();
 
     MdfStringStream fdExtData;
 
     // Property: ResourceId
-    fd << tab() << startStr(sResourceId);
+    fd << tab.tab() << startStr(sResourceId);
     fd << EncodeString(drawingLayer->GetResourceID());
     fd << endStr(sResourceId) << std::endl;
 
     // Property: Opacity (optional)
     if (drawingLayer->GetOpacity() != 1.0)
     {
-        fd << tab() << startStr(sOpacity);
+        fd << tab.tab() << startStr(sOpacity);
         fd << DoubleToStr(drawingLayer->GetOpacity());
         fd << endStr(sOpacity) << std::endl;
     }
@@ -208,38 +208,38 @@
         if (!version || (*version >= Version(2, 3, 0)))
         {
             // only write Watermarks if the LDF version is 2.3.0 or greater
-            fd << tab() << startStr(sWatermarks) << std::endl;
-            inctab();
+            fd << tab.tab() << startStr(sWatermarks) << std::endl;
+            tab.inctab();
             for (int i=0; i<watermarkCount; ++i)
-                IOWatermarkInstance::Write(fd, drawingLayer->GetWatermarks()->GetAt(i), version);
-            dectab();
-            fd << tab() << endStr(sWatermarks) << std::endl;
+                IOWatermarkInstance::Write(fd, drawingLayer->GetWatermarks()->GetAt(i), version, tab);
+            tab.dectab();
+            fd << tab.tab() << endStr(sWatermarks) << std::endl;
         }
         else if (*version >= Version(1, 0, 0))
         {
             // save Watermarks as extended data for LDF versions 1.0.0 - 1.3.0
-            inctab();
+            tab.inctab();
 
-            fdExtData << tab() << startStr(sWatermarks) << std::endl;
-            inctab();
+            fdExtData << tab.tab() << startStr(sWatermarks) << std::endl;
+            tab.inctab();
             for (int i=0; i<watermarkCount; ++i)
-                IOWatermarkInstance::Write(fdExtData, drawingLayer->GetWatermarks()->GetAt(i), version);
-            dectab();
-            fdExtData << tab() << endStr(sWatermarks) << std::endl;
+                IOWatermarkInstance::Write(fdExtData, drawingLayer->GetWatermarks()->GetAt(i), version, tab);
+            tab.dectab();
+            fdExtData << tab.tab() << endStr(sWatermarks) << std::endl;
 
-            dectab();
+            tab.dectab();
         }
     }
 
     // Property: Sheet
-    fd << tab() << startStr(sSheet);
+    fd << tab.tab() << startStr(sSheet);
     fd << EncodeString(drawingLayer->GetSheet());
     fd << endStr(sSheet) << std::endl;
 
     // Property: LayerFilter (optional)
     if (!drawingLayer->GetLayerFilter().empty())
     {
-        fd << tab() << startStr(sLayerFilter);
+        fd << tab.tab() << startStr(sLayerFilter);
         fd << EncodeString(drawingLayer->GetLayerFilter());
         fd << endStr(sLayerFilter) << std::endl;
     }
@@ -247,7 +247,7 @@
     // Property: MinScale (optional)
     if (drawingLayer->GetMinScale() != 0.0)
     {
-        fd << tab() << startStr(sMinScale);
+        fd << tab.tab() << startStr(sMinScale);
         fd << DoubleToStr(drawingLayer->GetMinScale());
         fd << endStr(sMinScale) << std::endl;
     }
@@ -255,17 +255,17 @@
     // Property: MaxScale (optional)
     if (drawingLayer->GetMaxScale() != VectorScaleRange::MAX_MAP_SCALE)
     {
-        fd << tab() << startStr(sMaxScale);
+        fd << tab.tab() << startStr(sMaxScale);
         fd << DoubleToStr(drawingLayer->GetMaxScale());
         fd << endStr(sMaxScale) << std::endl;
     }
 
     // Write any unknown XML / extended data
-    IOUnknown::Write(fd, drawingLayer->GetUnknownXml(), fdExtData.str(), version);
+    IOUnknown::Write(fd, drawingLayer->GetUnknownXml(), fdExtData.str(), version, tab);
 
-    dectab();
-    fd << tab() << endStr(sDrawingLayerDefinition) << std::endl;
+    tab.dectab();
+    fd << tab.tab() << endStr(sDrawingLayerDefinition) << std::endl;
 
-    dectab();
-    fd << tab() << "</LayerDefinition>" << std::endl; // NOXLATE
+    tab.dectab();
+    fd << tab.tab() << "</LayerDefinition>" << std::endl; // NOXLATE
 }

Modified: sandbox/adsk/2.3r/Common/MdfParser/IODrawingLayerDefinition.h
===================================================================
--- sandbox/adsk/2.3r/Common/MdfParser/IODrawingLayerDefinition.h	2011-02-22 07:43:02 UTC (rev 5564)
+++ sandbox/adsk/2.3r/Common/MdfParser/IODrawingLayerDefinition.h	2011-02-25 21:46:04 UTC (rev 5565)
@@ -38,7 +38,7 @@
         virtual void ElementChars(const wchar_t* ch);
         virtual void EndElement(const wchar_t* name, HandlerStack* handlerStack);
 
-        static void Write(MdfStream& fd, DrawingLayerDefinition* drawingLayer, Version* version);
+        static void Write(MdfStream& fd, DrawingLayerDefinition* drawingLayer, Version* version, MgTab& tab);
 
     private:
         static bool GetWatermarkDefinitionVersion(Version* ldfVersion, Version& wdVersion);

Modified: sandbox/adsk/2.3r/Common/MdfParser/IOElevationSettings.cpp
===================================================================
--- sandbox/adsk/2.3r/Common/MdfParser/IOElevationSettings.cpp	2011-02-22 07:43:02 UTC (rev 5564)
+++ sandbox/adsk/2.3r/Common/MdfParser/IOElevationSettings.cpp	2011-02-25 21:46:04 UTC (rev 5565)
@@ -121,23 +121,23 @@
 }
 
 
-void IOElevationSettings::Write(MdfStream& fd, ElevationSettings* elevationSettings, Version* version)
+void IOElevationSettings::Write(MdfStream& fd, ElevationSettings* elevationSettings, Version* version, MgTab& tab)
 {
-    fd << tab() << startStr(sElevationSettings) << std::endl;
-    inctab();
+    fd << tab.tab() << startStr(sElevationSettings) << std::endl;
+    tab.inctab();
 
     // Property: ZOffset
-    fd << tab() << startStr(sZOffset);
+    fd << tab.tab() << startStr(sZOffset);
     fd << EncodeString(elevationSettings->GetZOffsetExpression());
     fd << endStr(sZOffset) << std::endl;
 
     // Property: ZExtrusion
-    fd << tab() << startStr(sZExtrusion);
+    fd << tab.tab() << startStr(sZExtrusion);
     fd << EncodeString(elevationSettings->GetZExtrusionExpression());
     fd << endStr(sZExtrusion) << std::endl;
 
     // Property: ZOffsetType
-    fd << tab() << startStr(sZOffsetType);
+    fd << tab.tab() << startStr(sZOffsetType);
     if (elevationSettings->GetElevationType() == ElevationSettings::Absolute)
         fd << "Absolute"; // NOXLATE
     else
@@ -145,14 +145,14 @@
     fd << endStr(sZOffsetType) << std::endl;
 
     // Property: Unit
-    fd << tab() << startStr(sUnit);
+    fd << tab.tab() << startStr(sUnit);
     std::auto_ptr<MdfString> str(LengthConverter::UnitToEnglish(elevationSettings->GetUnit()));
     fd << EncodeString(*str);
     fd << endStr(sUnit) << std::endl;
 
     // Write any unknown XML / extended data
-    IOUnknown::Write(fd, elevationSettings->GetUnknownXml(), version);
+    IOUnknown::Write(fd, elevationSettings->GetUnknownXml(), version, tab);
 
-    dectab();
-    fd << tab() << endStr(sElevationSettings) << std::endl;
+    tab.dectab();
+    fd << tab.tab() << endStr(sElevationSettings) << std::endl;
 }

Modified: sandbox/adsk/2.3r/Common/MdfParser/IOElevationSettings.h
===================================================================
--- sandbox/adsk/2.3r/Common/MdfParser/IOElevationSettings.h	2011-02-22 07:43:02 UTC (rev 5564)
+++ sandbox/adsk/2.3r/Common/MdfParser/IOElevationSettings.h	2011-02-25 21:46:04 UTC (rev 5565)
@@ -39,7 +39,7 @@
         virtual void ElementChars(const wchar_t* ch);
         virtual void EndElement(const wchar_t* name, HandlerStack* handlerStack);
 
-        static void Write(MdfStream& fd, ElevationSettings* elevationSettings, Version* version);
+        static void Write(MdfStream& fd, ElevationSettings* elevationSettings, Version* version, MgTab& tab);
 
     private:
         ElevationSettings* m_elevationSettings;

Modified: sandbox/adsk/2.3r/Common/MdfParser/IOExtension.cpp
===================================================================
--- sandbox/adsk/2.3r/Common/MdfParser/IOExtension.cpp	2011-02-22 07:43:02 UTC (rev 5564)
+++ sandbox/adsk/2.3r/Common/MdfParser/IOExtension.cpp	2011-02-25 21:46:04 UTC (rev 5565)
@@ -125,32 +125,32 @@
 }
 
 
-void IOExtension::Write(MdfStream& fd, Extension* extension, Version* version)
+void IOExtension::Write(MdfStream& fd, Extension* extension, Version* version, MgTab& tab)
 {
-    fd << tab() << startStr(sExtension) << std::endl;
-    inctab();
+    fd << tab.tab() << startStr(sExtension) << std::endl;
+    tab.inctab();
 
     // Property: CalculatedProperties
     for (int i=0; i<extension->GetCalculatedProperties()->GetCount(); ++i)
-        IOCalculatedProperty::Write(fd, extension->GetCalculatedProperties()->GetAt(i), version);
+        IOCalculatedProperty::Write(fd, extension->GetCalculatedProperties()->GetAt(i), version, tab);
 
     // Property: AttributeRelate
     for (int i=0; i<extension->GetAttributeRelates()->GetCount(); ++i)
-        IOAttributeRelate::Write(fd, extension->GetAttributeRelates()->GetAt(i), version);
+        IOAttributeRelate::Write(fd, extension->GetAttributeRelates()->GetAt(i), version, tab);
 
     // Property: Name
-    fd << tab() << startStr(sName);
+    fd << tab.tab() << startStr(sName);
     fd << EncodeString(extension->GetName());
     fd << endStr(sName) << std::endl;
 
     // Property: FeatureClass
-    fd << tab() << startStr(sFeatureClass);
+    fd << tab.tab() << startStr(sFeatureClass);
     fd << EncodeString(extension->GetFeatureClass());
     fd << endStr(sFeatureClass) << std::endl;
 
     // Write any unknown XML / extended data
-    IOUnknown::Write(fd, extension->GetUnknownXml(), version);
+    IOUnknown::Write(fd, extension->GetUnknownXml(), version, tab);
 
-    dectab();
-    fd << tab() << endStr(sExtension) << std::endl;
+    tab.dectab();
+    fd << tab.tab() << endStr(sExtension) << std::endl;
 }

Modified: sandbox/adsk/2.3r/Common/MdfParser/IOExtension.h
===================================================================
--- sandbox/adsk/2.3r/Common/MdfParser/IOExtension.h	2011-02-22 07:43:02 UTC (rev 5564)
+++ sandbox/adsk/2.3r/Common/MdfParser/IOExtension.h	2011-02-25 21:46:04 UTC (rev 5565)
@@ -39,7 +39,7 @@
         virtual void ElementChars(const wchar_t* ch);
         virtual void EndElement(const wchar_t* name, HandlerStack* handlerStack);
 
-        static void Write(MdfStream& fd, Extension* extension, Version* version);
+        static void Write(MdfStream& fd, Extension* extension, Version* version, MgTab& tab);
 
     private:
         Extension* m_extension;

Modified: sandbox/adsk/2.3r/Common/MdfParser/IOExtra.cpp
===================================================================
--- sandbox/adsk/2.3r/Common/MdfParser/IOExtra.cpp	2011-02-22 07:43:02 UTC (rev 5564)
+++ sandbox/adsk/2.3r/Common/MdfParser/IOExtra.cpp	2011-02-25 21:46:04 UTC (rev 5565)
@@ -106,36 +106,36 @@
 }
 
 
-void IOExtra::WriteBox2D(MdfStream& fd, const Box2D& box2D, bool autoCorrect, Version* version)
+void IOExtra::WriteBox2D(MdfStream& fd, const Box2D& box2D, bool autoCorrect, Version* version, MgTab& tab)
 {
     double x1 = autoCorrect? box2D.GetMinX() : box2D.GetX1();
     double x2 = autoCorrect? box2D.GetMaxX() : box2D.GetX2();
     double y1 = autoCorrect? box2D.GetMinY() : box2D.GetY1();
     double y2 = autoCorrect? box2D.GetMaxY() : box2D.GetY2();
 
-    fd << tab() << startStr(sExtents) << std::endl;
-    inctab();
+    fd << tab.tab() << startStr(sExtents) << std::endl;
+    tab.inctab();
 
     // Property: MinX
-    fd << tab() << startStr(sMinX);
+    fd << tab.tab() << startStr(sMinX);
     fd << DoubleToStr(x1);
     fd << endStr(sMinX) << std::endl;
 
     // Property: MaxX
-    fd << tab() << startStr(sMaxX);
+    fd << tab.tab() << startStr(sMaxX);
     fd << DoubleToStr(x2);
     fd << endStr(sMaxX) << std::endl;
 
     // Property: MinY
-    fd << tab() << startStr(sMinY);
+    fd << tab.tab() << startStr(sMinY);
     fd << DoubleToStr(y1);
     fd << endStr(sMinY) << std::endl;
 
     // Property: MaxY
-    fd << tab() << startStr(sMaxY);
+    fd << tab.tab() << startStr(sMaxY);
     fd << DoubleToStr(y2);
     fd << endStr(sMaxY) << std::endl;
 
-    dectab();
-    fd << tab() << endStr(sExtents) << std::endl;
+    tab.dectab();
+    fd << tab.tab() << endStr(sExtents) << std::endl;
 }

Modified: sandbox/adsk/2.3r/Common/MdfParser/IOExtra.h
===================================================================
--- sandbox/adsk/2.3r/Common/MdfParser/IOExtra.h	2011-02-22 07:43:02 UTC (rev 5564)
+++ sandbox/adsk/2.3r/Common/MdfParser/IOExtra.h	2011-02-25 21:46:04 UTC (rev 5565)
@@ -39,7 +39,7 @@
         virtual void ElementChars(const wchar_t* ch);
         virtual void EndElement(const wchar_t* name, HandlerStack* handlerStack);
 
-        static void WriteBox2D(MdfStream& fd, const Box2D& box2D, bool autoCorrect, Version* version);
+        static void WriteBox2D(MdfStream& fd, const Box2D& box2D, bool autoCorrect, Version* version, MgTab& tab);
 
     private:
         double m_minX;

Modified: sandbox/adsk/2.3r/Common/MdfParser/IOFeatureSource.cpp
===================================================================
--- sandbox/adsk/2.3r/Common/MdfParser/IOFeatureSource.cpp	2011-02-22 07:43:02 UTC (rev 5564)
+++ sandbox/adsk/2.3r/Common/MdfParser/IOFeatureSource.cpp	2011-02-25 21:46:04 UTC (rev 5565)
@@ -137,41 +137,41 @@
 }
 
 
-void IOFeatureSource::Write(MdfStream& fd, FeatureSource* featureSource, Version* version)
+void IOFeatureSource::Write(MdfStream& fd, FeatureSource* featureSource, Version* version, MgTab& tab)
 {
-    fd << tab() << "<FeatureSource xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"FeatureSource-1.0.0.xsd\" version=\"1.0.0\">" << std::endl; // NOXLATE
-    inctab();
+    fd << tab.tab() << "<FeatureSource xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"FeatureSource-1.0.0.xsd\" version=\"1.0.0\">" << std::endl; // NOXLATE
+    tab.inctab();
 
     // Property: Provider
-    fd << tab() << startStr(sProvider);
+    fd << tab.tab() << startStr(sProvider);
     fd << EncodeString(featureSource->GetProvider());
     fd << endStr(sProvider) << std::endl;
 
     // Property: Parameters
     for (int i=0; i<featureSource->GetParameters()->GetCount(); ++i)
-        IONameStringPair::Write(fd, sParameter, featureSource->GetParameters()->GetAt(i), version);
+        IONameStringPair::Write(fd, sParameter, featureSource->GetParameters()->GetAt(i), version, tab);
 
     // Property: SupplementalSpatialContextInfo
     for (int i=0; i<featureSource->GetSupplementalSpatialContextInfo()->GetCount(); ++i)
-        IOSupplementalSpatialContextInfo::Write(fd, featureSource->GetSupplementalSpatialContextInfo()->GetAt(i), version);
+        IOSupplementalSpatialContextInfo::Write(fd, featureSource->GetSupplementalSpatialContextInfo()->GetAt(i), version, tab);
 
     // Property: ConfigurationDocument
-    fd << tab() << startStr(sConfigurationDocument);
+    fd << tab.tab() << startStr(sConfigurationDocument);
     fd << EncodeString(featureSource->GetConfigurationDocument());
     fd << endStr(sConfigurationDocument) << std::endl;
 
     // Property: LongTransaction
-    fd << tab() << startStr(sLongTransaction);
+    fd << tab.tab() << startStr(sLongTransaction);
     fd << EncodeString(featureSource->GetLongTransaction());
     fd << endStr(sLongTransaction) << std::endl;
 
     // Property: Extension
     for (int i=0; i<featureSource->GetExtensions()->GetCount(); ++i)
-        IOExtension::Write(fd, featureSource->GetExtensions()->GetAt(i), version);
+        IOExtension::Write(fd, featureSource->GetExtensions()->GetAt(i), version, tab);
 
     // Write any unknown XML / extended data
-    IOUnknown::Write(fd, featureSource->GetUnknownXml(), version);
+    IOUnknown::Write(fd, featureSource->GetUnknownXml(), version, tab);
 
-    dectab();
-    fd << tab() << "</FeatureSource>" << std::endl; // NOXLATE
+    tab.dectab();
+    fd << tab.tab() << "</FeatureSource>" << std::endl; // NOXLATE
 }

Modified: sandbox/adsk/2.3r/Common/MdfParser/IOFeatureSource.h
===================================================================
--- sandbox/adsk/2.3r/Common/MdfParser/IOFeatureSource.h	2011-02-22 07:43:02 UTC (rev 5564)
+++ sandbox/adsk/2.3r/Common/MdfParser/IOFeatureSource.h	2011-02-25 21:46:04 UTC (rev 5565)
@@ -38,7 +38,7 @@
         virtual void ElementChars(const wchar_t* ch);
         virtual void EndElement(const wchar_t* name, HandlerStack* handlerStack);
 
-        static void Write(MdfStream& fd, FeatureSource* featureSource, Version* version);
+        static void Write(MdfStream& fd, FeatureSource* featureSource, Version* version, MgTab& tab);
 
     private:
         FeatureSource* m_featureSource;

Modified: sandbox/adsk/2.3r/Common/MdfParser/IOFill.cpp
===================================================================
--- sandbox/adsk/2.3r/Common/MdfParser/IOFill.cpp	2011-02-22 07:43:02 UTC (rev 5564)
+++ sandbox/adsk/2.3r/Common/MdfParser/IOFill.cpp	2011-02-25 21:46:04 UTC (rev 5565)
@@ -107,29 +107,29 @@
 }
 
 
-void IOFill::Write(MdfStream& fd, Fill* fill, Version* version)
+void IOFill::Write(MdfStream& fd, Fill* fill, Version* version, MgTab& tab)
 {
-    fd << tab() << startStr(sFill) << std::endl;
-    inctab();
+    fd << tab.tab() << startStr(sFill) << std::endl;
+    tab.inctab();
 
     // Property: FillPattern
-    fd << tab() << startStr(sFillPattern);
+    fd << tab.tab() << startStr(sFillPattern);
     fd << EncodeString(fill->GetFillPattern());
     fd << endStr(sFillPattern) << std::endl;
 
     // Property: ForegroundColor
-    fd << tab() << startStr(sForegroundColor);
+    fd << tab.tab() << startStr(sForegroundColor);
     fd << EncodeString(fill->GetForegroundColor());
     fd << endStr(sForegroundColor) << std::endl;
 
     // Property: BackgroundColor
-    fd << tab() << startStr(sBackgroundColor);
+    fd << tab.tab() << startStr(sBackgroundColor);
     fd << EncodeString(fill->GetBackgroundColor());
     fd << endStr(sBackgroundColor) << std::endl;
 
     // Write any unknown XML / extended data
-    IOUnknown::Write(fd, fill->GetUnknownXml(), version);
+    IOUnknown::Write(fd, fill->GetUnknownXml(), version, tab);
 
-    dectab();
-    fd << tab() << endStr(sFill) << std::endl;
+    tab.dectab();
+    fd << tab.tab() << endStr(sFill) << std::endl;
 }

Modified: sandbox/adsk/2.3r/Common/MdfParser/IOFill.h
===================================================================
--- sandbox/adsk/2.3r/Common/MdfParser/IOFill.h	2011-02-22 07:43:02 UTC (rev 5564)
+++ sandbox/adsk/2.3r/Common/MdfParser/IOFill.h	2011-02-25 21:46:04 UTC (rev 5565)
@@ -38,7 +38,7 @@
         virtual void ElementChars(const wchar_t* ch);
         virtual void EndElement(const wchar_t* name, HandlerStack* handlerStack);
 
-        static void Write(MdfStream& fd, Fill* fill, Version* version);
+        static void Write(MdfStream& fd, Fill* fill, Version* version, MgTab& tab);
 
     private:
         Fill* m_fill;

Modified: sandbox/adsk/2.3r/Common/MdfParser/IOFontSymbol.cpp
===================================================================
--- sandbox/adsk/2.3r/Common/MdfParser/IOFontSymbol.cpp	2011-02-22 07:43:02 UTC (rev 5564)
+++ sandbox/adsk/2.3r/Common/MdfParser/IOFontSymbol.cpp	2011-02-25 21:46:04 UTC (rev 5565)
@@ -128,20 +128,20 @@
 }
 
 
-void IOFontSymbol::Write(MdfStream& fd, FontSymbol* symbol, Version* version)
+void IOFontSymbol::Write(MdfStream& fd, FontSymbol* symbol, Version* version, MgTab& tab)
 {
-    fd << tab() << startStr(sFont) << std::endl;
-    inctab();
+    fd << tab.tab() << startStr(sFont) << std::endl;
+    tab.inctab();
 
-    IOSymbol::Write(fd, symbol, version);
+    IOSymbol::Write(fd, symbol, version, tab);
 
     // Property: FontName
-    fd << tab() << startStr(sFontName);
+    fd << tab.tab() << startStr(sFontName);
     fd << EncodeString(symbol->GetFontName());
     fd << endStr(sFontName) << std::endl;
 
     // Property: Character
-    fd << tab() << startStr(sCharacter);
+    fd << tab.tab() << startStr(sCharacter);
     wchar_t c[2];
     c[0] = symbol->GetCharacter();
     c[1] = 0;
@@ -151,7 +151,7 @@
     // Property: Bold
     if (wstrToBool(symbol->GetBold().c_str()))
     {
-        fd << tab() << startStr(sBold);
+        fd << tab.tab() << startStr(sBold);
         fd << EncodeString(symbol->GetBold());
         fd << endStr(sBold) << std::endl;
     }
@@ -159,7 +159,7 @@
     // Property: Italic
     if (wstrToBool(symbol->GetItalic().c_str()))
     {
-        fd << tab() << startStr(sItalic);
+        fd << tab.tab() << startStr(sItalic);
         fd << EncodeString(symbol->GetItalic());
         fd << endStr(sItalic) << std::endl;
     }
@@ -167,19 +167,19 @@
     // Property: Underlined
     if (wstrToBool(symbol->GetUnderlined().c_str()))
     {
-        fd << tab() << startStr(sUnderlined);
+        fd << tab.tab() << startStr(sUnderlined);
         fd << EncodeString(symbol->GetUnderlined());
         fd << endStr(sUnderlined) << std::endl;
     }
 
     // Property: ForegroundColor
-    fd << tab() << startStr(sForegroundColor);
+    fd << tab.tab() << startStr(sForegroundColor);
     fd << EncodeString(symbol->GetForegroundColor());
     fd << endStr(sForegroundColor) << std::endl;
 
     // Write any unknown XML / extended data
-    IOUnknown::Write(fd, symbol->GetUnknownXml(), version);
+    IOUnknown::Write(fd, symbol->GetUnknownXml(), version, tab);
 
-    dectab();
-    fd << tab() << endStr(sFont) << std::endl;
+    tab.dectab();
+    fd << tab.tab() << endStr(sFont) << std::endl;
 }

Modified: sandbox/adsk/2.3r/Common/MdfParser/IOFontSymbol.h
===================================================================
--- sandbox/adsk/2.3r/Common/MdfParser/IOFontSymbol.h	2011-02-22 07:43:02 UTC (rev 5564)
+++ sandbox/adsk/2.3r/Common/MdfParser/IOFontSymbol.h	2011-02-25 21:46:04 UTC (rev 5565)
@@ -35,7 +35,7 @@
         virtual void ElementChars(const wchar_t* ch);
         virtual void EndElement(const wchar_t* name, HandlerStack* handlerStack);
 
-        static void Write(MdfStream& fd, FontSymbol* fontSymbol, Version* version);
+        static void Write(MdfStream& fd, FontSymbol* fontSymbol, Version* version, MgTab& tab);
 };
 
 END_NAMESPACE_MDFPARSER

Modified: sandbox/adsk/2.3r/Common/MdfParser/IOGraphicElement.cpp
===================================================================
--- sandbox/adsk/2.3r/Common/MdfParser/IOGraphicElement.cpp	2011-02-22 07:43:02 UTC (rev 5564)
+++ sandbox/adsk/2.3r/Common/MdfParser/IOGraphicElement.cpp	2011-02-25 21:46:04 UTC (rev 5565)
@@ -58,7 +58,7 @@
 }
 
 
-void IOGraphicElement::Write(MdfStream& fd, GraphicElement* element, Version* version)
+void IOGraphicElement::Write(MdfStream& fd, GraphicElement* element, Version* version, MgTab& tab)
 {
-    EMIT_STRING_PROPERTY(fd, element, ResizeControl, true, GraphicElement::sResizeControlDefault)
+    EMIT_STRING_PROPERTY(fd, element, ResizeControl, true, GraphicElement::sResizeControlDefault, tab)
 }

Modified: sandbox/adsk/2.3r/Common/MdfParser/IOGraphicElement.h
===================================================================
--- sandbox/adsk/2.3r/Common/MdfParser/IOGraphicElement.h	2011-02-22 07:43:02 UTC (rev 5564)
+++ sandbox/adsk/2.3r/Common/MdfParser/IOGraphicElement.h	2011-02-25 21:46:04 UTC (rev 5565)
@@ -36,7 +36,7 @@
         virtual void ElementChars(const wchar_t* ch);
         virtual void EndElement(const wchar_t* name, HandlerStack* handlerStack);
 
-        static void Write(MdfStream& fd, GraphicElement* element, Version* version);
+        static void Write(MdfStream& fd, GraphicElement* element, Version* version, MgTab& tab);
 
     protected:
         GraphicElement* m_element;

Modified: sandbox/adsk/2.3r/Common/MdfParser/IOGraphicElementCollection.cpp
===================================================================
--- sandbox/adsk/2.3r/Common/MdfParser/IOGraphicElementCollection.cpp	2011-02-22 07:43:02 UTC (rev 5564)
+++ sandbox/adsk/2.3r/Common/MdfParser/IOGraphicElementCollection.cpp	2011-02-25 21:46:04 UTC (rev 5565)
@@ -90,10 +90,10 @@
 }
 
 
-void IOGraphicElementCollection::Write(MdfStream& fd, GraphicElementCollection* elementCollection, Version* version)
+void IOGraphicElementCollection::Write(MdfStream& fd, GraphicElementCollection* elementCollection, Version* version, MgTab& tab)
 {
-    fd << tab() << "<Graphics>" << std::endl; // NOXLATE
-    inctab();
+    fd << tab.tab() << "<Graphics>" << std::endl; // NOXLATE
+    tab.inctab();
 
     int numElements = elementCollection->GetCount();
     for (int i=0; i<numElements; ++i)
@@ -103,25 +103,25 @@
         Path* path = dynamic_cast<Path*>(elem);
         if (path)
         {
-            IOPath::Write(fd, path, version);
+            IOPath::Write(fd, path, version, tab);
             continue;
         }
 
         Image* image = dynamic_cast<Image*>(elem);
         if (image)
         {
-            IOImage::Write(fd, image, version);
+            IOImage::Write(fd, image, version, tab);
             continue;
         }
 
         Text* text = dynamic_cast<Text*>(elem);
         if (text)
         {
-            IOText::Write(fd, text, version);
+            IOText::Write(fd, text, version, tab);
             continue;
         }
     }
 
-    dectab();
-    fd << tab() << "</Graphics>" << std::endl; // NOXLATE
+    tab.dectab();
+    fd << tab.tab() << "</Graphics>" << std::endl; // NOXLATE
 }

Modified: sandbox/adsk/2.3r/Common/MdfParser/IOGraphicElementCollection.h
===================================================================
--- sandbox/adsk/2.3r/Common/MdfParser/IOGraphicElementCollection.h	2011-02-22 07:43:02 UTC (rev 5564)
+++ sandbox/adsk/2.3r/Common/MdfParser/IOGraphicElementCollection.h	2011-02-25 21:46:04 UTC (rev 5565)
@@ -37,7 +37,7 @@
         virtual void ElementChars(const wchar_t* ch);
         virtual void EndElement(const wchar_t* name, HandlerStack* handlerStack);
 
-        static void Write(MdfStream& fd, GraphicElementCollection* elementCollection, Version* version);
+        static void Write(MdfStream& fd, GraphicElementCollection* elementCollection, Version* version, MgTab& tab);
 
     private:
         GraphicElementCollection* m_elementCollection;

Modified: sandbox/adsk/2.3r/Common/MdfParser/IOGridColor.cpp
===================================================================
--- sandbox/adsk/2.3r/Common/MdfParser/IOGridColor.cpp	2011-02-22 07:43:02 UTC (rev 5564)
+++ sandbox/adsk/2.3r/Common/MdfParser/IOGridColor.cpp	2011-02-25 21:46:04 UTC (rev 5565)
@@ -120,15 +120,15 @@
 }
 
 
-void IOGridColor::Write(MdfStream& fd, GridColor* color, Version* version)
+void IOGridColor::Write(MdfStream& fd, GridColor* color, Version* version, MgTab& tab)
 {
-    fd << tab() << startStr(sColor) << std::endl;
-    inctab();
+    fd << tab.tab() << startStr(sColor) << std::endl;
+    tab.inctab();
 
     GridColorExplicit* colorExplicit = dynamic_cast<GridColorExplicit*>(color);
     if (colorExplicit)
     {
-        fd << tab() << startStr(sExplicitColor);
+        fd << tab.tab() << startStr(sExplicitColor);
         fd << EncodeString(colorExplicit->GetExplicitColor());
         fd << endStr(sExplicitColor) << std::endl;
     }
@@ -136,18 +136,18 @@
     GridColorBand* colorBand = dynamic_cast<GridColorBand*>(color);
     if (colorBand)
     {
-        fd << tab() << startStr(sBand);
+        fd << tab.tab() << startStr(sBand);
         fd << EncodeString(colorBand->GetBand());
         fd << endStr(sBand) << std::endl;
     }
 
     GridColorBands* colorBands = dynamic_cast<GridColorBands*>(color);
     if (colorBands)
-        IOGridColorBands::Write(fd, colorBands, version);
+        IOGridColorBands::Write(fd, colorBands, version, tab);
 
     // Write any unknown XML / extended data
-    IOUnknown::Write(fd, color->GetUnknownXml(), version);
+    IOUnknown::Write(fd, color->GetUnknownXml(), version, tab);
 
-    dectab();
-    fd << tab() << endStr(sColor) << std::endl;
+    tab.dectab();
+    fd << tab.tab() << endStr(sColor) << std::endl;
 }

Modified: sandbox/adsk/2.3r/Common/MdfParser/IOGridColor.h
===================================================================
--- sandbox/adsk/2.3r/Common/MdfParser/IOGridColor.h	2011-02-22 07:43:02 UTC (rev 5564)
+++ sandbox/adsk/2.3r/Common/MdfParser/IOGridColor.h	2011-02-25 21:46:04 UTC (rev 5565)
@@ -40,7 +40,7 @@
         virtual void ElementChars(const wchar_t* ch);
         virtual void EndElement(const wchar_t* name, HandlerStack* handlerStack);
 
-        static void Write(MdfStream& fd, GridColor* color, Version* version);
+        static void Write(MdfStream& fd, GridColor* color, Version* version, MgTab& tab);
 
     protected:
         GridColorRule* m_colorRule;
@@ -58,7 +58,7 @@
         virtual void ElementChars(const wchar_t* ch);
         virtual void EndElement(const wchar_t* name, HandlerStack* handlerStack);
 
-        static void Write(MdfStream& fd, GridColorBands* colorBands, Version* version);
+        static void Write(MdfStream& fd, GridColorBands* colorBands, Version* version, MgTab& tab);
 
     private:
         GridColorBands* m_colorBands;

Modified: sandbox/adsk/2.3r/Common/MdfParser/IOGridColorBands.cpp
===================================================================
--- sandbox/adsk/2.3r/Common/MdfParser/IOGridColorBands.cpp	2011-02-22 07:43:02 UTC (rev 5564)
+++ sandbox/adsk/2.3r/Common/MdfParser/IOGridColorBands.cpp	2011-02-25 21:46:04 UTC (rev 5565)
@@ -133,18 +133,18 @@
 }
 
 
-void IOGridColorBands::Write(MdfStream& fd, GridColorBands* colorBands, Version* version)
+void IOGridColorBands::Write(MdfStream& fd, GridColorBands* colorBands, Version* version, MgTab& tab)
 {
-    fd << tab() << startStr(sBands) << std::endl;
-    inctab();
+    fd << tab.tab() << startStr(sBands) << std::endl;
+    tab.inctab();
 
-    IOChannelBand::Write(fd, &(colorBands->GetRedBand()), sRedBand, version);
-    IOChannelBand::Write(fd, &(colorBands->GetGreenBand()), sGreenBand, version);
-    IOChannelBand::Write(fd, &(colorBands->GetBlueBand()), sBlueBand, version);
+    IOChannelBand::Write(fd, &(colorBands->GetRedBand()), sRedBand, version, tab);
+    IOChannelBand::Write(fd, &(colorBands->GetGreenBand()), sGreenBand, version, tab);
+    IOChannelBand::Write(fd, &(colorBands->GetBlueBand()), sBlueBand, version, tab);
 
     // Write any unknown XML / extended data
-    IOUnknown::Write(fd, colorBands->GetUnknownXml(), version);
+    IOUnknown::Write(fd, colorBands->GetUnknownXml(), version, tab);
 
-    dectab();
-    fd << tab() << endStr(sBands) << std::endl;
+    tab.dectab();
+    fd << tab.tab() << endStr(sBands) << std::endl;
 }

Modified: sandbox/adsk/2.3r/Common/MdfParser/IOGridColorRule.cpp
===================================================================
--- sandbox/adsk/2.3r/Common/MdfParser/IOGridColorRule.cpp	2011-02-22 07:43:02 UTC (rev 5564)
+++ sandbox/adsk/2.3r/Common/MdfParser/IOGridColorRule.cpp	2011-02-25 21:46:04 UTC (rev 5565)
@@ -127,34 +127,34 @@
 }
 
 
-void IOGridColorRule::Write(MdfStream& fd, GridColorRule* colorRule, Version* version)
+void IOGridColorRule::Write(MdfStream& fd, GridColorRule* colorRule, Version* version, MgTab& tab)
 {
-    fd << tab() << startStr(sColorRule) << std::endl;
-    inctab();
+    fd << tab.tab() << startStr(sColorRule) << std::endl;
+    tab.inctab();
 
     // Property: Legend Lable
-    fd << tab() << startStr(sLegendLabel);
+    fd << tab.tab() << startStr(sLegendLabel);
     fd << EncodeString(colorRule->GetLegendLabel());
     fd << endStr(sLegendLabel) << std::endl;
 
     // Property: Filter
     if (!colorRule->GetFilter().empty())
     {
-        fd << tab() << startStr(sFilter);
+        fd << tab.tab() << startStr(sFilter);
         fd << EncodeString(colorRule->GetFilter());
         fd << endStr(sFilter) << std::endl;
     }
 
     // Property: Label
     if (colorRule->GetLabel())
-        IOLabel::Write(fd, colorRule->GetLabel(), version);
+        IOLabel::Write(fd, colorRule->GetLabel(), version, tab);
 
     // Property: GridColor
-    IOGridColor::Write(fd, colorRule->GetGridColor(), version);
+    IOGridColor::Write(fd, colorRule->GetGridColor(), version, tab);
 
     // Write any unknown XML / extended data
-    IOUnknown::Write(fd, colorRule->GetUnknownXml(), version);
+    IOUnknown::Write(fd, colorRule->GetUnknownXml(), version, tab);
 
-    dectab();
-    fd << tab() << endStr(sColorRule) << std::endl;
+    tab.dectab();
+    fd << tab.tab() << endStr(sColorRule) << std::endl;
 }

Modified: sandbox/adsk/2.3r/Common/MdfParser/IOGridColorRule.h
===================================================================
--- sandbox/adsk/2.3r/Common/MdfParser/IOGridColorRule.h	2011-02-22 07:43:02 UTC (rev 5564)
+++ sandbox/adsk/2.3r/Common/MdfParser/IOGridColorRule.h	2011-02-25 21:46:04 UTC (rev 5565)
@@ -39,7 +39,7 @@
         virtual void ElementChars(const wchar_t* ch);
         virtual void EndElement(const wchar_t* name, HandlerStack* handlerStack);
 
-        static void Write(MdfStream& fd, GridColorRule* colorRule, Version* version);
+        static void Write(MdfStream& fd, GridColorRule* colorRule, Version* version, MgTab& tab);
 
     private:
         GridColorStyle* m_colorStyle;

Modified: sandbox/adsk/2.3r/Common/MdfParser/IOGridColorStyle.cpp
===================================================================
--- sandbox/adsk/2.3r/Common/MdfParser/IOGridColorStyle.cpp	2011-02-22 07:43:02 UTC (rev 5564)
+++ sandbox/adsk/2.3r/Common/MdfParser/IOGridColorStyle.cpp	2011-02-25 21:46:04 UTC (rev 5565)
@@ -132,19 +132,19 @@
 }
 
 
-void IOGridColorStyle::Write(MdfStream& fd, GridColorStyle* colorStyle, Version* version)
+void IOGridColorStyle::Write(MdfStream& fd, GridColorStyle* colorStyle, Version* version, MgTab& tab)
 {
-    fd << tab() << startStr(sColorStyle) << std::endl;
-    inctab();
+    fd << tab.tab() << startStr(sColorStyle) << std::endl;
+    tab.inctab();
 
     // Property: HillShade
     if (colorStyle->GetHillShade())
-        IOHillShade::Write(fd, colorStyle->GetHillShade(), version);
+        IOHillShade::Write(fd, colorStyle->GetHillShade(), version, tab);
 
     // Property: TransparencyColor (optional)
     if (!colorStyle->GetTransparencyColor().empty())
     {
-        fd << tab() << startStr(sTransparencyColor);
+        fd << tab.tab() << startStr(sTransparencyColor);
         fd << EncodeString(colorStyle->GetTransparencyColor());
         fd << endStr(sTransparencyColor) << std::endl;
     }
@@ -152,7 +152,7 @@
     // Property: BrightnessFactor (optional)
     if (colorStyle->GetBrightnessFactor() != 0.0)
     {
-        fd << tab() << startStr(sBrightnessFactor);
+        fd << tab.tab() << startStr(sBrightnessFactor);
         fd << DoubleToStr(colorStyle->GetBrightnessFactor());
         fd << endStr(sBrightnessFactor) << std::endl;
     }
@@ -160,7 +160,7 @@
     // Property: ContrastFactor (optional)
     if (colorStyle->GetContrastFactor() != 0.0)
     {
-        fd << tab() << startStr(sContrastFactor);
+        fd << tab.tab() << startStr(sContrastFactor);
         fd << DoubleToStr(colorStyle->GetContrastFactor());
         fd << endStr(sContrastFactor) << std::endl;
     }
@@ -171,12 +171,12 @@
     {
         GridColorRule* colorRule = static_cast<GridColorRule*>(colorRules->GetAt(i));
         if (colorRule)
-            IOGridColorRule::Write(fd, colorRule, version);
+            IOGridColorRule::Write(fd, colorRule, version, tab);
     }
 
     // Write any unknown XML / extended data
-    IOUnknown::Write(fd, colorStyle->GetUnknownXml(), version);
+    IOUnknown::Write(fd, colorStyle->GetUnknownXml(), version, tab);
 
-    dectab();
-    fd << tab() << endStr(sColorStyle) << std::endl;
+    tab.dectab();
+    fd << tab.tab() << endStr(sColorStyle) << std::endl;
 }

Modified: sandbox/adsk/2.3r/Common/MdfParser/IOGridColorStyle.h
===================================================================
--- sandbox/adsk/2.3r/Common/MdfParser/IOGridColorStyle.h	2011-02-22 07:43:02 UTC (rev 5564)
+++ sandbox/adsk/2.3r/Common/MdfParser/IOGridColorStyle.h	2011-02-25 21:46:04 UTC (rev 5565)
@@ -39,7 +39,7 @@
         virtual void ElementChars(const wchar_t* ch);
         virtual void EndElement(const wchar_t* name, HandlerStack* handlerStack);
 
-        static void Write(MdfStream& fd, GridColorStyle* colorStyle, Version* version);
+        static void Write(MdfStream& fd, GridColorStyle* colorStyle, Version* version, MgTab& tab);
 
     private:
         GridColorStyle* m_colorStyle;

Modified: sandbox/adsk/2.3r/Common/MdfParser/IOGridLayerDefinition.cpp
===================================================================
--- sandbox/adsk/2.3r/Common/MdfParser/IOGridLayerDefinition.cpp	2011-02-22 07:43:02 UTC (rev 5564)
+++ sandbox/adsk/2.3r/Common/MdfParser/IOGridLayerDefinition.cpp	2011-02-25 21:46:04 UTC (rev 5565)
@@ -154,7 +154,7 @@
 }
 
 
-void IOGridLayerDefinition::Write(MdfStream& fd, GridLayerDefinition* gridLayer, Version* version)
+void IOGridLayerDefinition::Write(MdfStream& fd, GridLayerDefinition* gridLayer, Version* version, MgTab& tab)
 {
     // verify the LDF version
     MdfString strVersion;
@@ -184,23 +184,23 @@
         strVersion = L"2.3.0";
     }
 
-    fd << tab() << "<LayerDefinition xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"LayerDefinition-" << EncodeString(strVersion) << ".xsd\" version=\"" << EncodeString(strVersion) << "\">" << std::endl; // NOXLATE
-    inctab();
+    fd << tab.tab() << "<LayerDefinition xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"LayerDefinition-" << EncodeString(strVersion) << ".xsd\" version=\"" << EncodeString(strVersion) << "\">" << std::endl; // NOXLATE
+    tab.inctab();
 
-    fd << tab() << startStr(sGridLayerDefinition) << std::endl;
-    inctab();
+    fd << tab.tab() << startStr(sGridLayerDefinition) << std::endl;
+    tab.inctab();
 
     MdfStringStream fdExtData;
 
     // Property: ResourceId
-    fd << tab() << startStr(sResourceId);
+    fd << tab.tab() << startStr(sResourceId);
     fd << EncodeString(gridLayer->GetResourceID());
     fd << endStr(sResourceId) << std::endl;
 
     // Property: Opacity (optional)
     if (gridLayer->GetOpacity() != 1.0)
     {
-        fd << tab() << startStr(sOpacity);
+        fd << tab.tab() << startStr(sOpacity);
         fd << DoubleToStr(gridLayer->GetOpacity());
         fd << endStr(sOpacity) << std::endl;
     }
@@ -212,57 +212,57 @@
         if (!version || (*version >= Version(2, 3, 0)))
         {
             // only write Watermarks if the LDF version is 2.3.0 or greater
-            fd << tab() << startStr(sWatermarks) << std::endl;
-            inctab();
+            fd << tab.tab() << startStr(sWatermarks) << std::endl;
+            tab.inctab();
             for (int i=0; i<watermarkCount; ++i)
-                IOWatermarkInstance::Write(fd, gridLayer->GetWatermarks()->GetAt(i), version);
-            dectab();
-            fd << tab() << endStr(sWatermarks) << std::endl;
+                IOWatermarkInstance::Write(fd, gridLayer->GetWatermarks()->GetAt(i), version, tab);
+            tab.dectab();
+            fd << tab.tab() << endStr(sWatermarks) << std::endl;
         }
         else if (*version >= Version(1, 0, 0))
         {
             // save Watermarks as extended data for LDF versions 1.0.0 - 1.3.0
-            inctab();
+            tab.inctab();
 
-            fdExtData << tab() << startStr(sWatermarks) << std::endl;
-            inctab();
+            fdExtData << tab.tab() << startStr(sWatermarks) << std::endl;
+            tab.inctab();
             for (int i=0; i<watermarkCount; ++i)
-                IOWatermarkInstance::Write(fdExtData, gridLayer->GetWatermarks()->GetAt(i), version);
-            dectab();
-            fdExtData << tab() << endStr(sWatermarks) << std::endl;
+                IOWatermarkInstance::Write(fdExtData, gridLayer->GetWatermarks()->GetAt(i), version, tab);
+            tab.dectab();
+            fdExtData << tab.tab() << endStr(sWatermarks) << std::endl;
 
-            dectab();
+            tab.dectab();
         }
     }
 
     // Property: FeatureName
-    fd << tab() << startStr(sFeatureName);
+    fd << tab.tab() << startStr(sFeatureName);
     fd << EncodeString(gridLayer->GetFeatureName());
     fd << endStr(sFeatureName) << std::endl;
 
     // Property: Geometry
-    fd << tab() << startStr(sGeometry);
+    fd << tab.tab() << startStr(sGeometry);
     fd << EncodeString(gridLayer->GetGeometry());
     fd << endStr(sGeometry) << std::endl;
 
     // Property: Filter
     if (!gridLayer->GetFilter().empty())
     {
-        fd << tab() << startStr(sFilter);
+        fd << tab.tab() << startStr(sFilter);
         fd << EncodeString(gridLayer->GetFilter());
         fd << endStr(sFilter) << std::endl;
     }
 
     // Property: GridScaleRange
     for (int i=0; i<gridLayer->GetScaleRanges()->GetCount(); ++i)
-        IOGridScaleRange::Write(fd, gridLayer->GetScaleRanges()->GetAt(i), version);
+        IOGridScaleRange::Write(fd, gridLayer->GetScaleRanges()->GetAt(i), version, tab);
 
     // Write any unknown XML / extended data
-    IOUnknown::Write(fd, gridLayer->GetUnknownXml(), fdExtData.str(), version);
+    IOUnknown::Write(fd, gridLayer->GetUnknownXml(), fdExtData.str(), version, tab);
 
-    dectab();
-    fd << tab() << endStr(sGridLayerDefinition) << std::endl;
+    tab.dectab();
+    fd << tab.tab() << endStr(sGridLayerDefinition) << std::endl;
 
-    dectab();
-    fd << tab() << "</LayerDefinition>" << std::endl; // NOXLATE
+    tab.dectab();
+    fd << tab.tab() << "</LayerDefinition>" << std::endl; // NOXLATE
 }

Modified: sandbox/adsk/2.3r/Common/MdfParser/IOGridLayerDefinition.h
===================================================================
--- sandbox/adsk/2.3r/Common/MdfParser/IOGridLayerDefinition.h	2011-02-22 07:43:02 UTC (rev 5564)
+++ sandbox/adsk/2.3r/Common/MdfParser/IOGridLayerDefinition.h	2011-02-25 21:46:04 UTC (rev 5565)
@@ -38,7 +38,7 @@
         virtual void ElementChars(const wchar_t* ch);
         virtual void EndElement(const wchar_t* name, HandlerStack* handlerStack);
 
-        static void Write(MdfStream& fd, GridLayerDefinition* gridLayer, Version* version);
+        static void Write(MdfStream& fd, GridLayerDefinition* gridLayer, Version* version, MgTab& tab);
 
     private:
         static bool GetWatermarkDefinitionVersion(Version* ldfVersion, Version& wdVersion);

Modified: sandbox/adsk/2.3r/Common/MdfParser/IOGridScaleRange.cpp
===================================================================
--- sandbox/adsk/2.3r/Common/MdfParser/IOGridScaleRange.cpp	2011-02-22 07:43:02 UTC (rev 5564)
+++ sandbox/adsk/2.3r/Common/MdfParser/IOGridScaleRange.cpp	2011-02-25 21:46:04 UTC (rev 5565)
@@ -135,15 +135,15 @@
 }
 
 
-void IOGridScaleRange::Write(MdfStream& fd, GridScaleRange* scaleRange, Version* version)
+void IOGridScaleRange::Write(MdfStream& fd, GridScaleRange* scaleRange, Version* version, MgTab& tab)
 {
-    fd << tab() << startStr(sGridScaleRange) << std::endl;
-    inctab();
+    fd << tab.tab() << startStr(sGridScaleRange) << std::endl;
+    tab.inctab();
 
     // Property: MinScale (optional)
     if (scaleRange->GetMinScale() != 0.0)
     {
-        fd << tab() << startStr(sMinScale);
+        fd << tab.tab() << startStr(sMinScale);
         fd << DoubleToStr(scaleRange->GetMinScale());
         fd << endStr(sMinScale) << std::endl;
     }
@@ -151,7 +151,7 @@
     // Property: MaxScale (optional)
     if (scaleRange->GetMaxScale() != VectorScaleRange::MAX_MAP_SCALE)
     {
-        fd << tab() << startStr(sMaxScale);
+        fd << tab.tab() << startStr(sMaxScale);
         fd << DoubleToStr(scaleRange->GetMaxScale());
         fd << endStr(sMaxScale) << std::endl;
     }
@@ -159,21 +159,21 @@
     // Property : Surface Style
     GridSurfaceStyle* gridSurfaceStyle = scaleRange->GetSurfaceStyle();
     if (gridSurfaceStyle)
-        IOGridSurfaceStyle::Write(fd, gridSurfaceStyle, version);
+        IOGridSurfaceStyle::Write(fd, gridSurfaceStyle, version, tab);
 
     // Property : Color Style
     GridColorStyle* gridColorStyle = scaleRange->GetColorStyle();
     if (gridColorStyle)
-        IOGridColorStyle::Write(fd, gridColorStyle, version);
+        IOGridColorStyle::Write(fd, gridColorStyle, version, tab);
 
     // Property : RebuildFactor
-    fd << tab() << startStr(sRebuildFactor);
+    fd << tab.tab() << startStr(sRebuildFactor);
     fd << DoubleToStr(scaleRange->GetRebuildFactor());
     fd << endStr(sRebuildFactor) << std::endl;
 
     // Write any unknown XML / extended data
-    IOUnknown::Write(fd, scaleRange->GetUnknownXml(), version);
+    IOUnknown::Write(fd, scaleRange->GetUnknownXml(), version, tab);
 
-    dectab();
-    fd << tab() << endStr(sGridScaleRange) << std::endl;
+    tab.dectab();
+    fd << tab.tab() << endStr(sGridScaleRange) << std::endl;
 }

Modified: sandbox/adsk/2.3r/Common/MdfParser/IOGridScaleRange.h
===================================================================
--- sandbox/adsk/2.3r/Common/MdfParser/IOGridScaleRange.h	2011-02-22 07:43:02 UTC (rev 5564)
+++ sandbox/adsk/2.3r/Common/MdfParser/IOGridScaleRange.h	2011-02-25 21:46:04 UTC (rev 5565)
@@ -39,7 +39,7 @@
         virtual void ElementChars(const wchar_t* ch);
         virtual void EndElement(const wchar_t* name, HandlerStack* handlerStack);
 
-        static void Write(MdfStream& fd, GridScaleRange* scaleRange, Version* version);
+        static void Write(MdfStream& fd, GridScaleRange* scaleRange, Version* version, MgTab& tab);
 
     private:
         GridScaleRange* m_scaleRange;

Modified: sandbox/adsk/2.3r/Common/MdfParser/IOGridSurfaceStyle.cpp
===================================================================
--- sandbox/adsk/2.3r/Common/MdfParser/IOGridSurfaceStyle.cpp	2011-02-22 07:43:02 UTC (rev 5564)
+++ sandbox/adsk/2.3r/Common/MdfParser/IOGridSurfaceStyle.cpp	2011-02-25 21:46:04 UTC (rev 5565)
@@ -117,20 +117,20 @@
 }
 
 
-void IOGridSurfaceStyle::Write(MdfStream& fd, GridSurfaceStyle* surfaceStyle, Version* version)
+void IOGridSurfaceStyle::Write(MdfStream& fd, GridSurfaceStyle* surfaceStyle, Version* version, MgTab& tab)
 {
-    fd << tab() << startStr(sSurfaceStyle) << std::endl;
-    inctab();
+    fd << tab.tab() << startStr(sSurfaceStyle) << std::endl;
+    tab.inctab();
 
     // Property: Band
-    fd << tab() << startStr(sBand);
+    fd << tab.tab() << startStr(sBand);
     fd << EncodeString(surfaceStyle->GetBand());
     fd << endStr(sBand) << std::endl;
 
     // Property: ZeroValue (optional)
     if (surfaceStyle->GetZeroValue() != 0.0)
     {
-        fd << tab() << startStr(sZeroValue);
+        fd << tab.tab() << startStr(sZeroValue);
         fd << DoubleToStr(surfaceStyle->GetZeroValue());
         fd << endStr(sZeroValue) << std::endl;
     }
@@ -138,19 +138,19 @@
     // Property: ScaleFactor (optional)
     if (surfaceStyle->GetScaleFactor() != 1.0)
     {
-        fd << tab() << startStr(sScaleFactor);
+        fd << tab.tab() << startStr(sScaleFactor);
         fd << DoubleToStr(surfaceStyle->GetScaleFactor());
         fd << endStr(sScaleFactor) << std::endl;
     }
 
     // Property: DefaultColor
-    fd << tab() << startStr(sDefaultColor);
+    fd << tab.tab() << startStr(sDefaultColor);
     fd << EncodeString(surfaceStyle->GetDefaultColor());
     fd << endStr(sDefaultColor) << std::endl;
 
     // Write any unknown XML / extended data
-    IOUnknown::Write(fd, surfaceStyle->GetUnknownXml(), version);
+    IOUnknown::Write(fd, surfaceStyle->GetUnknownXml(), version, tab);
 
-    dectab();
-    fd << tab() << endStr(sSurfaceStyle) << std::endl;
+    tab.dectab();
+    fd << tab.tab() << endStr(sSurfaceStyle) << std::endl;
 }

Modified: sandbox/adsk/2.3r/Common/MdfParser/IOGridSurfaceStyle.h
===================================================================
--- sandbox/adsk/2.3r/Common/MdfParser/IOGridSurfaceStyle.h	2011-02-22 07:43:02 UTC (rev 5564)
+++ sandbox/adsk/2.3r/Common/MdfParser/IOGridSurfaceStyle.h	2011-02-25 21:46:04 UTC (rev 5565)
@@ -39,7 +39,7 @@
         virtual void ElementChars(const wchar_t* ch);
         virtual void EndElement(const wchar_t* name, HandlerStack* handlerStack);
 
-        static void Write(MdfStream& fd, GridSurfaceStyle* surfaceStyle, Version* version);
+        static void Write(MdfStream& fd, GridSurfaceStyle* surfaceStyle, Version* version, MgTab& tab);
 
     private:
         GridSurfaceStyle* m_surfaceStyle;

Modified: sandbox/adsk/2.3r/Common/MdfParser/IOHillShade.cpp
===================================================================
--- sandbox/adsk/2.3r/Common/MdfParser/IOHillShade.cpp	2011-02-22 07:43:02 UTC (rev 5564)
+++ sandbox/adsk/2.3r/Common/MdfParser/IOHillShade.cpp	2011-02-25 21:46:04 UTC (rev 5565)
@@ -117,37 +117,37 @@
 }
 
 
-void IOHillShade::Write(MdfStream& fd, HillShade* hillShade, Version* version)
+void IOHillShade::Write(MdfStream& fd, HillShade* hillShade, Version* version, MgTab& tab)
 {
-    fd << tab() << startStr(sHillShade) << std::endl;
-    inctab();
+    fd << tab.tab() << startStr(sHillShade) << std::endl;
+    tab.inctab();
 
     // Property: Band
-    fd << tab() << startStr(sBand);
+    fd << tab.tab() << startStr(sBand);
     fd << EncodeString(hillShade->GetBand());
     fd << endStr(sBand) << std::endl;
 
     // Property : Azimuth
-    fd << tab() << startStr(sAzimuth);
+    fd << tab.tab() << startStr(sAzimuth);
     fd << hillShade->GetAzimuth();
     fd << endStr(sAzimuth) << std::endl;
 
     // Property : Altitude
-    fd << tab() << startStr(sAltitude);
+    fd << tab.tab() << startStr(sAltitude);
     fd << hillShade->GetAltitude();
     fd << endStr(sAltitude) << std::endl;
 
     // Property : ScaleFactor (optional)
     if (hillShade->GetScaleFactor() != 1.0)
     {
-        fd << tab() << startStr(sScaleFactor);
+        fd << tab.tab() << startStr(sScaleFactor);
         fd << hillShade->GetScaleFactor();
         fd << endStr(sScaleFactor) << std::endl;
     }
 
     // Write any unknown XML / extended data
-    IOUnknown::Write(fd, hillShade->GetUnknownXml(), version);
+    IOUnknown::Write(fd, hillShade->GetUnknownXml(), version, tab);
 
-    dectab();
-    fd << tab() << endStr(sHillShade) << std::endl;
+    tab.dectab();
+    fd << tab.tab() << endStr(sHillShade) << std::endl;
 }

Modified: sandbox/adsk/2.3r/Common/MdfParser/IOHillShade.h
===================================================================
--- sandbox/adsk/2.3r/Common/MdfParser/IOHillShade.h	2011-02-22 07:43:02 UTC (rev 5564)
+++ sandbox/adsk/2.3r/Common/MdfParser/IOHillShade.h	2011-02-25 21:46:04 UTC (rev 5565)
@@ -39,7 +39,7 @@
         virtual void ElementChars(const wchar_t* ch);
         virtual void EndElement(const wchar_t* name, HandlerStack* handlerStack);
 
-        static void Write(MdfStream& fd, HillShade* hillShade, Version* version);
+        static void Write(MdfStream& fd, HillShade* hillShade, Version* version, MgTab& tab);
 
     private:
         GridColorStyle* m_colorStyle;

Modified: sandbox/adsk/2.3r/Common/MdfParser/IOImage.cpp
===================================================================
--- sandbox/adsk/2.3r/Common/MdfParser/IOImage.cpp	2011-02-22 07:43:02 UTC (rev 5564)
+++ sandbox/adsk/2.3r/Common/MdfParser/IOImage.cpp	2011-02-25 21:46:04 UTC (rev 5565)
@@ -69,37 +69,37 @@
 }
 
 
-void IOImage::Write(MdfStream& fd, Image* image, Version* version)
+void IOImage::Write(MdfStream& fd, Image* image, Version* version, MgTab& tab)
 {
     // We must emit either the content or a reference, but
     // not both.  It's invalid for all strings to be empty,
     // but to ensure the XML is valid we still write an empty
     // reference.
-    fd << tab() << "<Image>" << std::endl; // NOXLATE
-    inctab();
+    fd << tab.tab() << "<Image>" << std::endl; // NOXLATE
+    tab.inctab();
 
-    IOGraphicElement::Write(fd, image, version);
+    IOGraphicElement::Write(fd, image, version, tab);
 
     if (image->GetContent().size() > 0)
     {
-        EMIT_STRING_PROPERTY(fd, image, Content, false, NULL)
+        EMIT_STRING_PROPERTY(fd, image, Content, false, NULL, tab)
     }
     else
     {
         _ASSERT(image->GetLibraryItemName().size() > 0);
-        IOResourceRef::Write(fd, "Reference", image->GetResourceId(), image->GetLibraryItemName(), true, version); // NOXLATE
+        IOResourceRef::Write(fd, "Reference", image->GetResourceId(), image->GetLibraryItemName(), true, version, tab); // NOXLATE
     }
 
-    EMIT_DOUBLE_PROPERTY(fd, image, SizeX, false, 1.0)
-    EMIT_DOUBLE_PROPERTY(fd, image, SizeY, false, 1.0)
-    EMIT_BOOL_PROPERTY(fd, image, SizeScalable, true, true) // default is true
-    EMIT_DOUBLE_PROPERTY(fd, image, Angle, true, 0.0)       // default is 0.0
-    EMIT_DOUBLE_PROPERTY(fd, image, PositionX, true, 0.0)   // default is 0.0
-    EMIT_DOUBLE_PROPERTY(fd, image, PositionY, true, 0.0)   // default is 0.0
+    EMIT_DOUBLE_PROPERTY(fd, image, SizeX, false, 1.0, tab)
+    EMIT_DOUBLE_PROPERTY(fd, image, SizeY, false, 1.0, tab)
+    EMIT_BOOL_PROPERTY(fd, image, SizeScalable, true, true, tab) // default is true
+    EMIT_DOUBLE_PROPERTY(fd, image, Angle, true, 0.0, tab)       // default is 0.0
+    EMIT_DOUBLE_PROPERTY(fd, image, PositionX, true, 0.0, tab)   // default is 0.0
+    EMIT_DOUBLE_PROPERTY(fd, image, PositionY, true, 0.0, tab)   // default is 0.0
 
     // Write any unknown XML / extended data
-    IOUnknown::Write(fd, image->GetUnknownXml(), version);
+    IOUnknown::Write(fd, image->GetUnknownXml(), version, tab);
 
-    dectab();
-    fd << tab() << "</Image>" << std::endl; // NOXLATE
+    tab.dectab();
+    fd << tab.tab() << "</Image>" << std::endl; // NOXLATE
 }

Modified: sandbox/adsk/2.3r/Common/MdfParser/IOImage.h
===================================================================
--- sandbox/adsk/2.3r/Common/MdfParser/IOImage.h	2011-02-22 07:43:02 UTC (rev 5564)
+++ sandbox/adsk/2.3r/Common/MdfParser/IOImage.h	2011-02-25 21:46:04 UTC (rev 5565)
@@ -37,7 +37,7 @@
         virtual void StartElement(const wchar_t* name, HandlerStack* handlerStack);
         virtual void ElementChars(const wchar_t* ch);
 
-        static void Write(MdfStream& fd, Image* image, Version* version);
+        static void Write(MdfStream& fd, Image* image, Version* version, MgTab& tab);
 };
 
 END_NAMESPACE_MDFPARSER

Modified: sandbox/adsk/2.3r/Common/MdfParser/IOImageSymbol.cpp
===================================================================
--- sandbox/adsk/2.3r/Common/MdfParser/IOImageSymbol.cpp	2011-02-22 07:43:02 UTC (rev 5564)
+++ sandbox/adsk/2.3r/Common/MdfParser/IOImageSymbol.cpp	2011-02-25 21:46:04 UTC (rev 5565)
@@ -127,29 +127,29 @@
 }
 
 
-void IOImageSymbol::Write(MdfStream& fd, ImageSymbol* symbol, Version* version)
+void IOImageSymbol::Write(MdfStream& fd, ImageSymbol* symbol, Version* version, MgTab& tab)
 {
-    fd << tab() << startStr(sImage) << std::endl;
-    inctab();
+    fd << tab.tab() << startStr(sImage) << std::endl;
+    tab.inctab();
 
-    IOSymbol::Write(fd, symbol, version);
+    IOSymbol::Write(fd, symbol, version, tab);
 
     if (!symbol->GetImageLibrary().empty())
     {
         // Property: Image
-        IOResourceRef::Write(fd, sImage, symbol->GetImageLibrary(), symbol->GetImageName(), false, version);
+        IOResourceRef::Write(fd, sImage, symbol->GetImageLibrary(), symbol->GetImageName(), false, version, tab);
     }
     else
     {
         // Property: Content
-        fd << tab() << startStr(sContent);
+        fd << tab.tab() << startStr(sContent);
         fd << EncodeString(symbol->GetContent());
         fd << endStr(sContent) << std::endl;
     }
 
     // Write any unknown XML / extended data
-    IOUnknown::Write(fd, symbol->GetUnknownXml(), version);
+    IOUnknown::Write(fd, symbol->GetUnknownXml(), version, tab);
 
-    dectab();
-    fd << tab() << endStr(sImage) << std::endl;
+    tab.dectab();
+    fd << tab.tab() << endStr(sImage) << std::endl;
 }

Modified: sandbox/adsk/2.3r/Common/MdfParser/IOImageSymbol.h
===================================================================
--- sandbox/adsk/2.3r/Common/MdfParser/IOImageSymbol.h	2011-02-22 07:43:02 UTC (rev 5564)
+++ sandbox/adsk/2.3r/Common/MdfParser/IOImageSymbol.h	2011-02-25 21:46:04 UTC (rev 5565)
@@ -36,7 +36,7 @@
         virtual void ElementChars(const wchar_t* ch);
         virtual void EndElement(const wchar_t* name, HandlerStack* handlerStack);
 
-        static void Write(MdfStream& fd, ImageSymbol* imageSymbol, Version* version);
+        static void Write(MdfStream& fd, ImageSymbol* imageSymbol, Version* version, MgTab& tab);
 
     private:
         IOResourceRef* m_ioResourceRef;

Modified: sandbox/adsk/2.3r/Common/MdfParser/IOLabel.cpp
===================================================================
--- sandbox/adsk/2.3r/Common/MdfParser/IOLabel.cpp	2011-02-22 07:43:02 UTC (rev 5564)
+++ sandbox/adsk/2.3r/Common/MdfParser/IOLabel.cpp	2011-02-25 21:46:04 UTC (rev 5565)
@@ -241,39 +241,39 @@
 }
 
 
-void IOLabel::Write(MdfStream& fd, Label* label, Version* version)
+void IOLabel::Write(MdfStream& fd, Label* label, Version* version, MgTab& tab)
 {
     TextSymbol* symbol = label->GetSymbol();
 
     if (symbol)
     {
-        fd << tab() << startStr(sLabel) << std::endl;
-        inctab();
+        fd << tab.tab() << startStr(sLabel) << std::endl;
+        tab.inctab();
 
-        IOSymbol::Write(fd, symbol, version);
+        IOSymbol::Write(fd, symbol, version, tab);
 
         // Property: Text
-        fd << tab() << startStr(sText);
+        fd << tab.tab() << startStr(sText);
         fd << EncodeString(symbol->GetText());
         fd << endStr(sText) << std::endl;
 
         // Property: FontName
-        fd << tab() << startStr(sFontName);
+        fd << tab.tab() << startStr(sFontName);
         fd << EncodeString(symbol->GetFontName());
         fd << endStr(sFontName) << std::endl;
 
         // Property: ForegroundColor
-        fd << tab() << startStr(sForegroundColor);
+        fd << tab.tab() << startStr(sForegroundColor);
         fd << EncodeString(symbol->GetForegroundColor());
         fd << endStr(sForegroundColor) << std::endl;
 
         // Property: BackgroundColor
-        fd << tab() << startStr(sBackgroundColor);
+        fd << tab.tab() << startStr(sBackgroundColor);
         fd << EncodeString(symbol->GetBackgroundColor());
         fd << endStr(sBackgroundColor) << std::endl;
 
         // Property: BackgroundStyle
-        fd << tab() << startStr(sBackgroundStyle);
+        fd << tab.tab() << startStr(sBackgroundStyle);
         if (symbol->GetBackgroundStyle() == TextSymbol::Transparent)
             fd << "Transparent"; // NOXLATE
         else if (symbol->GetBackgroundStyle() == TextSymbol::Opaque)
@@ -285,7 +285,7 @@
         // Property: HorizontalAlignment
         if (symbol->GetHorizontalAlignment() != L"'Center'") // NOXLATE
         {
-            fd << tab() << startStr(sHorizontalAlignment);
+            fd << tab.tab() << startStr(sHorizontalAlignment);
             fd << EncodeString(symbol->GetHorizontalAlignment());
             fd << endStr(sHorizontalAlignment) << std::endl;
         }
@@ -293,7 +293,7 @@
         // Property: VerticalAlignment
         if (symbol->GetVerticalAlignment() != L"'Baseline'") // NOXLATE
         {
-            fd << tab() << startStr(sVerticalAlignment);
+            fd << tab.tab() << startStr(sVerticalAlignment);
             fd << EncodeString(symbol->GetVerticalAlignment());
             fd << endStr(sVerticalAlignment) << std::endl;
         }
@@ -301,7 +301,7 @@
         // Property: Bold
         if (wstrToBool(symbol->GetBold().c_str()))
         {
-            fd << tab() << startStr(sBold);
+            fd << tab.tab() << startStr(sBold);
             fd << BoolToStr(true);
             fd << endStr(sBold) << std::endl;
         }
@@ -309,7 +309,7 @@
         // Property: Italic
         if (wstrToBool(symbol->GetItalic().c_str()))
         {
-            fd << tab() << startStr(sItalic);
+            fd << tab.tab() << startStr(sItalic);
             fd << BoolToStr(true);
             fd << endStr(sItalic) << std::endl;
         }
@@ -317,24 +317,24 @@
         // Property: Underlined
         if (wstrToBool(symbol->GetUnderlined().c_str()))
         {
-            fd << tab() << startStr(sUnderlined);
+            fd << tab.tab() << startStr(sUnderlined);
             fd << BoolToStr(true);
             fd << endStr(sUnderlined) << std::endl;
         }
 
         // Property: AdvancedPlacement
-        fd << tab() << startStr(sAdvancedPlacement) << std::endl;
-        inctab();
-        fd << tab() << startStr(sScaleLimit);
+        fd << tab.tab() << startStr(sAdvancedPlacement) << std::endl;
+        tab.inctab();
+        fd << tab.tab() << startStr(sScaleLimit);
         fd << DoubleToStr(symbol->GetScaleLimit());
         fd << endStr(sScaleLimit) << std::endl;
-        dectab();
-        fd << tab() << endStr(sAdvancedPlacement) << std::endl;
+        tab.dectab();
+        fd << tab.tab() << endStr(sAdvancedPlacement) << std::endl;
 
         // Write any unknown XML / extended data
-        IOUnknown::Write(fd, label->GetUnknownXml(), version);
+        IOUnknown::Write(fd, label->GetUnknownXml(), version, tab);
 
-        dectab();
-        fd << tab() << endStr(sLabel) << std::endl;
+        tab.dectab();
+        fd << tab.tab() << endStr(sLabel) << std::endl;
     }
 }

Modified: sandbox/adsk/2.3r/Common/MdfParser/IOLabel.h
===================================================================
--- sandbox/adsk/2.3r/Common/MdfParser/IOLabel.h	2011-02-22 07:43:02 UTC (rev 5564)
+++ sandbox/adsk/2.3r/Common/MdfParser/IOLabel.h	2011-02-25 21:46:04 UTC (rev 5565)
@@ -39,7 +39,7 @@
         virtual void ElementChars(const wchar_t* ch);
         virtual void EndElement(const wchar_t* name, HandlerStack* handlerStack);
 
-        static void Write(MdfStream& fd, Label* label, Version* version);
+        static void Write(MdfStream& fd, Label* label, Version* version, MgTab& tab);
 
     private:
         Label* m_label;

Modified: sandbox/adsk/2.3r/Common/MdfParser/IOLineRule.cpp
===================================================================
--- sandbox/adsk/2.3r/Common/MdfParser/IOLineRule.cpp	2011-02-22 07:43:02 UTC (rev 5564)
+++ sandbox/adsk/2.3r/Common/MdfParser/IOLineRule.cpp	2011-02-25 21:46:04 UTC (rev 5565)
@@ -127,35 +127,35 @@
 }
 
 
-void IOLineRule::Write(MdfStream& fd, LineRule* lineRule, Version* version)
+void IOLineRule::Write(MdfStream& fd, LineRule* lineRule, Version* version, MgTab& tab)
 {
-    fd << tab() << startStr(sLineRule) << std::endl;
-    inctab();
+    fd << tab.tab() << startStr(sLineRule) << std::endl;
+    tab.inctab();
 
     // Property: LegendLabel
-    fd << tab() << startStr(sLegendLabel);
+    fd << tab.tab() << startStr(sLegendLabel);
     fd << EncodeString(lineRule->GetLegendLabel());
     fd << endStr(sLegendLabel) << std::endl;
 
     // Property: Filter
     if (!lineRule->GetFilter().empty())
     {
-        fd << tab() << startStr(sFilter);
+        fd << tab.tab() << startStr(sFilter);
         fd << EncodeString(lineRule->GetFilter());
         fd << endStr(sFilter) << std::endl;
     }
 
     // Property: Label
     if (lineRule->GetLabel() && lineRule->GetLabel()->GetSymbol())
-        IOLabel::Write(fd, lineRule->GetLabel(), version);
+        IOLabel::Write(fd, lineRule->GetLabel(), version, tab);
 
     // Property: Symbolizations
     for (int i=0; i<lineRule->GetSymbolizations()->GetCount(); ++i)
-        IOLineSymbolization2D::Write(fd, lineRule->GetSymbolizations()->GetAt(i), version);
+        IOLineSymbolization2D::Write(fd, lineRule->GetSymbolizations()->GetAt(i), version, tab);
 
     // Write any unknown XML / extended data
-    IOUnknown::Write(fd, lineRule->GetUnknownXml(), version);
+    IOUnknown::Write(fd, lineRule->GetUnknownXml(), version, tab);
 
-    dectab();
-    fd << tab() << endStr(sLineRule) << std::endl;
+    tab.dectab();
+    fd << tab.tab() << endStr(sLineRule) << std::endl;
 }

Modified: sandbox/adsk/2.3r/Common/MdfParser/IOLineRule.h
===================================================================
--- sandbox/adsk/2.3r/Common/MdfParser/IOLineRule.h	2011-02-22 07:43:02 UTC (rev 5564)
+++ sandbox/adsk/2.3r/Common/MdfParser/IOLineRule.h	2011-02-25 21:46:04 UTC (rev 5565)
@@ -39,7 +39,7 @@
         virtual void ElementChars(const wchar_t* ch);
         virtual void EndElement(const wchar_t* name, HandlerStack* handlerStack);
 
-        static void Write(MdfStream& fd, LineRule* lineRule, Version* version);
+        static void Write(MdfStream& fd, LineRule* lineRule, Version* version, MgTab& tab);
 
     private:
         LineRule* m_lineRule;

Modified: sandbox/adsk/2.3r/Common/MdfParser/IOLineSymbolization2D.cpp
===================================================================
--- sandbox/adsk/2.3r/Common/MdfParser/IOLineSymbolization2D.cpp	2011-02-22 07:43:02 UTC (rev 5564)
+++ sandbox/adsk/2.3r/Common/MdfParser/IOLineSymbolization2D.cpp	2011-02-25 21:46:04 UTC (rev 5565)
@@ -127,8 +127,8 @@
 }
 
 
-void IOLineSymbolization2D::Write(MdfStream& fd, LineSymbolization2D* lineSymbolization, Version* version)
+void IOLineSymbolization2D::Write(MdfStream& fd, LineSymbolization2D* lineSymbolization, Version* version, MgTab& tab)
 {
     // a LineSymbolization2D is just a Stroke
-    IOStroke::Write(fd, lineSymbolization->GetStroke(), sLineSymbolization2D, version);
+    IOStroke::Write(fd, lineSymbolization->GetStroke(), sLineSymbolization2D, version, tab);
 }

Modified: sandbox/adsk/2.3r/Common/MdfParser/IOLineSymbolization2D.h
===================================================================
--- sandbox/adsk/2.3r/Common/MdfParser/IOLineSymbolization2D.h	2011-02-22 07:43:02 UTC (rev 5564)
+++ sandbox/adsk/2.3r/Common/MdfParser/IOLineSymbolization2D.h	2011-02-25 21:46:04 UTC (rev 5565)
@@ -39,7 +39,7 @@
         virtual void ElementChars(const wchar_t* ch);
         virtual void EndElement(const wchar_t* name, HandlerStack* handlerStack);
 
-        static void Write(MdfStream& fd, LineSymbolization2D* lineSymbolization, Version* version);
+        static void Write(MdfStream& fd, LineSymbolization2D* lineSymbolization, Version* version, MgTab& tab);
 
     private:
         LineSymbolization2D* m_lineSymbolization;

Modified: sandbox/adsk/2.3r/Common/MdfParser/IOLineTypeStyle.cpp
===================================================================
--- sandbox/adsk/2.3r/Common/MdfParser/IOLineTypeStyle.cpp	2011-02-22 07:43:02 UTC (rev 5564)
+++ sandbox/adsk/2.3r/Common/MdfParser/IOLineTypeStyle.cpp	2011-02-25 21:46:04 UTC (rev 5565)
@@ -108,38 +108,38 @@
 }
 
 
-void IOLineTypeStyle::Write(MdfStream& fd, LineTypeStyle* lineTypeStyle, Version* version)
+void IOLineTypeStyle::Write(MdfStream& fd, LineTypeStyle* lineTypeStyle, Version* version, MgTab& tab)
 {
-    fd << tab() << startStr(sLineTypeStyle) << std::endl;
-    inctab();
+    fd << tab.tab() << startStr(sLineTypeStyle) << std::endl;
+    tab.inctab();
 
     MdfStringStream fdExtData;
 
     // Property: Rules
     for (int i=0; i<lineTypeStyle->GetRules()->GetCount(); ++i)
-        IOLineRule::Write(fd, static_cast<LineRule*>(lineTypeStyle->GetRules()->GetAt(i)), version);
+        IOLineRule::Write(fd, static_cast<LineRule*>(lineTypeStyle->GetRules()->GetAt(i)), version, tab);
 
     // Property: ShowInLegend
     if (!version || (*version >= Version(1, 3, 0)))
     {
         // version 1.3.0 has a ShowInLegend Property
-        fd << tab() << startStr(sShowInLegend);
+        fd << tab.tab() << startStr(sShowInLegend);
         fd << BoolToStr(lineTypeStyle->IsShowInLegend());
         fd << endStr(sShowInLegend) << std::endl;
     }
     else if (*version >= Version(1, 0, 0))
     {
         // save ShowInLegend as extended data for LDF versions 1.0.0, 1.1.0, and 1.2.0
-        inctab();
-        fdExtData << tab() << startStr(sShowInLegend);
+        tab.inctab();
+        fdExtData << tab.tab() << startStr(sShowInLegend);
         fdExtData << BoolToStr(lineTypeStyle->IsShowInLegend());
         fdExtData << endStr(sShowInLegend) << std::endl;
-        dectab();
+        tab.dectab();
     }
 
     // Write any unknown XML / extended data
-    IOUnknown::Write(fd, lineTypeStyle->GetUnknownXml(), fdExtData.str(), version);
+    IOUnknown::Write(fd, lineTypeStyle->GetUnknownXml(), fdExtData.str(), version, tab);
 
-    dectab();
-    fd << tab() << endStr(sLineTypeStyle) << std::endl;
+    tab.dectab();
+    fd << tab.tab() << endStr(sLineTypeStyle) << std::endl;
 }

Modified: sandbox/adsk/2.3r/Common/MdfParser/IOLineTypeStyle.h
===================================================================
--- sandbox/adsk/2.3r/Common/MdfParser/IOLineTypeStyle.h	2011-02-22 07:43:02 UTC (rev 5564)
+++ sandbox/adsk/2.3r/Common/MdfParser/IOLineTypeStyle.h	2011-02-25 21:46:04 UTC (rev 5565)
@@ -39,7 +39,7 @@
         virtual void ElementChars(const wchar_t* ch);
         virtual void EndElement(const wchar_t* name, HandlerStack* handlerStack);
 
-        static void Write(MdfStream& fd, LineTypeStyle* lineTypeStyle, Version* version);
+        static void Write(MdfStream& fd, LineTypeStyle* lineTypeStyle, Version* version, MgTab& tab);
 
     private:
         LineTypeStyle* m_lineTypeStyle;

Modified: sandbox/adsk/2.3r/Common/MdfParser/IOLineUsage.cpp
===================================================================
--- sandbox/adsk/2.3r/Common/MdfParser/IOLineUsage.cpp	2011-02-22 07:43:02 UTC (rev 5564)
+++ sandbox/adsk/2.3r/Common/MdfParser/IOLineUsage.cpp	2011-02-25 21:46:04 UTC (rev 5565)
@@ -102,13 +102,13 @@
 }
 
 
-void IOLineUsage::Write(MdfStream& fd, LineUsage* lineUsage, Version* version)
+void IOLineUsage::Write(MdfStream& fd, LineUsage* lineUsage, Version* version, MgTab& tab)
 {
-    fd << tab() << "<LineUsage>" << std::endl; // NOXLATE
-    inctab();
+    fd << tab.tab() << "<LineUsage>" << std::endl; // NOXLATE
+    tab.inctab();
 
-    EMIT_STRING_PROPERTY(fd, lineUsage, AngleControl, true, LineUsage::sAngleControlDefault)
-    EMIT_STRING_PROPERTY(fd, lineUsage, UnitsControl, true, LineUsage::sUnitsControlDefault)
+    EMIT_STRING_PROPERTY(fd, lineUsage, AngleControl, true, LineUsage::sAngleControlDefault, tab)
+    EMIT_STRING_PROPERTY(fd, lineUsage, UnitsControl, true, LineUsage::sUnitsControlDefault, tab)
 
     // Property: VertexControl
 
@@ -140,13 +140,13 @@
 
     if (emitVertexControl)
     {
-        fd << tab() << "<VertexControl>";       // NOXLATE
+        fd << tab.tab() << "<VertexControl>";       // NOXLATE
         fd << EncodeString(strVertexControl);
         fd << "</VertexControl>" << std::endl;  // NOXLATE
     }
 
     // Property: Angle
-    EMIT_DOUBLE_PROPERTY(fd, lineUsage, Angle, true, 0.0)   // default is 0.0
+    EMIT_DOUBLE_PROPERTY(fd, lineUsage, Angle, true, 0.0, tab)   // default is 0.0
 
     // Property: StartOffset / EndOffset
     bool emitStartOffset = false;
@@ -189,29 +189,29 @@
 
     if (emitStartOffset)
     {
-        fd << tab() << "<StartOffset>";         // NOXLATE
+        fd << tab.tab() << "<StartOffset>";         // NOXLATE
         fd << EncodeString(strStartOffset);
         fd << "</StartOffset>" << std::endl;    // NOXLATE
     }
 
     if (emitEndOffset)
     {
-        fd << tab() << "<EndOffset>";           // NOXLATE
+        fd << tab.tab() << "<EndOffset>";           // NOXLATE
         fd << EncodeString(strEndOffset);
         fd << "</EndOffset>" << std::endl;      // NOXLATE
     }
 
-    EMIT_DOUBLE_PROPERTY(fd, lineUsage, Repeat, true, 0.0)           // default is 0.0
-    EMIT_DOUBLE_PROPERTY(fd, lineUsage, VertexAngleLimit, true, 0.0) // default is 0.0
-    EMIT_STRING_PROPERTY(fd, lineUsage, VertexJoin, true, LineUsage::sVertexJoinDefault)
-    EMIT_DOUBLE_PROPERTY(fd, lineUsage, VertexMiterLimit, true, 5.0) // default is 5.0
+    EMIT_DOUBLE_PROPERTY(fd, lineUsage, Repeat, true, 0.0, tab)           // default is 0.0
+    EMIT_DOUBLE_PROPERTY(fd, lineUsage, VertexAngleLimit, true, 0.0, tab) // default is 0.0
+    EMIT_STRING_PROPERTY(fd, lineUsage, VertexJoin, true, LineUsage::sVertexJoinDefault, tab)
+    EMIT_DOUBLE_PROPERTY(fd, lineUsage, VertexMiterLimit, true, 5.0, tab) // default is 5.0
 
     if (lineUsage->GetDefaultPath())
-        IOPath::Write(fd, lineUsage->GetDefaultPath(), "DefaultPath", version);
+        IOPath::Write(fd, lineUsage->GetDefaultPath(), "DefaultPath", version, tab);
 
     // Write any unknown XML / extended data
-    IOUnknown::Write(fd, lineUsage->GetUnknownXml(), version);
+    IOUnknown::Write(fd, lineUsage->GetUnknownXml(), version, tab);
 
-    dectab();
-    fd << tab() << "</LineUsage>" << std::endl; // NOXLATE
+    tab.dectab();
+    fd << tab.tab() << "</LineUsage>" << std::endl; // NOXLATE
 }

Modified: sandbox/adsk/2.3r/Common/MdfParser/IOLineUsage.h
===================================================================
--- sandbox/adsk/2.3r/Common/MdfParser/IOLineUsage.h	2011-02-22 07:43:02 UTC (rev 5564)
+++ sandbox/adsk/2.3r/Common/MdfParser/IOLineUsage.h	2011-02-25 21:46:04 UTC (rev 5565)
@@ -37,7 +37,7 @@
         virtual void ElementChars(const wchar_t* ch);
         virtual void EndElement(const wchar_t* name, HandlerStack* handlerStack);
 
-        static void Write(MdfStream& fd, LineUsage* lineUsage, Version* version);
+        static void Write(MdfStream& fd, LineUsage* lineUsage, Version* version, MgTab& tab);
 
     private:
         SimpleSymbolDefinition* m_symbolDefinition;

Modified: sandbox/adsk/2.3r/Common/MdfParser/IOMapDefinition.cpp
===================================================================
--- sandbox/adsk/2.3r/Common/MdfParser/IOMapDefinition.cpp	2011-02-22 07:43:02 UTC (rev 5564)
+++ sandbox/adsk/2.3r/Common/MdfParser/IOMapDefinition.cpp	2011-02-25 21:46:04 UTC (rev 5565)
@@ -178,7 +178,7 @@
 }
 
 
-void IOMapDefinition::Write(MdfStream& fd, MapDefinition* map, Version* version)
+void IOMapDefinition::Write(MdfStream& fd, MapDefinition* map, Version* version, MgTab& tab)
 {
     // verify the MDF version
     MdfString strVersion;
@@ -204,48 +204,48 @@
     }
 
     if (!version || (*version > Version(1, 0, 0)))
-        fd << tab() << "<MapDefinition xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"MapDefinition-" << EncodeString(strVersion) << ".xsd\" version=\"" << EncodeString(strVersion) << "\">" << std::endl; // NOXLATE
+        fd << tab.tab() << "<MapDefinition xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"MapDefinition-" << EncodeString(strVersion) << ".xsd\" version=\"" << EncodeString(strVersion) << "\">" << std::endl; // NOXLATE
     else
-        fd << tab() << "<MapDefinition xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"MapDefinition-1.0.0.xsd\">" << std::endl; // NOXLATE
-    inctab();
+        fd << tab.tab() << "<MapDefinition xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"MapDefinition-1.0.0.xsd\">" << std::endl; // NOXLATE
+    tab.inctab();
 
     // Property: Name
-    fd << tab() << startStr(sName);
+    fd << tab.tab() << startStr(sName);
     fd << EncodeString(map->GetName());
     fd << endStr(sName) << std::endl;
 
     // Property: CoordinateSystem
-    fd << tab() << startStr(sCoordinateSystem);
+    fd << tab.tab() << startStr(sCoordinateSystem);
     fd << EncodeString(map->GetCoordinateSystem());
     fd << endStr(sCoordinateSystem) << std::endl;
 
     // Property: Extents
-    IOExtra::WriteBox2D(fd, map->GetExtents(), false, version);
+    IOExtra::WriteBox2D(fd, map->GetExtents(), false, version, tab);
 
     // Property: BackgroundColor
-    fd << tab() << startStr(sBackgroundColor);
+    fd << tab.tab() << startStr(sBackgroundColor);
     fd << EncodeString(map->GetBackgroundColor());
     fd << endStr(sBackgroundColor) << std::endl;
 
     // Property: Metadata
     if (!map->GetMetadata().empty())
     {
-        fd << tab() << startStr(sMetadata);
+        fd << tab.tab() << startStr(sMetadata);
         fd << EncodeString(map->GetMetadata());
         fd << endStr(sMetadata) << std::endl;
     }
 
     // Property: MapLayer
     for (int i=0; i<map->GetLayers()->GetCount(); ++i)
-        IOMapLayer::Write(fd, map->GetLayers()->GetAt(i), version);
+        IOMapLayer::Write(fd, map->GetLayers()->GetAt(i), version, tab);
 
     // Property: MapLayerGroup
     for (int i=0; i<map->GetLayerGroups()->GetCount(); ++i)
-        IOMapLayerGroup::Write(fd, map->GetLayerGroups()->GetAt(i), version);
+        IOMapLayerGroup::Write(fd, map->GetLayerGroups()->GetAt(i), version, tab);
 
     // Property: BaseMapDefinition
     if (map->GetFiniteDisplayScales()->GetCount() > 0)
-        IOBaseMapDefinition::Write(fd, map, version);
+        IOBaseMapDefinition::Write(fd, map, version, tab);
 
     // Property: Watermarks (optional)
     int watermarkCount = map->GetWatermarks()->GetCount();
@@ -254,19 +254,19 @@
         // only write Watermarks if the MDF version is 2.3.0 or greater
         if (!version || (*version >= Version(2, 3, 0)))
         {
-            fd << tab() << startStr(sWatermarks) << std::endl;
-            inctab();
+            fd << tab.tab() << startStr(sWatermarks) << std::endl;
+            tab.inctab();
             for (int i=0; i<watermarkCount; ++i)
-                IOWatermarkInstance::Write(fd, map->GetWatermarks()->GetAt(i), version);
-            dectab();
-            fd << tab() << endStr(sWatermarks) << std::endl;
+                IOWatermarkInstance::Write(fd, map->GetWatermarks()->GetAt(i), version, tab);
+            tab.dectab();
+            fd << tab.tab() << endStr(sWatermarks) << std::endl;
         }
     }
 
     // Write any unknown XML / extended data
     if (!version || (*version >= Version(2, 3, 0)))
-        IOUnknown::Write(fd, map->GetUnknownXml(), version);
+        IOUnknown::Write(fd, map->GetUnknownXml(), version, tab);
 
-    dectab();
-    fd << tab() << "</MapDefinition>" << std::endl; // NOXLATE
+    tab.dectab();
+    fd << tab.tab() << "</MapDefinition>" << std::endl; // NOXLATE
 }

Modified: sandbox/adsk/2.3r/Common/MdfParser/IOMapDefinition.h
===================================================================
--- sandbox/adsk/2.3r/Common/MdfParser/IOMapDefinition.h	2011-02-22 07:43:02 UTC (rev 5564)
+++ sandbox/adsk/2.3r/Common/MdfParser/IOMapDefinition.h	2011-02-25 21:46:04 UTC (rev 5565)
@@ -38,7 +38,7 @@
         virtual void ElementChars(const wchar_t* ch);
         virtual void EndElement(const wchar_t* name, HandlerStack* handlerStack);
 
-        static void Write(MdfStream& fd, MapDefinition* map, Version* version);
+        static void Write(MdfStream& fd, MapDefinition* map, Version* version, MgTab& tab);
 
     private:
         static bool GetWatermarkDefinitionVersion(Version* mdfVersion, Version& wdVersion);

Modified: sandbox/adsk/2.3r/Common/MdfParser/IOMapLayer.cpp
===================================================================
--- sandbox/adsk/2.3r/Common/MdfParser/IOMapLayer.cpp	2011-02-22 07:43:02 UTC (rev 5564)
+++ sandbox/adsk/2.3r/Common/MdfParser/IOMapLayer.cpp	2011-02-25 21:46:04 UTC (rev 5565)
@@ -106,27 +106,27 @@
 }
 
 
-void IOMapLayer::Write(MdfStream& fd, MapLayer* mapLayer, Version* version)
+void IOMapLayer::Write(MdfStream& fd, MapLayer* mapLayer, Version* version, MgTab& tab)
 {
-    fd << tab() << startStr(sMapLayer) << std::endl;
-    inctab();
+    fd << tab.tab() << startStr(sMapLayer) << std::endl;
+    tab.inctab();
 
-    IOMapLayerCommon::Write(fd, mapLayer, version);
+    IOMapLayerCommon::Write(fd, mapLayer, version, tab);
 
     // Property: Visible
-    fd << tab() << startStr(sVisible);
+    fd << tab.tab() << startStr(sVisible);
     fd << BoolToStr(mapLayer->IsVisible());
     fd << endStr(sVisible) << std::endl;
 
     // Property: Group
-    fd << tab() << startStr(sGroup);
+    fd << tab.tab() << startStr(sGroup);
     fd << EncodeString(mapLayer->GetGroup());
     fd << endStr(sGroup) << std::endl;
 
     // Write any unknown XML / extended data
     if (!version || (*version >= Version(2, 3, 0)))
-        IOUnknown::Write(fd, mapLayer->GetUnknownXml(), version);
+        IOUnknown::Write(fd, mapLayer->GetUnknownXml(), version, tab);
 
-    dectab();
-    fd << tab() << endStr(sMapLayer) << std::endl; // NOXLATE
+    tab.dectab();
+    fd << tab.tab() << endStr(sMapLayer) << std::endl; // NOXLATE
 }

Modified: sandbox/adsk/2.3r/Common/MdfParser/IOMapLayer.h
===================================================================
--- sandbox/adsk/2.3r/Common/MdfParser/IOMapLayer.h	2011-02-22 07:43:02 UTC (rev 5564)
+++ sandbox/adsk/2.3r/Common/MdfParser/IOMapLayer.h	2011-02-25 21:46:04 UTC (rev 5565)
@@ -39,7 +39,7 @@
         virtual void ElementChars(const wchar_t* ch);
         virtual void EndElement(const wchar_t* name, HandlerStack* handlerStack);
 
-        static void Write(MdfStream& fd, MapLayer* mapLayer, Version* version);
+        static void Write(MdfStream& fd, MapLayer* mapLayer, Version* version, MgTab& tab);
 
     private:
         MapDefinition* m_map;

Modified: sandbox/adsk/2.3r/Common/MdfParser/IOMapLayerCommon.cpp
===================================================================
--- sandbox/adsk/2.3r/Common/MdfParser/IOMapLayerCommon.cpp	2011-02-22 07:43:02 UTC (rev 5564)
+++ sandbox/adsk/2.3r/Common/MdfParser/IOMapLayerCommon.cpp	2011-02-25 21:46:04 UTC (rev 5565)
@@ -51,35 +51,35 @@
 }
 
 
-void IOMapLayerCommon::Write(MdfStream& fd, BaseMapLayer* baseMapLayer, Version* version)
+void IOMapLayerCommon::Write(MdfStream& fd, BaseMapLayer* baseMapLayer, Version* version, MgTab& tab)
 {
     // Property: Name
-    fd << tab() << "<Name>"; // NOXLATE
+    fd << tab.tab() << "<Name>"; // NOXLATE
     fd << EncodeString(baseMapLayer->GetName());
     fd << "</Name>" << std::endl; // NOXLATE
 
     // Property: ResourceId
-    fd << tab() << "<ResourceId>"; // NOXLATE
+    fd << tab.tab() << "<ResourceId>"; // NOXLATE
     fd << EncodeString(baseMapLayer->GetLayerResourceID());
     fd << "</ResourceId>" << std::endl; // NOXLATE
 
     // Property: Selectable
-    fd << tab() << "<Selectable>"; // NOXLATE
+    fd << tab.tab() << "<Selectable>"; // NOXLATE
     fd << BoolToStr(baseMapLayer->IsSelectable());
     fd << "</Selectable>" << std::endl; // NOXLATE
 
     // Property: ShowInLegend
-    fd << tab() << "<ShowInLegend>"; // NOXLATE
+    fd << tab.tab() << "<ShowInLegend>"; // NOXLATE
     fd << BoolToStr(baseMapLayer->IsShowInLegend());
     fd << "</ShowInLegend>" << std::endl; // NOXLATE
 
     // Property: LegendLabel
-    fd << tab() << "<LegendLabel>"; // NOXLATE
+    fd << tab.tab() << "<LegendLabel>"; // NOXLATE
     fd << EncodeString(baseMapLayer->GetLegendLabel());
     fd << "</LegendLabel>" << std::endl; // NOXLATE
 
     // Property: ExpandInLegend
-    fd << tab() << "<ExpandInLegend>"; // NOXLATE
+    fd << tab.tab() << "<ExpandInLegend>"; // NOXLATE
     fd << BoolToStr(baseMapLayer->IsExpandInLegend());
     fd << "</ExpandInLegend>" << std::endl; // NOXLATE
 }

Modified: sandbox/adsk/2.3r/Common/MdfParser/IOMapLayerCommon.h
===================================================================
--- sandbox/adsk/2.3r/Common/MdfParser/IOMapLayerCommon.h	2011-02-22 07:43:02 UTC (rev 5564)
+++ sandbox/adsk/2.3r/Common/MdfParser/IOMapLayerCommon.h	2011-02-25 21:46:04 UTC (rev 5565)
@@ -39,7 +39,7 @@
 
         virtual void ElementChars(const wchar_t* ch);
 
-        static void Write(MdfStream& fd, BaseMapLayer* baseMapLayer, Version* version);
+        static void Write(MdfStream& fd, BaseMapLayer* baseMapLayer, Version* version, MgTab& tab);
 
     protected:
         BaseMapLayer* m_mapLayerCommon;

Modified: sandbox/adsk/2.3r/Common/MdfParser/IOMapLayerGroup.cpp
===================================================================
--- sandbox/adsk/2.3r/Common/MdfParser/IOMapLayerGroup.cpp	2011-02-22 07:43:02 UTC (rev 5564)
+++ sandbox/adsk/2.3r/Common/MdfParser/IOMapLayerGroup.cpp	2011-02-25 21:46:04 UTC (rev 5565)
@@ -99,22 +99,22 @@
 }
 
 
-void IOMapLayerGroup::Write(MdfStream& fd, MapLayerGroup* mapLayerGroup, Version* version)
+void IOMapLayerGroup::Write(MdfStream& fd, MapLayerGroup* mapLayerGroup, Version* version, MgTab& tab)
 {
-    fd << tab() << startStr(sMapLayerGroup) << std::endl;
-    inctab();
+    fd << tab.tab() << startStr(sMapLayerGroup) << std::endl;
+    tab.inctab();
 
-    IOMapLayerGroupCommon::Write(fd, mapLayerGroup, version);
+    IOMapLayerGroupCommon::Write(fd, mapLayerGroup, version, tab);
 
     // Property: Group
-    fd << tab() << startStr(sGroup);
+    fd << tab.tab() << startStr(sGroup);
     fd << EncodeString(mapLayerGroup->GetGroup());
     fd << endStr(sGroup) << std::endl;
 
     // Write any unknown XML / extended data
     if (!version || (*version >= Version(2, 3, 0)))
-        IOUnknown::Write(fd, mapLayerGroup->GetUnknownXml(), version);
+        IOUnknown::Write(fd, mapLayerGroup->GetUnknownXml(), version, tab);
 
-    dectab();
-    fd << tab() << endStr(sMapLayerGroup) << std::endl;
+    tab.dectab();
+    fd << tab.tab() << endStr(sMapLayerGroup) << std::endl;
 }

Modified: sandbox/adsk/2.3r/Common/MdfParser/IOMapLayerGroup.h
===================================================================
--- sandbox/adsk/2.3r/Common/MdfParser/IOMapLayerGroup.h	2011-02-22 07:43:02 UTC (rev 5564)
+++ sandbox/adsk/2.3r/Common/MdfParser/IOMapLayerGroup.h	2011-02-25 21:46:04 UTC (rev 5565)
@@ -39,7 +39,7 @@
         virtual void ElementChars(const wchar_t* ch);
         virtual void EndElement(const wchar_t* name, HandlerStack* handlerStack);
 
-        static void Write(MdfStream& fd, MapLayerGroup* mapLayerGroup, Version* version);
+        static void Write(MdfStream& fd, MapLayerGroup* mapLayerGroup, Version* version, MgTab& tab);
 };
 
 END_NAMESPACE_MDFPARSER

Modified: sandbox/adsk/2.3r/Common/MdfParser/IOMapLayerGroupCommon.cpp
===================================================================
--- sandbox/adsk/2.3r/Common/MdfParser/IOMapLayerGroupCommon.cpp	2011-02-22 07:43:02 UTC (rev 5564)
+++ sandbox/adsk/2.3r/Common/MdfParser/IOMapLayerGroupCommon.cpp	2011-02-25 21:46:04 UTC (rev 5565)
@@ -57,30 +57,30 @@
 }
 
 
-void IOMapLayerGroupCommon::Write(MdfStream& fd, MapLayerGroupCommon* layerGroup, Version* version)
+void IOMapLayerGroupCommon::Write(MdfStream& fd, MapLayerGroupCommon* layerGroup, Version* version, MgTab& tab)
 {
     // Property: Name
-    fd << tab() << "<Name>"; // NOXLATE
+    fd << tab.tab() << "<Name>"; // NOXLATE
     fd << EncodeString(layerGroup->GetName());
     fd << "</Name>" << std::endl; // NOXLATE
 
     // Property: Visible
-    fd << tab() << "<Visible>"; // NOXLATE
+    fd << tab.tab() << "<Visible>"; // NOXLATE
     fd << BoolToStr(layerGroup->IsVisible());
     fd << "</Visible>" << std::endl; // NOXLATE
 
     // Property: ShowInLegend
-    fd << tab() << "<ShowInLegend>"; // NOXLATE
+    fd << tab.tab() << "<ShowInLegend>"; // NOXLATE
     fd << BoolToStr(layerGroup->IsShowInLegend());
     fd << "</ShowInLegend>" << std::endl; // NOXLATE
 
     // Property: ExpandInLegend
-    fd << tab() << "<ExpandInLegend>"; // NOXLATE
+    fd << tab.tab() << "<ExpandInLegend>"; // NOXLATE
     fd << BoolToStr(layerGroup->IsExpandInLegend());
     fd << "</ExpandInLegend>" << std::endl; // NOXLATE
 
     // Property: LegendLabel
-    fd << tab() << "<LegendLabel>"; // NOXLATE
+    fd << tab.tab() << "<LegendLabel>"; // NOXLATE
     fd << EncodeString(layerGroup->GetLegendLabel());
     fd << "</LegendLabel>" << std::endl; // NOXLATE
 }

Modified: sandbox/adsk/2.3r/Common/MdfParser/IOMapLayerGroupCommon.h
===================================================================
--- sandbox/adsk/2.3r/Common/MdfParser/IOMapLayerGroupCommon.h	2011-02-22 07:43:02 UTC (rev 5564)
+++ sandbox/adsk/2.3r/Common/MdfParser/IOMapLayerGroupCommon.h	2011-02-25 21:46:04 UTC (rev 5565)
@@ -39,7 +39,7 @@
 
         virtual void ElementChars(const wchar_t* ch);
 
-        static void Write(MdfStream& fd, MapLayerGroupCommon* layerGroup, Version* version);
+        static void Write(MdfStream& fd, MapLayerGroupCommon* layerGroup, Version* version, MgTab& tab);
 
     protected:
         MapLayerGroupCommon* m_layerGroup;

Modified: sandbox/adsk/2.3r/Common/MdfParser/IOMarkSymbol.cpp
===================================================================
--- sandbox/adsk/2.3r/Common/MdfParser/IOMarkSymbol.cpp	2011-02-22 07:43:02 UTC (rev 5564)
+++ sandbox/adsk/2.3r/Common/MdfParser/IOMarkSymbol.cpp	2011-02-25 21:46:04 UTC (rev 5565)
@@ -143,15 +143,15 @@
 }
 
 
-void IOMarkSymbol::Write(MdfStream& fd, MarkSymbol* markSymbol, Version* version)
+void IOMarkSymbol::Write(MdfStream& fd, MarkSymbol* markSymbol, Version* version, MgTab& tab)
 {
-    fd << tab() << startStr(sMark) << std::endl;
-    inctab();
+    fd << tab.tab() << startStr(sMark) << std::endl;
+    tab.inctab();
 
-    IOSymbol::Write(fd, markSymbol, version);
+    IOSymbol::Write(fd, markSymbol, version, tab);
 
     // Property: Shape
-    fd << tab() << startStr(sShape);
+    fd << tab.tab() << startStr(sShape);
     if (markSymbol->GetShape() == MarkSymbol::Square)
         fd << EncodeString(L"Square"); // NOXLATE
     else if (markSymbol->GetShape() == MarkSymbol::Circle)
@@ -168,15 +168,15 @@
 
     // Property: Fill
     if (markSymbol->GetFill())
-        IOFill::Write(fd, markSymbol->GetFill(), version);
+        IOFill::Write(fd, markSymbol->GetFill(), version, tab);
 
     // Property: Edge
     if (markSymbol->GetEdge())
-        IOStroke::Write(fd, markSymbol->GetEdge(), sEdge, version);
+        IOStroke::Write(fd, markSymbol->GetEdge(), sEdge, version, tab);
 
     // Write any unknown XML / extended data
-    IOUnknown::Write(fd, markSymbol->GetUnknownXml(), version);
+    IOUnknown::Write(fd, markSymbol->GetUnknownXml(), version, tab);
 
-    dectab();
-    fd << tab() << endStr(sMark) << std::endl;
+    tab.dectab();
+    fd << tab.tab() << endStr(sMark) << std::endl;
 }

Modified: sandbox/adsk/2.3r/Common/MdfParser/IOMarkSymbol.h
===================================================================
--- sandbox/adsk/2.3r/Common/MdfParser/IOMarkSymbol.h	2011-02-22 07:43:02 UTC (rev 5564)
+++ sandbox/adsk/2.3r/Common/MdfParser/IOMarkSymbol.h	2011-02-25 21:46:04 UTC (rev 5565)
@@ -35,7 +35,7 @@
         virtual void ElementChars(const wchar_t* ch);
         virtual void EndElement(const wchar_t* name, HandlerStack* handlerStack);
 
-        static void Write(MdfStream& fd, MarkSymbol* markSymbol, Version* version);
+        static void Write(MdfStream& fd, MarkSymbol* markSymbol, Version* version, MgTab& tab);
 };
 
 END_NAMESPACE_MDFPARSER

Modified: sandbox/adsk/2.3r/Common/MdfParser/IONameStringPair.cpp
===================================================================
--- sandbox/adsk/2.3r/Common/MdfParser/IONameStringPair.cpp	2011-02-22 07:43:02 UTC (rev 5564)
+++ sandbox/adsk/2.3r/Common/MdfParser/IONameStringPair.cpp	2011-02-25 21:46:04 UTC (rev 5565)
@@ -141,24 +141,24 @@
 }
 
 
-void IONameStringPair::Write(MdfStream& fd, std::string name, NameStringPair* nameStringPair, Version* version)
+void IONameStringPair::Write(MdfStream& fd, std::string name, NameStringPair* nameStringPair, Version* version, MgTab& tab)
 {
-    fd << tab() << startStr(name) << std::endl;
-    inctab();
+    fd << tab.tab() << startStr(name) << std::endl;
+    tab.inctab();
 
     // Property: Name
-    fd << tab() << startStr(sName);
+    fd << tab.tab() << startStr(sName);
     fd << EncodeString(nameStringPair->GetName());
     fd << endStr(sName) << std::endl;
 
     // Property: Value
-    fd << tab() << startStr(sValue);
+    fd << tab.tab() << startStr(sValue);
     fd << EncodeString(nameStringPair->GetValue());
     fd << endStr(sValue) << std::endl;
 
     // Write any unknown XML / extended data
-    IOUnknown::Write(fd, nameStringPair->GetUnknownXml(), version);
+    IOUnknown::Write(fd, nameStringPair->GetUnknownXml(), version, tab);
 
-    dectab();
-    fd << tab() << endStr(name) << std::endl;
+    tab.dectab();
+    fd << tab.tab() << endStr(name) << std::endl;
 }

Modified: sandbox/adsk/2.3r/Common/MdfParser/IONameStringPair.h
===================================================================
--- sandbox/adsk/2.3r/Common/MdfParser/IONameStringPair.h	2011-02-22 07:43:02 UTC (rev 5564)
+++ sandbox/adsk/2.3r/Common/MdfParser/IONameStringPair.h	2011-02-25 21:46:04 UTC (rev 5565)
@@ -41,7 +41,7 @@
         virtual void ElementChars(const wchar_t* ch);
         virtual void EndElement(const wchar_t* name, HandlerStack* handlerStack);
 
-        static void Write(MdfStream& fd, std::string name, NameStringPair* nameStringPair, Version* version);
+        static void Write(MdfStream& fd, std::string name, NameStringPair* nameStringPair, Version* version, MgTab& tab);
 
     private:
         NameStringPair* m_nameStringPair;

Modified: sandbox/adsk/2.3r/Common/MdfParser/IOOverride.cpp
===================================================================
--- sandbox/adsk/2.3r/Common/MdfParser/IOOverride.cpp	2011-02-22 07:43:02 UTC (rev 5564)
+++ sandbox/adsk/2.3r/Common/MdfParser/IOOverride.cpp	2011-02-25 21:46:04 UTC (rev 5565)
@@ -90,16 +90,16 @@
 }
 
 
-void IOOverride::Write(MdfStream& fd, Override* pOverride, Version* version)
+void IOOverride::Write(MdfStream& fd, Override* pOverride, Version* version, MgTab& tab)
 {
-    fd << tab() << "<Override>" << std::endl; // NOXLATE
-    inctab();
+    fd << tab.tab() << "<Override>" << std::endl; // NOXLATE
+    tab.inctab();
 
     MdfStringStream fdExtData;
 
-    EMIT_STRING_PROPERTY(fd, pOverride, SymbolName, false, NULL)
-    EMIT_STRING_PROPERTY(fd, pOverride, ParameterIdentifier, false, NULL)
-    EMIT_STRING_PROPERTY(fd, pOverride, ParameterValue, false, NULL)
+    EMIT_STRING_PROPERTY(fd, pOverride, SymbolName, false, NULL, tab)
+    EMIT_STRING_PROPERTY(fd, pOverride, ParameterIdentifier, false, NULL, tab)
+    EMIT_STRING_PROPERTY(fd, pOverride, ParameterValue, false, NULL, tab)
 
     ThemeLabel* themeLabel = pOverride->GetThemeLabel();
     if (themeLabel)
@@ -107,20 +107,20 @@
         // only write ThemeLabel if the LDF version is 1.2.0 or greater
         if (!version || (*version >= Version(1, 2, 0)))
         {
-            IOThemeLabel::Write(fd, themeLabel, version);
+            IOThemeLabel::Write(fd, themeLabel, version, tab);
         }
         else if (*version >= Version(1, 0, 0))
         {
             // save ThemeLabel as extended data for LDF versions 1.0.0 and 1.1.0
-            inctab();
-            IOThemeLabel::Write(fdExtData, themeLabel, version);
-            dectab();
+            tab.inctab();
+            IOThemeLabel::Write(fdExtData, themeLabel, version, tab);
+            tab.dectab();
         }
     }
 
     // Write the unknown XML / extended data
-    IOUnknown::Write(fd, pOverride->GetUnknownXml(), fdExtData.str(), version);
+    IOUnknown::Write(fd, pOverride->GetUnknownXml(), fdExtData.str(), version, tab);
 
-    dectab();
-    fd << tab() << "</Override>" << std::endl; // NOXLATE
+    tab.dectab();
+    fd << tab.tab() << "</Override>" << std::endl; // NOXLATE
 }

Modified: sandbox/adsk/2.3r/Common/MdfParser/IOOverride.h
===================================================================
--- sandbox/adsk/2.3r/Common/MdfParser/IOOverride.h	2011-02-22 07:43:02 UTC (rev 5564)
+++ sandbox/adsk/2.3r/Common/MdfParser/IOOverride.h	2011-02-25 21:46:04 UTC (rev 5565)
@@ -37,7 +37,7 @@
         virtual void ElementChars(const wchar_t* ch);
         virtual void EndElement(const wchar_t* name, HandlerStack* handlerStack);
 
-        static void Write(MdfStream& fd, Override* pOverride, Version* version);
+        static void Write(MdfStream& fd, Override* pOverride, Version* version, MgTab& tab);
 
     private:
         Override* m_override;

Modified: sandbox/adsk/2.3r/Common/MdfParser/IOOverrideCollection.cpp
===================================================================
--- sandbox/adsk/2.3r/Common/MdfParser/IOOverrideCollection.cpp	2011-02-22 07:43:02 UTC (rev 5564)
+++ sandbox/adsk/2.3r/Common/MdfParser/IOOverrideCollection.cpp	2011-02-25 21:46:04 UTC (rev 5565)
@@ -78,23 +78,23 @@
 }
 
 
-void IOOverrideCollection::Write(MdfStream& fd, OverrideCollection* overrideCollection, Version* version)
+void IOOverrideCollection::Write(MdfStream& fd, OverrideCollection* overrideCollection, Version* version, MgTab& tab)
 {
     // always write the element, even if it has 0 elements
     int numElements = overrideCollection->GetCount();
 
-    fd << tab() << "<ParameterOverrides>" << std::endl; // NOXLATE
-    inctab();
+    fd << tab.tab() << "<ParameterOverrides>" << std::endl; // NOXLATE
+    tab.inctab();
 
     for (int i=0; i<numElements; ++i)
     {
         Override* pOverride = overrideCollection->GetAt(i);
-        IOOverride::Write(fd, pOverride, version);
+        IOOverride::Write(fd, pOverride, version, tab);
     }
 
     // Write any unknown XML / extended data
-    IOUnknown::Write(fd, overrideCollection->GetUnknownXml(), version);
+    IOUnknown::Write(fd, overrideCollection->GetUnknownXml(), version, tab);
 
-    dectab();
-    fd << tab() << "</ParameterOverrides>" << std::endl; // NOXLATE
+    tab.dectab();
+    fd << tab.tab() << "</ParameterOverrides>" << std::endl; // NOXLATE
 }

Modified: sandbox/adsk/2.3r/Common/MdfParser/IOOverrideCollection.h
===================================================================
--- sandbox/adsk/2.3r/Common/MdfParser/IOOverrideCollection.h	2011-02-22 07:43:02 UTC (rev 5564)
+++ sandbox/adsk/2.3r/Common/MdfParser/IOOverrideCollection.h	2011-02-25 21:46:04 UTC (rev 5565)
@@ -36,7 +36,7 @@
         virtual void ElementChars(const wchar_t* ch);
         virtual void EndElement(const wchar_t* name, HandlerStack* handlerStack);
 
-        static void Write(MdfStream& fd, OverrideCollection* overrideCollection, Version* version);
+        static void Write(MdfStream& fd, OverrideCollection* overrideCollection, Version* version, MgTab& tab);
 
     private:
         OverrideCollection* m_overrideCollection;

Modified: sandbox/adsk/2.3r/Common/MdfParser/IOParameter.cpp
===================================================================
--- sandbox/adsk/2.3r/Common/MdfParser/IOParameter.cpp	2011-02-22 07:43:02 UTC (rev 5564)
+++ sandbox/adsk/2.3r/Common/MdfParser/IOParameter.cpp	2011-02-25 21:46:04 UTC (rev 5565)
@@ -122,17 +122,17 @@
 }
 
 
-void IOParameter::Write(MdfStream& fd, Parameter* parameter, Version* version)
+void IOParameter::Write(MdfStream& fd, Parameter* parameter, Version* version, MgTab& tab)
 {
-    fd << tab() << "<Parameter>" << std::endl; // NOXLATE
-    inctab();
+    fd << tab.tab() << "<Parameter>" << std::endl; // NOXLATE
+    tab.inctab();
 
     MdfStringStream fdExtData;
 
-    EMIT_STRING_PROPERTY(fd, parameter, Identifier, false, NULL)
-    EMIT_STRING_PROPERTY(fd, parameter, DefaultValue, false, NULL)
-    EMIT_STRING_PROPERTY(fd, parameter, DisplayName, true, L"")         // default is empty string
-    EMIT_STRING_PROPERTY(fd, parameter, Description, true, L"")         // default is empty string
+    EMIT_STRING_PROPERTY(fd, parameter, Identifier, false, NULL, tab)
+    EMIT_STRING_PROPERTY(fd, parameter, DefaultValue, false, NULL, tab)
+    EMIT_STRING_PROPERTY(fd, parameter, DisplayName, true, L"", tab)         // default is empty string
+    EMIT_STRING_PROPERTY(fd, parameter, Description, true, L"", tab)         // default is empty string
 
     Parameter::DataType dataType = parameter->GetDataType();
     if (dataType != Parameter::String)
@@ -142,7 +142,7 @@
             // with symbol definition version 1.1.0 and higher we can directly
             // save the new data type enumerations
 
-            fd << tab() << "<DataType>";                                                      // NOXLATE
+            fd << tab.tab() << "<DataType>";                                                      // NOXLATE
 
                  if (dataType == Parameter::Boolean)             fd << "Boolean";             // NOXLATE
             else if (dataType == Parameter::Integer)             fd << "Integer";             // NOXLATE
@@ -188,7 +188,7 @@
                 dataType == Parameter::Color)
             {
                 // older enumerated value - save directly
-                fd << tab() << "<DataType>";                                                      // NOXLATE
+                fd << tab.tab() << "<DataType>";                                                      // NOXLATE
 
                      if (dataType == Parameter::Boolean)             fd << "Boolean";             // NOXLATE
                 else if (dataType == Parameter::Integer)             fd << "Integer";             // NOXLATE
@@ -200,8 +200,8 @@
             else
             {
                 // newer enumerated value - save with extended data
-                inctab();
-                fdExtData << tab() << "<DataType>";                                                      // NOXLATE
+                tab.inctab();
+                fdExtData << tab.tab() << "<DataType>";                                                      // NOXLATE
 
                      if (dataType == Parameter::Angle)               fdExtData << "Angle";               // NOXLATE
                 else if (dataType == Parameter::FillColor)           fdExtData << "FillColor";           // NOXLATE
@@ -231,14 +231,14 @@
                 else if (dataType == Parameter::RepeatY)             fdExtData << "RepeatY";             // NOXLATE
 
                 fdExtData << "</DataType>" << std::endl;                                                 // NOXLATE
-                dectab();
+                tab.dectab();
             }
         }
     }
 
     // Write the unknown XML / extended data
-    IOUnknown::Write(fd, parameter->GetUnknownXml(), fdExtData.str(), version);
+    IOUnknown::Write(fd, parameter->GetUnknownXml(), fdExtData.str(), version, tab);
 
-    dectab();
-    fd << tab() << "</Parameter>" << std::endl; // NOXLATE
+    tab.dectab();
+    fd << tab.tab() << "</Parameter>" << std::endl; // NOXLATE
 }

Modified: sandbox/adsk/2.3r/Common/MdfParser/IOParameter.h
===================================================================
--- sandbox/adsk/2.3r/Common/MdfParser/IOParameter.h	2011-02-22 07:43:02 UTC (rev 5564)
+++ sandbox/adsk/2.3r/Common/MdfParser/IOParameter.h	2011-02-25 21:46:04 UTC (rev 5565)
@@ -37,7 +37,7 @@
         virtual void ElementChars(const wchar_t* ch);
         virtual void EndElement(const wchar_t* name, HandlerStack* handlerStack);
 
-        static void Write(MdfStream& fd, Parameter* parameter, Version* version);
+        static void Write(MdfStream& fd, Parameter* parameter, Version* version, MgTab& tab);
 
     private:
         Parameter* m_parameter;

Modified: sandbox/adsk/2.3r/Common/MdfParser/IOParameterCollection.cpp
===================================================================
--- sandbox/adsk/2.3r/Common/MdfParser/IOParameterCollection.cpp	2011-02-22 07:43:02 UTC (rev 5564)
+++ sandbox/adsk/2.3r/Common/MdfParser/IOParameterCollection.cpp	2011-02-25 21:46:04 UTC (rev 5565)
@@ -78,23 +78,23 @@
 }
 
 
-void IOParameterCollection::Write(MdfStream& fd, ParameterCollection* parameterCollection, Version* version)
+void IOParameterCollection::Write(MdfStream& fd, ParameterCollection* parameterCollection, Version* version, MgTab& tab)
 {
     // always write the element, even if it has 0 elements
     int numElements = parameterCollection->GetCount();
 
-    fd << tab() << "<ParameterDefinition>" << std::endl; // NOXLATE
-    inctab();
+    fd << tab.tab() << "<ParameterDefinition>" << std::endl; // NOXLATE
+    tab.inctab();
 
     for (int i=0; i<numElements; ++i)
     {
         Parameter* parameter = parameterCollection->GetAt(i);
-        IOParameter::Write(fd, parameter, version);
+        IOParameter::Write(fd, parameter, version, tab);
     }
 
     // Write any unknown XML / extended data
-    IOUnknown::Write(fd, parameterCollection->GetUnknownXml(), version);
+    IOUnknown::Write(fd, parameterCollection->GetUnknownXml(), version, tab);
 
-    dectab();
-    fd << tab() << "</ParameterDefinition>" << std::endl; // NOXLATE
+    tab.dectab();
+    fd << tab.tab() << "</ParameterDefinition>" << std::endl; // NOXLATE
 }

Modified: sandbox/adsk/2.3r/Common/MdfParser/IOParameterCollection.h
===================================================================
--- sandbox/adsk/2.3r/Common/MdfParser/IOParameterCollection.h	2011-02-22 07:43:02 UTC (rev 5564)
+++ sandbox/adsk/2.3r/Common/MdfParser/IOParameterCollection.h	2011-02-25 21:46:04 UTC (rev 5565)
@@ -36,7 +36,7 @@
         virtual void ElementChars(const wchar_t* ch);
         virtual void EndElement(const wchar_t* name, HandlerStack* handlerStack);
 
-        static void Write(MdfStream& fd, ParameterCollection* parameterCollection, Version* version);
+        static void Write(MdfStream& fd, ParameterCollection* parameterCollection, Version* version, MgTab& tab);
 
     private:
         ParameterCollection* m_parameterCollection;

Modified: sandbox/adsk/2.3r/Common/MdfParser/IOPath.cpp
===================================================================
--- sandbox/adsk/2.3r/Common/MdfParser/IOPath.cpp	2011-02-22 07:43:02 UTC (rev 5564)
+++ sandbox/adsk/2.3r/Common/MdfParser/IOPath.cpp	2011-02-25 21:46:04 UTC (rev 5565)
@@ -67,31 +67,31 @@
 }
 
 
-void IOPath::Write(MdfStream& fd, Path* path, Version* version)
+void IOPath::Write(MdfStream& fd, Path* path, Version* version, MgTab& tab)
 {
-    IOPath::Write(fd, path, "Path", version); // NOXLATE
+    IOPath::Write(fd, path, "Path", version, tab); // NOXLATE
 }
 
 
-void IOPath::Write(MdfStream& fd, Path* path, std::string name, Version* version)
+void IOPath::Write(MdfStream& fd, Path* path, std::string name, Version* version, MgTab& tab)
 {
-    fd << tab() << "<" << name << ">" << std::endl;
-    inctab();
+    fd << tab.tab() << "<" << name << ">" << std::endl;
+    tab.inctab();
 
-    IOGraphicElement::Write(fd, path, version);
+    IOGraphicElement::Write(fd, path, version, tab);
 
-    EMIT_STRING_PROPERTY(fd, path, Geometry, false, NULL)
-    EMIT_STRING_PROPERTY(fd, path, FillColor, true, L"")         // default is empty string
-    EMIT_STRING_PROPERTY(fd, path, LineColor, true, L"")         // default is empty string
-    EMIT_DOUBLE_PROPERTY(fd, path, LineWeight, true, 0.0)        // default is 0.0
-    EMIT_BOOL_PROPERTY(fd, path, LineWeightScalable, true, true) // default is true
-    EMIT_STRING_PROPERTY(fd, path, LineCap, true, Path::sLineCapDefault)
-    EMIT_STRING_PROPERTY(fd, path, LineJoin, true, Path::sLineJoinDefault)
-    EMIT_DOUBLE_PROPERTY(fd, path, LineMiterLimit, true, 5.0)    // default is 5.0
+    EMIT_STRING_PROPERTY(fd, path, Geometry, false, NULL, tab)
+    EMIT_STRING_PROPERTY(fd, path, FillColor, true, L"", tab)         // default is empty string
+    EMIT_STRING_PROPERTY(fd, path, LineColor, true, L"", tab)         // default is empty string
+    EMIT_DOUBLE_PROPERTY(fd, path, LineWeight, true, 0.0, tab)        // default is 0.0
+    EMIT_BOOL_PROPERTY(fd, path, LineWeightScalable, true, true, tab) // default is true
+    EMIT_STRING_PROPERTY(fd, path, LineCap, true, Path::sLineCapDefault, tab)
+    EMIT_STRING_PROPERTY(fd, path, LineJoin, true, Path::sLineJoinDefault, tab)
+    EMIT_DOUBLE_PROPERTY(fd, path, LineMiterLimit, true, 5.0, tab)    // default is 5.0
 
     // Write any unknown XML / extended data
-    IOUnknown::Write(fd, path->GetUnknownXml(), version);
+    IOUnknown::Write(fd, path->GetUnknownXml(), version, tab);
 
-    dectab();
-    fd << tab() << "</" << name << ">" << std::endl;
+    tab.dectab();
+    fd << tab.tab() << "</" << name << ">" << std::endl;
 }

Modified: sandbox/adsk/2.3r/Common/MdfParser/IOPath.h
===================================================================
--- sandbox/adsk/2.3r/Common/MdfParser/IOPath.h	2011-02-22 07:43:02 UTC (rev 5564)
+++ sandbox/adsk/2.3r/Common/MdfParser/IOPath.h	2011-02-25 21:46:04 UTC (rev 5565)
@@ -37,8 +37,8 @@
         virtual void StartElement(const wchar_t* name, HandlerStack* handlerStack);
         virtual void ElementChars(const wchar_t* ch);
 
-        static void Write(MdfStream& fd, Path* path, Version* version);
-        static void Write(MdfStream& fd, Path* path, std::string name, Version* version);
+        static void Write(MdfStream& fd, Path* path, Version* version, MgTab& tab);
+        static void Write(MdfStream& fd, Path* path, std::string name, Version* version, MgTab& tab);
 };
 
 END_NAMESPACE_MDFPARSER

Modified: sandbox/adsk/2.3r/Common/MdfParser/IOPointRule.cpp
===================================================================
--- sandbox/adsk/2.3r/Common/MdfParser/IOPointRule.cpp	2011-02-22 07:43:02 UTC (rev 5564)
+++ sandbox/adsk/2.3r/Common/MdfParser/IOPointRule.cpp	2011-02-25 21:46:04 UTC (rev 5565)
@@ -127,35 +127,35 @@
 }
 
 
-void IOPointRule::Write(MdfStream& fd, PointRule* pointRule, Version* version)
+void IOPointRule::Write(MdfStream& fd, PointRule* pointRule, Version* version, MgTab& tab)
 {
-    fd << tab() << startStr(sPointRule) << std::endl;
-    inctab();
+    fd << tab.tab() << startStr(sPointRule) << std::endl;
+    tab.inctab();
 
     // Property: LegendLabel
-    fd << tab() << startStr(sLegendLabel);
+    fd << tab.tab() << startStr(sLegendLabel);
     fd << EncodeString(pointRule->GetLegendLabel());
     fd << endStr(sLegendLabel) << std::endl;
 
     // Property: Filter
     if (!pointRule->GetFilter().empty())
     {
-        fd << tab() << startStr(sFilter);
+        fd << tab.tab() << startStr(sFilter);
         fd << EncodeString(pointRule->GetFilter());
         fd << endStr(sFilter) << std::endl;
     }
     // Property: Label
     if (pointRule->GetLabel() && pointRule->GetLabel()->GetSymbol())
-        IOLabel::Write(fd, pointRule->GetLabel(), version);
+        IOLabel::Write(fd, pointRule->GetLabel(), version, tab);
 
     // Property: Symbolization
     PointSymbolization2D* symbolization2D = static_cast<PointSymbolization2D*>(pointRule->GetSymbolization());
     if (symbolization2D)
-        IOPointSymbolization2D::Write(fd, symbolization2D, version);
+        IOPointSymbolization2D::Write(fd, symbolization2D, version, tab);
 
     // Write any unknown XML / extended data
-    IOUnknown::Write(fd, pointRule->GetUnknownXml(), version);
+    IOUnknown::Write(fd, pointRule->GetUnknownXml(), version, tab);
 
-    dectab();
-    fd << tab() << endStr(sPointRule) << std::endl;
+    tab.dectab();
+    fd << tab.tab() << endStr(sPointRule) << std::endl;
 }

Modified: sandbox/adsk/2.3r/Common/MdfParser/IOPointRule.h
===================================================================
--- sandbox/adsk/2.3r/Common/MdfParser/IOPointRule.h	2011-02-22 07:43:02 UTC (rev 5564)
+++ sandbox/adsk/2.3r/Common/MdfParser/IOPointRule.h	2011-02-25 21:46:04 UTC (rev 5565)
@@ -39,7 +39,7 @@
         virtual void ElementChars(const wchar_t* ch);
         virtual void EndElement(const wchar_t* name, HandlerStack* handlerStack);
 
-        static void Write(MdfStream& fd, PointRule* pointRule, Version* version);
+        static void Write(MdfStream& fd, PointRule* pointRule, Version* version, MgTab& tab);
 
     private:
         PointRule* m_pointRule;

Modified: sandbox/adsk/2.3r/Common/MdfParser/IOPointSymbolization2D.cpp
===================================================================
--- sandbox/adsk/2.3r/Common/MdfParser/IOPointSymbolization2D.cpp	2011-02-22 07:43:02 UTC (rev 5564)
+++ sandbox/adsk/2.3r/Common/MdfParser/IOPointSymbolization2D.cpp	2011-02-25 21:46:04 UTC (rev 5565)
@@ -144,10 +144,10 @@
 }
 
 
-void IOPointSymbolization2D::Write(MdfStream& fd, PointSymbolization2D* pointSymbolization2D, Version* version)
+void IOPointSymbolization2D::Write(MdfStream& fd, PointSymbolization2D* pointSymbolization2D, Version* version, MgTab& tab)
 {
-    fd << tab() << startStr(sPointSymbolization2D) << std::endl;
-    inctab();
+    fd << tab.tab() << startStr(sPointSymbolization2D) << std::endl;
+    tab.inctab();
 
     // Property: Symbol
     MarkSymbol* markSymbol = dynamic_cast<MarkSymbol*>(pointSymbolization2D->GetSymbol());
@@ -156,19 +156,19 @@
     W2DSymbol* w2DSymbol = dynamic_cast<W2DSymbol*>(pointSymbolization2D->GetSymbol());
     BlockSymbol* blockSymbol = dynamic_cast<BlockSymbol*>(pointSymbolization2D->GetSymbol());
     if (markSymbol)
-        IOMarkSymbol::Write(fd, markSymbol, version);
+        IOMarkSymbol::Write(fd, markSymbol, version, tab);
     else if (imageSymbol)
-        IOImageSymbol::Write(fd, imageSymbol, version);
+        IOImageSymbol::Write(fd, imageSymbol, version, tab);
     else if (fontSymbol)
-        IOFontSymbol::Write(fd, fontSymbol, version);
+        IOFontSymbol::Write(fd, fontSymbol, version, tab);
     else if (w2DSymbol)
-        IOW2DSymbol::Write(fd, w2DSymbol, version);
+        IOW2DSymbol::Write(fd, w2DSymbol, version, tab);
     else if (blockSymbol)
-        IOBlockSymbol::Write(fd, blockSymbol, version);
+        IOBlockSymbol::Write(fd, blockSymbol, version, tab);
 
     // Write any unknown XML / extended data
-    IOUnknown::Write(fd, pointSymbolization2D->GetUnknownXml(), version);
+    IOUnknown::Write(fd, pointSymbolization2D->GetUnknownXml(), version, tab);
 
-    dectab();
-    fd << tab() << endStr(sPointSymbolization2D) << std::endl;
+    tab.dectab();
+    fd << tab.tab() << endStr(sPointSymbolization2D) << std::endl;
 }

Modified: sandbox/adsk/2.3r/Common/MdfParser/IOPointSymbolization2D.h
===================================================================
--- sandbox/adsk/2.3r/Common/MdfParser/IOPointSymbolization2D.h	2011-02-22 07:43:02 UTC (rev 5564)
+++ sandbox/adsk/2.3r/Common/MdfParser/IOPointSymbolization2D.h	2011-02-25 21:46:04 UTC (rev 5565)
@@ -40,7 +40,7 @@
         virtual void ElementChars(const wchar_t* ch);
         virtual void EndElement(const wchar_t* name, HandlerStack* handlerStack);
 
-        static void Write(MdfStream& fd, PointSymbolization2D* pointSymbolization2D, Version* version);
+        static void Write(MdfStream& fd, PointSymbolization2D* pointSymbolization2D, Version* version, MgTab& tab);
 
     private:
         PointSymbolization2D* m_pointSymbolization2D;

Modified: sandbox/adsk/2.3r/Common/MdfParser/IOPointTypeStyle.cpp
===================================================================
--- sandbox/adsk/2.3r/Common/MdfParser/IOPointTypeStyle.cpp	2011-02-22 07:43:02 UTC (rev 5564)
+++ sandbox/adsk/2.3r/Common/MdfParser/IOPointTypeStyle.cpp	2011-02-25 21:46:04 UTC (rev 5565)
@@ -122,48 +122,48 @@
 }
 
 
-void IOPointTypeStyle::Write(MdfStream& fd, PointTypeStyle* pointTypeStyle, Version* version)
+void IOPointTypeStyle::Write(MdfStream& fd, PointTypeStyle* pointTypeStyle, Version* version, MgTab& tab)
 {
-    fd << tab() << startStr(sPointTypeStyle) << std::endl;
-    inctab();
+    fd << tab.tab() << startStr(sPointTypeStyle) << std::endl;
+    tab.inctab();
 
     MdfStringStream fdExtData;
 
     // Property: DisplayAsText
-    fd << tab() << startStr(sDisplayAsText);
+    fd << tab.tab() << startStr(sDisplayAsText);
     fd << BoolToStr(pointTypeStyle->IsDisplayAsText());
     fd << endStr(sDisplayAsText) << std::endl;
 
     // Property: AllowOverpost
-    fd << tab() << startStr(sAllowOverpost);
+    fd << tab.tab() << startStr(sAllowOverpost);
     fd << BoolToStr(pointTypeStyle->IsAllowOverpost());
     fd << endStr(sAllowOverpost) << std::endl;
 
     // Property: Rules
     for (int i=0; i<pointTypeStyle->GetRules()->GetCount(); ++i)
-        IOPointRule::Write(fd, static_cast<PointRule*>(pointTypeStyle->GetRules()->GetAt(i)), version);
+        IOPointRule::Write(fd, static_cast<PointRule*>(pointTypeStyle->GetRules()->GetAt(i)), version, tab);
 
     // Property: ShowInLegend
     if (!version || (*version >= Version(1, 3, 0)))
     {
         // version 1.3.0 has a ShowInLegend Property
-        fd << tab() << startStr(sShowInLegend);
+        fd << tab.tab() << startStr(sShowInLegend);
         fd << BoolToStr(pointTypeStyle->IsShowInLegend());
         fd << endStr(sShowInLegend) << std::endl;
     }
     else if (*version >= Version(1, 0, 0))
     {
         // save ShowInLegend as extended data for LDF versions 1.0.0, 1.1.0, and 1.2.0
-        inctab();
-        fdExtData << tab() << startStr(sShowInLegend);
+        tab.inctab();
+        fdExtData << tab.tab() << startStr(sShowInLegend);
         fdExtData << BoolToStr(pointTypeStyle->IsShowInLegend());
         fdExtData << endStr(sShowInLegend) << std::endl;
-        dectab();
+        tab.dectab();
     }
 
     // Write any unknown XML / extended data
-    IOUnknown::Write(fd, pointTypeStyle->GetUnknownXml(), fdExtData.str(), version);
+    IOUnknown::Write(fd, pointTypeStyle->GetUnknownXml(), fdExtData.str(), version, tab);
 
-    dectab();
-    fd << tab() << endStr(sPointTypeStyle) << std::endl;
+    tab.dectab();
+    fd << tab.tab() << endStr(sPointTypeStyle) << std::endl;
 }

Modified: sandbox/adsk/2.3r/Common/MdfParser/IOPointTypeStyle.h
===================================================================
--- sandbox/adsk/2.3r/Common/MdfParser/IOPointTypeStyle.h	2011-02-22 07:43:02 UTC (rev 5564)
+++ sandbox/adsk/2.3r/Common/MdfParser/IOPointTypeStyle.h	2011-02-25 21:46:04 UTC (rev 5565)
@@ -39,7 +39,7 @@
         virtual void ElementChars(const wchar_t* ch);
         virtual void EndElement(const wchar_t* name, HandlerStack* handlerStack);
 
-        static void Write(MdfStream& fd, PointTypeStyle* pointTypeStyle, Version* version);
+        static void Write(MdfStream& fd, PointTypeStyle* pointTypeStyle, Version* version, MgTab& tab);
 
     private:
         PointTypeStyle* m_pointTypeStyle;

Modified: sandbox/adsk/2.3r/Common/MdfParser/IOPointUsage.cpp
===================================================================
--- sandbox/adsk/2.3r/Common/MdfParser/IOPointUsage.cpp	2011-02-22 07:43:02 UTC (rev 5564)
+++ sandbox/adsk/2.3r/Common/MdfParser/IOPointUsage.cpp	2011-02-25 21:46:04 UTC (rev 5565)
@@ -79,19 +79,19 @@
 }
 
 
-void IOPointUsage::Write(MdfStream& fd, PointUsage* pointUsage, Version* version)
+void IOPointUsage::Write(MdfStream& fd, PointUsage* pointUsage, Version* version, MgTab& tab)
 {
-    fd << tab() << "<PointUsage>" << std::endl; // NOXLATE
-    inctab();
+    fd << tab.tab() << "<PointUsage>" << std::endl; // NOXLATE
+    tab.inctab();
 
-    EMIT_STRING_PROPERTY(fd, pointUsage, AngleControl, true, PointUsage::sAngleControlDefault)
-    EMIT_DOUBLE_PROPERTY(fd, pointUsage, Angle, true, 0.0)          // default is 0.0
-    EMIT_DOUBLE_PROPERTY(fd, pointUsage, OriginOffsetX, true, 0.0)  // default is 0.0
-    EMIT_DOUBLE_PROPERTY(fd, pointUsage, OriginOffsetY, true, 0.0)  // default is 0.0
+    EMIT_STRING_PROPERTY(fd, pointUsage, AngleControl, true, PointUsage::sAngleControlDefault, tab)
+    EMIT_DOUBLE_PROPERTY(fd, pointUsage, Angle, true, 0.0, tab)          // default is 0.0
+    EMIT_DOUBLE_PROPERTY(fd, pointUsage, OriginOffsetX, true, 0.0, tab)  // default is 0.0
+    EMIT_DOUBLE_PROPERTY(fd, pointUsage, OriginOffsetY, true, 0.0, tab)  // default is 0.0
 
     // Write any unknown XML / extended data
-    IOUnknown::Write(fd, pointUsage->GetUnknownXml(), version);
+    IOUnknown::Write(fd, pointUsage->GetUnknownXml(), version, tab);
 
-    dectab();
-    fd << tab() << "</PointUsage>" << std::endl; // NOXLATE
+    tab.dectab();
+    fd << tab.tab() << "</PointUsage>" << std::endl; // NOXLATE
 }

Modified: sandbox/adsk/2.3r/Common/MdfParser/IOPointUsage.h
===================================================================
--- sandbox/adsk/2.3r/Common/MdfParser/IOPointUsage.h	2011-02-22 07:43:02 UTC (rev 5564)
+++ sandbox/adsk/2.3r/Common/MdfParser/IOPointUsage.h	2011-02-25 21:46:04 UTC (rev 5565)
@@ -37,7 +37,7 @@
         virtual void ElementChars(const wchar_t* ch);
         virtual void EndElement(const wchar_t* name, HandlerStack* handlerStack);
 
-        static void Write(MdfStream& fd, PointUsage* pointUsage, Version* version);
+        static void Write(MdfStream& fd, PointUsage* pointUsage, Version* version, MgTab& tab);
 
     private:
         SimpleSymbolDefinition* m_symbolDefinition;

Modified: sandbox/adsk/2.3r/Common/MdfParser/IORelateProperty.cpp
===================================================================
--- sandbox/adsk/2.3r/Common/MdfParser/IORelateProperty.cpp	2011-02-22 07:43:02 UTC (rev 5564)
+++ sandbox/adsk/2.3r/Common/MdfParser/IORelateProperty.cpp	2011-02-25 21:46:04 UTC (rev 5565)
@@ -113,25 +113,25 @@
 }
 
 
-void IORelateProperty::Write(MdfStream& fd, RelateProperty* relateProperty, Version* version)
+void IORelateProperty::Write(MdfStream& fd, RelateProperty* relateProperty, Version* version, MgTab& tab)
 {
-    fd << tab() << startStr(sRelateProperty) << std::endl;
-    inctab();
+    fd << tab.tab() << startStr(sRelateProperty) << std::endl;
+    tab.inctab();
 
     // Property: FeatureClassProperty
-    fd << tab() << startStr(sFeatureClassProperty);
+    fd << tab.tab() << startStr(sFeatureClassProperty);
     // use false parameter to get the complete property name with the prefix
     fd << EncodeString(relateProperty->GetFeatureClassProperty(false));
     fd << endStr(sFeatureClassProperty) << std::endl;
 
     // Property: AttributeClassProperty
-    fd << tab() << startStr(sAttributeClassProperty);
+    fd << tab.tab() << startStr(sAttributeClassProperty);
     fd << EncodeString(relateProperty->GetAttributeClassProperty());
     fd << endStr(sAttributeClassProperty) << std::endl;
 
     // Write any unknown XML / extended data
-    IOUnknown::Write(fd, relateProperty->GetUnknownXml(), version);
+    IOUnknown::Write(fd, relateProperty->GetUnknownXml(), version, tab);
 
-    dectab();
-    fd << tab() << endStr(sRelateProperty) << std::endl;
+    tab.dectab();
+    fd << tab.tab() << endStr(sRelateProperty) << std::endl;
 }

Modified: sandbox/adsk/2.3r/Common/MdfParser/IORelateProperty.h
===================================================================
--- sandbox/adsk/2.3r/Common/MdfParser/IORelateProperty.h	2011-02-22 07:43:02 UTC (rev 5564)
+++ sandbox/adsk/2.3r/Common/MdfParser/IORelateProperty.h	2011-02-25 21:46:04 UTC (rev 5565)
@@ -39,7 +39,7 @@
         virtual void ElementChars(const wchar_t* ch);
         virtual void EndElement(const wchar_t* name, HandlerStack* handlerStack);
 
-        static void Write(MdfStream& fd, RelateProperty* relateProperty, Version* version);
+        static void Write(MdfStream& fd, RelateProperty* relateProperty, Version* version, MgTab& tab);
 
     private:
         RelateProperty* m_relateProperty;

Modified: sandbox/adsk/2.3r/Common/MdfParser/IOResizeBox.cpp
===================================================================
--- sandbox/adsk/2.3r/Common/MdfParser/IOResizeBox.cpp	2011-02-22 07:43:02 UTC (rev 5564)
+++ sandbox/adsk/2.3r/Common/MdfParser/IOResizeBox.cpp	2011-02-25 21:46:04 UTC (rev 5565)
@@ -85,20 +85,20 @@
 }
 
 
-void IOResizeBox::Write(MdfStream& fd, ResizeBox* resizeBox, Version* version)
+void IOResizeBox::Write(MdfStream& fd, ResizeBox* resizeBox, Version* version, MgTab& tab)
 {
-    fd << tab() << "<ResizeBox>" << std::endl; // NOXLATE
-    inctab();
+    fd << tab.tab() << "<ResizeBox>" << std::endl; // NOXLATE
+    tab.inctab();
 
-    EMIT_DOUBLE_PROPERTY(fd, resizeBox, SizeX, false, 1.0)
-    EMIT_DOUBLE_PROPERTY(fd, resizeBox, SizeY, false, 1.0)
-    EMIT_DOUBLE_PROPERTY(fd, resizeBox, PositionX, false, 0.0)
-    EMIT_DOUBLE_PROPERTY(fd, resizeBox, PositionY, false, 0.0)
-    EMIT_STRING_PROPERTY(fd, resizeBox, GrowControl, false, NULL)
+    EMIT_DOUBLE_PROPERTY(fd, resizeBox, SizeX, false, 1.0, tab)
+    EMIT_DOUBLE_PROPERTY(fd, resizeBox, SizeY, false, 1.0, tab)
+    EMIT_DOUBLE_PROPERTY(fd, resizeBox, PositionX, false, 0.0, tab)
+    EMIT_DOUBLE_PROPERTY(fd, resizeBox, PositionY, false, 0.0, tab)
+    EMIT_STRING_PROPERTY(fd, resizeBox, GrowControl, false, NULL, tab)
 
     // Write any unknown XML / extended data
-    IOUnknown::Write(fd, resizeBox->GetUnknownXml(), version);
+    IOUnknown::Write(fd, resizeBox->GetUnknownXml(), version, tab);
 
-    dectab();
-    fd << tab() << "</ResizeBox>" << std::endl; // NOXLATE
+    tab.dectab();
+    fd << tab.tab() << "</ResizeBox>" << std::endl; // NOXLATE
 }

Modified: sandbox/adsk/2.3r/Common/MdfParser/IOResizeBox.h
===================================================================
--- sandbox/adsk/2.3r/Common/MdfParser/IOResizeBox.h	2011-02-22 07:43:02 UTC (rev 5564)
+++ sandbox/adsk/2.3r/Common/MdfParser/IOResizeBox.h	2011-02-25 21:46:04 UTC (rev 5565)
@@ -38,7 +38,7 @@
         virtual void ElementChars(const wchar_t* ch);
         virtual void EndElement(const wchar_t* name, HandlerStack* handlerStack);
 
-        static void Write(MdfStream& fd, ResizeBox* resizeBox, Version* version);
+        static void Write(MdfStream& fd, ResizeBox* resizeBox, Version* version, MgTab& tab);
 
     private:
         SimpleSymbolDefinition* m_symbolDefinition;

Modified: sandbox/adsk/2.3r/Common/MdfParser/IOResourceRef.cpp
===================================================================
--- sandbox/adsk/2.3r/Common/MdfParser/IOResourceRef.cpp	2011-02-22 07:43:02 UTC (rev 5564)
+++ sandbox/adsk/2.3r/Common/MdfParser/IOResourceRef.cpp	2011-02-25 21:46:04 UTC (rev 5565)
@@ -82,24 +82,24 @@
 }
 
 
-void IOResourceRef::Write(MdfStream& fd, std::string name, std::wstring resourceId, std::wstring itemName, bool mandatory, Version* version)
+void IOResourceRef::Write(MdfStream& fd, std::string name, std::wstring resourceId, std::wstring itemName, bool mandatory, Version* version, MgTab& tab)
 {
-    fd << tab() << startStr(name) << std::endl;
-    inctab();
+    fd << tab.tab() << startStr(name) << std::endl;
+    tab.inctab();
 
     // Property: ResourceId
-    fd << tab() << startStr(sResourceId);
+    fd << tab.tab() << startStr(sResourceId);
     fd << EncodeString(resourceId);
     fd << endStr(sResourceId) << std::endl;
 
     // Property: LibraryItemName
     if (!itemName.empty() || mandatory)
     {
-        fd << tab() << startStr(sLibraryItemName);
+        fd << tab.tab() << startStr(sLibraryItemName);
         fd << EncodeString(itemName);
         fd << endStr(sLibraryItemName) << std::endl;
     }
 
-    dectab();
-    fd << tab() << endStr(name) <<std::endl;
+    tab.dectab();
+    fd << tab.tab() << endStr(name) <<std::endl;
 }

Modified: sandbox/adsk/2.3r/Common/MdfParser/IOResourceRef.h
===================================================================
--- sandbox/adsk/2.3r/Common/MdfParser/IOResourceRef.h	2011-02-22 07:43:02 UTC (rev 5564)
+++ sandbox/adsk/2.3r/Common/MdfParser/IOResourceRef.h	2011-02-25 21:46:04 UTC (rev 5565)
@@ -38,7 +38,7 @@
         virtual void ElementChars(const wchar_t* ch);
         virtual void EndElement(const wchar_t* name, HandlerStack* handlerStack);
 
-        static void Write(MdfStream& fd, std::string name, std::wstring resourceId, std::wstring itemName, bool mandatory, Version* version);
+        static void Write(MdfStream& fd, std::string name, std::wstring resourceId, std::wstring itemName, bool mandatory, Version* version, MgTab& tab);
 
     private:
         std::wstring m_elementName;

Modified: sandbox/adsk/2.3r/Common/MdfParser/IOSimpleSymbol.cpp
===================================================================
--- sandbox/adsk/2.3r/Common/MdfParser/IOSimpleSymbol.cpp	2011-02-22 07:43:02 UTC (rev 5564)
+++ sandbox/adsk/2.3r/Common/MdfParser/IOSimpleSymbol.cpp	2011-02-25 21:46:04 UTC (rev 5565)
@@ -86,24 +86,24 @@
 }
 
 
-void IOSimpleSymbol::Write(MdfStream& fd, SimpleSymbol* simpleSymbol, Version* version)
+void IOSimpleSymbol::Write(MdfStream& fd, SimpleSymbol* simpleSymbol, Version* version, MgTab& tab)
 {
-    fd << tab() << "<SimpleSymbol>" << std::endl; // NOXLATE
-    inctab();
+    fd << tab.tab() << "<SimpleSymbol>" << std::endl; // NOXLATE
+    tab.inctab();
 
     // we must write either a symbol definition or reference, but not both
     if (simpleSymbol->GetSymbolDefinition())
-        IOSimpleSymbolDefinition::Write(fd, simpleSymbol->GetSymbolDefinition(), false, version);
+        IOSimpleSymbolDefinition::Write(fd, simpleSymbol->GetSymbolDefinition(), false, version, tab);
     else
     {
-        EMIT_STRING_PROPERTY(fd, simpleSymbol, ResourceId, false, NULL)
+        EMIT_STRING_PROPERTY(fd, simpleSymbol, ResourceId, false, NULL, tab)
     }
 
-    EMIT_INTEGER_PROPERTY(fd, simpleSymbol, RenderingPass, true, 0) // default is 0
+    EMIT_INTEGER_PROPERTY(fd, simpleSymbol, RenderingPass, true, 0, tab) // default is 0
 
     // Write any unknown XML / extended data
-    IOUnknown::Write(fd, simpleSymbol->GetUnknownXml(), version);
+    IOUnknown::Write(fd, simpleSymbol->GetUnknownXml(), version, tab);
 
-    dectab();
-    fd << tab() << "</SimpleSymbol>" << std::endl; // NOXLATE
+    tab.dectab();
+    fd << tab.tab() << "</SimpleSymbol>" << std::endl; // NOXLATE
 }

Modified: sandbox/adsk/2.3r/Common/MdfParser/IOSimpleSymbol.h
===================================================================
--- sandbox/adsk/2.3r/Common/MdfParser/IOSimpleSymbol.h	2011-02-22 07:43:02 UTC (rev 5564)
+++ sandbox/adsk/2.3r/Common/MdfParser/IOSimpleSymbol.h	2011-02-25 21:46:04 UTC (rev 5565)
@@ -36,7 +36,7 @@
         virtual void ElementChars(const wchar_t* ch);
         virtual void EndElement(const wchar_t* name, HandlerStack* handlerStack);
 
-        static void Write(MdfStream& fd, SimpleSymbol* simpleSymbol, Version* version);
+        static void Write(MdfStream& fd, SimpleSymbol* simpleSymbol, Version* version, MgTab& tab);
 
     private:
         SimpleSymbolCollection* m_symbolCollection;

Modified: sandbox/adsk/2.3r/Common/MdfParser/IOSimpleSymbolDefinition.cpp
===================================================================
--- sandbox/adsk/2.3r/Common/MdfParser/IOSimpleSymbolDefinition.cpp	2011-02-22 07:43:02 UTC (rev 5564)
+++ sandbox/adsk/2.3r/Common/MdfParser/IOSimpleSymbolDefinition.cpp	2011-02-25 21:46:04 UTC (rev 5565)
@@ -115,7 +115,7 @@
 }
 
 
-void IOSimpleSymbolDefinition::Write(MdfStream& fd, SimpleSymbolDefinition* symbolDefinition, bool writeAsRootElement, Version* version)
+void IOSimpleSymbolDefinition::Write(MdfStream& fd, SimpleSymbolDefinition* symbolDefinition, bool writeAsRootElement, Version* version, MgTab& tab)
 {
     if (writeAsRootElement)
     {
@@ -142,34 +142,34 @@
             strVersion = L"1.1.0";
         }
 
-        fd << tab() << "<SimpleSymbolDefinition xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"SymbolDefinition-" << EncodeString(strVersion) << ".xsd\" version=\"" << EncodeString(strVersion) << "\">" << std::endl; // NOXLATE
+        fd << tab.tab() << "<SimpleSymbolDefinition xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"SymbolDefinition-" << EncodeString(strVersion) << ".xsd\" version=\"" << EncodeString(strVersion) << "\">" << std::endl; // NOXLATE
     }
     else
-        fd << tab() << "<SimpleSymbolDefinition>" << std::endl; // NOXLATE
-    inctab();
+        fd << tab.tab() << "<SimpleSymbolDefinition>" << std::endl; // NOXLATE
+    tab.inctab();
 
-    EMIT_STRING_PROPERTY(fd, symbolDefinition, Name, false, NULL)
-    EMIT_STRING_PROPERTY(fd, symbolDefinition, Description, true, L"") // default is empty string
+    EMIT_STRING_PROPERTY(fd, symbolDefinition, Name, false, NULL, tab)
+    EMIT_STRING_PROPERTY(fd, symbolDefinition, Description, true, L"", tab) // default is empty string
 
-    IOGraphicElementCollection::Write(fd, symbolDefinition->GetGraphics(), version);
+    IOGraphicElementCollection::Write(fd, symbolDefinition->GetGraphics(), version, tab);
 
     if (symbolDefinition->GetResizeBox())
-        IOResizeBox::Write(fd, symbolDefinition->GetResizeBox(), version);
+        IOResizeBox::Write(fd, symbolDefinition->GetResizeBox(), version, tab);
 
     if (symbolDefinition->GetPointUsage())
-        IOPointUsage::Write(fd, symbolDefinition->GetPointUsage(), version);
+        IOPointUsage::Write(fd, symbolDefinition->GetPointUsage(), version, tab);
 
     if (symbolDefinition->GetLineUsage())
-        IOLineUsage::Write(fd, symbolDefinition->GetLineUsage(), version);
+        IOLineUsage::Write(fd, symbolDefinition->GetLineUsage(), version, tab);
 
     if (symbolDefinition->GetAreaUsage())
-        IOAreaUsage::Write(fd, symbolDefinition->GetAreaUsage(), version);
+        IOAreaUsage::Write(fd, symbolDefinition->GetAreaUsage(), version, tab);
 
-    IOParameterCollection::Write(fd, symbolDefinition->GetParameterDefinition(), version);
+    IOParameterCollection::Write(fd, symbolDefinition->GetParameterDefinition(), version, tab);
 
     // Write any unknown XML / extended data
-    IOUnknown::Write(fd, symbolDefinition->GetUnknownXml(), version);
+    IOUnknown::Write(fd, symbolDefinition->GetUnknownXml(), version, tab);
 
-    dectab();
-    fd << tab() << "</SimpleSymbolDefinition>" << std::endl; // NOXLATE
+    tab.dectab();
+    fd << tab.tab() << "</SimpleSymbolDefinition>" << std::endl; // NOXLATE
 }

Modified: sandbox/adsk/2.3r/Common/MdfParser/IOSimpleSymbolDefinition.h
===================================================================
--- sandbox/adsk/2.3r/Common/MdfParser/IOSimpleSymbolDefinition.h	2011-02-22 07:43:02 UTC (rev 5564)
+++ sandbox/adsk/2.3r/Common/MdfParser/IOSimpleSymbolDefinition.h	2011-02-25 21:46:04 UTC (rev 5565)
@@ -36,7 +36,7 @@
         virtual void ElementChars(const wchar_t* ch);
         virtual void EndElement(const wchar_t* name, HandlerStack* handlerStack);
 
-        static void Write(MdfStream& fd, SimpleSymbolDefinition* symbolDefinition, bool writeAsRootElement, Version* version);
+        static void Write(MdfStream& fd, SimpleSymbolDefinition* symbolDefinition, bool writeAsRootElement, Version* version, MgTab& tab);
 
     private:
         SimpleSymbolDefinition* m_symbolDefinition;

Modified: sandbox/adsk/2.3r/Common/MdfParser/IOStroke.cpp
===================================================================
--- sandbox/adsk/2.3r/Common/MdfParser/IOStroke.cpp	2011-02-22 07:43:02 UTC (rev 5564)
+++ sandbox/adsk/2.3r/Common/MdfParser/IOStroke.cpp	2011-02-25 21:46:04 UTC (rev 5565)
@@ -131,30 +131,30 @@
 }
 
 
-void IOStroke::Write(MdfStream& fd, Stroke* stroke, std::string name, Version* version)
+void IOStroke::Write(MdfStream& fd, Stroke* stroke, std::string name, Version* version, MgTab& tab)
 {
-    fd << tab() << startStr(name) << std::endl;
-    inctab();
+    fd << tab.tab() << startStr(name) << std::endl;
+    tab.inctab();
 
     MdfStringStream fdExtData;
 
     // Property: LineStyle
-    fd << tab() << startStr(sLineStyle);
+    fd << tab.tab() << startStr(sLineStyle);
     fd << EncodeString(stroke->GetLineStyle());
     fd << endStr(sLineStyle) << std::endl;
 
     // Property: Thickness
-    fd << tab() << startStr(sThickness);
+    fd << tab.tab() << startStr(sThickness);
     fd << EncodeString(stroke->GetThickness());
     fd << endStr(sThickness) << std::endl;
 
     // Property: ForegroundColor
-    fd << tab() << startStr(sColor);
+    fd << tab.tab() << startStr(sColor);
     fd << EncodeString(stroke->GetColor());
     fd << endStr(sColor) << std::endl;
 
     // Property: Unit
-    fd << tab() << startStr(sUnit);
+    fd << tab.tab() << startStr(sUnit);
     std::auto_ptr<MdfString> str(LengthConverter::UnitToEnglish(stroke->GetUnit()));
     fd << EncodeString(*str);
     fd << endStr(sUnit) << std::endl;
@@ -163,7 +163,7 @@
     if (!version || (*version >= Version(1, 1, 0)))
     {
         // only write SizeContext if the LDF version is 1.1.0 or greater
-        fd << tab() << startStr(sSizeContext);
+        fd << tab.tab() << startStr(sSizeContext);
         if (stroke->GetSizeContext() == MdfModel::MappingUnits)
             fd << "MappingUnits"; // NOXLATE
         else
@@ -173,21 +173,21 @@
     else if (*version == Version(1, 0, 0))
     {
         // save SizeContext as extended data for LDF version 1.0.0
-        inctab();
+        tab.inctab();
 
-        fdExtData << tab() << startStr(sSizeContext);
+        fdExtData << tab.tab() << startStr(sSizeContext);
         if (stroke->GetSizeContext() == MdfModel::MappingUnits)
             fdExtData << "MappingUnits"; // NOXLATE
         else
             fdExtData << "DeviceUnits"; // NOXLATE
         fdExtData << endStr(sSizeContext) << std::endl;
 
-        dectab();
+        tab.dectab();
     }
 
     // Write the unknown XML / extended data
-    IOUnknown::Write(fd, stroke->GetUnknownXml(), fdExtData.str(), version);
+    IOUnknown::Write(fd, stroke->GetUnknownXml(), fdExtData.str(), version, tab);
 
-    dectab();
-    fd << tab() << endStr(name) << std::endl;
+    tab.dectab();
+    fd << tab.tab() << endStr(name) << std::endl;
 }

Modified: sandbox/adsk/2.3r/Common/MdfParser/IOStroke.h
===================================================================
--- sandbox/adsk/2.3r/Common/MdfParser/IOStroke.h	2011-02-22 07:43:02 UTC (rev 5564)
+++ sandbox/adsk/2.3r/Common/MdfParser/IOStroke.h	2011-02-25 21:46:04 UTC (rev 5565)
@@ -38,7 +38,7 @@
         virtual void ElementChars(const wchar_t* ch);
         virtual void EndElement(const wchar_t* name, HandlerStack* handlerStack);
 
-        static void Write(MdfStream& fd, Stroke* stroke, std::string name, Version* version);
+        static void Write(MdfStream& fd, Stroke* stroke, std::string name, Version* version, MgTab& tab);
 
     private:
         Stroke* m_stroke;

Modified: sandbox/adsk/2.3r/Common/MdfParser/IOSupplementalSpatialContextInfo.cpp
===================================================================
--- sandbox/adsk/2.3r/Common/MdfParser/IOSupplementalSpatialContextInfo.cpp	2011-02-22 07:43:02 UTC (rev 5564)
+++ sandbox/adsk/2.3r/Common/MdfParser/IOSupplementalSpatialContextInfo.cpp	2011-02-25 21:46:04 UTC (rev 5565)
@@ -111,24 +111,24 @@
 }
 
 
-void IOSupplementalSpatialContextInfo::Write(MdfStream& fd, SupplementalSpatialContextInfo* ssContextInfo, Version* version)
+void IOSupplementalSpatialContextInfo::Write(MdfStream& fd, SupplementalSpatialContextInfo* ssContextInfo, Version* version, MgTab& tab)
 {
-    fd << tab() << startStr(sSupplementalSpatialContextInfo) << std::endl;
-    inctab();
+    fd << tab.tab() << startStr(sSupplementalSpatialContextInfo) << std::endl;
+    tab.inctab();
 
     // Property: Name
-    fd << tab() << startStr(sName);
+    fd << tab.tab() << startStr(sName);
     fd << EncodeString(ssContextInfo->GetName());
     fd << endStr(sName) << std::endl;
 
     // Property: CoordinateSystem
-    fd << tab() << startStr(sCoordinateSystem);
+    fd << tab.tab() << startStr(sCoordinateSystem);
     fd << EncodeString(ssContextInfo->GetCoordinateSystem());
     fd << endStr(sCoordinateSystem) << std::endl;
 
     // Write any unknown XML / extended data
-    IOUnknown::Write(fd, ssContextInfo->GetUnknownXml(), version);
+    IOUnknown::Write(fd, ssContextInfo->GetUnknownXml(), version, tab);
 
-    dectab();
-    fd << tab() << endStr(sSupplementalSpatialContextInfo) << std::endl;
+    tab.dectab();
+    fd << tab.tab() << endStr(sSupplementalSpatialContextInfo) << std::endl;
 }

Modified: sandbox/adsk/2.3r/Common/MdfParser/IOSupplementalSpatialContextInfo.h
===================================================================
--- sandbox/adsk/2.3r/Common/MdfParser/IOSupplementalSpatialContextInfo.h	2011-02-22 07:43:02 UTC (rev 5564)
+++ sandbox/adsk/2.3r/Common/MdfParser/IOSupplementalSpatialContextInfo.h	2011-02-25 21:46:04 UTC (rev 5565)
@@ -39,7 +39,7 @@
         virtual void ElementChars(const wchar_t* ch);
         virtual void EndElement(const wchar_t* name, HandlerStack* handlerStack);
 
-        static void Write(MdfStream& fd, SupplementalSpatialContextInfo* ssContextInfo, Version* version);
+        static void Write(MdfStream& fd, SupplementalSpatialContextInfo* ssContextInfo, Version* version, MgTab& tab);
 
     private:
         SupplementalSpatialContextInfo* m_ssContextInfo;

Modified: sandbox/adsk/2.3r/Common/MdfParser/IOSymbol.cpp
===================================================================
--- sandbox/adsk/2.3r/Common/MdfParser/IOSymbol.cpp	2011-02-22 07:43:02 UTC (rev 5564)
+++ sandbox/adsk/2.3r/Common/MdfParser/IOSymbol.cpp	2011-02-25 21:46:04 UTC (rev 5565)
@@ -64,16 +64,16 @@
 }
 
 
-void IOSymbol::Write(MdfStream& fd, Symbol* symbol, Version* version)
+void IOSymbol::Write(MdfStream& fd, Symbol* symbol, Version* version, MgTab& tab)
 {
     // Property: Unit
-    fd << tab() << "<Unit>"; // NOXLATE
+    fd << tab.tab() << "<Unit>"; // NOXLATE
     std::auto_ptr<MdfString> str(LengthConverter::UnitToEnglish(symbol->GetUnit()));
     fd << EncodeString(*str);
     fd << "</Unit>" << std::endl; // NOXLATE
 
     // Property: SizeContext
-    fd << tab() << "<SizeContext>"; // NOXLATE
+    fd << tab.tab() << "<SizeContext>"; // NOXLATE
     if (symbol->GetSizeContext() == MdfModel::MappingUnits)
         fd << "MappingUnits"; // NOXLATE
     else
@@ -81,24 +81,24 @@
     fd << "</SizeContext>" << std::endl; // NOXLATE
 
     // Property: SizeX
-    fd << tab() << "<SizeX>"; // NOXLATE
+    fd << tab.tab() << "<SizeX>"; // NOXLATE
     fd << EncodeString(symbol->GetSizeX());
     fd << "</SizeX>" << std::endl; // NOXLATE
 
     // Property: SizeY
-    fd << tab() << "<SizeY>"; // NOXLATE
+    fd << tab.tab() << "<SizeY>"; // NOXLATE
     fd << EncodeString(symbol->GetSizeY());
     fd << "</SizeY>" << std::endl; // NOXLATE
 
     // Property: Rotation (optional)
-    fd << tab() << "<Rotation>"; // NOXLATE
+    fd << tab.tab() << "<Rotation>"; // NOXLATE
     fd << EncodeString(symbol->GetRotation());
     fd << "</Rotation>" << std::endl; // NOXLATE
 
     // Property: MaintainAspect (optional)
     if (symbol->GetMaintainAspect() == false)
     {
-        fd << tab() << "<MaintainAspect>"; // NOXLATE
+        fd << tab.tab() << "<MaintainAspect>"; // NOXLATE
         fd << BoolToStr(false);
         fd << "</MaintainAspect>" << std::endl; // NOXLATE
     }
@@ -106,7 +106,7 @@
     // Property: InsertionPointX (optional)
     if (wstrToDouble(symbol->GetInsertionPointX().c_str()) != 0.5)
     {
-        fd << tab() << "<InsertionPointX>"; // NOXLATE
+        fd << tab.tab() << "<InsertionPointX>"; // NOXLATE
         fd << EncodeString(symbol->GetInsertionPointX());
         fd << "</InsertionPointX>" << std::endl; // NOXLATE
     }
@@ -114,7 +114,7 @@
     // Property: InsertionPointY (optional)
     if (wstrToDouble(symbol->GetInsertionPointY().c_str()) != 0.5)
     {
-        fd << tab() << "<InsertionPointY>"; // NOXLATE
+        fd << tab.tab() << "<InsertionPointY>"; // NOXLATE
         fd << EncodeString(symbol->GetInsertionPointY());
         fd << "</InsertionPointY>" << std::endl; // NOXLATE
     }

Modified: sandbox/adsk/2.3r/Common/MdfParser/IOSymbol.h
===================================================================
--- sandbox/adsk/2.3r/Common/MdfParser/IOSymbol.h	2011-02-22 07:43:02 UTC (rev 5564)
+++ sandbox/adsk/2.3r/Common/MdfParser/IOSymbol.h	2011-02-25 21:46:04 UTC (rev 5565)
@@ -35,7 +35,7 @@
 
         Symbol* GetSymbol();
 
-        static void Write(MdfStream& fd, Symbol* symbol, Version* version);
+        static void Write(MdfStream& fd, Symbol* symbol, Version* version, MgTab& tab);
 
     protected:
         Symbol* m_symbol;

Modified: sandbox/adsk/2.3r/Common/MdfParser/IOSymbolInstance.cpp
===================================================================
--- sandbox/adsk/2.3r/Common/MdfParser/IOSymbolInstance.cpp	2011-02-22 07:43:02 UTC (rev 5564)
+++ sandbox/adsk/2.3r/Common/MdfParser/IOSymbolInstance.cpp	2011-02-25 21:46:04 UTC (rev 5565)
@@ -176,10 +176,10 @@
 }
 
 
-void IOSymbolInstance::Write(MdfStream& fd, SymbolInstance* symbolInstance, Version* version)
+void IOSymbolInstance::Write(MdfStream& fd, SymbolInstance* symbolInstance, Version* version, MgTab& tab)
 {
-    fd << tab() << "<SymbolInstance>" << std::endl; // NOXLATE
-    inctab();
+    fd << tab.tab() << "<SymbolInstance>" << std::endl; // NOXLATE
+    tab.inctab();
 
     MdfStringStream fdExtData;
 
@@ -195,39 +195,39 @@
         CompoundSymbolDefinition* compoundSymbol = dynamic_cast<CompoundSymbolDefinition*>(symbol);
 
         if (simpleSymbol)
-            IOSimpleSymbolDefinition::Write(fd, simpleSymbol, false, &sdVersion);
+            IOSimpleSymbolDefinition::Write(fd, simpleSymbol, false, &sdVersion,tab);
         else if (compoundSymbol)
-            IOCompoundSymbolDefinition::Write(fd, compoundSymbol, false, &sdVersion);
+            IOCompoundSymbolDefinition::Write(fd, compoundSymbol, false, &sdVersion, tab);
     }
     else
     {
-        EMIT_STRING_PROPERTY(fd, symbolInstance, ResourceId, false, NULL)
+        EMIT_STRING_PROPERTY(fd, symbolInstance, ResourceId, false, NULL, tab)
     }
 
-    IOOverrideCollection::Write(fd, symbolInstance->GetParameterOverrides(), version);
+    IOOverrideCollection::Write(fd, symbolInstance->GetParameterOverrides(), version, tab);
 
-    EMIT_DOUBLE_PROPERTY(fd, symbolInstance, ScaleX, true, 1.0)                          // default is 1.0
-    EMIT_DOUBLE_PROPERTY(fd, symbolInstance, ScaleY, true, 1.0)                          // default is 1.0
-    EMIT_DOUBLE_PROPERTY(fd, symbolInstance, InsertionOffsetX, true, 0.0)                // default is 0.0
-    EMIT_DOUBLE_PROPERTY(fd, symbolInstance, InsertionOffsetY, true, 0.0)                // default is 0.0
-    EMIT_ENUM_2(fd, symbolInstance, MdfModel, SizeContext, DeviceUnits, MappingUnits, 1) // default is DeviceUnits
-    EMIT_BOOL_PROPERTY(fd, symbolInstance, DrawLast, true, false)                        // default is false
-    EMIT_BOOL_PROPERTY(fd, symbolInstance, CheckExclusionRegion, true, false)            // default is false
-    EMIT_BOOL_PROPERTY(fd, symbolInstance, AddToExclusionRegion, true, false)            // default is false
-    EMIT_STRING_PROPERTY(fd, symbolInstance, PositioningAlgorithm, true, SymbolInstance::sPositioningAlgorithmDefault)
+    EMIT_DOUBLE_PROPERTY(fd, symbolInstance, ScaleX, true, 1.0, tab)                          // default is 1.0
+    EMIT_DOUBLE_PROPERTY(fd, symbolInstance, ScaleY, true, 1.0, tab)                          // default is 1.0
+    EMIT_DOUBLE_PROPERTY(fd, symbolInstance, InsertionOffsetX, true, 0.0, tab)                // default is 0.0
+    EMIT_DOUBLE_PROPERTY(fd, symbolInstance, InsertionOffsetY, true, 0.0, tab)                // default is 0.0
+    EMIT_ENUM_2(fd, symbolInstance, MdfModel, SizeContext, DeviceUnits, MappingUnits, 1, tab) // default is DeviceUnits
+    EMIT_BOOL_PROPERTY(fd, symbolInstance, DrawLast, true, false, tab)                        // default is false
+    EMIT_BOOL_PROPERTY(fd, symbolInstance, CheckExclusionRegion, true, false, tab)            // default is false
+    EMIT_BOOL_PROPERTY(fd, symbolInstance, AddToExclusionRegion, true, false, tab)            // default is false
+    EMIT_STRING_PROPERTY(fd, symbolInstance, PositioningAlgorithm, true, SymbolInstance::sPositioningAlgorithmDefault, tab)
 
     if (!version || (*version >= Version(1, 2, 0)))
     {
         // write new version 1.2.0 properties
 
         // Property: RenderingPass
-        EMIT_INTEGER_PROPERTY(fd, symbolInstance, RenderingPass, true, 0)               // default is 0
+        EMIT_INTEGER_PROPERTY(fd, symbolInstance, RenderingPass, true, 0, tab)               // default is 0
 
         // Property: UsageContext
         SymbolInstance::UsageContext usageContext = symbolInstance->GetUsageContext();
         if (usageContext != SymbolInstance::ucUnspecified)
         {
-            fd << tab() << "<UsageContext>";         // NOXLATE
+            fd << tab.tab() << "<UsageContext>";         // NOXLATE
             if (usageContext == SymbolInstance::ucPoint)
                 fd << "Point";                       // NOXLATE
             else if (usageContext == SymbolInstance::ucLine)
@@ -241,7 +241,7 @@
         SymbolInstance::GeometryContext geomContext = symbolInstance->GetGeometryContext();
         if (geomContext != SymbolInstance::gcUnspecified)
         {
-            fd << tab() << "<GeometryContext>";      // NOXLATE
+            fd << tab.tab() << "<GeometryContext>";      // NOXLATE
             if (geomContext == SymbolInstance::gcPoint)
                 fd << "Point";                       // NOXLATE
             else if (geomContext == SymbolInstance::gcLineString)
@@ -254,16 +254,16 @@
     else if (*version >= Version(1, 0, 0))
     {
         // save new properties as extended data for LDF versions 1.0.0 and 1.1.0
-        inctab();
+        tab.inctab();
 
         // Property: RenderingPass
-        EMIT_INTEGER_PROPERTY(fdExtData, symbolInstance, RenderingPass, true, 0)        // default is 0
+        EMIT_INTEGER_PROPERTY(fdExtData, symbolInstance, RenderingPass, true, 0, tab)        // default is 0
 
         // Property: UsageContext
         SymbolInstance::UsageContext usageContext = symbolInstance->GetUsageContext();
         if (usageContext != SymbolInstance::ucUnspecified)
         {
-            fdExtData << tab() << "<UsageContext>";         // NOXLATE
+            fdExtData << tab.tab() << "<UsageContext>";         // NOXLATE
             if (usageContext == SymbolInstance::ucPoint)
                 fdExtData << "Point";                       // NOXLATE
             else if (usageContext == SymbolInstance::ucLine)
@@ -277,7 +277,7 @@
         SymbolInstance::GeometryContext geomContext = symbolInstance->GetGeometryContext();
         if (geomContext != SymbolInstance::gcUnspecified)
         {
-            fdExtData << tab() << "<GeometryContext>";      // NOXLATE
+            fdExtData << tab.tab() << "<GeometryContext>";      // NOXLATE
             if (geomContext == SymbolInstance::gcPoint)
                 fdExtData << "Point";                       // NOXLATE
             else if (geomContext == SymbolInstance::gcLineString)
@@ -287,12 +287,12 @@
             fdExtData << "</GeometryContext>" << std::endl; // NOXLATE
         }
 
-        dectab();
+        tab.dectab();
     }
 
     // Write the unknown XML / extended data
-    IOUnknown::Write(fd, symbolInstance->GetUnknownXml(), fdExtData.str(), version);
+    IOUnknown::Write(fd, symbolInstance->GetUnknownXml(), fdExtData.str(), version, tab);
 
-    dectab();
-    fd << tab() << "</SymbolInstance>" << std::endl; // NOXLATE
+    tab.dectab();
+    fd << tab.tab() << "</SymbolInstance>" << std::endl; // NOXLATE
 }

Modified: sandbox/adsk/2.3r/Common/MdfParser/IOSymbolInstance.h
===================================================================
--- sandbox/adsk/2.3r/Common/MdfParser/IOSymbolInstance.h	2011-02-22 07:43:02 UTC (rev 5564)
+++ sandbox/adsk/2.3r/Common/MdfParser/IOSymbolInstance.h	2011-02-25 21:46:04 UTC (rev 5565)
@@ -36,7 +36,7 @@
         virtual void ElementChars(const wchar_t* ch);
         virtual void EndElement(const wchar_t* name, HandlerStack* handlerStack);
 
-        static void Write(MdfStream& fd, SymbolInstance* symbolInstance, Version* version);
+        static void Write(MdfStream& fd, SymbolInstance* symbolInstance, Version* version, MgTab& tab);
 
     private:
         static bool GetSymbolDefinitionVersion(Version* ldfVersion, Version& sdVersion);

Modified: sandbox/adsk/2.3r/Common/MdfParser/IOText.cpp
===================================================================
--- sandbox/adsk/2.3r/Common/MdfParser/IOText.cpp	2011-02-22 07:43:02 UTC (rev 5564)
+++ sandbox/adsk/2.3r/Common/MdfParser/IOText.cpp	2011-02-25 21:46:04 UTC (rev 5565)
@@ -103,71 +103,71 @@
 }
 
 
-void IOText::Write(MdfStream& fd, Text* text, Version* version)
+void IOText::Write(MdfStream& fd, Text* text, Version* version, MgTab& tab)
 {
-    fd << tab() << "<Text>" << std::endl; // NOXLATE
-    inctab();
+    fd << tab.tab() << "<Text>" << std::endl; // NOXLATE
+    tab.inctab();
 
     MdfStringStream fdExtData;
 
-    IOGraphicElement::Write(fd, text, version);
+    IOGraphicElement::Write(fd, text, version, tab);
 
-    EMIT_STRING_PROPERTY(fd, text, Content, false, NULL)
-    EMIT_STRING_PROPERTY(fd, text, FontName, false, NULL)
-    EMIT_BOOL_PROPERTY(fd, text, Bold, true, false)                           // default is false
-    EMIT_BOOL_PROPERTY(fd, text, Italic, true, false)                         // default is false
-    EMIT_BOOL_PROPERTY(fd, text, Underlined, true, false)                     // default is false
+    EMIT_STRING_PROPERTY(fd, text, Content, false, NULL, tab)
+    EMIT_STRING_PROPERTY(fd, text, FontName, false, NULL, tab)
+    EMIT_BOOL_PROPERTY(fd, text, Bold, true, false, tab)                           // default is false
+    EMIT_BOOL_PROPERTY(fd, text, Italic, true, false, tab)                         // default is false
+    EMIT_BOOL_PROPERTY(fd, text, Underlined, true, false, tab)                     // default is false
 
     if (!version || (*version >= Version(1, 1, 0)))
     {
-        EMIT_BOOL_PROPERTY(fd, text, Overlined, true, false)                  // default is false
-        EMIT_DOUBLE_PROPERTY(fd, text, ObliqueAngle, true, 0.0)               // default is 0.0
-        EMIT_DOUBLE_PROPERTY(fd, text, TrackSpacing, true, 1.0)               // default is 1.0
+        EMIT_BOOL_PROPERTY(fd, text, Overlined, true, false, tab)                  // default is false
+        EMIT_DOUBLE_PROPERTY(fd, text, ObliqueAngle, true, 0.0, tab)               // default is 0.0
+        EMIT_DOUBLE_PROPERTY(fd, text, TrackSpacing, true, 1.0, tab)               // default is 1.0
     }
     else if (*version == Version(1, 0, 0))
     {
         // save new properties as extended data for symbol definition version 1.0.0
-        inctab();
+        tab.inctab();
 
-        EMIT_BOOL_PROPERTY(fdExtData, text, Overlined, true, false)           // default is false
-        EMIT_DOUBLE_PROPERTY(fdExtData, text, ObliqueAngle, true, 0.0)        // default is 0.0
-        EMIT_DOUBLE_PROPERTY(fdExtData, text, TrackSpacing, true, 1.0)        // default is 1.0
+        EMIT_BOOL_PROPERTY(fdExtData, text, Overlined, true, false, tab)           // default is false
+        EMIT_DOUBLE_PROPERTY(fdExtData, text, ObliqueAngle, true, 0.0, tab)        // default is 0.0
+        EMIT_DOUBLE_PROPERTY(fdExtData, text, TrackSpacing, true, 1.0, tab)        // default is 1.0
 
-        dectab();
+        tab.dectab();
     }
 
-    EMIT_DOUBLE_PROPERTY(fd, text, Height, true, 4.0)                         // default is 4.0
-    EMIT_BOOL_PROPERTY(fd, text, HeightScalable, true, true)                  // default is true
-    EMIT_DOUBLE_PROPERTY(fd, text, Angle, true, 0.0)                          // default is 0.0
-    EMIT_DOUBLE_PROPERTY(fd, text, PositionX, true, 0.0)                      // default is 0.0
-    EMIT_DOUBLE_PROPERTY(fd, text, PositionY, true, 0.0)                      // default is 0.0
-    EMIT_STRING_PROPERTY(fd, text, HorizontalAlignment, true, Text::sHAlignmentDefault)
-    EMIT_STRING_PROPERTY(fd, text, VerticalAlignment, true, Text::sVAlignmentDefault)
-    EMIT_STRING_PROPERTY(fd, text, Justification, true, Text::sJustificationDefault)
-    EMIT_DOUBLE_PROPERTY(fd, text, LineSpacing, true, 1.05)                   // default is 1.05
-    EMIT_STRING_PROPERTY(fd, text, TextColor, true, L"ff000000")              // default is ff000000
-    EMIT_STRING_PROPERTY(fd, text, GhostColor, true, L"")                     // default is empty string
+    EMIT_DOUBLE_PROPERTY(fd, text, Height, true, 4.0, tab)                         // default is 4.0
+    EMIT_BOOL_PROPERTY(fd, text, HeightScalable, true, true, tab)                  // default is true
+    EMIT_DOUBLE_PROPERTY(fd, text, Angle, true, 0.0, tab)                          // default is 0.0
+    EMIT_DOUBLE_PROPERTY(fd, text, PositionX, true, 0.0, tab)                      // default is 0.0
+    EMIT_DOUBLE_PROPERTY(fd, text, PositionY, true, 0.0, tab)                      // default is 0.0
+    EMIT_STRING_PROPERTY(fd, text, HorizontalAlignment, true, Text::sHAlignmentDefault, tab)
+    EMIT_STRING_PROPERTY(fd, text, VerticalAlignment, true, Text::sVAlignmentDefault, tab)
+    EMIT_STRING_PROPERTY(fd, text, Justification, true, Text::sJustificationDefault, tab)
+    EMIT_DOUBLE_PROPERTY(fd, text, LineSpacing, true, 1.05, tab)                   // default is 1.05
+    EMIT_STRING_PROPERTY(fd, text, TextColor, true, L"ff000000", tab)              // default is ff000000
+    EMIT_STRING_PROPERTY(fd, text, GhostColor, true, L"", tab)                     // default is empty string
 
     if (text->GetFrame())
-        IOTextFrame::Write(fd, text->GetFrame(), version);
+        IOTextFrame::Write(fd, text->GetFrame(), version, tab);
 
     if (!version || (*version >= Version(1, 1, 0)))
     {
-        EMIT_STRING_PROPERTY(fd, text, Markup, true, Text::sMarkupDefault)
+        EMIT_STRING_PROPERTY(fd, text, Markup, true, Text::sMarkupDefault, tab)
     }
     else if (*version == Version(1, 0, 0))
     {
         // save new property as extended data for symbol definition version 1.0.0
-        inctab();
+        tab.inctab();
 
-        EMIT_STRING_PROPERTY(fdExtData, text, Markup, true, Text::sMarkupDefault)
+        EMIT_STRING_PROPERTY(fdExtData, text, Markup, true, Text::sMarkupDefault, tab)
 
-        dectab();
+        tab.dectab();
     }
 
     // Write the unknown XML / extended data
-    IOUnknown::Write(fd, text->GetUnknownXml(), fdExtData.str(), version);
+    IOUnknown::Write(fd, text->GetUnknownXml(), fdExtData.str(), version, tab);
 
-    dectab();
-    fd << tab() << "</Text>" << std::endl; // NOXLATE
+    tab.dectab();
+    fd << tab.tab() << "</Text>" << std::endl; // NOXLATE
 }

Modified: sandbox/adsk/2.3r/Common/MdfParser/IOText.h
===================================================================
--- sandbox/adsk/2.3r/Common/MdfParser/IOText.h	2011-02-22 07:43:02 UTC (rev 5564)
+++ sandbox/adsk/2.3r/Common/MdfParser/IOText.h	2011-02-25 21:46:04 UTC (rev 5565)
@@ -37,7 +37,7 @@
         virtual void StartElement(const wchar_t* name, HandlerStack* handlerStack);
         virtual void ElementChars(const wchar_t* ch);
 
-        static void Write(MdfStream& fd, Text* text, Version* version);
+        static void Write(MdfStream& fd, Text* text, Version* version, MgTab& tab);
 };
 
 END_NAMESPACE_MDFPARSER

Modified: sandbox/adsk/2.3r/Common/MdfParser/IOTextFrame.cpp
===================================================================
--- sandbox/adsk/2.3r/Common/MdfParser/IOTextFrame.cpp	2011-02-22 07:43:02 UTC (rev 5564)
+++ sandbox/adsk/2.3r/Common/MdfParser/IOTextFrame.cpp	2011-02-25 21:46:04 UTC (rev 5565)
@@ -84,19 +84,19 @@
 }
 
 
-void IOTextFrame::Write(MdfStream& fd, TextFrame* textFrame, Version* version)
+void IOTextFrame::Write(MdfStream& fd, TextFrame* textFrame, Version* version, MgTab& tab)
 {
-    fd << tab() << "<Frame>" << std::endl; // NOXLATE
-    inctab();
+    fd << tab.tab() << "<Frame>" << std::endl; // NOXLATE
+    tab.inctab();
 
-    EMIT_STRING_PROPERTY(fd, textFrame, LineColor, true, L"")   // empty string is default
-    EMIT_STRING_PROPERTY(fd, textFrame, FillColor, true, L"")   // empty string is default
-    EMIT_DOUBLE_PROPERTY(fd, textFrame, OffsetX, true, 0.0)     // 0.0 is default
-    EMIT_DOUBLE_PROPERTY(fd, textFrame, OffsetY, true, 0.0)     // 0.0 is default
+    EMIT_STRING_PROPERTY(fd, textFrame, LineColor, true, L"", tab)   // empty string is default
+    EMIT_STRING_PROPERTY(fd, textFrame, FillColor, true, L"", tab)   // empty string is default
+    EMIT_DOUBLE_PROPERTY(fd, textFrame, OffsetX, true, 0.0, tab)     // 0.0 is default
+    EMIT_DOUBLE_PROPERTY(fd, textFrame, OffsetY, true, 0.0, tab)     // 0.0 is default
 
     // Write any unknown XML / extended data
-    IOUnknown::Write(fd, textFrame->GetUnknownXml(), version);
+    IOUnknown::Write(fd, textFrame->GetUnknownXml(), version, tab);
 
-    dectab();
-    fd << tab() << "</Frame>" << std::endl; // NOXLATE
+    tab.dectab();
+    fd << tab.tab() << "</Frame>" << std::endl; // NOXLATE
 }

Modified: sandbox/adsk/2.3r/Common/MdfParser/IOTextFrame.h
===================================================================
--- sandbox/adsk/2.3r/Common/MdfParser/IOTextFrame.h	2011-02-22 07:43:02 UTC (rev 5564)
+++ sandbox/adsk/2.3r/Common/MdfParser/IOTextFrame.h	2011-02-25 21:46:04 UTC (rev 5565)
@@ -38,7 +38,7 @@
         virtual void ElementChars(const wchar_t* ch);
         virtual void EndElement(const wchar_t* name, HandlerStack* handlerStack);
 
-        static void Write(MdfStream& fd, TextFrame* textFrame, Version* version);
+        static void Write(MdfStream& fd, TextFrame* textFrame, Version* version, MgTab& tab);
 
     private:
         Text* m_text;

Modified: sandbox/adsk/2.3r/Common/MdfParser/IOThemeLabel.cpp
===================================================================
--- sandbox/adsk/2.3r/Common/MdfParser/IOThemeLabel.cpp	2011-02-22 07:43:02 UTC (rev 5564)
+++ sandbox/adsk/2.3r/Common/MdfParser/IOThemeLabel.cpp	2011-02-25 21:46:04 UTC (rev 5565)
@@ -82,17 +82,17 @@
 }
 
 
-void IOThemeLabel::Write(MdfStream& fd, ThemeLabel* pThemeLabel, Version* version)
+void IOThemeLabel::Write(MdfStream& fd, ThemeLabel* pThemeLabel, Version* version, MgTab& tab)
 {
-    fd << tab() << "<ThemeLabel>" << std::endl; // NOXLATE
-    inctab();
+    fd << tab.tab() << "<ThemeLabel>" << std::endl; // NOXLATE
+    tab.inctab();
 
-    EMIT_STRING_PROPERTY(fd, pThemeLabel, Description, false, NULL)
-    EMIT_STRING_PROPERTY(fd, pThemeLabel, CategoryFormat, false, NULL)
+    EMIT_STRING_PROPERTY(fd, pThemeLabel, Description, false, NULL, tab)
+    EMIT_STRING_PROPERTY(fd, pThemeLabel, CategoryFormat, false, NULL, tab)
 
     // Write any unknown XML / extended data
-    IOUnknown::Write(fd, pThemeLabel->GetUnknownXml(), version);
+    IOUnknown::Write(fd, pThemeLabel->GetUnknownXml(), version, tab);
 
-    dectab();
-    fd << tab() << "</ThemeLabel>" << std::endl; // NOXLATE
+    tab.dectab();
+    fd << tab.tab() << "</ThemeLabel>" << std::endl; // NOXLATE
 }

Modified: sandbox/adsk/2.3r/Common/MdfParser/IOThemeLabel.h
===================================================================
--- sandbox/adsk/2.3r/Common/MdfParser/IOThemeLabel.h	2011-02-22 07:43:02 UTC (rev 5564)
+++ sandbox/adsk/2.3r/Common/MdfParser/IOThemeLabel.h	2011-02-25 21:46:04 UTC (rev 5565)
@@ -38,7 +38,7 @@
         virtual void ElementChars(const wchar_t* ch);
         virtual void EndElement(const wchar_t* name, HandlerStack* handlerStack);
 
-        static void Write(MdfStream& fd, ThemeLabel* pThemeLabel, Version* version);
+        static void Write(MdfStream& fd, ThemeLabel* pThemeLabel, Version* version, MgTab& tab);
 
     private:
         Override* m_override;

Modified: sandbox/adsk/2.3r/Common/MdfParser/IOTileWatermarkPosition.cpp
===================================================================
--- sandbox/adsk/2.3r/Common/MdfParser/IOTileWatermarkPosition.cpp	2011-02-22 07:43:02 UTC (rev 5564)
+++ sandbox/adsk/2.3r/Common/MdfParser/IOTileWatermarkPosition.cpp	2011-02-25 21:46:04 UTC (rev 5565)
@@ -116,27 +116,27 @@
 }
 
 
-void IOTileWatermarkPosition::Write(MdfStream& fd, TileWatermarkPosition* position, Version* version)
+void IOTileWatermarkPosition::Write(MdfStream& fd, TileWatermarkPosition* position, Version* version, MgTab& tab)
 {
-    fd << tab() << startStr(sTilePosition) << std::endl;
-    inctab();
+    fd << tab.tab() << startStr(sTilePosition) << std::endl;
+    tab.inctab();
 
     // Property: TileWidth
-    fd << tab() << startStr(sTileWidth);
+    fd << tab.tab() << startStr(sTileWidth);
     fd << DoubleToStr(position->GetTileWidth());
     fd << endStr(sTileWidth) << std::endl;
 
     // Property: TileHeight
-    fd << tab() << startStr(sTileHeight);
+    fd << tab.tab() << startStr(sTileHeight);
     fd << DoubleToStr(position->GetTileHeight());
     fd << endStr(sTileHeight) << std::endl;
 
     // Property: HorizontalPosition
-    IOWatermarkXOffset::Write(fd, position->GetHorizontalPosition(), sHorizontalPosition, version);
+    IOWatermarkXOffset::Write(fd, position->GetHorizontalPosition(), sHorizontalPosition, version, tab);
 
     // Property: VerticalPosition
-    IOWatermarkYOffset::Write(fd, position->GetVerticalPosition(), sVerticalPosition, version);
+    IOWatermarkYOffset::Write(fd, position->GetVerticalPosition(), sVerticalPosition, version, tab);
 
-    dectab();
-    fd << tab() << endStr(sTilePosition) << std::endl;
+    tab.dectab();
+    fd << tab.tab() << endStr(sTilePosition) << std::endl;
 }

Modified: sandbox/adsk/2.3r/Common/MdfParser/IOTileWatermarkPosition.h
===================================================================
--- sandbox/adsk/2.3r/Common/MdfParser/IOTileWatermarkPosition.h	2011-02-22 07:43:02 UTC (rev 5564)
+++ sandbox/adsk/2.3r/Common/MdfParser/IOTileWatermarkPosition.h	2011-02-25 21:46:04 UTC (rev 5565)
@@ -38,7 +38,7 @@
         virtual void ElementChars(const wchar_t* ch);
         virtual void EndElement(const wchar_t* name, HandlerStack* handlerStack);
 
-        static void Write(MdfStream& fd, TileWatermarkPosition* position, Version* version);
+        static void Write(MdfStream& fd, TileWatermarkPosition* position, Version* version, MgTab& tab);
 
     private:
         TileWatermarkPosition* m_position;

Modified: sandbox/adsk/2.3r/Common/MdfParser/IOUnknown.cpp
===================================================================
--- sandbox/adsk/2.3r/Common/MdfParser/IOUnknown.cpp	2011-02-22 07:43:02 UTC (rev 5564)
+++ sandbox/adsk/2.3r/Common/MdfParser/IOUnknown.cpp	2011-02-25 21:46:04 UTC (rev 5565)
@@ -114,37 +114,37 @@
 
 
 // The supplied unknown data is assumed to not be tabbed.
-void IOUnknown::Write(MdfStream& fd, const std::wstring& unkData, Version* version)
+void IOUnknown::Write(MdfStream& fd, const std::wstring& unkData, Version* version, MgTab& tab)
 {
     if (unkData.empty())
         return;
 
     if (!version || (*version >= Version(1, 0, 0)))
     {
-        fd << tab() << "<ExtendedData1>" << std::endl; // NOXLATE
+        fd << tab.tab() << "<ExtendedData1>" << std::endl; // NOXLATE
 
-        WriteUnknown(fd, unkData);
+        WriteUnknown(fd, unkData, tab);
 
-        fd << tab() << "</ExtendedData1>" << std::endl; // NOXLATE
+        fd << tab.tab() << "</ExtendedData1>" << std::endl; // NOXLATE
     }
 }
 
 
 // The supplied unknown data is assumed to be unformatted,
 // while the raw data is assumed to be formatted.
-void IOUnknown::Write(MdfStream& fd, const std::wstring& unkData, const std::string& rawData, Version* version)
+void IOUnknown::Write(MdfStream& fd, const std::wstring& unkData, const std::string& rawData, Version* version, MgTab& tab)
 {
     if (unkData.empty() && rawData.empty())
         return;
 
     if (!version || (*version >= Version(1, 0, 0)))
     {
-        fd << tab() << "<ExtendedData1>" << std::endl; // NOXLATE
+        fd << tab.tab() << "<ExtendedData1>" << std::endl; // NOXLATE
 
         WriteRaw(fd, rawData);
-        WriteUnknown(fd, unkData);
+        WriteUnknown(fd, unkData, tab);
 
-        fd << tab() << "</ExtendedData1>" << std::endl; // NOXLATE
+        fd << tab.tab() << "</ExtendedData1>" << std::endl; // NOXLATE
     }
 }
 
@@ -167,13 +167,13 @@
 
 
 // The supplied data is assumed to be unformatted.
-void IOUnknown::WriteUnknown(MdfStream& fd, const std::wstring& unkData)
+void IOUnknown::WriteUnknown(MdfStream& fd, const std::wstring& unkData, MgTab& tab)
 {
     if (unkData.empty())
         return;
 
     // get the current tab count
-    int tabCount = gettabcount() + 1;
+    int tabCount = tab.gettabcount() + 1;
     std::wstring tabstr;
     tabstr.reserve(tabCount);
     tabstr.append(tabCount, L' ');

Modified: sandbox/adsk/2.3r/Common/MdfParser/IOUnknown.h
===================================================================
--- sandbox/adsk/2.3r/Common/MdfParser/IOUnknown.h	2011-02-22 07:43:02 UTC (rev 5564)
+++ sandbox/adsk/2.3r/Common/MdfParser/IOUnknown.h	2011-02-25 21:46:04 UTC (rev 5565)
@@ -36,12 +36,12 @@
         virtual void ElementChars(const wchar_t* ch);
         virtual void EndElement(const wchar_t* name, HandlerStack* handlerStack);
 
-        static void Write(MdfStream& fd, const std::wstring& unkData, Version* version);
-        static void Write(MdfStream& fd, const std::wstring& unkData, const std::string& rawData, Version* version);
+        static void Write(MdfStream& fd, const std::wstring& unkData, Version* version, MgTab& tab);
+        static void Write(MdfStream& fd, const std::wstring& unkData, const std::string& rawData, Version* version, MgTab& tab);
 
     private:
         static void WriteRaw(MdfStream& fd, const std::string& rawData);
-        static void WriteUnknown(MdfStream& fd, const std::wstring& unkData);
+        static void WriteUnknown(MdfStream& fd, const std::wstring& unkData, MgTab& tab);
 
     private:
         std::wstring* m_xml;

Modified: sandbox/adsk/2.3r/Common/MdfParser/IOUtil.cpp
===================================================================
--- sandbox/adsk/2.3r/Common/MdfParser/IOUtil.cpp	2011-02-22 07:43:02 UTC (rev 5564)
+++ sandbox/adsk/2.3r/Common/MdfParser/IOUtil.cpp	2011-02-25 21:46:04 UTC (rev 5565)
@@ -21,52 +21,9 @@
 
 BEGIN_NAMESPACE_MDFPARSER
 
-bool tabsEnabled = true;
-int tabcount = 0;
+bool MgTab::m_tabsEnabled = true;
 
 
-std::string tab()
-{
-    std::string ret;
-    if (tabsEnabled)
-    {
-        ret.reserve(tabcount);
-        ret.append(tabcount, ' ');
-    }
-    return ret;
-}
-
-
-int gettabcount()
-{
-    return tabcount;
-}
-
-
-void inctab()
-{
-    tabcount++;
-}
-
-
-void dectab()
-{
-    tabcount--;
-}
-
-
-void zerotab()
-{
-    tabcount = 0;
-}
-
-
-void disableTabs()
-{
-    tabsEnabled = false;
-}
-
-
 std::wstring toMdfString(const char* str)
 {
     std::wstring s;

Modified: sandbox/adsk/2.3r/Common/MdfParser/IOUtil.h
===================================================================
--- sandbox/adsk/2.3r/Common/MdfParser/IOUtil.h	2011-02-22 07:43:02 UTC (rev 5564)
+++ sandbox/adsk/2.3r/Common/MdfParser/IOUtil.h	2011-02-25 21:46:04 UTC (rev 5565)
@@ -26,7 +26,66 @@
 using namespace MDFMODEL_NAMESPACE;
 
 BEGIN_NAMESPACE_MDFPARSER
+class MgTab
+{
+public:
+    MgTab()
+    {
+        // Tabs are initially enabled
+        m_tabcount = 0;
+    }
 
+    ~MgTab()
+    {
+    }
+
+    inline std::string tab()
+    {
+        std::string ret;
+        if (m_tabsEnabled)
+        {
+            ret.reserve(m_tabcount);
+            ret.append(m_tabcount, ' ');
+        }
+        return ret;
+    }
+
+    inline int gettabcount()
+    {
+        return m_tabcount;
+    }
+
+    inline void inctab()
+    {
+        m_tabcount++;
+    }
+
+    inline void dectab()
+    {
+        m_tabcount--;
+    }
+
+    inline void zerotab()
+    {
+        m_tabcount = 0;
+    }
+
+    static inline void enableTabs()
+    {
+        m_tabsEnabled = true;
+    }
+
+    static inline void disableTabs()
+    {
+        m_tabsEnabled = false;
+    }
+
+// Members
+private:
+    static bool m_tabsEnabled;
+    int m_tabcount;
+};
+
     // TODO: The streams below should really be changed to std::w* versions to
     // output unicode strings but MapGuide explicitly supports UTF-8 characters in the
     // output for some reason; If we have time, we should come back to this and fix
@@ -49,15 +108,15 @@
     MDFPARSER_API std::string IntToStr(int i);
     MDFPARSER_API std::string DoubleToStr(double d);
     MDFPARSER_API std::string BoolToStr(bool b);
+/*
+    MDFPARSER_API std::string tab.tab();
 
-    MDFPARSER_API std::string tab();
-
     MDFPARSER_API int gettabcount();
-    MDFPARSER_API void inctab();
-    MDFPARSER_API void dectab();
+    MDFPARSER_API void tab.inctab();
+    MDFPARSER_API void tab.dectab();
     MDFPARSER_API void zerotab();
     MDFPARSER_API void disableTabs();
-
+*/
     MDFPARSER_API std::string startStr(const std::string& elementName);
     MDFPARSER_API std::string endStr(const std::string& elementName);
 

Modified: sandbox/adsk/2.3r/Common/MdfParser/IOVectorLayerDefinition.cpp
===================================================================
--- sandbox/adsk/2.3r/Common/MdfParser/IOVectorLayerDefinition.cpp	2011-02-22 07:43:02 UTC (rev 5564)
+++ sandbox/adsk/2.3r/Common/MdfParser/IOVectorLayerDefinition.cpp	2011-02-25 21:46:04 UTC (rev 5565)
@@ -182,7 +182,7 @@
 }
 
 
-void IOVectorLayerDefinition::Write(MdfStream& fd, VectorLayerDefinition* vectorLayer, Version* version)
+void IOVectorLayerDefinition::Write(MdfStream& fd, VectorLayerDefinition* vectorLayer, Version* version, MgTab& tab)
 {
     // verify the LDF version
     MdfString strVersion;
@@ -212,23 +212,23 @@
         strVersion = L"2.3.0";
     }
 
-    fd << tab() << "<LayerDefinition xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"LayerDefinition-" << EncodeString(strVersion) << ".xsd\" version=\"" << EncodeString(strVersion) << "\">" << std::endl; // NOXLATE
-    inctab();
+    fd << tab.tab() << "<LayerDefinition xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"LayerDefinition-" << EncodeString(strVersion) << ".xsd\" version=\"" << EncodeString(strVersion) << "\">" << std::endl; // NOXLATE
+    tab.inctab();
 
-    fd << tab() << startStr(sVectorLayerDefinition) << std::endl;
-    inctab();
+    fd << tab.tab() << startStr(sVectorLayerDefinition) << std::endl;
+    tab.inctab();
 
     MdfStringStream fdExtData;
 
     // Property: ResourceId
-    fd << tab() << startStr(sResourceId);
+    fd << tab.tab() << startStr(sResourceId);
     fd << EncodeString(vectorLayer->GetResourceID());
     fd << endStr(sResourceId) << std::endl;
 
     // Property: Opacity (optional)
     if (vectorLayer->GetOpacity() != 1.0)
     {
-        fd << tab() << startStr(sOpacity);
+        fd << tab.tab() << startStr(sOpacity);
         fd << DoubleToStr(vectorLayer->GetOpacity());
         fd << endStr(sOpacity) << std::endl;
     }
@@ -240,36 +240,36 @@
         if (!version || (*version >= Version(2, 3, 0)))
         {
             // only write Watermarks if the LDF version is 2.3.0 or greater
-            fd << tab() << startStr(sWatermarks) << std::endl;
-            inctab();
+            fd << tab.tab() << startStr(sWatermarks) << std::endl;
+            tab.inctab();
             for (int i=0; i<watermarkCount; ++i)
-                IOWatermarkInstance::Write(fd, vectorLayer->GetWatermarks()->GetAt(i), version);
-            dectab();
-            fd << tab() << endStr(sWatermarks) << std::endl;
+                IOWatermarkInstance::Write(fd, vectorLayer->GetWatermarks()->GetAt(i), version, tab);
+            tab.dectab();
+            fd << tab.tab() << endStr(sWatermarks) << std::endl;
         }
         else if (*version >= Version(1, 0, 0))
         {
             // save Watermarks as extended data for LDF versions 1.0.0 - 1.3.0
-            inctab();
+            tab.inctab();
 
-            fdExtData << tab() << startStr(sWatermarks) << std::endl;
-            inctab();
+            fdExtData << tab.tab() << startStr(sWatermarks) << std::endl;
+            tab.inctab();
             for (int i=0; i<watermarkCount; ++i)
-                IOWatermarkInstance::Write(fdExtData, vectorLayer->GetWatermarks()->GetAt(i), version);
-            dectab();
-            fdExtData << tab() << endStr(sWatermarks) << std::endl;
+                IOWatermarkInstance::Write(fdExtData, vectorLayer->GetWatermarks()->GetAt(i), version, tab);
+            tab.dectab();
+            fdExtData << tab.tab() << endStr(sWatermarks) << std::endl;
 
-            dectab();
+            tab.dectab();
         }
     }
 
     // Property: FeatureName
-    fd << tab() << startStr(sFeatureName);
+    fd << tab.tab() << startStr(sFeatureName);
     fd << EncodeString(vectorLayer->GetFeatureName());
     fd << endStr(sFeatureName) << std::endl;
 
     // Property: FeatureNameType
-    fd << tab() << startStr(sFeatureNameType);
+    fd << tab.tab() << startStr(sFeatureNameType);
     if (vectorLayer->GetFeatureNameType() == VectorLayerDefinition::FeatureClass)
         fd << "FeatureClass"; // NOXLATE
     else
@@ -279,24 +279,24 @@
     // Property: Filter
     if (!vectorLayer->GetFilter().empty())
     {
-        fd << tab() << startStr(sFilter);
+        fd << tab.tab() << startStr(sFilter);
         fd << EncodeString(vectorLayer->GetFilter());
         fd << endStr(sFilter) << std::endl;
     }
 
     // Property: PropertyMappings
     for (int i=0; i<vectorLayer->GetPropertyMappings()->GetCount(); ++i)
-        IONameStringPair::Write(fd, sPropertyMapping, vectorLayer->GetPropertyMappings()->GetAt(i), version);
+        IONameStringPair::Write(fd, sPropertyMapping, vectorLayer->GetPropertyMappings()->GetAt(i), version, tab);
 
     // Property: Geometry
-    fd << tab() << startStr(sGeometry);
+    fd << tab.tab() << startStr(sGeometry);
     fd << EncodeString(vectorLayer->GetGeometry());
     fd << endStr(sGeometry) << std::endl;
 
     // Property: Url
     if (!vectorLayer->GetUrl().empty())
     {
-        fd << tab() << startStr(sUrl);
+        fd << tab.tab() << startStr(sUrl);
         fd << EncodeString(vectorLayer->GetUrl());
         fd << endStr(sUrl) << std::endl;
     }
@@ -304,21 +304,21 @@
     // Property: ToolTip
     if (!vectorLayer->GetToolTip().empty())
     {
-        fd << tab() << startStr(sToolTip);
+        fd << tab.tab() << startStr(sToolTip);
         fd << EncodeString(vectorLayer->GetToolTip());
         fd << endStr(sToolTip) << std::endl;
     }
 
     // Property: VectorScaleRange
     for (int i=0; i<vectorLayer->GetScaleRanges()->GetCount(); ++i)
-        IOVectorScaleRange::Write(fd, vectorLayer->GetScaleRanges()->GetAt(i), version);
+        IOVectorScaleRange::Write(fd, vectorLayer->GetScaleRanges()->GetAt(i), version, tab);
 
     // Write any unknown XML / extended data
-    IOUnknown::Write(fd, vectorLayer->GetUnknownXml(), fdExtData.str(), version);
+    IOUnknown::Write(fd, vectorLayer->GetUnknownXml(), fdExtData.str(), version, tab);
 
-    dectab();
-    fd << tab() << endStr(sVectorLayerDefinition) << std::endl;
+    tab.dectab();
+    fd << tab.tab() << endStr(sVectorLayerDefinition) << std::endl;
 
-    dectab();
-    fd << tab() << "</LayerDefinition>" << std::endl; // NOXLATE
+    tab.dectab();
+    fd << tab.tab() << "</LayerDefinition>" << std::endl; // NOXLATE
 }

Modified: sandbox/adsk/2.3r/Common/MdfParser/IOVectorLayerDefinition.h
===================================================================
--- sandbox/adsk/2.3r/Common/MdfParser/IOVectorLayerDefinition.h	2011-02-22 07:43:02 UTC (rev 5564)
+++ sandbox/adsk/2.3r/Common/MdfParser/IOVectorLayerDefinition.h	2011-02-25 21:46:04 UTC (rev 5565)
@@ -38,7 +38,7 @@
         virtual void ElementChars(const wchar_t* ch);
         virtual void EndElement(const wchar_t* name, HandlerStack* handlerStack);
 
-        static void Write(MdfStream& fd, VectorLayerDefinition* vectorLayer, Version* version);
+        static void Write(MdfStream& fd, VectorLayerDefinition* vectorLayer, Version* version, MgTab& tab);
 
     private:
         static bool GetWatermarkDefinitionVersion(Version* ldfVersion, Version& wdVersion);

Modified: sandbox/adsk/2.3r/Common/MdfParser/IOVectorScaleRange.cpp
===================================================================
--- sandbox/adsk/2.3r/Common/MdfParser/IOVectorScaleRange.cpp	2011-02-22 07:43:02 UTC (rev 5564)
+++ sandbox/adsk/2.3r/Common/MdfParser/IOVectorScaleRange.cpp	2011-02-25 21:46:04 UTC (rev 5565)
@@ -157,17 +157,17 @@
 }
 
 
-void IOVectorScaleRange::Write(MdfStream& fd, VectorScaleRange* scaleRange, Version* version)
+void IOVectorScaleRange::Write(MdfStream& fd, VectorScaleRange* scaleRange, Version* version, MgTab& tab)
 {
-    fd << tab() << startStr(sVectorScaleRange) << std::endl;
-    inctab();
+    fd << tab.tab() << startStr(sVectorScaleRange) << std::endl;
+    tab.inctab();
 
     MdfStringStream fdExtData;
 
     // Property: MinScale (optional)
     if (scaleRange->GetMinScale() != 0.0)
     {
-        fd << tab() << startStr(sMinScale);
+        fd << tab.tab() << startStr(sMinScale);
         fd << DoubleToStr(scaleRange->GetMinScale());
         fd << endStr(sMinScale) << std::endl;
     }
@@ -175,7 +175,7 @@
     // Property: MaxScale (optional)
     if (scaleRange->GetMaxScale() != VectorScaleRange::MAX_MAP_SCALE)
     {
-        fd << tab() << startStr(sMaxScale);
+        fd << tab.tab() << startStr(sMaxScale);
         fd << DoubleToStr(scaleRange->GetMaxScale());
         fd << endStr(sMaxScale) << std::endl;
     }
@@ -187,29 +187,29 @@
 
         if (dynamic_cast<AreaTypeStyle*>(fts) != 0)
         {
-            IOAreaTypeStyle::Write(fd, dynamic_cast<AreaTypeStyle*>(fts), version);
+            IOAreaTypeStyle::Write(fd, dynamic_cast<AreaTypeStyle*>(fts), version, tab);
         }
         else if (dynamic_cast<LineTypeStyle*>(fts) != 0)
         {
-            IOLineTypeStyle::Write(fd, dynamic_cast<LineTypeStyle*>(fts), version);
+            IOLineTypeStyle::Write(fd, dynamic_cast<LineTypeStyle*>(fts), version, tab);
         }
         else if (dynamic_cast<PointTypeStyle*>(fts) != 0)
         {
-            IOPointTypeStyle::Write(fd, dynamic_cast<PointTypeStyle*>(fts), version);
+            IOPointTypeStyle::Write(fd, dynamic_cast<PointTypeStyle*>(fts), version, tab);
         }
         else if (dynamic_cast<CompositeTypeStyle*>(fts) != 0)
         {
             // only write CompositeTypeStyle if the LDF version is 1.1.0 or greater
             if (!version || (*version >= Version(1, 1, 0)))
             {
-                IOCompositeTypeStyle::Write(fd, dynamic_cast<CompositeTypeStyle*>(fts), version);
+                IOCompositeTypeStyle::Write(fd, dynamic_cast<CompositeTypeStyle*>(fts), version, tab);
             }
             else if (*version == Version(1, 0, 0))
             {
                 // save CompositeTypeStyle as extended data for LDF version 1.0.0
-                inctab();
-                IOCompositeTypeStyle::Write(fdExtData, dynamic_cast<CompositeTypeStyle*>(fts), version);
-                dectab();
+                tab.inctab();
+                IOCompositeTypeStyle::Write(fdExtData, dynamic_cast<CompositeTypeStyle*>(fts), version, tab);
+                tab.dectab();
             }
         }
     }
@@ -221,20 +221,20 @@
         // only write ElevationSettings if the LDF version is 1.1.0 or greater
         if (!version || (*version >= Version(1, 1, 0)))
         {
-            IOElevationSettings::Write(fd, elevationSettings, version);
+            IOElevationSettings::Write(fd, elevationSettings, version, tab);
         }
         else if (*version == Version(1, 0, 0))
         {
             // save ElevationSettings as extended data for LDF version 1.0.0
-            inctab();
-            IOElevationSettings::Write(fdExtData, elevationSettings, version);
-            dectab();
+            tab.inctab();
+            IOElevationSettings::Write(fdExtData, elevationSettings, version, tab);
+            tab.dectab();
         }
     }
 
     // Write the unknown XML / extended data
-    IOUnknown::Write(fd, scaleRange->GetUnknownXml(), fdExtData.str(), version);
+    IOUnknown::Write(fd, scaleRange->GetUnknownXml(), fdExtData.str(), version, tab);
 
-    dectab();
-    fd << tab() << endStr(sVectorScaleRange) << std::endl;
+    tab.dectab();
+    fd << tab.tab() << endStr(sVectorScaleRange) << std::endl;
 }

Modified: sandbox/adsk/2.3r/Common/MdfParser/IOVectorScaleRange.h
===================================================================
--- sandbox/adsk/2.3r/Common/MdfParser/IOVectorScaleRange.h	2011-02-22 07:43:02 UTC (rev 5564)
+++ sandbox/adsk/2.3r/Common/MdfParser/IOVectorScaleRange.h	2011-02-25 21:46:04 UTC (rev 5565)
@@ -39,7 +39,7 @@
         virtual void ElementChars(const wchar_t* ch);
         virtual void EndElement(const wchar_t* name, HandlerStack* handlerStack);
 
-        static void Write(MdfStream& fd, VectorScaleRange* scaleRange, Version* version);
+        static void Write(MdfStream& fd, VectorScaleRange* scaleRange, Version* version, MgTab& tab);
 
     private:
         VectorScaleRange* m_scaleRange;

Modified: sandbox/adsk/2.3r/Common/MdfParser/IOW2DSymbol.cpp
===================================================================
--- sandbox/adsk/2.3r/Common/MdfParser/IOW2DSymbol.cpp	2011-02-22 07:43:02 UTC (rev 5564)
+++ sandbox/adsk/2.3r/Common/MdfParser/IOW2DSymbol.cpp	2011-02-25 21:46:04 UTC (rev 5565)
@@ -135,20 +135,20 @@
 }
 
 
-void IOW2DSymbol::Write(MdfStream& fd, W2DSymbol* symbol, Version* version)
+void IOW2DSymbol::Write(MdfStream& fd, W2DSymbol* symbol, Version* version, MgTab& tab)
 {
-    fd << tab() << startStr(sW2D) << std::endl;
-    inctab();
+    fd << tab.tab() << startStr(sW2D) << std::endl;
+    tab.inctab();
 
-    IOSymbol::Write(fd, symbol, version);
+    IOSymbol::Write(fd, symbol, version, tab);
 
     // Property: W2DSymbol
-    IOResourceRef::Write(fd, sW2DSymbol, symbol->GetSymbolLibrary(), symbol->GetSymbolName(), true, version);
+    IOResourceRef::Write(fd, sW2DSymbol, symbol->GetSymbolLibrary(), symbol->GetSymbolName(), true, version, tab);
 
     // Property: FillColor
     if (!symbol->GetFillColor().empty())
     {
-        fd << tab() << startStr(sFillColor);
+        fd << tab.tab() << startStr(sFillColor);
         fd << EncodeString(symbol->GetFillColor());
         fd << endStr(sFillColor) << std::endl;
     }
@@ -156,7 +156,7 @@
     // Property: LineColor
     if (!symbol->GetLineColor().empty())
     {
-        fd << tab() << startStr(sLineColor);
+        fd << tab.tab() << startStr(sLineColor);
         fd << EncodeString(symbol->GetLineColor());
         fd << endStr(sLineColor) << std::endl;
     }
@@ -164,14 +164,14 @@
     // Property: TextColor
     if (!symbol->GetTextColor().empty())
     {
-        fd << tab() << startStr(sTextColor);
+        fd << tab.tab() << startStr(sTextColor);
         fd << EncodeString(symbol->GetTextColor());
         fd << endStr(sTextColor) << std::endl;
     }
 
     // Write any unknown XML / extended data
-    IOUnknown::Write(fd, symbol->GetUnknownXml(), version);
+    IOUnknown::Write(fd, symbol->GetUnknownXml(), version, tab);
 
-    dectab();
-    fd << tab() << endStr(sW2D) << std::endl;
+    tab.dectab();
+    fd << tab.tab() << endStr(sW2D) << std::endl;
 }

Modified: sandbox/adsk/2.3r/Common/MdfParser/IOW2DSymbol.h
===================================================================
--- sandbox/adsk/2.3r/Common/MdfParser/IOW2DSymbol.h	2011-02-22 07:43:02 UTC (rev 5564)
+++ sandbox/adsk/2.3r/Common/MdfParser/IOW2DSymbol.h	2011-02-25 21:46:04 UTC (rev 5565)
@@ -36,7 +36,7 @@
         virtual void ElementChars(const wchar_t* ch);
         virtual void EndElement(const wchar_t* name, HandlerStack* handlerStack);
 
-        static void Write(MdfStream& fd, W2DSymbol* symbol, Version* version);
+        static void Write(MdfStream& fd, W2DSymbol* symbol, Version* version, MgTab& tab);
 
     private:
         IOResourceRef* m_ioResourceRef;

Modified: sandbox/adsk/2.3r/Common/MdfParser/IOWatermarkAppearance.cpp
===================================================================
--- sandbox/adsk/2.3r/Common/MdfParser/IOWatermarkAppearance.cpp	2011-02-22 07:43:02 UTC (rev 5564)
+++ sandbox/adsk/2.3r/Common/MdfParser/IOWatermarkAppearance.cpp	2011-02-25 21:46:04 UTC (rev 5565)
@@ -97,15 +97,15 @@
 }
 
 
-void IOWatermarkAppearance::Write(MdfStream& fd, WatermarkAppearance* appearance, Version* version, const std::string& name)
+void IOWatermarkAppearance::Write(MdfStream& fd, WatermarkAppearance* appearance, Version* version, const std::string& name, MgTab& tab)
 {
-    fd << tab() << startStr(name) << std::endl;
-    inctab();
+    fd << tab.tab() << startStr(name) << std::endl;
+    tab.inctab();
 
     // Property: Transparency (optional)
     if (appearance->GetTransparency() != 0.0)
     {
-        fd << tab() << startStr(sTransparency);
+        fd << tab.tab() << startStr(sTransparency);
         fd << DoubleToStr(appearance->GetTransparency());
         fd << endStr(sTransparency) << std::endl;
     }
@@ -113,11 +113,11 @@
     // Property: Rotation (optional)
     if (appearance->GetRotation() != 0.0)
     {
-        fd << tab() << startStr(sRotation);
+        fd << tab.tab() << startStr(sRotation);
         fd << DoubleToStr(appearance->GetRotation());
         fd << endStr(sRotation) << std::endl;
     }
 
-    dectab();
-    fd << tab() << endStr(name) << std::endl;
+    tab.dectab();
+    fd << tab.tab() << endStr(name) << std::endl;
 }

Modified: sandbox/adsk/2.3r/Common/MdfParser/IOWatermarkAppearance.h
===================================================================
--- sandbox/adsk/2.3r/Common/MdfParser/IOWatermarkAppearance.h	2011-02-22 07:43:02 UTC (rev 5564)
+++ sandbox/adsk/2.3r/Common/MdfParser/IOWatermarkAppearance.h	2011-02-25 21:46:04 UTC (rev 5565)
@@ -38,7 +38,7 @@
         virtual void ElementChars(const wchar_t* ch);
         virtual void EndElement(const wchar_t* name, HandlerStack* handlerStack);
 
-        static void Write(MdfStream& fd, WatermarkAppearance* appearance, Version* version, const std::string& name);
+        static void Write(MdfStream& fd, WatermarkAppearance* appearance, Version* version, const std::string& name, MgTab& tab);
 
     private:
         WatermarkAppearance* m_appearance;

Modified: sandbox/adsk/2.3r/Common/MdfParser/IOWatermarkDefinition.cpp
===================================================================
--- sandbox/adsk/2.3r/Common/MdfParser/IOWatermarkDefinition.cpp	2011-02-22 07:43:02 UTC (rev 5564)
+++ sandbox/adsk/2.3r/Common/MdfParser/IOWatermarkDefinition.cpp	2011-02-25 21:46:04 UTC (rev 5565)
@@ -170,7 +170,7 @@
 }
 
 
-void IOWatermarkDefinition::Write(MdfStream& fd, WatermarkDefinition* watermark, Version* version)
+void IOWatermarkDefinition::Write(MdfStream& fd, WatermarkDefinition* watermark, Version* version, MgTab& tab)
 {
     // verify the WatermarkDefinition version
     MdfString strVersion;
@@ -195,12 +195,12 @@
         strVersion = L"2.3.0";
     }
 
-    fd << tab() << "<WatermarkDefinition xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"WatermarkDefinition-" << EncodeString(strVersion) << ".xsd\" version=\"" << EncodeString(strVersion) << "\">" << std::endl; // NOXLATE
-    inctab();
+    fd << tab.tab() << "<WatermarkDefinition xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"WatermarkDefinition-" << EncodeString(strVersion) << ".xsd\" version=\"" << EncodeString(strVersion) << "\">" << std::endl; // NOXLATE
+    tab.inctab();
 
     // Property: Content
-    fd << tab() << startStr(sContent) << std::endl;
-    inctab();
+    fd << tab.tab() << startStr(sContent) << std::endl;
+    tab.inctab();
 
     SymbolDefinition* symbol = watermark->GetContent();
     Version sdVersion;
@@ -210,36 +210,36 @@
         CompoundSymbolDefinition* compoundSymbol = dynamic_cast<CompoundSymbolDefinition*>(symbol);
 
         if (simpleSymbol)
-            IOSimpleSymbolDefinition::Write(fd, simpleSymbol, false, &sdVersion);
+            IOSimpleSymbolDefinition::Write(fd, simpleSymbol, false, &sdVersion, tab);
         else if (compoundSymbol)
-            IOCompoundSymbolDefinition::Write(fd, compoundSymbol, false, &sdVersion);
+            IOCompoundSymbolDefinition::Write(fd, compoundSymbol, false, &sdVersion, tab);
     }
 
-    dectab();
+    tab.dectab();
     fd << endStr(sContent) << std::endl;
 
     // Property: Appearance
-    IOWatermarkAppearance::Write(fd, watermark->GetAppearance(), version, sAppearance);
+    IOWatermarkAppearance::Write(fd, watermark->GetAppearance(), version, sAppearance, tab);
 
     // Property: Position
-    fd << tab() << startStr(sPosition) << std::endl;
-    inctab();
+    fd << tab.tab() << startStr(sPosition) << std::endl;
+    tab.inctab();
 
     WatermarkPosition* position = watermark->GetPosition();
     XYWatermarkPosition* xyPosition = dynamic_cast<XYWatermarkPosition*>(position);
     TileWatermarkPosition* tilePosition = dynamic_cast<TileWatermarkPosition*>(position);
 
     if (xyPosition)
-        IOXYWatermarkPosition::Write(fd, xyPosition, version);
+        IOXYWatermarkPosition::Write(fd, xyPosition, version, tab);
     else if (tilePosition)
-        IOTileWatermarkPosition::Write(fd, tilePosition, version);
+        IOTileWatermarkPosition::Write(fd, tilePosition, version, tab);
 
-    dectab();
+    tab.dectab();
     fd << endStr(sPosition) << std::endl;
 
     // Write any unknown XML / extended data
-    IOUnknown::Write(fd, watermark->GetUnknownXml(), version);
+    IOUnknown::Write(fd, watermark->GetUnknownXml(), version, tab);
 
-    dectab();
-    fd << tab() << "</WatermarkDefinition>" << std::endl; // NOXLATE
+    tab.dectab();
+    fd << tab.tab() << "</WatermarkDefinition>" << std::endl; // NOXLATE
 }

Modified: sandbox/adsk/2.3r/Common/MdfParser/IOWatermarkDefinition.h
===================================================================
--- sandbox/adsk/2.3r/Common/MdfParser/IOWatermarkDefinition.h	2011-02-22 07:43:02 UTC (rev 5564)
+++ sandbox/adsk/2.3r/Common/MdfParser/IOWatermarkDefinition.h	2011-02-25 21:46:04 UTC (rev 5565)
@@ -38,7 +38,7 @@
         virtual void ElementChars(const wchar_t* ch);
         virtual void EndElement(const wchar_t* name, HandlerStack* handlerStack);
 
-        static void Write(MdfStream& fd, WatermarkDefinition* watermark, Version* version);
+        static void Write(MdfStream& fd, WatermarkDefinition* watermark, Version* version, MgTab& tab);
 
     private:
         static bool GetSymbolDefinitionVersion(Version* wdVersion, Version& sdVersion);

Modified: sandbox/adsk/2.3r/Common/MdfParser/IOWatermarkInstance.cpp
===================================================================
--- sandbox/adsk/2.3r/Common/MdfParser/IOWatermarkInstance.cpp	2011-02-22 07:43:02 UTC (rev 5564)
+++ sandbox/adsk/2.3r/Common/MdfParser/IOWatermarkInstance.cpp	2011-02-25 21:46:04 UTC (rev 5565)
@@ -149,18 +149,18 @@
 }
 
 
-void IOWatermarkInstance::Write(MdfStream& fd, WatermarkInstance* watermark, Version* version)
+void IOWatermarkInstance::Write(MdfStream& fd, WatermarkInstance* watermark, Version* version, MgTab& tab)
 {
-    fd << tab() << startStr(sWatermark) << std::endl;
-    inctab();
+    fd << tab.tab() << startStr(sWatermark) << std::endl;
+    tab.inctab();
 
     // Property: Name
-    fd << tab() << startStr(sName);
+    fd << tab.tab() << startStr(sName);
     fd << EncodeString(watermark->GetName());
     fd << endStr(sName) << std::endl;
 
     // Property: ResourceId
-    fd << tab() << startStr(sResourceId);
+    fd << tab.tab() << startStr(sResourceId);
     fd << EncodeString(watermark->GetResourceId());
     fd << endStr(sResourceId) << std::endl;
 
@@ -168,7 +168,7 @@
     WatermarkInstance::Usage usage = watermark->GetUsage();
     if (usage != WatermarkInstance::All)
     {
-        fd << tab() << startStr(sUsage);
+        fd << tab.tab() << startStr(sUsage);
         if (usage == WatermarkInstance::WMS)
             fd << "WMS"; // NOXLATE
         else if (usage == WatermarkInstance::Viewer)
@@ -179,30 +179,30 @@
     // Property: AppearanceOverride (optional)
     WatermarkAppearance* appearanceOverride = watermark->GetAppearanceOverride();
     if (appearanceOverride)
-        IOWatermarkAppearance::Write(fd, appearanceOverride, version, sAppearanceOverride);
+        IOWatermarkAppearance::Write(fd, appearanceOverride, version, sAppearanceOverride, tab);
 
     // Property: PositionOverride (optional)
     WatermarkPosition* positionOverride = watermark->GetPositionOverride();
     if (positionOverride)
     {
-        fd << tab() << startStr(sPositionOverride) << std::endl;
-        inctab();
+        fd << tab.tab() << startStr(sPositionOverride) << std::endl;
+        tab.inctab();
 
         XYWatermarkPosition* xyPositionOverride = dynamic_cast<XYWatermarkPosition*>(positionOverride);
         TileWatermarkPosition* tilePositionOverride = dynamic_cast<TileWatermarkPosition*>(positionOverride);
 
         if (xyPositionOverride)
-            IOXYWatermarkPosition::Write(fd, xyPositionOverride, version);
+            IOXYWatermarkPosition::Write(fd, xyPositionOverride, version, tab);
         else if (tilePositionOverride)
-            IOTileWatermarkPosition::Write(fd, tilePositionOverride, version);
+            IOTileWatermarkPosition::Write(fd, tilePositionOverride, version, tab);
 
-        dectab();
+        tab.dectab();
         fd << endStr(sPositionOverride) << std::endl;
     }
 
     // Write any unknown XML / extended data
-    IOUnknown::Write(fd, watermark->GetUnknownXml(), version);
+    IOUnknown::Write(fd, watermark->GetUnknownXml(), version, tab);
 
-    dectab();
-    fd << tab() << endStr(sWatermark) << std::endl;
+    tab.dectab();
+    fd << tab.tab() << endStr(sWatermark) << std::endl;
 }

Modified: sandbox/adsk/2.3r/Common/MdfParser/IOWatermarkInstance.h
===================================================================
--- sandbox/adsk/2.3r/Common/MdfParser/IOWatermarkInstance.h	2011-02-22 07:43:02 UTC (rev 5564)
+++ sandbox/adsk/2.3r/Common/MdfParser/IOWatermarkInstance.h	2011-02-25 21:46:04 UTC (rev 5565)
@@ -38,7 +38,7 @@
         virtual void ElementChars(const wchar_t* ch);
         virtual void EndElement(const wchar_t* name, HandlerStack* handlerStack);
 
-        static void Write(MdfStream& fd, WatermarkInstance* watermark, Version* version);
+        static void Write(MdfStream& fd, WatermarkInstance* watermark, Version* version, MgTab& tab);
 
     private:
         WatermarkInstance* m_watermark;

Modified: sandbox/adsk/2.3r/Common/MdfParser/IOWatermarkOffsetUnit.cpp
===================================================================
--- sandbox/adsk/2.3r/Common/MdfParser/IOWatermarkOffsetUnit.cpp	2011-02-22 07:43:02 UTC (rev 5564)
+++ sandbox/adsk/2.3r/Common/MdfParser/IOWatermarkOffsetUnit.cpp	2011-02-25 21:46:04 UTC (rev 5565)
@@ -38,10 +38,10 @@
 }
 
 
-void IOWatermarkOffsetUnit::Write(MdfStream& fd, WatermarkOffset::WatermarkOffsetUnit offsetUnit)
+void IOWatermarkOffsetUnit::Write(MdfStream& fd, WatermarkOffset::WatermarkOffsetUnit offsetUnit, MgTab& tab)
 {
     // Property: Unit
-    fd << tab() << startStr("Unit"); // NOXLATE
+    fd << tab.tab() << startStr("Unit"); // NOXLATE
     if (offsetUnit == WatermarkOffset::Inches)
         fd << "Inches"; // NOXLATE
     else if (offsetUnit == WatermarkOffset::Centimeters)

Modified: sandbox/adsk/2.3r/Common/MdfParser/IOWatermarkOffsetUnit.h
===================================================================
--- sandbox/adsk/2.3r/Common/MdfParser/IOWatermarkOffsetUnit.h	2011-02-22 07:43:02 UTC (rev 5564)
+++ sandbox/adsk/2.3r/Common/MdfParser/IOWatermarkOffsetUnit.h	2011-02-25 21:46:04 UTC (rev 5565)
@@ -30,7 +30,7 @@
     public:
         static WatermarkOffset::WatermarkOffsetUnit ParseWatermarkOffsetUnit(const wchar_t* ch);
 
-        static void Write(MdfStream& fd, WatermarkOffset::WatermarkOffsetUnit offsetUnit);
+        static void Write(MdfStream& fd, WatermarkOffset::WatermarkOffsetUnit offsetUnit, MgTab& tab);
 };
 
 END_NAMESPACE_MDFPARSER

Modified: sandbox/adsk/2.3r/Common/MdfParser/IOWatermarkXOffset.cpp
===================================================================
--- sandbox/adsk/2.3r/Common/MdfParser/IOWatermarkXOffset.cpp	2011-02-22 07:43:02 UTC (rev 5564)
+++ sandbox/adsk/2.3r/Common/MdfParser/IOWatermarkXOffset.cpp	2011-02-25 21:46:04 UTC (rev 5565)
@@ -108,21 +108,21 @@
 }
 
 
-void IOWatermarkXOffset::Write(MdfStream& fd, WatermarkXOffset* xOffset, const std::string& name, Version* version)
+void IOWatermarkXOffset::Write(MdfStream& fd, WatermarkXOffset* xOffset, const std::string& name, Version* version, MgTab& tab)
 {
-    fd << tab() << startStr(name) << std::endl;
-    inctab();
+    fd << tab.tab() << startStr(name) << std::endl;
+    tab.inctab();
 
     // Property: Offset
-    fd << tab() << startStr(sOffset);
+    fd << tab.tab() << startStr(sOffset);
     fd << DoubleToStr(xOffset->GetOffset());
     fd << endStr(sOffset) << std::endl;
 
     // Property: Unit
-    IOWatermarkOffsetUnit::Write(fd, xOffset->GetUnit());
+    IOWatermarkOffsetUnit::Write(fd, xOffset->GetUnit(), tab);
 
     // Property: Alignment
-    fd << tab() << startStr(sAlignment);
+    fd << tab.tab() << startStr(sAlignment);
     WatermarkXOffset::HorizontalAlignment alignment = xOffset->GetAlignment();
     if (alignment == WatermarkXOffset::Left)
         fd << "Left"; // NOXLATE
@@ -132,6 +132,6 @@
         fd << "Center"; // NOXLATE
     fd << endStr(sAlignment) << std::endl;
 
-    dectab();
-    fd << tab() << endStr(name) << std::endl;
+    tab.dectab();
+    fd << tab.tab() << endStr(name) << std::endl;
 }

Modified: sandbox/adsk/2.3r/Common/MdfParser/IOWatermarkXOffset.h
===================================================================
--- sandbox/adsk/2.3r/Common/MdfParser/IOWatermarkXOffset.h	2011-02-22 07:43:02 UTC (rev 5564)
+++ sandbox/adsk/2.3r/Common/MdfParser/IOWatermarkXOffset.h	2011-02-25 21:46:04 UTC (rev 5565)
@@ -38,7 +38,7 @@
         virtual void ElementChars(const wchar_t* ch);
         virtual void EndElement(const wchar_t* name, HandlerStack* handlerStack);
 
-        static void Write(MdfStream& fd, WatermarkXOffset* xOffset, const std::string& name, Version* version);
+        static void Write(MdfStream& fd, WatermarkXOffset* xOffset, const std::string& name, Version* version, MgTab& tab);
 
     private:
         WatermarkXOffset* m_XOffset;

Modified: sandbox/adsk/2.3r/Common/MdfParser/IOWatermarkYOffset.cpp
===================================================================
--- sandbox/adsk/2.3r/Common/MdfParser/IOWatermarkYOffset.cpp	2011-02-22 07:43:02 UTC (rev 5564)
+++ sandbox/adsk/2.3r/Common/MdfParser/IOWatermarkYOffset.cpp	2011-02-25 21:46:04 UTC (rev 5565)
@@ -108,21 +108,21 @@
 }
 
 
-void IOWatermarkYOffset::Write(MdfStream& fd, WatermarkYOffset* yOffset, const std::string& name, Version* version)
+void IOWatermarkYOffset::Write(MdfStream& fd, WatermarkYOffset* yOffset, const std::string& name, Version* version, MgTab& tab)
 {
-    fd << tab() << startStr(name) << std::endl;
-    inctab();
+    fd << tab.tab() << startStr(name) << std::endl;
+    tab.inctab();
 
     // Property: Offset
-    fd << tab() << startStr(sOffset);
+    fd << tab.tab() << startStr(sOffset);
     fd << DoubleToStr(yOffset->GetOffset());
     fd << endStr(sOffset) << std::endl;
 
     // Property: Unit
-    IOWatermarkOffsetUnit::Write(fd, yOffset->GetUnit());
+    IOWatermarkOffsetUnit::Write(fd, yOffset->GetUnit(), tab);
 
     // Property: Alignment
-    fd << tab() << startStr(sAlignment);
+    fd << tab.tab() << startStr(sAlignment);
     WatermarkYOffset::VerticalAlignment alignment = yOffset->GetAlignment();
     if (alignment == WatermarkYOffset::Top)
         fd << "Top"; // NOXLATE
@@ -132,6 +132,6 @@
         fd << "Center"; // NOXLATE
     fd << endStr(sAlignment) << std::endl;
 
-    dectab();
-    fd << tab() << endStr(name) << std::endl;
+    tab.dectab();
+    fd << tab.tab() << endStr(name) << std::endl;
 }

Modified: sandbox/adsk/2.3r/Common/MdfParser/IOWatermarkYOffset.h
===================================================================
--- sandbox/adsk/2.3r/Common/MdfParser/IOWatermarkYOffset.h	2011-02-22 07:43:02 UTC (rev 5564)
+++ sandbox/adsk/2.3r/Common/MdfParser/IOWatermarkYOffset.h	2011-02-25 21:46:04 UTC (rev 5565)
@@ -38,7 +38,7 @@
         virtual void ElementChars(const wchar_t* ch);
         virtual void EndElement(const wchar_t* name, HandlerStack* handlerStack);
 
-        static void Write(MdfStream& fd, WatermarkYOffset* xOffset, const std::string& name, Version* version);
+        static void Write(MdfStream& fd, WatermarkYOffset* xOffset, const std::string& name, Version* version, MgTab& tab);
 
     private:
         WatermarkYOffset* m_YOffset;

Modified: sandbox/adsk/2.3r/Common/MdfParser/IOXYWatermarkPosition.cpp
===================================================================
--- sandbox/adsk/2.3r/Common/MdfParser/IOXYWatermarkPosition.cpp	2011-02-22 07:43:02 UTC (rev 5564)
+++ sandbox/adsk/2.3r/Common/MdfParser/IOXYWatermarkPosition.cpp	2011-02-25 21:46:04 UTC (rev 5565)
@@ -104,17 +104,17 @@
 }
 
 
-void IOXYWatermarkPosition::Write(MdfStream& fd, XYWatermarkPosition* position, Version* version)
+void IOXYWatermarkPosition::Write(MdfStream& fd, XYWatermarkPosition* position, Version* version, MgTab& tab)
 {
-    fd << tab() << startStr(sXYPosition) << std::endl;
-    inctab();
+    fd << tab.tab() << startStr(sXYPosition) << std::endl;
+    tab.inctab();
 
     // Property: XPosition
-    IOWatermarkXOffset::Write(fd, position->GetXPosition(), sXPosition, version);
+    IOWatermarkXOffset::Write(fd, position->GetXPosition(), sXPosition, version, tab);
 
     // Property: YPosition
-    IOWatermarkYOffset::Write(fd, position->GetYPosition(), sYPosition, version);
+    IOWatermarkYOffset::Write(fd, position->GetYPosition(), sYPosition, version, tab);
 
-    dectab();
-    fd << tab() << endStr(sXYPosition) << std::endl;
+    tab.dectab();
+    fd << tab.tab() << endStr(sXYPosition) << std::endl;
 }

Modified: sandbox/adsk/2.3r/Common/MdfParser/IOXYWatermarkPosition.h
===================================================================
--- sandbox/adsk/2.3r/Common/MdfParser/IOXYWatermarkPosition.h	2011-02-22 07:43:02 UTC (rev 5564)
+++ sandbox/adsk/2.3r/Common/MdfParser/IOXYWatermarkPosition.h	2011-02-25 21:46:04 UTC (rev 5565)
@@ -38,7 +38,7 @@
         virtual void ElementChars(const wchar_t* ch);
         virtual void EndElement(const wchar_t* name, HandlerStack* handlerStack);
 
-        static void Write(MdfStream& fd, XYWatermarkPosition* position, Version* version);
+        static void Write(MdfStream& fd, XYWatermarkPosition* position, Version* version, MgTab& tab);
 
     private:
         XYWatermarkPosition* m_position;

Modified: sandbox/adsk/2.3r/Common/MdfParser/PrintLayout/IODataConfiguration.cpp
===================================================================
--- sandbox/adsk/2.3r/Common/MdfParser/PrintLayout/IODataConfiguration.cpp	2011-02-22 07:43:02 UTC (rev 5564)
+++ sandbox/adsk/2.3r/Common/MdfParser/PrintLayout/IODataConfiguration.cpp	2011-02-25 21:46:04 UTC (rev 5565)
@@ -110,39 +110,39 @@
     }
 }
 
-void IODataConfiguration::Write(MdfStream& fd, DataConfiguration* dataConf, Version* version)
+void IODataConfiguration::Write(MdfStream& fd, DataConfiguration* dataConf, Version* version, MgTab& tab)
 {
     _ASSERT(NULL != dataConf);
 
-    fd << tab() << startStr(sData) << std::endl;
-    inctab();
+    fd << tab.tab() << startStr(sData) << std::endl;
+    tab.inctab();
 
     // Property: ResourceId
-    fd << tab() << startStr(sResourceId);
+    fd << tab.tab() << startStr(sResourceId);
     fd << EncodeString(dataConf->GetResourceId());
     fd << endStr(sResourceId) << std::endl;
 
     // Property: FeatureClass
-    fd << tab() << startStr(sFeatureClass);
+    fd << tab.tab() << startStr(sFeatureClass);
     fd << EncodeString(dataConf->GetFeatureClass());
     fd << endStr(sFeatureClass) << std::endl;
 
     // Property: Geometry
-    fd << tab() << startStr(sGeometry);
+    fd << tab.tab() << startStr(sGeometry);
     fd << EncodeString(dataConf->GetGeometry());
     fd << endStr(sGeometry) << std::endl;
 
     // Property: Filter
-    fd << tab() << startStr(sFilter);
+    fd << tab.tab() << startStr(sFilter);
     fd << EncodeString(dataConf->GetFilter());
     fd << endStr(sFilter) << std::endl;
 
     // Property: PropertyMappings
-    IOPropertyMappingCollection::Write(fd, dataConf->GetPropertyMappings(), version, sPropertyMappings);
+    IOPropertyMappingCollection::Write(fd, dataConf->GetPropertyMappings(), version, sPropertyMappings, tab);
 
     // Write any unknown XML / extended data
-    IOUnknown::Write(fd, dataConf->GetUnknownXml(), version);
+    IOUnknown::Write(fd, dataConf->GetUnknownXml(), version, tab);
 
-    dectab();
-    fd << tab() << endStr(sData) << std::endl;
+    tab.dectab();
+    fd << tab.tab() << endStr(sData) << std::endl;
 }

Modified: sandbox/adsk/2.3r/Common/MdfParser/PrintLayout/IODataConfiguration.h
===================================================================
--- sandbox/adsk/2.3r/Common/MdfParser/PrintLayout/IODataConfiguration.h	2011-02-22 07:43:02 UTC (rev 5564)
+++ sandbox/adsk/2.3r/Common/MdfParser/PrintLayout/IODataConfiguration.h	2011-02-25 21:46:04 UTC (rev 5565)
@@ -33,7 +33,7 @@
     virtual void ElementChars(const wchar_t* ch);
     virtual void EndElement(const wchar_t* name, HandlerStack* handlerStack);
 
-    static void Write(MdfStream& fd, DataConfiguration* dataConf, Version* version);
+    static void Write(MdfStream& fd, DataConfiguration* dataConf, Version* version, MgTab& tab);
 
 private:
     // Hidden default/copy constructors and assignment operator.

Modified: sandbox/adsk/2.3r/Common/MdfParser/PrintLayout/IOMapView.cpp
===================================================================
--- sandbox/adsk/2.3r/Common/MdfParser/PrintLayout/IOMapView.cpp	2011-02-22 07:43:02 UTC (rev 5564)
+++ sandbox/adsk/2.3r/Common/MdfParser/PrintLayout/IOMapView.cpp	2011-02-25 21:46:04 UTC (rev 5565)
@@ -115,37 +115,37 @@
     }
 }
 
-void IOMapView::Write(MdfStream& fd, MapView* mapView, Version* version)
+void IOMapView::Write(MdfStream& fd, MapView* mapView, Version* version, MgTab& tab)
 {
     _ASSERT(NULL != mapView);
 
-    fd << tab() << startStr(sMapView) << std::endl;
-    inctab();
+    fd << tab.tab() << startStr(sMapView) << std::endl;
+    tab.inctab();
 
     // Property: Center
-    IOPoint3D::Write(fd, mapView->GetCenter(), version, sCenter);
+    IOPoint3D::Write(fd, mapView->GetCenter(), version, sCenter, tab);
 
     // Property: Height
-    fd << tab() << startStr(sHeight);
+    fd << tab.tab() << startStr(sHeight);
     fd << DoubleToStr(mapView->GetHeight());
     fd << endStr(sHeight) << std::endl;
 
     // Property: Rotation
-    fd << tab() << startStr(sRotation);
+    fd << tab.tab() << startStr(sRotation);
     fd << DoubleToStr(mapView->GetRotation());
     fd << endStr(sRotation) << std::endl;
 
     // Property: ViewDirection
-    IOVector3D::Write(fd, mapView->GetViewDirection(), version);
+    IOVector3D::Write(fd, mapView->GetViewDirection(), version, tab);
 
     // Property: ModelUnits
-    fd << tab() << startStr(sModelUnits);
+    fd << tab.tab() << startStr(sModelUnits);
     fd << EncodeString(mapView->GetModelUnits());
     fd << endStr(sModelUnits) << std::endl;
 
     // Write any unknown XML / extended data
-    IOUnknown::Write(fd, mapView->GetUnknownXml(), version);
+    IOUnknown::Write(fd, mapView->GetUnknownXml(), version, tab);
 
-    dectab();
-    fd << tab() << endStr(sMapView) << std::endl;
+    tab.dectab();
+    fd << tab.tab() << endStr(sMapView) << std::endl;
 }

Modified: sandbox/adsk/2.3r/Common/MdfParser/PrintLayout/IOMapView.h
===================================================================
--- sandbox/adsk/2.3r/Common/MdfParser/PrintLayout/IOMapView.h	2011-02-22 07:43:02 UTC (rev 5564)
+++ sandbox/adsk/2.3r/Common/MdfParser/PrintLayout/IOMapView.h	2011-02-25 21:46:04 UTC (rev 5565)
@@ -33,7 +33,7 @@
     virtual void ElementChars(const wchar_t* ch);
     virtual void EndElement(const wchar_t* name, HandlerStack* handlerStack);
 
-    static void Write(MdfStream& fd, MapView* mapView, Version* version);
+    static void Write(MdfStream& fd, MapView* mapView, Version* version, MgTab& tab);
 
 private:
     // Hidden default/copy constructors and assignment operator.

Modified: sandbox/adsk/2.3r/Common/MdfParser/PrintLayout/IOMapViewportDefinition.cpp
===================================================================
--- sandbox/adsk/2.3r/Common/MdfParser/PrintLayout/IOMapViewportDefinition.cpp	2011-02-22 07:43:02 UTC (rev 5564)
+++ sandbox/adsk/2.3r/Common/MdfParser/PrintLayout/IOMapViewportDefinition.cpp	2011-02-25 21:46:04 UTC (rev 5565)
@@ -108,45 +108,45 @@
     }
 }
 
-void IOMapViewportDefinition::Write(MdfStream& fd, MapViewportDefinition* mapViewportDef, Version* version)
+void IOMapViewportDefinition::Write(MdfStream& fd, MapViewportDefinition* mapViewportDef, Version* version, MgTab& tab)
 {
     _ASSERT(NULL != mapViewportDef);
 
     // Set the expected version
     MdfString strVersion = L"2.0.0";
 
-    fd << tab() << "<PrintLayoutElementDefinition xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"PrintLayoutDefinition-" << EncodeString(strVersion) << ".xsd\" version=\"" << EncodeString(strVersion) << "\">" << std::endl; // NOXLATE
-    inctab();
+    fd << tab.tab() << "<PrintLayoutElementDefinition xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"PrintLayoutDefinition-" << EncodeString(strVersion) << ".xsd\" version=\"" << EncodeString(strVersion) << "\">" << std::endl; // NOXLATE
+    tab.inctab();
 
-    fd << tab() << startStr(sMapViewportDefinition) << std::endl;
-    inctab();
+    fd << tab.tab() << startStr(sMapViewportDefinition) << std::endl;
+    tab.inctab();
 
-    IOPrintLayoutElementDefinition::Write(fd, mapViewportDef, version);
+    IOPrintLayoutElementDefinition::Write(fd, mapViewportDef, version, tab);
 
     // Property: MapName
-    fd << tab() << startStr(sMapName);
+    fd << tab.tab() << startStr(sMapName);
     fd << EncodeString(mapViewportDef->GetMapName());
     fd << endStr(sMapName) << std::endl;
 
     // Property: HiddenLayerNames
-    IOStringObjectCollection::Write(fd, mapViewportDef->GetHiddenLayerNames(), version, sHiddenLayerNames, sName);
+    IOStringObjectCollection::Write(fd, mapViewportDef->GetHiddenLayerNames(), version, sHiddenLayerNames, sName, tab);
 
     // Property: Locked
-    fd << tab() << startStr(sLocked);
+    fd << tab.tab() << startStr(sLocked);
     fd << BoolToStr(mapViewportDef->GetIsLocked());
     fd << endStr(sLocked) << std::endl;
 
     // Property: On
-    fd << tab() << startStr(sOn);
+    fd << tab.tab() << startStr(sOn);
     fd << BoolToStr(mapViewportDef->GetIsOn());
     fd << endStr(sOn) << std::endl;
 
     // Property: MapView
-    IOMapView::Write(fd, mapViewportDef->GetMapView(), version);
+    IOMapView::Write(fd, mapViewportDef->GetMapView(), version, tab);
 
-    dectab();
-    fd << tab() << endStr(sMapViewportDefinition) << std::endl;
+    tab.dectab();
+    fd << tab.tab() << endStr(sMapViewportDefinition) << std::endl;
 
-    dectab();
-    fd << tab() << "</PrintLayoutElementDefinition>" << std::endl; // NOXLATE
+    tab.dectab();
+    fd << tab.tab() << "</PrintLayoutElementDefinition>" << std::endl; // NOXLATE
 }

Modified: sandbox/adsk/2.3r/Common/MdfParser/PrintLayout/IOMapViewportDefinition.h
===================================================================
--- sandbox/adsk/2.3r/Common/MdfParser/PrintLayout/IOMapViewportDefinition.h	2011-02-22 07:43:02 UTC (rev 5564)
+++ sandbox/adsk/2.3r/Common/MdfParser/PrintLayout/IOMapViewportDefinition.h	2011-02-25 21:46:04 UTC (rev 5565)
@@ -34,7 +34,7 @@
     virtual void StartElement(const wchar_t* name, HandlerStack* handlerStack);
     virtual void ElementChars(const wchar_t* ch);
 
-    static void Write(MdfStream& fd, MapViewportDefinition* mapViewportDef, Version* version);
+    static void Write(MdfStream& fd, MapViewportDefinition* mapViewportDef, Version* version, MgTab& tab);
 
 private:
     // Hidden default/copy constructors and assignment operator.

Modified: sandbox/adsk/2.3r/Common/MdfParser/PrintLayout/IOPrintLayoutDefinition.cpp
===================================================================
--- sandbox/adsk/2.3r/Common/MdfParser/PrintLayout/IOPrintLayoutDefinition.cpp	2011-02-22 07:43:02 UTC (rev 5564)
+++ sandbox/adsk/2.3r/Common/MdfParser/PrintLayout/IOPrintLayoutDefinition.cpp	2011-02-25 21:46:04 UTC (rev 5565)
@@ -155,59 +155,59 @@
     }
 }
 
-void IOPrintLayoutDefinition::Write(MdfStream& fd, PrintLayoutDefinition* layoutDef, Version* version)
+void IOPrintLayoutDefinition::Write(MdfStream& fd, PrintLayoutDefinition* layoutDef, Version* version, MgTab& tab)
 {
     _ASSERT(NULL != layoutDef);
 
     // Set the expected version
     MdfString strVersion = L"2.0.0";
 
-    fd << tab() << "<PrintLayoutDefinition xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"PrintLayoutDefinition-" << EncodeString(strVersion) << ".xsd\" version=\"" << EncodeString(strVersion) << "\">" << std::endl; // NOXLATE
-    inctab();
+    fd << tab.tab() << "<PrintLayoutDefinition xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"PrintLayoutDefinition-" << EncodeString(strVersion) << ".xsd\" version=\"" << EncodeString(strVersion) << "\">" << std::endl; // NOXLATE
+    tab.inctab();
 
     // Property: Name
-    fd << tab() << startStr(sName);
+    fd << tab.tab() << startStr(sName);
     fd << EncodeString(layoutDef->GetName());
     fd << endStr(sName) << std::endl;
 
     // Property: Extent
-    IOExtent3D::Write(fd, layoutDef->GetExtent(), version);
+    IOExtent3D::Write(fd, layoutDef->GetExtent(), version, tab);
 
     // Property: Elements
-    IOPrintLayoutElementCollection::Write(fd, layoutDef->GetElements(), version, sElements);
+    IOPrintLayoutElementCollection::Write(fd, layoutDef->GetElements(), version, sElements, tab);
 
     // Property: PaperSize
-    IOSize2D::Write(fd, layoutDef->GetPaperSize(), version, sPaperSize);
+    IOSize2D::Write(fd, layoutDef->GetPaperSize(), version, sPaperSize, tab);
 
     // Property: DeviceName
-    fd << tab() << startStr(sDeviceName);
+    fd << tab.tab() << startStr(sDeviceName);
     fd << EncodeString(layoutDef->GetDeviceName());
     fd << endStr(sDeviceName) << std::endl;
 
     // Property: MediaName
-    fd << tab() << startStr(sMediaName);
+    fd << tab.tab() << startStr(sMediaName);
     fd << EncodeString(layoutDef->GetMediaName());
     fd << endStr(sMediaName) << std::endl;
 
     // Property: Orientation
-    fd << tab() << startStr(sOrientation);
+    fd << tab.tab() << startStr(sOrientation);
     fd << EncodeString(layoutDef->GetOrientation());
     fd << endStr(sOrientation) << std::endl;
 
     // Property: PaperMargin
-    IOThickness::Write(fd, layoutDef->GetPaperMargin(), version, sPaperMargin);
+    IOThickness::Write(fd, layoutDef->GetPaperMargin(), version, sPaperMargin, tab);
 
     // Property: Units
-    fd << tab() << startStr(sUnits);
+    fd << tab.tab() << startStr(sUnits);
     fd << EncodeString(layoutDef->GetUnits());
     fd << endStr(sUnits) << std::endl;
 
     // Property: BackgroundColor
-    IOColor::Write(fd, layoutDef->GetBackgroundColor(), version, sBackgroundColor);
+    IOColor::Write(fd, layoutDef->GetBackgroundColor(), version, sBackgroundColor, tab);
 
     // Write any unknown XML / extended data
-    IOUnknown::Write(fd, layoutDef->GetUnknownXml(), version);
+    IOUnknown::Write(fd, layoutDef->GetUnknownXml(), version, tab);
 
-    dectab();
-    fd << tab() << endStr(sPrintLayoutDefinition) << std::endl;
+    tab.dectab();
+    fd << tab.tab() << endStr(sPrintLayoutDefinition) << std::endl;
 }

Modified: sandbox/adsk/2.3r/Common/MdfParser/PrintLayout/IOPrintLayoutDefinition.h
===================================================================
--- sandbox/adsk/2.3r/Common/MdfParser/PrintLayout/IOPrintLayoutDefinition.h	2011-02-22 07:43:02 UTC (rev 5564)
+++ sandbox/adsk/2.3r/Common/MdfParser/PrintLayout/IOPrintLayoutDefinition.h	2011-02-25 21:46:04 UTC (rev 5565)
@@ -33,7 +33,7 @@
     virtual void ElementChars(const wchar_t* ch);
     virtual void EndElement(const wchar_t* name, HandlerStack* handlerStack);
 
-    static void Write(MdfStream& fd, PrintLayoutDefinition* layoutDef, Version* version);
+    static void Write(MdfStream& fd, PrintLayoutDefinition* layoutDef, Version* version, MgTab& tab);
 
 private:
     // Hidden default/copy constructors and assignment operator.

Modified: sandbox/adsk/2.3r/Common/MdfParser/PrintLayout/IOPrintLayoutElementCollection.cpp
===================================================================
--- sandbox/adsk/2.3r/Common/MdfParser/PrintLayout/IOPrintLayoutElementCollection.cpp	2011-02-22 07:43:02 UTC (rev 5564)
+++ sandbox/adsk/2.3r/Common/MdfParser/PrintLayout/IOPrintLayoutElementCollection.cpp	2011-02-25 21:46:04 UTC (rev 5565)
@@ -147,74 +147,74 @@
     }
 }
 
-void IOPrintLayoutElementCollection::Write(MdfStream& fd, PrintLayoutElementCollection* layoutElems, Version* version, const std::string& name)
+void IOPrintLayoutElementCollection::Write(MdfStream& fd, PrintLayoutElementCollection* layoutElems, Version* version, const std::string& name, MgTab& tab)
 {
     _ASSERT(NULL != layoutElems);
 
-    fd << tab() << startStr(name) << std::endl;
-    inctab();
+    fd << tab.tab() << startStr(name) << std::endl;
+    tab.inctab();
 
     for (int i = 0; i < layoutElems->GetCount(); ++i)
     {
-       fd << tab() << startStr(sLayoutElement) << std::endl;
-       inctab();
+       fd << tab.tab() << startStr(sLayoutElement) << std::endl;
+       tab.inctab();
 
         PrintLayoutElement* layoutElem = dynamic_cast<PrintLayoutElement*>(layoutElems->GetAt(i));
         _ASSERT(NULL != layoutElem);
 
         // Property: Name
-        fd << tab() << startStr(sName);
+        fd << tab.tab() << startStr(sName);
         fd << EncodeString(layoutElem->GetName());
         fd << endStr(sName) << std::endl;
 
         // Property: ResourceId
-        fd << tab() << startStr(sResourceId);
+        fd << tab.tab() << startStr(sResourceId);
         fd << EncodeString(layoutElem->GetResourceId());
         fd << endStr(sResourceId) << std::endl;
 
         // Property: Center
-        IOPoint3D::Write(fd, layoutElem->GetCenter(), version, sCenter);
+        IOPoint3D::Write(fd, layoutElem->GetCenter(), version, sCenter, tab);
 
         // Property: Width
-        fd << tab() << startStr(sWidth);
+        fd << tab.tab() << startStr(sWidth);
         fd << DoubleToStr(layoutElem->GetWidth());
         fd << endStr(sWidth) << std::endl;
 
         // Property: Height
-        fd << tab() << startStr(sHeight);
+        fd << tab.tab() << startStr(sHeight);
         fd << DoubleToStr(layoutElem->GetHeight());
         fd << endStr(sHeight) << std::endl;
 
         // Property: Rotation
-        fd << tab() << startStr(sRotation);
+        fd << tab.tab() << startStr(sRotation);
         fd << DoubleToStr(layoutElem->GetRotation());
         fd << endStr(sRotation) << std::endl;
 
         // Property: Units
-        fd << tab() << startStr(sUnits);
+        fd << tab.tab() << startStr(sUnits);
         fd << EncodeString(layoutElem->GetUnits());
         fd << endStr(sUnits) << std::endl;
 
         // Property: Visible
-        fd << tab() << startStr(sVisible);
+        fd << tab.tab() << startStr(sVisible);
         fd << BoolToStr(layoutElem->GetIsVisible());
         fd << endStr(sVisible) << std::endl;
 
         // Property: Opacity
-        fd << tab() << startStr(sOpacity);
+        fd << tab.tab() << startStr(sOpacity);
         fd << DoubleToStr(layoutElem->GetOpacity());
         fd << endStr(sOpacity) << std::endl;
 
         // Property: References
-        IOStringObjectCollection::Write(fd, layoutElem->GetReferences(), version, sReferences, sName);
+        IOStringObjectCollection::Write(fd, layoutElem->GetReferences(), version, sReferences, sName, tab);
 
         // Write any unknown XML / extended data
-        IOUnknown::Write(fd, layoutElem->GetUnknownXml(), version);
+        IOUnknown::Write(fd, layoutElem->GetUnknownXml(), version, tab);
 
-        dectab();
-        fd << tab() << endStr(sLayoutElement) << std::endl;
+        tab.dectab();
+        fd << tab.tab() << endStr(sLayoutElement) << std::endl;
     }
 
-    dectab();
-    fd << tab() << endStr(name) << std::endl;
+    tab.dectab();
+    fd << tab.tab() << endStr(name) << std::endl;
 }

Modified: sandbox/adsk/2.3r/Common/MdfParser/PrintLayout/IOPrintLayoutElementCollection.h
===================================================================
--- sandbox/adsk/2.3r/Common/MdfParser/PrintLayout/IOPrintLayoutElementCollection.h	2011-02-22 07:43:02 UTC (rev 5564)
+++ sandbox/adsk/2.3r/Common/MdfParser/PrintLayout/IOPrintLayoutElementCollection.h	2011-02-25 21:46:04 UTC (rev 5565)
@@ -33,7 +33,7 @@
     virtual void ElementChars(const wchar_t* ch);
     virtual void EndElement(const wchar_t* name, HandlerStack* handlerStack);
 
-    static void Write(MdfStream& fd, PrintLayoutElementCollection* layoutElems, Version* version, const std::string& name);
+    static void Write(MdfStream& fd, PrintLayoutElementCollection* layoutElems, Version* version, const std::string& name, MgTab& tab);
 
 private:
     // Hidden default/copy constructors and assignment operator.

Modified: sandbox/adsk/2.3r/Common/MdfParser/PrintLayout/IOPrintLayoutElementDefinition.cpp
===================================================================
--- sandbox/adsk/2.3r/Common/MdfParser/PrintLayout/IOPrintLayoutElementDefinition.cpp	2011-02-22 07:43:02 UTC (rev 5564)
+++ sandbox/adsk/2.3r/Common/MdfParser/PrintLayout/IOPrintLayoutElementDefinition.cpp	2011-02-25 21:46:04 UTC (rev 5565)
@@ -110,26 +110,26 @@
     }
 }
 
-void IOPrintLayoutElementDefinition::Write(MdfStream& fd, PrintLayoutElementDefinition* layoutElemDef, Version* version)
+void IOPrintLayoutElementDefinition::Write(MdfStream& fd, PrintLayoutElementDefinition* layoutElemDef, Version* version, MgTab& tab)
 {
     _ASSERT(NULL != layoutElemDef);
 
     // Property: Description
-    fd << tab() << startStr(sDescription);
+    fd << tab.tab() << startStr(sDescription);
     fd << EncodeString(layoutElemDef->GetDescription());
     fd << endStr(sDescription) << std::endl;
 
     // Property: ResourceId
-    fd << tab() << startStr(sResourceId);
+    fd << tab.tab() << startStr(sResourceId);
     fd << EncodeString(layoutElemDef->GetResourceId());
     fd << endStr(sResourceId) << std::endl;
 
     // Property: Stylization
-    IOStylizationConfiguration::Write(fd, layoutElemDef->GetStylizationConfiguration(), version);
+    IOStylizationConfiguration::Write(fd, layoutElemDef->GetStylizationConfiguration(), version, tab);
 
     // Property: Data
-    IODataConfiguration::Write(fd, layoutElemDef->GetDataConfiguration(), version);
+    IODataConfiguration::Write(fd, layoutElemDef->GetDataConfiguration(), version, tab);
 
     // Write any unknown XML / extended data
-    IOUnknown::Write(fd, layoutElemDef->GetUnknownXml(), version);
+    IOUnknown::Write(fd, layoutElemDef->GetUnknownXml(), version, tab);
 }

Modified: sandbox/adsk/2.3r/Common/MdfParser/PrintLayout/IOPrintLayoutElementDefinition.h
===================================================================
--- sandbox/adsk/2.3r/Common/MdfParser/PrintLayout/IOPrintLayoutElementDefinition.h	2011-02-22 07:43:02 UTC (rev 5564)
+++ sandbox/adsk/2.3r/Common/MdfParser/PrintLayout/IOPrintLayoutElementDefinition.h	2011-02-25 21:46:04 UTC (rev 5565)
@@ -34,7 +34,7 @@
     virtual void EndElement(const wchar_t* name, HandlerStack* handlerStack);
 
 protected:
-    static void Write(MdfStream& fd, PrintLayoutElementDefinition* layoutElemDef, Version* version);
+    static void Write(MdfStream& fd, PrintLayoutElementDefinition* layoutElemDef, Version* version, MgTab& tab);
 
 private:
     // Hidden default/copy constructors and assignment operator.

Modified: sandbox/adsk/2.3r/Common/MdfParser/PrintLayout/IOPrintLayoutElementStyle.cpp
===================================================================
--- sandbox/adsk/2.3r/Common/MdfParser/PrintLayout/IOPrintLayoutElementStyle.cpp	2011-02-22 07:43:02 UTC (rev 5564)
+++ sandbox/adsk/2.3r/Common/MdfParser/PrintLayout/IOPrintLayoutElementStyle.cpp	2011-02-25 21:46:04 UTC (rev 5565)
@@ -89,21 +89,21 @@
     }
 }
 
-void IOPrintLayoutElementStyle::Write(MdfStream& fd, PrintLayoutElementStyle* layoutElemStyle, Version* version, const std::string& name)
+void IOPrintLayoutElementStyle::Write(MdfStream& fd, PrintLayoutElementStyle* layoutElemStyle, Version* version, const std::string& name, MgTab& tab)
 {
     _ASSERT(NULL != layoutElemStyle);
 
-    fd << tab() << startStr(name) << std::endl;
-    inctab();
+    fd << tab.tab() << startStr(name) << std::endl;
+    tab.inctab();
 
     // Property: Name
-    fd << tab() << startStr(sName);
+    fd << tab.tab() << startStr(sName);
     fd << EncodeString(layoutElemStyle->GetName());
     fd << endStr(sName) << std::endl;
 
     // Write any unknown XML / extended data
-    IOUnknown::Write(fd, layoutElemStyle->GetUnknownXml(), version);
+    IOUnknown::Write(fd, layoutElemStyle->GetUnknownXml(), version, tab);
 
-    dectab();
-    fd << tab() << endStr(name) << std::endl;
+    tab.dectab();
+    fd << tab.tab() << endStr(name) << std::endl;
 }

Modified: sandbox/adsk/2.3r/Common/MdfParser/PrintLayout/IOPrintLayoutElementStyle.h
===================================================================
--- sandbox/adsk/2.3r/Common/MdfParser/PrintLayout/IOPrintLayoutElementStyle.h	2011-02-22 07:43:02 UTC (rev 5564)
+++ sandbox/adsk/2.3r/Common/MdfParser/PrintLayout/IOPrintLayoutElementStyle.h	2011-02-25 21:46:04 UTC (rev 5565)
@@ -33,7 +33,7 @@
     virtual void ElementChars(const wchar_t* ch);
     virtual void EndElement(const wchar_t* name, HandlerStack* handlerStack);
 
-    static void Write(MdfStream& fd, PrintLayoutElementStyle* layoutElemStyle, Version* version, const std::string& name);
+    static void Write(MdfStream& fd, PrintLayoutElementStyle* layoutElemStyle, Version* version, const std::string& name, MgTab& tab);
 
 private:
     // Hidden default/copy constructors and assignment operator.

Modified: sandbox/adsk/2.3r/Common/MdfParser/PrintLayout/IOPropertyMappingCollection.cpp
===================================================================
--- sandbox/adsk/2.3r/Common/MdfParser/PrintLayout/IOPropertyMappingCollection.cpp	2011-02-22 07:43:02 UTC (rev 5564)
+++ sandbox/adsk/2.3r/Common/MdfParser/PrintLayout/IOPropertyMappingCollection.cpp	2011-02-25 21:46:04 UTC (rev 5565)
@@ -102,43 +102,43 @@
     }
 }
 
-void IOPropertyMappingCollection::Write(MdfStream& fd, PropertyMappingCollection* propMappings, Version* version, const std::string& name)
+void IOPropertyMappingCollection::Write(MdfStream& fd, PropertyMappingCollection* propMappings, Version* version, const std::string& name, MgTab& tab)
 {
     _ASSERT(NULL != propMappings);
 
-    fd << tab() << startStr(name) << std::endl;
-    inctab();
+    fd << tab.tab() << startStr(name) << std::endl;
+    tab.inctab();
 
     for (int i = 0; i < propMappings->GetCount(); ++i)
     {
-       fd << tab() << startStr(sPropertyMapping) << std::endl;
-       inctab();
+       fd << tab.tab() << startStr(sPropertyMapping) << std::endl;
+       tab.inctab();
 
         PropertyMapping* propMapping = dynamic_cast<PropertyMapping*>(propMappings->GetAt(i));
         _ASSERT(NULL != propMapping);
 
         // Property: TargetProperty
-        fd << tab() << startStr(sTargetProperty);
+        fd << tab.tab() << startStr(sTargetProperty);
         fd << EncodeString(propMapping->GetTargetProperty());
         fd << endStr(sTargetProperty) << std::endl;
 
         // Property: SourceProperty
-        fd << tab() << startStr(sSourceProperty);
+        fd << tab.tab() << startStr(sSourceProperty);
         fd << EncodeString(propMapping->GetSourceProperty());
         fd << endStr(sSourceProperty) << std::endl;
 
         // Property: SourceUnits
-        fd << tab() << startStr(sSourceUnits);
+        fd << tab.tab() << startStr(sSourceUnits);
         fd << EncodeString(propMapping->GetSourceUnits());
         fd << endStr(sSourceUnits) << std::endl;
 
         // Write any unknown XML / extended data
-        IOUnknown::Write(fd, propMapping->GetUnknownXml(), version);
+        IOUnknown::Write(fd, propMapping->GetUnknownXml(), version, tab);
 
-        dectab();
-        fd << tab() << endStr(sPropertyMapping) << std::endl;
+        tab.dectab();
+        fd << tab.tab() << endStr(sPropertyMapping) << std::endl;
     }
 
-    dectab();
-    fd << tab() << endStr(name) << std::endl;
+    tab.dectab();
+    fd << tab.tab() << endStr(name) << std::endl;
 }

Modified: sandbox/adsk/2.3r/Common/MdfParser/PrintLayout/IOPropertyMappingCollection.h
===================================================================
--- sandbox/adsk/2.3r/Common/MdfParser/PrintLayout/IOPropertyMappingCollection.h	2011-02-22 07:43:02 UTC (rev 5564)
+++ sandbox/adsk/2.3r/Common/MdfParser/PrintLayout/IOPropertyMappingCollection.h	2011-02-25 21:46:04 UTC (rev 5565)
@@ -33,7 +33,7 @@
     virtual void ElementChars(const wchar_t* ch);
     virtual void EndElement(const wchar_t* name, HandlerStack* handlerStack);
 
-    static void Write(MdfStream& fd, PropertyMappingCollection* propMappings, Version* version, const std::string& name);
+    static void Write(MdfStream& fd, PropertyMappingCollection* propMappings, Version* version, const std::string& name, MgTab& tab);
 
 private:
     // Hidden default/copy constructors and assignment operator.

Modified: sandbox/adsk/2.3r/Common/MdfParser/PrintLayout/IOStylizationConfiguration.cpp
===================================================================
--- sandbox/adsk/2.3r/Common/MdfParser/PrintLayout/IOStylizationConfiguration.cpp	2011-02-22 07:43:02 UTC (rev 5564)
+++ sandbox/adsk/2.3r/Common/MdfParser/PrintLayout/IOStylizationConfiguration.cpp	2011-02-25 21:46:04 UTC (rev 5565)
@@ -85,21 +85,21 @@
     }
 }
 
-void IOStylizationConfiguration::Write(MdfStream& fd, StylizationConfiguration* stylizationConf, Version* version)
+void IOStylizationConfiguration::Write(MdfStream& fd, StylizationConfiguration* stylizationConf, Version* version, MgTab& tab)
 {
     _ASSERT(NULL != stylizationConf);
 
-    fd << tab() << startStr(sStylization) << std::endl;
-    inctab();
+    fd << tab.tab() << startStr(sStylization) << std::endl;
+    tab.inctab();
 
     // Property: ResourceId
-    fd << tab() << startStr(sResourceId);
+    fd << tab.tab() << startStr(sResourceId);
     fd << EncodeString(stylizationConf->GetResourceId());
     fd << endStr(sResourceId) << std::endl;
 
     // Write any unknown XML / extended data
-    IOUnknown::Write(fd, stylizationConf->GetUnknownXml(), version);
+    IOUnknown::Write(fd, stylizationConf->GetUnknownXml(), version, tab);
 
-    dectab();
-    fd << tab() << endStr(sStylization) << std::endl;
+    tab.dectab();
+    fd << tab.tab() << endStr(sStylization) << std::endl;
 }

Modified: sandbox/adsk/2.3r/Common/MdfParser/PrintLayout/IOStylizationConfiguration.h
===================================================================
--- sandbox/adsk/2.3r/Common/MdfParser/PrintLayout/IOStylizationConfiguration.h	2011-02-22 07:43:02 UTC (rev 5564)
+++ sandbox/adsk/2.3r/Common/MdfParser/PrintLayout/IOStylizationConfiguration.h	2011-02-25 21:46:04 UTC (rev 5565)
@@ -33,7 +33,7 @@
     virtual void ElementChars(const wchar_t* ch);
     virtual void EndElement(const wchar_t* name, HandlerStack* handlerStack);
 
-    static void Write(MdfStream& fd, StylizationConfiguration* stylizationConf, Version* version);
+    static void Write(MdfStream& fd, StylizationConfiguration* stylizationConf, Version* version, MgTab& tab);
 
 private:
     // Hidden default/copy constructors and assignment operator.

Modified: sandbox/adsk/2.3r/Common/MdfParser/PrintLayout/IOThickness.cpp
===================================================================
--- sandbox/adsk/2.3r/Common/MdfParser/PrintLayout/IOThickness.cpp	2011-02-22 07:43:02 UTC (rev 5564)
+++ sandbox/adsk/2.3r/Common/MdfParser/PrintLayout/IOThickness.cpp	2011-02-25 21:46:04 UTC (rev 5565)
@@ -84,33 +84,33 @@
     }
 }
 
-void IOThickness::Write(MdfStream& fd, Thickness* thickness, Version* version, const std::string& name)
+void IOThickness::Write(MdfStream& fd, Thickness* thickness, Version* version, const std::string& name, MgTab& tab)
 {
     _ASSERT(NULL != thickness);
 
-    fd << tab() << startStr(name) << std::endl;
-    inctab();
+    fd << tab.tab() << startStr(name) << std::endl;
+    tab.inctab();
 
     // Property: Left
-    fd << tab() << startStr(sLeft);
+    fd << tab.tab() << startStr(sLeft);
     fd << DoubleToStr(thickness->GetLeft());
     fd << endStr(sLeft) << std::endl;
 
     // Property: Top
-    fd << tab() << startStr(sTop);
+    fd << tab.tab() << startStr(sTop);
     fd << DoubleToStr(thickness->GetTop());
     fd << endStr(sTop) << std::endl;
 
     // Property: Right
-    fd << tab() << startStr(sRight);
+    fd << tab.tab() << startStr(sRight);
     fd << DoubleToStr(thickness->GetRight());
     fd << endStr(sRight) << std::endl;
 
     // Property: Bottom
-    fd << tab() << startStr(sBottom);
+    fd << tab.tab() << startStr(sBottom);
     fd << DoubleToStr(thickness->GetBottom());
     fd << endStr(sBottom) << std::endl;
 
-    dectab();
-    fd << tab() << endStr(name) << std::endl;
+    tab.dectab();
+    fd << tab.tab() << endStr(name) << std::endl;
 }

Modified: sandbox/adsk/2.3r/Common/MdfParser/PrintLayout/IOThickness.h
===================================================================
--- sandbox/adsk/2.3r/Common/MdfParser/PrintLayout/IOThickness.h	2011-02-22 07:43:02 UTC (rev 5564)
+++ sandbox/adsk/2.3r/Common/MdfParser/PrintLayout/IOThickness.h	2011-02-25 21:46:04 UTC (rev 5565)
@@ -33,7 +33,7 @@
     virtual void ElementChars(const wchar_t* ch);
     virtual void EndElement(const wchar_t* name, HandlerStack* handlerStack);
 
-    static void Write(MdfStream& fd, Thickness* thickness, Version* version, const std::string& name);
+    static void Write(MdfStream& fd, Thickness* thickness, Version* version, const std::string& name, MgTab& tab);
 
 private:
     // Hidden default/copy constructors and assignment operator.

Modified: sandbox/adsk/2.3r/Common/MdfParser/SAX2Parser.cpp
===================================================================
--- sandbox/adsk/2.3r/Common/MdfParser/SAX2Parser.cpp	2011-02-22 07:43:02 UTC (rev 5564)
+++ sandbox/adsk/2.3r/Common/MdfParser/SAX2Parser.cpp	2011-02-25 21:46:04 UTC (rev 5565)
@@ -113,7 +113,7 @@
 
 void SAX2Parser::DisableTabs()
 {
-    disableTabs();
+    MgTab::disableTabs();
 }
 
 
@@ -363,21 +363,21 @@
     fd.open(name.c_str());
     if (fd.is_open())
     {
-        zerotab();
-        fd << tab() << "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" << std::endl; // NOXLATE
+        MgTab tab;
+        fd << tab.tab() << "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" << std::endl; // NOXLATE
 
         if (NULL != map)
-            IOMapDefinition::Write(fd, map, version);
+            IOMapDefinition::Write(fd, map, version, tab);
         else if (NULL != vLayer)
-            IOVectorLayerDefinition::Write(fd, vLayer, version);
+            IOVectorLayerDefinition::Write(fd, vLayer, version, tab);
         else if (NULL != dLayer)
-            IODrawingLayerDefinition::Write(fd, dLayer, version);
+            IODrawingLayerDefinition::Write(fd, dLayer, version, tab);
         else if (NULL != gLayer)
-            IOGridLayerDefinition::Write(fd, gLayer, version);
+            IOGridLayerDefinition::Write(fd, gLayer, version, tab);
         else if (NULL != printLayout)
-            IOPrintLayoutDefinition::Write(fd, printLayout, version);
+            IOPrintLayoutDefinition::Write(fd, printLayout, version, tab);
         else if (NULL != mapViewport)
-            IOMapViewportDefinition::Write(fd, mapViewport, version);
+            IOMapViewportDefinition::Write(fd, mapViewport, version, tab);
     }
     fd.close();
 }
@@ -389,16 +389,16 @@
     fd.open(name.c_str());
     if (fd.is_open())
     {
-        zerotab();
-        fd << tab() << "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" << std::endl; // NOXLATE
+        MgTab tab;
+        fd << tab.tab() << "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" << std::endl; // NOXLATE
 
         SimpleSymbolDefinition* simpleSymbol = dynamic_cast<SimpleSymbolDefinition*>(symbol);
         CompoundSymbolDefinition* compoundSymbol = dynamic_cast<CompoundSymbolDefinition*>(symbol);
 
         if (NULL != simpleSymbol)
-            IOSimpleSymbolDefinition::Write(fd, simpleSymbol, true, version);
+            IOSimpleSymbolDefinition::Write(fd, simpleSymbol, true, version, tab);
         else if (NULL != compoundSymbol)
-            IOCompoundSymbolDefinition::Write(fd, compoundSymbol, true, version);
+            IOCompoundSymbolDefinition::Write(fd, compoundSymbol, true, version, tab);
     }
     fd.close();
 }
@@ -410,11 +410,11 @@
     fd.open(name.c_str());
     if (fd.is_open())
     {
-        zerotab();
-        fd << tab() << "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" << std::endl; // NOXLATE
+        MgTab tab;
+        fd << tab.tab() << "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" << std::endl; // NOXLATE
 
         if (NULL != watermark)
-            IOWatermarkDefinition::Write(fd, watermark, version);
+            IOWatermarkDefinition::Write(fd, watermark, version, tab);
     }
     fd.close();
 }
@@ -423,9 +423,10 @@
 std::string SAX2Parser::SerializeToXML(MapDefinition* map, Version* version)
 {
     MdfStringStream fd;
+    MgTab tab;
 
     if (NULL != map)
-        IOMapDefinition::Write(fd, map, version);
+        IOMapDefinition::Write(fd, map, version, tab);
 
     return fd.str();
 }
@@ -434,9 +435,10 @@
 std::string SAX2Parser::SerializeToXML(PrintLayoutDefinition* printLayout, Version* version)
 {
     MdfStringStream fd;
+    MgTab tab;
 
     if (NULL != printLayout)
-        IOPrintLayoutDefinition::Write(fd, printLayout, version);
+        IOPrintLayoutDefinition::Write(fd, printLayout, version, tab);
 
     return fd.str();
 }
@@ -445,11 +447,12 @@
 std::string SAX2Parser::SerializeToXML(PrintLayoutElementDefinition* printLayoutElem, Version* version)
 {
     MdfStringStream fd;
+    MgTab tab;
 
     MapViewportDefinition* mapViewport = dynamic_cast<MapViewportDefinition*>(printLayoutElem);
 
     if (NULL != mapViewport)
-        IOMapViewportDefinition::Write(fd, mapViewport, version);
+        IOMapViewportDefinition::Write(fd, mapViewport, version, tab);
 
     return fd.str();
 }
@@ -458,17 +461,18 @@
 std::string SAX2Parser::SerializeToXML(LayerDefinition* layer, Version* version)
 {
     MdfStringStream fd;
+    MgTab tab;
 
     VectorLayerDefinition* vectorLayer = dynamic_cast<VectorLayerDefinition*>(layer);
     DrawingLayerDefinition* drawingLayer = dynamic_cast<DrawingLayerDefinition*>(layer);
     GridLayerDefinition* gridLayer = dynamic_cast<GridLayerDefinition*>(layer);
 
     if (NULL != vectorLayer)
-        IOVectorLayerDefinition::Write(fd, vectorLayer, version);
+        IOVectorLayerDefinition::Write(fd, vectorLayer, version, tab);
     else if (NULL != drawingLayer)
-        IODrawingLayerDefinition::Write(fd, drawingLayer, version);
+        IODrawingLayerDefinition::Write(fd, drawingLayer, version, tab);
     else if (NULL != gridLayer)
-        IOGridLayerDefinition::Write(fd, gridLayer, version);
+        IOGridLayerDefinition::Write(fd, gridLayer, version, tab);
 
     return fd.str();
 }
@@ -477,14 +481,15 @@
 std::string SAX2Parser::SerializeToXML(SymbolDefinition* symbol, Version* version)
 {
     MdfStringStream fd;
+    MgTab tab;
 
     SimpleSymbolDefinition* simpleSymbol = dynamic_cast<SimpleSymbolDefinition*>(symbol);
     CompoundSymbolDefinition* compoundSymbol = dynamic_cast<CompoundSymbolDefinition*>(symbol);
 
     if (NULL != simpleSymbol)
-        IOSimpleSymbolDefinition::Write(fd, simpleSymbol, true, version);
+        IOSimpleSymbolDefinition::Write(fd, simpleSymbol, true, version, tab);
     else if (NULL != compoundSymbol)
-        IOCompoundSymbolDefinition::Write(fd, compoundSymbol, true, version);
+        IOCompoundSymbolDefinition::Write(fd, compoundSymbol, true, version, tab);
 
     return fd.str();
 }
@@ -493,9 +498,10 @@
 std::string SAX2Parser::SerializeToXML(WatermarkDefinition* watermark, Version* version)
 {
     MdfStringStream fd;
+    MgTab tab;
 
     if (NULL != watermark)
-        IOWatermarkDefinition::Write(fd, watermark, version);
+        IOWatermarkDefinition::Write(fd, watermark, version, tab);
 
     return fd.str();
 }

Modified: sandbox/adsk/2.3r/Common/MdfParser/stdafx.h
===================================================================
--- sandbox/adsk/2.3r/Common/MdfParser/stdafx.h	2011-02-22 07:43:02 UTC (rev 5564)
+++ sandbox/adsk/2.3r/Common/MdfParser/stdafx.h	2011-02-25 21:46:04 UTC (rev 5565)
@@ -56,7 +56,7 @@
 #include "MdfParser.h"
 #include "IOUtil.h"
 
-#define EMIT_BOOL_PROPERTY(stream, object, prop, optional, defaultVal)          \
+#define EMIT_BOOL_PROPERTY(stream, object, prop, optional, defaultVal, tabObj)  \
             bool emit##prop = true;                                             \
             const MdfString& str##prop = object->Get##prop();                   \
             if (optional)                                                       \
@@ -72,12 +72,12 @@
             }                                                                   \
             if (emit##prop)                                                     \
             {                                                                   \
-                stream << tab() << "<" #prop ">";                               \
+                stream << tabObj.tab() << "<" #prop ">";                        \
                 stream << EncodeString(str##prop);                              \
                 stream << "</" #prop ">" << std::endl;                          \
             }
 
-#define EMIT_DOUBLE_PROPERTY(stream, object, prop, optional, defaultVal)        \
+#define EMIT_DOUBLE_PROPERTY(stream, object, prop, optional, defaultVal, tabObj)\
             bool emit##prop = true;                                             \
             const MdfString& str##prop = object->Get##prop();                   \
             if (optional)                                                       \
@@ -93,12 +93,12 @@
             }                                                                   \
             if (emit##prop)                                                     \
             {                                                                   \
-                stream << tab() << "<" #prop ">";                               \
+                stream << tabObj.tab() << "<" #prop ">";                        \
                 stream << EncodeString(str##prop);                              \
                 stream << "</" #prop ">" << std::endl;                          \
             }
 
-#define EMIT_INTEGER_PROPERTY(stream, object, prop, optional, defaultVal)       \
+#define EMIT_INTEGER_PROPERTY(stream, object, prop, optional, defaultVal, tabObj)\
             bool emit##prop = true;                                             \
             const MdfString& str##prop = object->Get##prop();                   \
             if (optional)                                                       \
@@ -114,12 +114,12 @@
             }                                                                   \
             if (emit##prop)                                                     \
             {                                                                   \
-                stream << tab() << "<" #prop ">";                               \
+                stream << tabObj.tab() << "<" #prop ">";                        \
                 stream << EncodeString(str##prop);                              \
                 stream << "</" #prop ">" << std::endl;                          \
             }
 
-#define EMIT_STRING_PROPERTY(stream, object, prop, optional, defaultVal)        \
+#define EMIT_STRING_PROPERTY(stream, object, prop, optional, defaultVal, tabObj)\
             bool emit##prop = true;                                             \
             const MdfString& str##prop = object->Get##prop();                   \
             if (optional)                                                       \
@@ -131,12 +131,12 @@
             }                                                                   \
             if (emit##prop)                                                     \
             {                                                                   \
-                stream << tab() << "<" #prop ">";                               \
+                stream << tabObj.tab() << "<" #prop ">";                        \
                 stream << EncodeString(str##prop);                              \
                 stream << "</" #prop ">" << std::endl;                          \
             }
 
-#define EMIT_ENUM_2(stream, object, enumtype, prop, e1, e2, optIdx)             \
+#define EMIT_ENUM_2(stream, object, enumtype, prop, e1, e2, optIdx, tabObj)     \
             enumtype::prop propVal##prop = object->Get##prop();                 \
             bool emit##prop = true;                                             \
             switch (optIdx)                                                     \
@@ -150,7 +150,7 @@
             }                                                                   \
             if (emit##prop)                                                     \
             {                                                                   \
-                stream << tab() << "<" #prop ">";                               \
+                stream << tabObj.tab() << "<" #prop ">";                        \
                 switch (propVal##prop)                                          \
                 {                                                               \
                 case enumtype::e1:                                              \
@@ -163,7 +163,7 @@
                 stream << "</" #prop ">" << std::endl;                          \
             }
 
-#define EMIT_ENUM_3(stream, object, enumtype, prop, e1, e2, e3, optIdx)         \
+#define EMIT_ENUM_3(stream, object, enumtype, prop, e1, e2, e3, optIdx, tabObj) \
             enumtype::prop propVal##prop = object->Get##prop();                 \
             bool emit##prop = true;                                             \
             switch (optIdx)                                                     \
@@ -180,7 +180,7 @@
             }                                                                   \
             if (emit##prop)                                                     \
             {                                                                   \
-                stream << tab() << "<" #prop ">";                               \
+                stream << tabObj.tab() << "<" #prop ">";                        \
                 switch (propVal##prop)                                          \
                 {                                                               \
                 case enumtype::e1:                                              \
@@ -196,7 +196,7 @@
                 stream << "</" #prop ">" << std::endl;                          \
             }
 
-#define EMIT_ENUM_4(stream, object, enumtype, prop, e1, e2, e3, e4, optIdx)     \
+#define EMIT_ENUM_4(stream, object, enumtype, prop, e1, e2, e3, e4, optIdx, tabObj)\
             enumtype::prop propVal##prop = object->Get##prop();                 \
             bool emit##prop = true;                                             \
             switch (optIdx)                                                     \
@@ -216,7 +216,7 @@
             }                                                                   \
             if (emit##prop)                                                     \
             {                                                                   \
-                stream << tab() << "<" #prop ">";                               \
+                stream << tabObj.tab() << "<" #prop ">";                        \
                 switch (propVal##prop)                                          \
                 {                                                               \
                 case enumtype::e1:                                              \
@@ -235,7 +235,7 @@
                 stream << "</" #prop ">" << std::endl;                          \
             }
 
-#define EMIT_ENUM_5(stream, object, enumtype, prop, e1, e2, e3, e4, e5, optIdx) \
+#define EMIT_ENUM_5(stream, object, enumtype, prop, e1, e2, e3, e4, e5, optIdx, tabObj)\
             enumtype::prop propVal##prop = object->Get##prop();                 \
             bool emit##prop = true;                                             \
             switch (optIdx)                                                     \
@@ -258,7 +258,7 @@
             }                                                                   \
             if (emit##prop)                                                     \
             {                                                                   \
-                stream << tab() << "<" #prop ">";                               \
+                stream << tabObj.tab() << "<" #prop ">";                        \
                 switch (propVal##prop)                                          \
                 {                                                               \
                 case enumtype::e1:                                              \



More information about the mapguide-commits mailing list