Locate a field ID in the constant 8BIM / Image Resource array INPUT: - nBimId = Image Resource ID (16-bit unsigned) OUTPUT: - nFldInd = Index into asBimRecords[] array RETURN: - Returns true if ID was found in array NOTE: - The constant struct array depends on BIM_T_END as a terminator for the list
| 131 | // - The constant struct array depends on BIM_T_END as a terminator for the list |
| 132 | // |
| 133 | bool CPsDecode::FindBimRecord(unsigned nBimId,unsigned &nFldInd) |
| 134 | { |
| 135 | unsigned nInd=0; |
| 136 | bool bDone=false; |
| 137 | bool bFound=false; |
| 138 | while (!bDone) { |
| 139 | if (asBimRecords[nInd].eBimType == BIM_T_END) { |
| 140 | bDone = true; |
| 141 | } else { |
| 142 | // Support detection of code ranges |
| 143 | unsigned nCodeStart = asBimRecords[nInd].nCode; |
| 144 | unsigned nCodeEnd = asBimRecords[nInd].nCodeEnd; |
| 145 | if ((nCodeEnd == 0) && (nCodeStart == nBimId)) { |
| 146 | // Match with single code (ie. not ranged entry) |
| 147 | bDone = true; |
| 148 | bFound = true; |
| 149 | } else if ((nCodeEnd != 0) && (nCodeStart <= nBimId) && (nCodeEnd >= nBimId)) { |
| 150 | // Match with code in ranged entry |
| 151 | bDone = true; |
| 152 | bFound = true; |
| 153 | } else { |
| 154 | nInd++; |
| 155 | } |
| 156 | |
| 157 | } |
| 158 | } |
| 159 | if (bFound) { |
| 160 | nFldInd = nInd; |
| 161 | } |
| 162 | return bFound; |
| 163 | } |
| 164 | |
| 165 | // Search the constant array of IPTC fields for the Record:DataSet index |
| 166 | // |
nothing calls this directly
no outgoing calls
no test coverage detected