[mapguide-commits] r5187 - in trunk/MgDev/Common: CoordinateSystem Geometry Geometry/Buffer Geometry/Parse MapGuideCommon/Services MapGuideCommon/System MdfModel MdfParser PlatformBase/MapLayer PlatformBase/Services Renderers Stylization

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Fri Sep 24 01:09:45 EDT 2010


Author: waltweltonlair
Date: 2010-09-24 05:09:44 +0000 (Fri, 24 Sep 2010)
New Revision: 5187

Modified:
   trunk/MgDev/Common/CoordinateSystem/ArbitraryCoordsys.cpp
   trunk/MgDev/Common/CoordinateSystem/CoordSysDatum.cpp
   trunk/MgDev/Common/CoordinateSystem/CoordSysEnumInteger32.cpp
   trunk/MgDev/Common/CoordinateSystem/CoordSysFormatConverter.cpp
   trunk/MgDev/Common/CoordinateSystem/CoordSysGeodeticTransformation.cpp
   trunk/MgDev/Common/Geometry/Buffer/GreatCircleBufferUtil.cpp
   trunk/MgDev/Common/Geometry/Buffer/MgBuffer.cpp
   trunk/MgDev/Common/Geometry/Buffer/MgBuffer.h
   trunk/MgDev/Common/Geometry/Buffer/bufrutil.cpp
   trunk/MgDev/Common/Geometry/Buffer/planeswp.cpp
   trunk/MgDev/Common/Geometry/CoordinateCollection.h
   trunk/MgDev/Common/Geometry/Parse/StringUtility.cpp
   trunk/MgDev/Common/MapGuideCommon/Services/FeatureInformation.h
   trunk/MgDev/Common/MapGuideCommon/Services/ServerConnection.cpp
   trunk/MgDev/Common/MapGuideCommon/Services/ServerConnectionPool.cpp
   trunk/MgDev/Common/MapGuideCommon/System/UserInformation.cpp
   trunk/MgDev/Common/MdfModel/AreaRule.cpp
   trunk/MgDev/Common/MdfModel/AreaSymbolization2D.cpp
   trunk/MgDev/Common/MdfModel/CompositeRule.cpp
   trunk/MgDev/Common/MdfModel/Label.cpp
   trunk/MgDev/Common/MdfModel/LineSymbolization2D.cpp
   trunk/MgDev/Common/MdfModel/LineUsage.cpp
   trunk/MgDev/Common/MdfModel/MarkSymbol.cpp
   trunk/MgDev/Common/MdfModel/MdfOwnerCollection.h
   trunk/MgDev/Common/MdfModel/Override.cpp
   trunk/MgDev/Common/MdfModel/PointRule.cpp
   trunk/MgDev/Common/MdfModel/PointSymbolization2D.cpp
   trunk/MgDev/Common/MdfModel/Rule.cpp
   trunk/MgDev/Common/MdfModel/SimpleSymbol.cpp
   trunk/MgDev/Common/MdfModel/SimpleSymbolDefinition.cpp
   trunk/MgDev/Common/MdfModel/SymbolInstance.cpp
   trunk/MgDev/Common/MdfModel/Text.cpp
   trunk/MgDev/Common/MdfModel/VectorScaleRange.cpp
   trunk/MgDev/Common/MdfParser/FSDSAX2Parser.cpp
   trunk/MgDev/Common/PlatformBase/MapLayer/SelectionBase.cpp
   trunk/MgDev/Common/PlatformBase/Services/FeatureAggregateOptions.h
   trunk/MgDev/Common/PlatformBase/Services/FeatureQueryOptions.h
   trunk/MgDev/Common/PlatformBase/Services/GeometryProperty.cpp
   trunk/MgDev/Common/Renderers/DWFRenderer.cpp
   trunk/MgDev/Common/Renderers/EMapRenderer.cpp
   trunk/MgDev/Common/Renderers/EPlotRenderer.cpp
   trunk/MgDev/Common/Renderers/GDRenderer.cpp
   trunk/MgDev/Common/Renderers/KmlRenderer.cpp
   trunk/MgDev/Common/Renderers/RS_ByteData.cpp
   trunk/MgDev/Common/Stylization/Band.cpp
   trunk/MgDev/Common/Stylization/BandData.cpp
   trunk/MgDev/Common/Stylization/DataValueStack.h
   trunk/MgDev/Common/Stylization/DefaultStylizer.cpp
   trunk/MgDev/Common/Stylization/GridData.cpp
   trunk/MgDev/Common/Stylization/GridThemeParser.cpp
   trunk/MgDev/Common/Stylization/LabelRenderer.cpp
   trunk/MgDev/Common/Stylization/LabelRendererLocal.cpp
   trunk/MgDev/Common/Stylization/RS_FontEngine.cpp
   trunk/MgDev/Common/Stylization/RasterAdapter.cpp
   trunk/MgDev/Common/Stylization/RichTextEngine.cpp
   trunk/MgDev/Common/Stylization/SE_StyleVisitor.cpp
   trunk/MgDev/Common/Stylization/atom.h
   trunk/MgDev/Common/Stylization/atom_element_style.cpp
   trunk/MgDev/Common/Stylization/mtext_parser.cpp
Log:
Minor cleanup...

Change code like the following:

    if (pointer)
        delete pointer;

to just:

    delete pointer;

Calling delete with null is safe.


Modified: trunk/MgDev/Common/CoordinateSystem/ArbitraryCoordsys.cpp
===================================================================
--- trunk/MgDev/Common/CoordinateSystem/ArbitraryCoordsys.cpp	2010-09-24 03:43:12 UTC (rev 5186)
+++ trunk/MgDev/Common/CoordinateSystem/ArbitraryCoordsys.cpp	2010-09-24 05:09:44 UTC (rev 5187)
@@ -529,7 +529,7 @@
    }
 
 
-   if(szComponent) delete [] szComponent;
+   delete [] szComponent;
 
    return bOK;
 }

Modified: trunk/MgDev/Common/CoordinateSystem/CoordSysDatum.cpp
===================================================================
--- trunk/MgDev/Common/CoordinateSystem/CoordSysDatum.cpp	2010-09-24 03:43:12 UTC (rev 5186)
+++ trunk/MgDev/Common/CoordinateSystem/CoordSysDatum.cpp	2010-09-24 05:09:44 UTC (rev 5187)
@@ -254,7 +254,7 @@
     strncpy(m_DtDef.key_nm, pStr, cs_KEYNM_MAX);
 
     //Free the converted string
-    delete [] pStr;
+    delete[] pStr;
 
     //And we're done!
     MG_CATCH_AND_THROW(L"MgCoordinateSystemDatum.SetDtCode")

Modified: trunk/MgDev/Common/CoordinateSystem/CoordSysEnumInteger32.cpp
===================================================================
--- trunk/MgDev/Common/CoordinateSystem/CoordSysEnumInteger32.cpp	2010-09-24 03:43:12 UTC (rev 5186)
+++ trunk/MgDev/Common/CoordinateSystem/CoordSysEnumInteger32.cpp	2010-09-24 05:09:44 UTC (rev 5187)
@@ -57,11 +57,9 @@
         throw new MgNullArgumentException(L"MgCoordinateSystemEnumInteger32.SetList", __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
-    if (m_pnValues)
-    {
-        delete [] m_pnValues;
-        m_pnValues = NULL;
-    }
+    delete [] m_pnValues;
+    m_pnValues = NULL;
+
     m_ulPos = 0;
     m_ulSize = 0;
 

Modified: trunk/MgDev/Common/CoordinateSystem/CoordSysFormatConverter.cpp
===================================================================
--- trunk/MgDev/Common/CoordinateSystem/CoordSysFormatConverter.cpp	2010-09-24 03:43:12 UTC (rev 5186)
+++ trunk/MgDev/Common/CoordinateSystem/CoordSysFormatConverter.cpp	2010-09-24 05:09:44 UTC (rev 5187)
@@ -315,18 +315,9 @@
                     //the dictionary we will fail because it is protected
                     //in the dictionary file
                     pCsFromDict->SetProtectMode(false);
-                    if (pswCsName)
-                    {
-                        delete[] pswCsName;
-                    }
-                    if (pswDtName)
-                    {
-                        delete[] pswDtName;
-                    }
-                    if (pswElName)
-                    {
-                        delete[] pswElName;
-                    }
+                    delete[] pswCsName;
+                    delete[] pswDtName;
+                    delete[] pswElName;
 
                     delete[] pszWkt;
 
@@ -343,19 +334,11 @@
             //text information parameters
             pEFromDict->Release();
         }
-        if (pswCsName)
-        {
-            delete[] pswCsName;
-        }
-        if (pswDtName)
-        {
-            delete[] pswDtName;
-        }
-        if (pswElName)
-        {
-            delete[] pswElName;
-        }
 
+        delete[] pswCsName;
+        delete[] pswDtName;
+        delete[] pswElName;
+
         //creates the coordsys defintion
         //don't ask the function to load the datum from the catalog, we'll set it later
         pCsDef=BuildInterfaceFromCsDef(csDef, NULL);

Modified: trunk/MgDev/Common/CoordinateSystem/CoordSysGeodeticTransformation.cpp
===================================================================
--- trunk/MgDev/Common/CoordinateSystem/CoordSysGeodeticTransformation.cpp	2010-09-24 03:43:12 UTC (rev 5186)
+++ trunk/MgDev/Common/CoordinateSystem/CoordSysGeodeticTransformation.cpp	2010-09-24 05:09:44 UTC (rev 5187)
@@ -386,8 +386,7 @@
 
     MG_CATCH(L"CCoordinateSystemGeodeticTransformation.SetupFromTransformationDef")
 
-    if (NULL != transformName)
-        delete[] transformName;
+    delete[] transformName;
 
     MG_THROW()
 }

Modified: trunk/MgDev/Common/Geometry/Buffer/GreatCircleBufferUtil.cpp
===================================================================
--- trunk/MgDev/Common/Geometry/Buffer/GreatCircleBufferUtil.cpp	2010-09-24 03:43:12 UTC (rev 5186)
+++ trunk/MgDev/Common/Geometry/Buffer/GreatCircleBufferUtil.cpp	2010-09-24 05:09:44 UTC (rev 5187)
@@ -174,10 +174,7 @@
 
 void GreatCircleBufferUtil::InitPolyObject()
 {
-    if (m_pfBufferVerts != NULL)
-    {
-        delete [] m_pfBufferVerts;
-    }
+    delete [] m_pfBufferVerts;
 
     // allocate the buffer used by CreateConvexOffsetChains() - note that the
     // buffer is given an "overrun" area at the end - this helps simplify the

Modified: trunk/MgDev/Common/Geometry/Buffer/MgBuffer.cpp
===================================================================
--- trunk/MgDev/Common/Geometry/Buffer/MgBuffer.cpp	2010-09-24 03:43:12 UTC (rev 5186)
+++ trunk/MgDev/Common/Geometry/Buffer/MgBuffer.cpp	2010-09-24 05:09:44 UTC (rev 5187)
@@ -254,12 +254,9 @@
     else
         delete bufferPolygon;
 
-    if (bufferUtil != NULL)
-        delete bufferUtil;
+    delete bufferUtil;
+    delete borderWalker;
 
-    if (borderWalker)
-        delete borderWalker;
-
     return;
 }
 
@@ -311,12 +308,9 @@
     else
         delete bufferPolygon;
 
-    if (bufferUtil != NULL)
-        delete bufferUtil;
+    delete bufferUtil;
+    delete borderWalker;
 
-    if (borderWalker)
-        delete borderWalker;
-
     return;
 }
 
@@ -378,12 +372,9 @@
     else
         delete bufferPolygon;
 
-    if (bufferUtil != NULL)
-        delete bufferUtil;
+    delete bufferUtil;
+    delete borderWalker;
 
-    if (borderWalker)
-        delete borderWalker;
-
     return;
 }
 
@@ -461,11 +452,8 @@
         else
             delete bufferPolygon;
 
-        if (bufferUtil != NULL)
-            delete bufferUtil;
-
-        if (borderWalker)
-            delete borderWalker;
+        delete bufferUtil;
+        delete borderWalker;
     }
 
     return;
@@ -542,12 +530,9 @@
         else
             delete bufferPolygon;
 
-        if (bufferUtil != NULL)
-            delete bufferUtil;
+        delete bufferUtil;
+        delete borderWalker;
 
-        if (borderWalker)
-            delete borderWalker;
-
         if (topoError)
             throw new PlaneSweepException(PlaneSweepException::TopologicalError);
     }
@@ -627,11 +612,8 @@
         else
             delete bufferPolygon;
 
-        if (bufferUtil != NULL)
-            delete bufferUtil;
-
-        if (borderWalker)
-            delete borderWalker;
+        delete bufferUtil;
+        delete borderWalker;
     }
 
     return;
@@ -719,11 +701,8 @@
         else
             delete bufferPolygon;
 
-        if (bufferUtil != NULL)
-            delete bufferUtil;
-
-        if (borderWalker)
-            delete borderWalker;
+        delete bufferUtil;
+        delete borderWalker;
     }
 
     return;

Modified: trunk/MgDev/Common/Geometry/Buffer/MgBuffer.h
===================================================================
--- trunk/MgDev/Common/Geometry/Buffer/MgBuffer.h	2010-09-24 03:43:12 UTC (rev 5186)
+++ trunk/MgDev/Common/Geometry/Buffer/MgBuffer.h	2010-09-24 05:09:44 UTC (rev 5187)
@@ -44,10 +44,8 @@
 
         ~BufferParams()
         {
-            if (progressCallback != NULL)
-                delete progressCallback;
-            if (transform != NULL)
-                delete transform;
+            delete progressCallback;
+            delete transform;
         }
 
         ProgressCallback* progressCallback;

Modified: trunk/MgDev/Common/Geometry/Buffer/bufrutil.cpp
===================================================================
--- trunk/MgDev/Common/Geometry/Buffer/bufrutil.cpp	2010-09-24 03:43:12 UTC (rev 5186)
+++ trunk/MgDev/Common/Geometry/Buffer/bufrutil.cpp	2010-09-24 05:09:44 UTC (rev 5187)
@@ -110,10 +110,7 @@
 
 BufferUtility::~BufferUtility()
 {
-    if (m_pfBufferVerts != NULL)
-    {
-        delete [] m_pfBufferVerts;
-    }
+    delete [] m_pfBufferVerts;
 
 } // end: destructor
 
@@ -188,10 +185,7 @@
 
 void BufferUtility::InitPointLine()
 {
-    if (m_pfBufferVerts != NULL)
-    {
-        delete [] m_pfBufferVerts;
-    }
+    delete [] m_pfBufferVerts;
 
     // allocate a buffer used to generate point/line segment buffers
 
@@ -222,10 +216,7 @@
 
 void BufferUtility::InitPolyObject()
 {
-    if (m_pfBufferVerts != NULL)
-    {
-        delete [] m_pfBufferVerts;
-    }
+    delete [] m_pfBufferVerts;
 
     // allocate the buffer used by CreateConvexOffsetChains() - note that the
     // buffer is given an "overrun" area at the end - this helps simplify the

Modified: trunk/MgDev/Common/Geometry/Buffer/planeswp.cpp
===================================================================
--- trunk/MgDev/Common/Geometry/Buffer/planeswp.cpp	2010-09-24 03:43:12 UTC (rev 5186)
+++ trunk/MgDev/Common/Geometry/Buffer/planeswp.cpp	2010-09-24 05:09:44 UTC (rev 5187)
@@ -332,10 +332,6 @@
 void PlaneSweep::DoPlaneSweep(ProgressCallback &callback,
     OrientedPolyPolygon &outputPolygon)
 {
-
-
-
-
     // check if there is anything to do
 
     if (m_nEdgesAdded == 0)
@@ -353,7 +349,6 @@
     if (callback.IsCanceled())
         return;
 
-
     // initialize pointers to data structures
 
     EventIntervalArray *eventIntArray = NULL;
@@ -495,12 +490,6 @@
             callback.AdvanceOneSubInterval();
     }
 
-
-
-
-
-
-
     // clean up data structures that are no longer required, and the
     // progress interval for the sweep part
 
@@ -541,21 +530,12 @@
         MG_THROW()
     }
 
-
-
-
-
-
-
     delete intersectList;
 
     // extract the output poly-polygon from the graph of WingedEdges
 
-
-
-
-
     if (!callback.IsCanceled())
+    {
         try
         {
             GetOutputPolygon(callback, outputPolygon);
@@ -566,14 +546,8 @@
             callback.EndProgressInterval();
             throw(ex);
         }
+    }
 
-
-
-
-
-
-
-
     // end the progress interval started above
 
     callback.EndProgressInterval();
@@ -680,7 +654,8 @@
 
 void PlaneSweep::AddEdge(OpsDoublePoint *vertices[2])
 {
-    if (*vertices[0] != *vertices[1]) {
+    if (*vertices[0] != *vertices[1])
+    {
         WingedEdge *wEdge = m_wingedEdgeAlloc->Allocate(vertices);
         m_tupleArray->AddSweepTuples(m_sweepEdgeAlloc->Allocate(wEdge));
         m_nEdgesAdded++;
@@ -735,7 +710,8 @@
 
     double ordinate;
     SweepEdge *edge2 = xOrdTree->Below(edge);
-    while (edge2 != NULL) {
+    while (edge2 != NULL)
+    {
         ordinate = edge2->Ordinate(x);
         if (y != ordinate)
             break;
@@ -746,7 +722,8 @@
     // walk up the X-Order looking for intersecting edges
 
     edge2 = xOrdTree->Above(edge);
-    while (edge2 != NULL) {
+    while (edge2 != NULL)
+    {
         ordinate = edge2->Ordinate(x);
         if (y != ordinate)
             break;
@@ -795,12 +772,10 @@
 
     OpsDoublePoint *intersectPt = edge1->MinVert();
 
-
     if ( !intersectList->Add(*intersectPt, edge1->GetWingedEdge(),
         edge2->GetWingedEdge()))
         return;
 
-
     // if the edges have the same slope, and the start point of edge1 is not
     // the end point of edge2 then the two edges overlap - add the appropriate
     // edge endpoint to the intersection list
@@ -1279,10 +1254,6 @@
 void PlaneSweep::GetOutputPolygon(ProgressCallback &callback,
     OrientedPolyPolygon &outputPolygon)
 {
-
-
-
-
     // open boundary traversal trace file if necessary (debug mode only)
 
 #if defined _DEBUG
@@ -1318,13 +1289,6 @@
                                                               (float)wEdge->m_vert[1]->x, (float)wEdge->m_vert[1]->y);
     }
     MgDumpFFGF::closeFile(ffgfFile);
-
-
-
-
-
-
-
 #endif
 
     for (int i = 0; i < totalEdges; i++) {
@@ -1394,12 +1358,6 @@
     }
 #endif
 
-
-
-
-
-
-
     // if no points in the output polygon and no cancelation was signalled,
     // then some sort of topological error must have occurred - throw a Plane-
     // SweepException to indicate the error
@@ -1477,9 +1435,6 @@
                 ::fprintf(boundaryTraversalTraceFile, "id: %d - already visited\n", wEdge->m_id);
 #endif
 
-
-
-
             abandonBoundary = TRUE;
             break;
         }
@@ -1509,7 +1464,6 @@
 
     } while ( wEdge != startEdge || side != startSide);
 
-
     // if no interior edges were encountered, then close the boundary and
     // call internal AcceptBoundary() method to determine whether or not to
     // accept the boundary
@@ -1674,11 +1628,13 @@
 
 void PlaneSweep::ResizeBoundaryArray()
 {
-    if (m_nBoundaryVertices + 1 > m_boundaryArraySize) {
+    if (m_nBoundaryVertices + 1 > m_boundaryArraySize)
+    {
         size_t newSize = m_boundaryArraySize + BoundaryArraySize;
         OpsFloatPoint *tmp = new OpsFloatPoint[newSize];
 
-        if (m_nBoundaryVertices > 0) {
+        if (m_nBoundaryVertices > 0)
+        {
             size_t nBytesToCopy = m_nBoundaryVertices * sizeof(OpsFloatPoint);
             ::memcpy(tmp, m_boundaryVertices, nBytesToCopy);
         }
@@ -1915,7 +1871,6 @@
         }
     }
 
-
     if (yCross[0] == HUGE_VAL || yCross[1] == HUGE_VAL)
         return FALSE;
 

Modified: trunk/MgDev/Common/Geometry/CoordinateCollection.h
===================================================================
--- trunk/MgDev/Common/Geometry/CoordinateCollection.h	2010-09-24 03:43:12 UTC (rev 5186)
+++ trunk/MgDev/Common/Geometry/CoordinateCollection.h	2010-09-24 05:09:44 UTC (rev 5187)
@@ -316,7 +316,10 @@
     virtual void ToAwkt(REFSTRING awktStr, REFSTRING coordDim, bool is2dOnly);
 
 protected:
-    void Dispose() { delete this; }
+    void Dispose()
+    {
+        delete this;
+    }
 
 private:
 

Modified: trunk/MgDev/Common/Geometry/Parse/StringUtility.cpp
===================================================================
--- trunk/MgDev/Common/Geometry/Parse/StringUtility.cpp	2010-09-24 03:43:12 UTC (rev 5186)
+++ trunk/MgDev/Common/Geometry/Parse/StringUtility.cpp	2010-09-24 05:09:44 UTC (rev 5187)
@@ -25,8 +25,7 @@
 
 void GisStringUtility::ClearString(wchar_t*& psz)
 {
-    if (psz != NULL)
-        delete [] psz;
+    delete [] psz;
     psz = NULL;
 }
 

Modified: trunk/MgDev/Common/MapGuideCommon/Services/FeatureInformation.h
===================================================================
--- trunk/MgDev/Common/MapGuideCommon/Services/FeatureInformation.h	2010-09-24 03:43:12 UTC (rev 5186)
+++ trunk/MgDev/Common/MapGuideCommon/Services/FeatureInformation.h	2010-09-24 05:09:44 UTC (rev 5187)
@@ -178,7 +178,10 @@
     /////////////////////////////////////////
     /// Dispose the object
     ///
-    virtual void Dispose() { delete this; }
+    virtual void Dispose()
+    {
+        delete this;
+    }
 
 private:
     Ptr<MgSelection>            m_selection;

Modified: trunk/MgDev/Common/MapGuideCommon/Services/ServerConnection.cpp
===================================================================
--- trunk/MgDev/Common/MapGuideCommon/Services/ServerConnection.cpp	2010-09-24 03:43:12 UTC (rev 5186)
+++ trunk/MgDev/Common/MapGuideCommon/Services/ServerConnection.cpp	2010-09-24 05:09:44 UTC (rev 5187)
@@ -55,14 +55,12 @@
 {
     assert( 0 == this->GetRefCount() );
 
-    if (NULL != m_lastUsed)
-        delete m_lastUsed;
-
-    if (NULL != m_serverConnImp)
-        delete m_serverConnImp;
-
+    delete m_lastUsed;
     m_lastUsed = NULL;
+
+    delete m_serverConnImp;
     m_serverConnImp = NULL;
+
     m_stack = NULL;
 }
 
@@ -195,7 +193,7 @@
 /// </returns>
 void MgServerConnection::Dispose()
 {
-        delete this;
+    delete this;
 }
 
 /////////////////////////////////////////////////////////////////

Modified: trunk/MgDev/Common/MapGuideCommon/Services/ServerConnectionPool.cpp
===================================================================
--- trunk/MgDev/Common/MapGuideCommon/Services/ServerConnectionPool.cpp	2010-09-24 03:43:12 UTC (rev 5186)
+++ trunk/MgDev/Common/MapGuideCommon/Services/ServerConnectionPool.cpp	2010-09-24 05:09:44 UTC (rev 5187)
@@ -57,11 +57,9 @@
     ConnectionPool::iterator iter = pool.begin();
     while (iter != pool.end())
     {
-        if (NULL != iter->second)
-        {
-            delete iter->second;
-            iter->second = NULL;
-        }
+        delete iter->second;
+        iter->second = NULL;
+
         iter++;
     }
 
@@ -116,10 +114,9 @@
 {
     ACE_MT (ACE_GUARD (ACE_Recursive_Thread_Mutex, ace_mon, *ACE_Static_Object_Lock::instance ()));
     MG_TRY()
-    if (MgServerConnectionPool::sm_pool != NULL)
-    {
-            delete MgServerConnectionPool::sm_pool;
-            MgServerConnectionPool::sm_pool = NULL;
-    }
+
+    delete MgServerConnectionPool::sm_pool;
+    MgServerConnectionPool::sm_pool = NULL;
+
     MG_CATCH_AND_RELEASE()   
 }

Modified: trunk/MgDev/Common/MapGuideCommon/System/UserInformation.cpp
===================================================================
--- trunk/MgDev/Common/MapGuideCommon/System/UserInformation.cpp	2010-09-24 03:43:12 UTC (rev 5186)
+++ trunk/MgDev/Common/MapGuideCommon/System/UserInformation.cpp	2010-09-24 05:09:44 UTC (rev 5187)
@@ -338,13 +338,19 @@
 /// </summary>
 /// <returns> Nothing
 /// </returns>
-void MgUserInformation::Dispose() { delete this; }
+void MgUserInformation::Dispose()
+{
+    delete this;
+}
 
 /////////////////////////////////////////////////////////////////
 /// <summary>
 /// Returns the classId.
 /// </summary>
-INT32 MgUserInformation::GetClassId() { return m_cls_id; }
+INT32 MgUserInformation::GetClassId()
+{
+    return m_cls_id;
+}
 
 MgByteReader* MgUserInformation::GetReader()
 {

Modified: trunk/MgDev/Common/MdfModel/AreaRule.cpp
===================================================================
--- trunk/MgDev/Common/MdfModel/AreaRule.cpp	2010-09-24 03:43:12 UTC (rev 5186)
+++ trunk/MgDev/Common/MdfModel/AreaRule.cpp	2010-09-24 05:09:44 UTC (rev 5187)
@@ -39,8 +39,7 @@
 //-------------------------------------------------------------------------
 AreaRule::~AreaRule()
 {
-    if (this->m_Symbolization != NULL)
-        delete this->m_Symbolization;
+    delete this->m_Symbolization;
 }
 
 //-------------------------------------------------------------------------
@@ -67,8 +66,7 @@
 {
     if (this->m_Symbolization != pflAdoptedSymbolization)
     {
-        if (this->m_Symbolization != NULL)
-            delete this->m_Symbolization;
+        delete this->m_Symbolization;
         this->m_Symbolization = pflAdoptedSymbolization;
     }
 }

Modified: trunk/MgDev/Common/MdfModel/AreaSymbolization2D.cpp
===================================================================
--- trunk/MgDev/Common/MdfModel/AreaSymbolization2D.cpp	2010-09-24 03:43:12 UTC (rev 5186)
+++ trunk/MgDev/Common/MdfModel/AreaSymbolization2D.cpp	2010-09-24 05:09:44 UTC (rev 5187)
@@ -72,8 +72,7 @@
 {
     if (this->m_pflFill != pflAdoptedFill)
     {
-        if (this->m_pflFill != NULL)
-            delete this->m_pflFill;
+        delete this->m_pflFill;
         this->m_pflFill = pflAdoptedFill;
     }
 }
@@ -120,8 +119,7 @@
 {
     if (this->m_pstkEdge != pstkAdoptedEdge)
     {
-        if (this->m_pstkEdge != NULL)
-            delete this->m_pstkEdge;
+        delete this->m_pstkEdge;
         this->m_pstkEdge = pstkAdoptedEdge;
     }
 }

Modified: trunk/MgDev/Common/MdfModel/CompositeRule.cpp
===================================================================
--- trunk/MgDev/Common/MdfModel/CompositeRule.cpp	2010-09-24 03:43:12 UTC (rev 5186)
+++ trunk/MgDev/Common/MdfModel/CompositeRule.cpp	2010-09-24 05:09:44 UTC (rev 5187)
@@ -40,8 +40,7 @@
 //-------------------------------------------------------------------------
 CompositeRule::~CompositeRule()
 {
-    if (this->m_pSymbolization != NULL)
-        delete this->m_pSymbolization;
+    delete this->m_pSymbolization;
 }
 
 //-------------------------------------------------------------------------
@@ -68,8 +67,7 @@
 {
     if (this->m_pSymbolization != compositeSymbolization)
     {
-        if (this->m_pSymbolization != NULL)
-            delete this->m_pSymbolization;
+        delete this->m_pSymbolization;
         this->m_pSymbolization = compositeSymbolization;
     }
 }

Modified: trunk/MgDev/Common/MdfModel/Label.cpp
===================================================================
--- trunk/MgDev/Common/MdfModel/Label.cpp	2010-09-24 03:43:12 UTC (rev 5186)
+++ trunk/MgDev/Common/MdfModel/Label.cpp	2010-09-24 05:09:44 UTC (rev 5187)
@@ -39,8 +39,7 @@
 //-------------------------------------------------------------------------
 Label::~Label()
 {
-    if (this->m_Symbol != NULL)
-        delete this->m_Symbol;
+    delete this->m_Symbol;
 }
 
 //-------------------------------------------------------------------------
@@ -67,8 +66,7 @@
 {
     if (this->m_Symbol != pflAdoptedSymbol)
     {
-        if (this->m_Symbol != NULL)
-            delete this->m_Symbol;
+        delete this->m_Symbol;
         this->m_Symbol = pflAdoptedSymbol;
     }
 }

Modified: trunk/MgDev/Common/MdfModel/LineSymbolization2D.cpp
===================================================================
--- trunk/MgDev/Common/MdfModel/LineSymbolization2D.cpp	2010-09-24 03:43:12 UTC (rev 5186)
+++ trunk/MgDev/Common/MdfModel/LineSymbolization2D.cpp	2010-09-24 05:09:44 UTC (rev 5187)
@@ -70,8 +70,7 @@
 {
     if (this->m_pstkStroke != pstkAdoptedStroke)
     {
-        if (this->m_pstkStroke != NULL)
-            delete this->m_pstkStroke;
+        delete this->m_pstkStroke;
         this->m_pstkStroke = pstkAdoptedStroke;
     }
 }

Modified: trunk/MgDev/Common/MdfModel/LineUsage.cpp
===================================================================
--- trunk/MgDev/Common/MdfModel/LineUsage.cpp	2010-09-24 03:43:12 UTC (rev 5186)
+++ trunk/MgDev/Common/MdfModel/LineUsage.cpp	2010-09-24 05:09:44 UTC (rev 5187)
@@ -64,8 +64,7 @@
 //-------------------------------------------------------------------------
 LineUsage::~LineUsage()
 {
-    if (this->m_pDefaultPath != NULL)
-        delete this->m_pDefaultPath;
+    delete this->m_pDefaultPath;
 }
 
 //-------------------------------------------------------------------------
@@ -265,8 +264,7 @@
 {
     if (this->m_pDefaultPath != defaultPath)
     {
-        if (this->m_pDefaultPath != NULL)
-            delete this->m_pDefaultPath;
+        delete this->m_pDefaultPath;
         this->m_pDefaultPath = defaultPath;
     }
 }

Modified: trunk/MgDev/Common/MdfModel/MarkSymbol.cpp
===================================================================
--- trunk/MgDev/Common/MdfModel/MarkSymbol.cpp	2010-09-24 03:43:12 UTC (rev 5186)
+++ trunk/MgDev/Common/MdfModel/MarkSymbol.cpp	2010-09-24 05:09:44 UTC (rev 5187)
@@ -95,8 +95,7 @@
 {
     if (this->m_pflFill != pflAdoptedFill)
     {
-        if (this->m_pflFill != NULL)
-            delete this->m_pflFill;
+        delete this->m_pflFill;
         this->m_pflFill = pflAdoptedFill;
     }
 }
@@ -143,8 +142,7 @@
 {
     if (this->m_pstkEdge != pstkAdoptedEdge)
     {
-        if (this->m_pstkEdge != NULL)
-            delete this->m_pstkEdge;
+        delete this->m_pstkEdge;
         this->m_pstkEdge = pstkAdoptedEdge;
     }
 }

Modified: trunk/MgDev/Common/MdfModel/MdfOwnerCollection.h
===================================================================
--- trunk/MgDev/Common/MdfModel/MdfOwnerCollection.h	2010-09-24 03:43:12 UTC (rev 5186)
+++ trunk/MgDev/Common/MdfModel/MdfOwnerCollection.h	2010-09-24 05:09:44 UTC (rev 5187)
@@ -51,10 +51,8 @@
         {
             // delete all members
             for(int i = 0; i < m_nSize; i++)
-            {
-                if (m_objArray[i] != NULL) //redundant check.
-                    delete m_objArray[i];
-            }
+                delete m_objArray[i];
+
             // delete allocated memory
             delete[] m_objArray;
         }

Modified: trunk/MgDev/Common/MdfModel/Override.cpp
===================================================================
--- trunk/MgDev/Common/MdfModel/Override.cpp	2010-09-24 03:43:12 UTC (rev 5186)
+++ trunk/MgDev/Common/MdfModel/Override.cpp	2010-09-24 05:09:44 UTC (rev 5187)
@@ -45,8 +45,7 @@
 //-------------------------------------------------------------------------
 Override::~Override()
 {
-    if (this->m_pThemeLabel != NULL)
-        delete this->m_pThemeLabel;
+    delete this->m_pThemeLabel;
 }
 
 //-------------------------------------------------------------------------
@@ -120,8 +119,7 @@
 {
     if (this->m_pThemeLabel != themeLabel)
     {
-        if (this->m_pThemeLabel != NULL)
-            delete this->m_pThemeLabel;
+        delete this->m_pThemeLabel;
         this->m_pThemeLabel = themeLabel;
     }
 }

Modified: trunk/MgDev/Common/MdfModel/PointRule.cpp
===================================================================
--- trunk/MgDev/Common/MdfModel/PointRule.cpp	2010-09-24 03:43:12 UTC (rev 5186)
+++ trunk/MgDev/Common/MdfModel/PointRule.cpp	2010-09-24 05:09:44 UTC (rev 5187)
@@ -40,8 +40,7 @@
 //-------------------------------------------------------------------------
 PointRule::~PointRule()
 {
-    if (this->m_Symbolization != NULL)
-        delete this->m_Symbolization;
+    delete this->m_Symbolization;
 }
 
 //-------------------------------------------------------------------------
@@ -68,8 +67,7 @@
 {
     if (this->m_Symbolization != pflAdoptedSymbolization)
     {
-        if (this->m_Symbolization != NULL)
-            delete this->m_Symbolization;
+        delete this->m_Symbolization;
         this->m_Symbolization = pflAdoptedSymbolization;
     }
 }

Modified: trunk/MgDev/Common/MdfModel/PointSymbolization2D.cpp
===================================================================
--- trunk/MgDev/Common/MdfModel/PointSymbolization2D.cpp	2010-09-24 03:43:12 UTC (rev 5186)
+++ trunk/MgDev/Common/MdfModel/PointSymbolization2D.cpp	2010-09-24 05:09:44 UTC (rev 5187)
@@ -76,8 +76,7 @@
 {
     if (this->m_psymSymbol != psymAdoptedSymbol)
     {
-        if (this->m_psymSymbol != NULL)
-            delete this->m_psymSymbol;
+        delete this->m_psymSymbol;
         this->m_psymSymbol = psymAdoptedSymbol;
     }
 }

Modified: trunk/MgDev/Common/MdfModel/Rule.cpp
===================================================================
--- trunk/MgDev/Common/MdfModel/Rule.cpp	2010-09-24 03:43:12 UTC (rev 5186)
+++ trunk/MgDev/Common/MdfModel/Rule.cpp	2010-09-24 05:09:44 UTC (rev 5187)
@@ -124,8 +124,7 @@
 {
     if (this->m_pLabel != pLabel)
     {
-        if (this->m_pLabel != NULL)
-            delete this->m_pLabel;
+        delete this->m_pLabel;
         this->m_pLabel = pLabel;
     }
 }

Modified: trunk/MgDev/Common/MdfModel/SimpleSymbol.cpp
===================================================================
--- trunk/MgDev/Common/MdfModel/SimpleSymbol.cpp	2010-09-24 03:43:12 UTC (rev 5186)
+++ trunk/MgDev/Common/MdfModel/SimpleSymbol.cpp	2010-09-24 05:09:44 UTC (rev 5187)
@@ -44,8 +44,7 @@
 //-------------------------------------------------------------------------
 SimpleSymbol::~SimpleSymbol()
 {
-    if (this->m_pSymbolDefinition != NULL)
-        delete this->m_pSymbolDefinition;
+    delete this->m_pSymbolDefinition;
 }
 
 //-------------------------------------------------------------------------
@@ -65,8 +64,7 @@
 {
     if (this->m_pSymbolDefinition != symbolDefinition)
     {
-        if (this->m_pSymbolDefinition != NULL)
-            delete this->m_pSymbolDefinition;
+        delete this->m_pSymbolDefinition;
         this->m_pSymbolDefinition = symbolDefinition;
 
         // Definition and Reference are mutually exclusive.  Setting one
@@ -107,11 +105,8 @@
 
     // Definition and Reference are mutually exclusive.  Setting one
     // clears the other.
-    if (this->m_pSymbolDefinition != NULL)
-    {
-        delete this->m_pSymbolDefinition;
-        this->m_pSymbolDefinition = NULL;
-    }
+    delete this->m_pSymbolDefinition;
+    this->m_pSymbolDefinition = NULL;
 }
 
 //-------------------------------------------------------------------------

Modified: trunk/MgDev/Common/MdfModel/SimpleSymbolDefinition.cpp
===================================================================
--- trunk/MgDev/Common/MdfModel/SimpleSymbolDefinition.cpp	2010-09-24 03:43:12 UTC (rev 5186)
+++ trunk/MgDev/Common/MdfModel/SimpleSymbolDefinition.cpp	2010-09-24 05:09:44 UTC (rev 5187)
@@ -42,14 +42,10 @@
 //-------------------------------------------------------------------------
 SimpleSymbolDefinition::~SimpleSymbolDefinition()
 {
-    if (this->m_pResizeBox != NULL)
-        delete this->m_pResizeBox;
-    if (this->m_pPointUsage != NULL)
-        delete this->m_pPointUsage;
-    if (this->m_pLineUsage != NULL)
-        delete this->m_pLineUsage;
-    if (this->m_pAreaUsage != NULL)
-        delete this->m_pAreaUsage;
+    delete this->m_pResizeBox;
+    delete this->m_pPointUsage;
+    delete this->m_pLineUsage;
+    delete this->m_pAreaUsage;
 }
 
 //-------------------------------------------------------------------------
@@ -78,8 +74,7 @@
 {
     if (this->m_pResizeBox != resizeBox)
     {
-        if (this->m_pResizeBox != NULL)
-            delete this->m_pResizeBox;
+        delete this->m_pResizeBox;
         this->m_pResizeBox = resizeBox;
     }
 }
@@ -112,8 +107,7 @@
 {
     if (this->m_pPointUsage != pointUsage)
     {
-        if (this->m_pPointUsage != NULL)
-            delete this->m_pPointUsage;
+        delete this->m_pPointUsage;
         this->m_pPointUsage = pointUsage;
     }
 }
@@ -146,8 +140,7 @@
 {
     if (this->m_pLineUsage != lineUsage)
     {
-        if (this->m_pLineUsage != NULL)
-            delete this->m_pLineUsage;
+        delete this->m_pLineUsage;
         this->m_pLineUsage = lineUsage;
     }
 }
@@ -180,8 +173,7 @@
 {
     if (this->m_pAreaUsage != areaUsage)
     {
-        if (this->m_pAreaUsage != NULL)
-            delete this->m_pAreaUsage;
+        delete this->m_pAreaUsage;
         this->m_pAreaUsage = areaUsage;
     }
 }

Modified: trunk/MgDev/Common/MdfModel/SymbolInstance.cpp
===================================================================
--- trunk/MgDev/Common/MdfModel/SymbolInstance.cpp	2010-09-24 03:43:12 UTC (rev 5186)
+++ trunk/MgDev/Common/MdfModel/SymbolInstance.cpp	2010-09-24 05:09:44 UTC (rev 5187)
@@ -60,8 +60,7 @@
 //-------------------------------------------------------------------------
 SymbolInstance::~SymbolInstance()
 {
-    if (this->m_pSymbolDefinition != NULL)
-        delete this->m_pSymbolDefinition;
+    delete this->m_pSymbolDefinition;
 }
 
 //-------------------------------------------------------------------------
@@ -85,11 +84,8 @@
 
     // Definition and Reference are mutually exclusive.  Setting one
     // clears the other.
-    if (this->m_pSymbolDefinition != NULL)
-    {
-        delete this->m_pSymbolDefinition;
-        this->m_pSymbolDefinition = NULL;
-    }
+    delete this->m_pSymbolDefinition;
+    this->m_pSymbolDefinition = NULL;
 }
 
 //-------------------------------------------------------------------------
@@ -109,8 +105,7 @@
 {
     if (this->m_pSymbolDefinition != symbolDefinition)
     {
-        if (this->m_pSymbolDefinition != NULL)
-            delete this->m_pSymbolDefinition;
+        delete this->m_pSymbolDefinition;
         this->m_pSymbolDefinition = symbolDefinition;
 
         // Definition and Reference are mutually exclusive.  Setting one

Modified: trunk/MgDev/Common/MdfModel/Text.cpp
===================================================================
--- trunk/MgDev/Common/MdfModel/Text.cpp	2010-09-24 03:43:12 UTC (rev 5186)
+++ trunk/MgDev/Common/MdfModel/Text.cpp	2010-09-24 05:09:44 UTC (rev 5187)
@@ -76,8 +76,7 @@
 //-------------------------------------------------------------------------
 Text::~Text()
 {
-    if (this->m_pFrame != NULL)
-        delete this->m_pFrame;
+    delete this->m_pFrame;
 }
 
 //-------------------------------------------------------------------------
@@ -457,8 +456,7 @@
 {
     if (this->m_pFrame != frame)
     {
-        if (this->m_pFrame != NULL)
-            delete this->m_pFrame;
+        delete this->m_pFrame;
         this->m_pFrame = frame;
     }
 }

Modified: trunk/MgDev/Common/MdfModel/VectorScaleRange.cpp
===================================================================
--- trunk/MgDev/Common/MdfModel/VectorScaleRange.cpp	2010-09-24 03:43:12 UTC (rev 5186)
+++ trunk/MgDev/Common/MdfModel/VectorScaleRange.cpp	2010-09-24 05:09:44 UTC (rev 5187)
@@ -51,8 +51,7 @@
 //-------------------------------------------------------------------------
 VectorScaleRange::~VectorScaleRange()
 {
-    if (this->m_elevationSettings != NULL)
-        delete this->m_elevationSettings;
+    delete this->m_elevationSettings;
 }
 
 //-------------------------------------------------------------------------
@@ -136,8 +135,7 @@
 {
     if (this->m_elevationSettings != elevationSettings)
     {
-        if (this->m_elevationSettings != NULL)
-            delete this->m_elevationSettings;
+        delete this->m_elevationSettings;
         this->m_elevationSettings = elevationSettings;
     }
 }

Modified: trunk/MgDev/Common/MdfParser/FSDSAX2Parser.cpp
===================================================================
--- trunk/MgDev/Common/MdfParser/FSDSAX2Parser.cpp	2010-09-24 03:43:12 UTC (rev 5186)
+++ trunk/MgDev/Common/MdfParser/FSDSAX2Parser.cpp	2010-09-24 05:09:44 UTC (rev 5187)
@@ -38,12 +38,9 @@
 
 FSDSAX2Parser::~FSDSAX2Parser()
 {
-    if (m_handlerStack != NULL)
-        delete m_handlerStack;
-    if (m_parser != NULL)
-        delete m_parser;
-    if (m_featureSource)
-        delete m_featureSource;
+    delete m_handlerStack;
+    delete m_parser;
+    delete m_featureSource;
 }
 
 

Modified: trunk/MgDev/Common/PlatformBase/MapLayer/SelectionBase.cpp
===================================================================
--- trunk/MgDev/Common/PlatformBase/MapLayer/SelectionBase.cpp	2010-09-24 03:43:12 UTC (rev 5186)
+++ trunk/MgDev/Common/PlatformBase/MapLayer/SelectionBase.cpp	2010-09-24 05:09:44 UTC (rev 5187)
@@ -68,11 +68,8 @@
     }
     m_selections.clear();
 
-    if (m_stream != NULL)
-    {
-        delete m_stream;
-        m_stream = NULL;
-    }
+    delete m_stream;
+    m_stream = NULL;
 }
 
 

Modified: trunk/MgDev/Common/PlatformBase/Services/FeatureAggregateOptions.h
===================================================================
--- trunk/MgDev/Common/PlatformBase/Services/FeatureAggregateOptions.h	2010-09-24 03:43:12 UTC (rev 5186)
+++ trunk/MgDev/Common/PlatformBase/Services/FeatureAggregateOptions.h	2010-09-24 05:09:44 UTC (rev 5187)
@@ -194,9 +194,16 @@
     virtual void Serialize(MgStream* stream);
     virtual void Deserialize(MgStream* stream);
 
-    virtual INT32 GetClassId() { return m_cls_id; }
-    virtual void Dispose() { delete this; }
+    virtual INT32 GetClassId()
+    {
+        return m_cls_id;
+    }
 
+    virtual void Dispose()
+    {
+        delete this;
+    }
+
 private:
 
     bool m_selectDistinct;                            // Apply Distinct operator

Modified: trunk/MgDev/Common/PlatformBase/Services/FeatureQueryOptions.h
===================================================================
--- trunk/MgDev/Common/PlatformBase/Services/FeatureQueryOptions.h	2010-09-24 03:43:12 UTC (rev 5186)
+++ trunk/MgDev/Common/PlatformBase/Services/FeatureQueryOptions.h	2010-09-24 05:09:44 UTC (rev 5187)
@@ -507,9 +507,16 @@
     virtual void Deserialize(MgStream* stream);
     STRING GetLogString();
 
-    virtual INT32 GetClassId() { return m_cls_id; }
-    virtual void Dispose() { delete this; }
+    virtual INT32 GetClassId()
+    {
+        return m_cls_id;
+    }
 
+    virtual void Dispose()
+    {
+        delete this;
+    }
+
     void ValidateEmptyArgument(CREFSTRING value);
 
 private:

Modified: trunk/MgDev/Common/PlatformBase/Services/GeometryProperty.cpp
===================================================================
--- trunk/MgDev/Common/PlatformBase/Services/GeometryProperty.cpp	2010-09-24 03:43:12 UTC (rev 5186)
+++ trunk/MgDev/Common/PlatformBase/Services/GeometryProperty.cpp	2010-09-24 05:09:44 UTC (rev 5187)
@@ -99,7 +99,10 @@
 /// <summary>
 /// Self destructing method
 /// </summary>
- void MgGeometryProperty::Dispose() { delete this; }
+ void MgGeometryProperty::Dispose()
+ {
+     delete this;
+ }
 
 /////////////////////////////////////////////////////////////////
 /// <summary>

Modified: trunk/MgDev/Common/Renderers/DWFRenderer.cpp
===================================================================
--- trunk/MgDev/Common/Renderers/DWFRenderer.cpp	2010-09-24 03:43:12 UTC (rev 5186)
+++ trunk/MgDev/Common/Renderers/DWFRenderer.cpp	2010-09-24 05:09:44 UTC (rev 5187)
@@ -260,24 +260,16 @@
 
 DWFRenderer::~DWFRenderer()
 {
-    if (m_wtPointBuffer)
-        delete[] m_wtPointBuffer;
+    delete[] m_wtPointBuffer;
+    delete m_hatchFac;
+    delete m_fillFac;
+    delete m_obsMesh;
 
-    if (m_hatchFac)
-        delete m_hatchFac;
-
-    if (m_fillFac)
-        delete m_fillFac;
-
-    if (m_obsMesh)
-        delete m_obsMesh; //should not get here
-
     delete (NodeTable*)m_hObjNodes;
 
     // could be non-NULL if an exception was raised before this was
     // added to the attribute resources collection
-    if (m_attributes)
-        delete m_attributes;
+    delete m_attributes;
 }
 
 
@@ -369,11 +361,8 @@
     m_lLayoutStreams.clear();
     m_lLayoutLabelStreams.clear();
 
-    if (m_obsMesh)
-    {
-        delete m_obsMesh;
-        m_obsMesh = NULL;
-    }
+    delete m_obsMesh;
+    m_obsMesh = NULL;
 
     // clear the map info
     m_mapInfo = NULL;
@@ -397,11 +386,8 @@
 
         // could be non-NULL if an exception was raised before this was
         // added to the attribute resources collection
-        if (m_attributes)
-        {
-            delete m_attributes;
-            m_attributes = NULL;
-        }
+        delete m_attributes;
+        m_attributes = NULL;
 
         m_attributes = DWFCORE_ALLOC_OBJECT(DWFObjectDefinitionResource(
                                         DWFXML::kzElement_PageObjectDefinition,
@@ -838,8 +824,7 @@
         IncrementDrawableCount();
     }
 
-    if (NULL != aggcxt)
-        delete aggcxt;
+    delete aggcxt;
 }
 
 

Modified: trunk/MgDev/Common/Renderers/EMapRenderer.cpp
===================================================================
--- trunk/MgDev/Common/Renderers/EMapRenderer.cpp	2010-09-24 03:43:12 UTC (rev 5186)
+++ trunk/MgDev/Common/Renderers/EMapRenderer.cpp	2010-09-24 05:09:44 UTC (rev 5187)
@@ -53,6 +53,7 @@
     delete m_uuid;
 }
 
+
 void EMapRenderer::StartMap(RS_MapUIInfo*    mapInfo,
                             RS_Bounds&       extents,
                             double           mapScale,

Modified: trunk/MgDev/Common/Renderers/EPlotRenderer.cpp
===================================================================
--- trunk/MgDev/Common/Renderers/EPlotRenderer.cpp	2010-09-24 03:43:12 UTC (rev 5186)
+++ trunk/MgDev/Common/Renderers/EPlotRenderer.cpp	2010-09-24 05:09:44 UTC (rev 5187)
@@ -73,9 +73,7 @@
 {
     delete m_uuid;
 
-    if (m_dwfPackageWriter)
-        delete m_dwfPackageWriter;
-
+    delete m_dwfPackageWriter;
     m_dwfPackageWriter = NULL;
 }
 

Modified: trunk/MgDev/Common/Renderers/GDRenderer.cpp
===================================================================
--- trunk/MgDev/Common/Renderers/GDRenderer.cpp	2010-09-24 03:43:12 UTC (rev 5186)
+++ trunk/MgDev/Common/Renderers/GDRenderer.cpp	2010-09-24 05:09:44 UTC (rev 5187)
@@ -157,11 +157,8 @@
     if (m_imsym)
         gdImageDestroy((gdImagePtr)m_imsym);
 
-    if (m_wtPointBuffer)
-        delete [] m_wtPointBuffer;
-
+    delete [] m_wtPointBuffer;
     delete m_labeler;
-
     delete m_polyrasterizer;
 }
 

Modified: trunk/MgDev/Common/Renderers/KmlRenderer.cpp
===================================================================
--- trunk/MgDev/Common/Renderers/KmlRenderer.cpp	2010-09-24 03:43:12 UTC (rev 5186)
+++ trunk/MgDev/Common/Renderers/KmlRenderer.cpp	2010-09-24 05:09:44 UTC (rev 5187)
@@ -508,20 +508,15 @@
 
 void KmlRenderer::ClearStyles()
 {
-    if (m_styleContent != NULL)
-    {
-        delete m_styleContent;
-        m_styleContent = NULL;
-    }
+    delete m_styleContent;
+    m_styleContent = NULL;
 }
 
 
 void KmlRenderer::WriteStyle(RS_FillStyle& fill)
 {
     if (m_styleContent == NULL)
-    {
         m_styleContent = new KmlContent();
-    }
 
     char buffer[256];
     int thisStyleId = 0;

Modified: trunk/MgDev/Common/Renderers/RS_ByteData.cpp
===================================================================
--- trunk/MgDev/Common/Renderers/RS_ByteData.cpp	2010-09-24 03:43:12 UTC (rev 5186)
+++ trunk/MgDev/Common/Renderers/RS_ByteData.cpp	2010-09-24 05:09:44 UTC (rev 5187)
@@ -43,8 +43,7 @@
 
 RS_ByteData::~RS_ByteData()
 {
-    if (m_bytes)
-        delete [] m_bytes;
+    delete [] m_bytes;
 }
 
 

Modified: trunk/MgDev/Common/Stylization/Band.cpp
===================================================================
--- trunk/MgDev/Common/Stylization/Band.cpp	2010-09-24 03:43:12 UTC (rev 5186)
+++ trunk/MgDev/Common/Stylization/Band.cpp	2010-09-24 05:09:44 UTC (rev 5187)
@@ -68,10 +68,7 @@
 
 Band::~Band()
 {
-    if (m_pBandData)
-    {
-        delete m_pBandData;
-    }
+    delete m_pBandData;
 }
 
 //*************************************************************************************************************

Modified: trunk/MgDev/Common/Stylization/BandData.cpp
===================================================================
--- trunk/MgDev/Common/Stylization/BandData.cpp	2010-09-24 03:43:12 UTC (rev 5186)
+++ trunk/MgDev/Common/Stylization/BandData.cpp	2010-09-24 05:09:44 UTC (rev 5187)
@@ -286,10 +286,7 @@
 
 BitBandData::~BitBandData()
 {
-    if (m_pData)
-    {
-        delete[] m_pData;
-    }
+    delete[] m_pData;
 }
 
 /////////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -303,10 +300,7 @@
 
 ByteBandData::~ByteBandData()
 {
-    if (m_pData)
-    {
-        delete[] m_pData;
-    }
+    delete[] m_pData;
 }
 
 //*************************************************************************************************************

Modified: trunk/MgDev/Common/Stylization/DataValueStack.h
===================================================================
--- trunk/MgDev/Common/Stylization/DataValueStack.h	2010-09-24 03:43:12 UTC (rev 5186)
+++ trunk/MgDev/Common/Stylization/DataValueStack.h	2010-09-24 05:09:44 UTC (rev 5187)
@@ -32,8 +32,7 @@
     {
         //note this destructor will not call
         //the individual element destructors
-        if (m_data)
-            delete [] m_data;
+        delete [] m_data;
     }
 
     inline void push(T* dv)

Modified: trunk/MgDev/Common/Stylization/DefaultStylizer.cpp
===================================================================
--- trunk/MgDev/Common/Stylization/DefaultStylizer.cpp	2010-09-24 03:43:12 UTC (rev 5186)
+++ trunk/MgDev/Common/Stylization/DefaultStylizer.cpp	2010-09-24 05:09:44 UTC (rev 5187)
@@ -463,10 +463,8 @@
 void DefaultStylizer::SetGeometryAdapter(FdoGeometryType type, GeometryAdapter* stylizer)
 {
     GeometryAdapter* old = (GeometryAdapter*)m_hGeomStylizers[type];
+    delete old;
 
-    if (old)
-        delete old;
-
     m_hGeomStylizers[type] = stylizer;
 }
 
@@ -534,9 +532,6 @@
 
     m_hGeomStylizers.clear();
 
-    if (m_pRasterAdapter)
-    {
-        delete m_pRasterAdapter;
-        m_pRasterAdapter = NULL;
-    }
+    delete m_pRasterAdapter;
+    m_pRasterAdapter = NULL;
 }

Modified: trunk/MgDev/Common/Stylization/GridData.cpp
===================================================================
--- trunk/MgDev/Common/Stylization/GridData.cpp	2010-09-24 03:43:12 UTC (rev 5186)
+++ trunk/MgDev/Common/Stylization/GridData.cpp	2010-09-24 05:09:44 UTC (rev 5187)
@@ -107,30 +107,18 @@
          itr != m_BandVector.end();
          ++itr)
     {
-        if (*itr)
-        {
-            delete *itr;
-            *itr = NULL;
-        }
+        delete *itr;
+        *itr = NULL;
     }
 
-    if (NULL != m_pColorBand)
-    {
-        delete m_pColorBand;
-        m_pColorBand = NULL;
-    }
+    delete m_pColorBand;
+    m_pColorBand = NULL;
 
-    if (NULL != m_pDrapedColorBand)
-    {
-        delete m_pDrapedColorBand;
-        m_pDrapedColorBand = NULL;
-    }
+    delete m_pDrapedColorBand;
+    m_pDrapedColorBand = NULL;
 
-    if (NULL != m_pStylizedBand)
-    {
-        delete m_pStylizedBand;
-        m_pStylizedBand = NULL;
-    }
+    delete m_pStylizedBand;
+    m_pStylizedBand = NULL;
 }
 
 //*************************************************************************************************************
@@ -139,9 +127,7 @@
 {
     Band* pBand = new Band(dataType, this);
     if (NULL == pBand)
-    {
         return NULL;
-    }
 
     pBand->SetName(name.c_str());
 

Modified: trunk/MgDev/Common/Stylization/GridThemeParser.cpp
===================================================================
--- trunk/MgDev/Common/Stylization/GridThemeParser.cpp	2010-09-24 03:43:12 UTC (rev 5186)
+++ trunk/MgDev/Common/Stylization/GridThemeParser.cpp	2010-09-24 05:09:44 UTC (rev 5187)
@@ -236,16 +236,11 @@
     }
     catch (std::exception &)
     {
-        if (pTheme)
-        {
-            delete pTheme;
-            pTheme = NULL;
-        }
-        if (pBucket)
-        {
-            delete pBucket;
-            pBucket = NULL;
-        }
+        delete pTheme;
+        pTheme = NULL;
+
+        delete pBucket;
+        pBucket = NULL;
     }
     return pTheme;
 }

Modified: trunk/MgDev/Common/Stylization/LabelRenderer.cpp
===================================================================
--- trunk/MgDev/Common/Stylization/LabelRenderer.cpp	2010-09-24 03:43:12 UTC (rev 5186)
+++ trunk/MgDev/Common/Stylization/LabelRenderer.cpp	2010-09-24 05:09:44 UTC (rev 5187)
@@ -55,19 +55,13 @@
         {
             LabelInfo& info = group.m_labels[j];
 
-            if (info.m_pts)
-            {
-                delete [] info.m_pts;
-                info.m_pts = NULL;
-                info.m_numpts = 0;
-            }
+            delete [] info.m_pts;
+            info.m_pts = NULL;
+            info.m_numpts = 0;
 
             // the style was cloned when it was passed to the LabelRenderer
-            if (info.m_sestyle)
-            {
-                delete info.m_sestyle;
-                info.m_sestyle = NULL;
-            }
+            delete info.m_sestyle;
+            info.m_sestyle = NULL;
         }
     }
 
@@ -253,19 +247,13 @@
                     {
                         LabelInfo& info = group.m_labels[j];
 
-                        if (info.m_pts)
-                        {
-                            delete [] info.m_pts;
-                            info.m_pts = NULL;
-                            info.m_numpts = 0;
-                        }
+                        delete [] info.m_pts;
+                        info.m_pts = NULL;
+                        info.m_numpts = 0;
 
                         // the style was cloned when it was passed to the LabelRenderer
-                        if (info.m_sestyle)
-                        {
-                            delete info.m_sestyle;
-                            info.m_sestyle = NULL;
-                        }
+                        delete info.m_sestyle;
+                        info.m_sestyle = NULL;
                     }
 
                     group.m_labels.clear();

Modified: trunk/MgDev/Common/Stylization/LabelRendererLocal.cpp
===================================================================
--- trunk/MgDev/Common/Stylization/LabelRendererLocal.cpp	2010-09-24 03:43:12 UTC (rev 5186)
+++ trunk/MgDev/Common/Stylization/LabelRendererLocal.cpp	2010-09-24 05:09:44 UTC (rev 5187)
@@ -56,25 +56,16 @@
         {
             LabelInfoLocal& info = group.m_labels[j];
 
-            if (info.m_rotated_points)
-            {
-                delete [] info.m_rotated_points;
-                info.m_rotated_points = NULL;
-            }
+            delete [] info.m_rotated_points;
+            info.m_rotated_points = NULL;
 
-            if (info.m_pts)
-            {
-                delete [] info.m_pts;
-                info.m_pts = NULL;
-                info.m_numpts = 0;
-            }
+            delete [] info.m_pts;
+            info.m_pts = NULL;
+            info.m_numpts = 0;
 
             // the style was cloned when it was passed to the LabelRenderer
-            if (info.m_sestyle)
-            {
-                delete info.m_sestyle;
-                info.m_sestyle = NULL;
-            }
+            delete info.m_sestyle;
+            info.m_sestyle = NULL;
         }
     }
 
@@ -407,19 +398,13 @@
                         // at this point there shouldn't yet be any rotated points
                         _ASSERT(info.m_rotated_points == NULL);
 
-                        if (info.m_pts)
-                        {
-                            delete [] info.m_pts;
-                            info.m_pts = NULL;
-                            info.m_numpts = 0;
-                        }
+                        delete [] info.m_pts;
+                        info.m_pts = NULL;
+                        info.m_numpts = 0;
 
                         // the style was cloned when it was passed to the LabelRenderer
-                        if (info.m_sestyle)
-                        {
-                            delete info.m_sestyle;
-                            info.m_sestyle = NULL;
-                        }
+                        delete info.m_sestyle;
+                        info.m_sestyle = NULL;
                     }
 
                     group.m_labels.clear();
@@ -502,19 +487,13 @@
                 // the original label infos should still not have any rotated points
                 _ASSERT(info.m_rotated_points == NULL);
 
-                if (info.m_pts)
-                {
-                    delete [] info.m_pts;
-                    info.m_pts = NULL;
-                    info.m_numpts = 0;
-                }
+                delete [] info.m_pts;
+                info.m_pts = NULL;
+                info.m_numpts = 0;
 
                 // the style was cloned when it was passed to the LabelRenderer
-                if (info.m_sestyle)
-                {
-                    delete info.m_sestyle;
-                    info.m_sestyle = NULL;
-                }
+                delete info.m_sestyle;
+                info.m_sestyle = NULL;
             }
 
             group.m_labels = repeated_infos;
@@ -831,11 +810,8 @@
                 _ASSERT(info.m_pts == NULL);
 
                 // the style was cloned when it was passed to the LabelRenderer
-                if (info.m_sestyle)
-                {
-                    delete info.m_sestyle;
-                    info.m_sestyle = NULL;
-                }
+                delete info.m_sestyle;
+                info.m_sestyle = NULL;
             }
         }
 

Modified: trunk/MgDev/Common/Stylization/RS_FontEngine.cpp
===================================================================
--- trunk/MgDev/Common/Stylization/RS_FontEngine.cpp	2010-09-24 03:43:12 UTC (rev 5186)
+++ trunk/MgDev/Common/Stylization/RS_FontEngine.cpp	2010-09-24 05:09:44 UTC (rev 5187)
@@ -797,8 +797,7 @@
         }
     }
 
-    if (pRichTextEngine)
-        delete pRichTextEngine;
+    delete pRichTextEngine;
 }
 
 

Modified: trunk/MgDev/Common/Stylization/RasterAdapter.cpp
===================================================================
--- trunk/MgDev/Common/Stylization/RasterAdapter.cpp	2010-09-24 03:43:12 UTC (rev 5186)
+++ trunk/MgDev/Common/Stylization/RasterAdapter.cpp	2010-09-24 05:09:44 UTC (rev 5187)
@@ -195,8 +195,7 @@
                     {
                         RS_InputStream* pal = raster->GetPalette();
                         DecodeMapped(reader, pal, dst, imgW, imgH);
-                        if (pal)
-                            delete pal;
+                        delete pal;
                     }
                     break;
                 case 1:

Modified: trunk/MgDev/Common/Stylization/RichTextEngine.cpp
===================================================================
--- trunk/MgDev/Common/Stylization/RichTextEngine.cpp	2010-09-24 03:43:12 UTC (rev 5186)
+++ trunk/MgDev/Common/Stylization/RichTextEngine.cpp	2010-09-24 05:09:44 UTC (rev 5187)
@@ -43,11 +43,8 @@
         delete pNext;
     }
 
-    if ( this->m_pHeadBlock )
-        delete this->m_pHeadBlock;
-
-    if ( this->m_pCurrLine )
-        delete this->m_pCurrLine;
+    delete this->m_pHeadBlock;
+    delete this->m_pCurrLine;
 }
 
 
@@ -1137,8 +1134,7 @@
 {
     size_t numComponents = this->m_components.size();
     for ( size_t i=0; i<numComponents; ++i )
-        if ( m_components[i] )
-            delete this->m_components[i];
+        delete this->m_components[i];
 }
 
 void AtomBaseComponentCollection::AddComponent( AtomBaseComponent* pComponent )

Modified: trunk/MgDev/Common/Stylization/SE_StyleVisitor.cpp
===================================================================
--- trunk/MgDev/Common/Stylization/SE_StyleVisitor.cpp	2010-09-24 03:43:12 UTC (rev 5186)
+++ trunk/MgDev/Common/Stylization/SE_StyleVisitor.cpp	2010-09-24 05:09:44 UTC (rev 5187)
@@ -467,11 +467,8 @@
 
 void SE_StyleVisitor::VisitPath(Path& path)
 {
-    if (m_primitive)
-    {
-        delete m_primitive;
-        m_primitive = NULL;
-    }
+    delete m_primitive;
+    m_primitive = NULL;
 
     SE_Color fillColor;
     ParseColorExpression(path.GetFillColor(), fillColor, 0);
@@ -532,11 +529,8 @@
 
 void SE_StyleVisitor::VisitImage(Image& image)
 {
-    if (m_primitive)
-    {
-        delete m_primitive;
-        m_primitive = NULL;
-    }
+    delete m_primitive;
+    m_primitive = NULL;
 
     SE_Raster* primitive = new SE_Raster();
     m_primitive = primitive;
@@ -609,11 +603,8 @@
 
 void SE_StyleVisitor::VisitText(Text& text)
 {
-    if (m_primitive)
-    {
-        delete m_primitive;
-        m_primitive = NULL;
-    }
+    delete m_primitive;
+    m_primitive = NULL;
 
     SE_Text* primitive = new SE_Text();
     m_primitive = primitive;

Modified: trunk/MgDev/Common/Stylization/atom.h
===================================================================
--- trunk/MgDev/Common/Stylization/atom.h	2010-09-24 03:43:12 UTC (rev 5186)
+++ trunk/MgDev/Common/Stylization/atom.h	2010-09-24 05:09:44 UTC (rev 5187)
@@ -2122,10 +2122,8 @@
 
     ~RangeCapabilityParticle()
     {
-        if(m_pMin)
-            delete(m_pMin);
-        if(m_pMax)
-            delete(m_pMax);
+        delete(m_pMin);
+        delete(m_pMax);
     }
 
     Particle* Clone() const

Modified: trunk/MgDev/Common/Stylization/atom_element_style.cpp
===================================================================
--- trunk/MgDev/Common/Stylization/atom_element_style.cpp	2010-09-24 03:43:12 UTC (rev 5186)
+++ trunk/MgDev/Common/Stylization/atom_element_style.cpp	2010-09-24 05:09:44 UTC (rev 5187)
@@ -71,7 +71,8 @@
 ATOM::Status StyleDescriptionElement::RemoveFromDescription(const ATOM::StyleParticle::StyleParticleType eType)
 {
     ATOM::StyleParticle* pGone = RemoveFromList(m_pDescription,eType);
-    if(pGone != NULL) {
+    if(pGone != NULL)
+    {
         delete(pGone);
         return ATOM::Status::keOk;
     }
@@ -88,7 +89,6 @@
 
 
 
-
 /* Style Particle List Tools */
 
 // Finds (the first) particle in a list (or set)
@@ -180,7 +180,8 @@
 void StyleChangeElement::Reset()
 {
     // Kill the deltas.
-    while(m_pDeltas) {
+    while(m_pDeltas)
+    {
         ATOM::StyleParticle* p = m_pDeltas;
         m_pDeltas = const_cast<ATOM::StyleParticle*>(p->Next());
         delete(p);

Modified: trunk/MgDev/Common/Stylization/mtext_parser.cpp
===================================================================
--- trunk/MgDev/Common/Stylization/mtext_parser.cpp	2010-09-24 03:43:12 UTC (rev 5186)
+++ trunk/MgDev/Common/Stylization/mtext_parser.cpp	2010-09-24 05:09:44 UTC (rev 5187)
@@ -1892,12 +1892,12 @@
 // Takes a pointer to an existing parser and destroys it.
 ATOM::Status MTextGenerator::Destroy(ATOM::ISink* pOldSink)
 {
-    if(pOldSink == NULL)
+    if (pOldSink == NULL)
         return ATOM::Status::keInvalidArg;
 
     // TO DO ... validate that it's one of ours?
 
-    delete(pOldSink);
+    delete pOldSink;
     return ATOM::Status::keOk;
 }
 



More information about the mapguide-commits mailing list