Explorar o código

HPCC-10838 Remove uneeded attrOnly flag in writeXmlText

The cases being checked should never happen.  The flag is confusing
and shouldn't be necessary.

Signed-off-by: Anthony Fishbeck <anthony.fishbeck@lexisnexis.com>
Tony %!s(int64=11) %!d(string=hai) anos
pai
achega
f9a0d9f04f
Modificáronse 2 ficheiros con 6 adicións e 8 borrados
  1. 5 7
      common/fileview2/fvresultset.cpp
  2. 1 1
      common/fileview2/fvresultset.ipp

+ 5 - 7
common/fileview2/fvresultset.cpp

@@ -1517,7 +1517,7 @@ IStringVal & CResultSetCursor::getDisplayText(IStringVal &ret, int columnIndex)
     return ret;
 }
 
-void CResultSetCursor::writeXmlText(IXmlWriter &writer, int columnIndex, const char *tag, bool attrOnly)
+void CResultSetCursor::writeXmlText(IXmlWriter &writer, int columnIndex, const char *tag)
 {
     if (!isValid())
         return;
@@ -1532,17 +1532,17 @@ void CResultSetCursor::writeXmlText(IXmlWriter &writer, int columnIndex, const c
         return;
     case FVFFbeginrecord:
         {
-            if (!attrOnly && name && *name)
+            if (name && *name)
             {
                 writer.outputBeginNested(name, false);
                 const IntArray &attributes = meta.meta->queryAttrList(columnIndex);
                 ForEachItemIn(ac, attributes)
-                    writeXmlText(writer, attributes.item(ac), NULL, true);
+                    writeXmlText(writer, attributes.item(ac), NULL);
             }
         }
         return;
     case FVFFendrecord:
-        if (!attrOnly && name && *name)
+        if (name && *name)
             writer.outputEndNested(name);
         return;
     }
@@ -1638,7 +1638,6 @@ void CResultSetCursor::writeXmlText(IXmlWriter &writer, int columnIndex, const c
         break;
     case type_table:
     case type_groupedtable:
-        if (!attrOnly)
         {
             writer.outputBeginNested(name, false);
             Owned<IResultSetCursor> childCursor = getChildren(columnIndex);
@@ -1650,7 +1649,6 @@ void CResultSetCursor::writeXmlText(IXmlWriter &writer, int columnIndex, const c
         }
         break;
     case type_set:
-        if (!attrOnly)
         {
             writer.outputBeginNested(name, false);
             if (getIsAll(columnIndex))
@@ -1724,7 +1722,7 @@ void CResultSetCursor::writeXmlRow(IXmlWriter &writer)
         writer.outputBeginNested(rowtag, false);
         const IntArray &attributes = meta.meta->queryAttrList();
         ForEachItemIn(ac, attributes)
-            writeXmlText(writer, attributes.item(ac), NULL, true);
+            writeXmlText(writer, attributes.item(ac), NULL);
     }
     unsigned numColumns = meta.getColumnCount();
     unsigned ignoreNesting = 0;

+ 1 - 1
common/fileview2/fvresultset.ipp

@@ -377,7 +377,7 @@ protected:
     void init(IExtendedNewResultSet * _resultSet);
     bool isMappedIndexField(unsigned columnIndex) { return resultSet->isMappedIndexField(columnIndex); }
     const byte * getColumn(unsigned idx) const      { return (const byte *)curRowData.toByteArray() + offsets[idx]; }
-    void writeXmlText(IXmlWriter &writer, int columnIndex, const char *tag=NULL, bool isAttr=false);
+    void writeXmlText(IXmlWriter &writer, int columnIndex, const char *tag=NULL);
 
     virtual __int64 getCurRow() const;
     virtual __int64 translateRow(__int64 row) const;