fix split bug in propertyvalues, remove obsolete functions
This commit is contained in:
parent
617315667c
commit
2c675b6181
@ -333,46 +333,6 @@ Public Class ImportZUGFeRDFiles
|
|||||||
End If
|
End If
|
||||||
Next
|
Next
|
||||||
|
|
||||||
' check for rows that are empty in every column
|
|
||||||
' this happens when a grouped row is not filled
|
|
||||||
' e.g. a row in a invoice that is just a note
|
|
||||||
_logger.Debug("Done Fetching Property values.")
|
|
||||||
Dim oIndexesToRemove As New List(Of Integer)
|
|
||||||
|
|
||||||
For oRowIndex = 0 To oRowCount - 1
|
|
||||||
Dim oColumnIsEmpty = False
|
|
||||||
|
|
||||||
For Each oRow In oPropertyList
|
|
||||||
Dim oValue As List(Of Object) = oRow.Value
|
|
||||||
'Dim oValue As List(Of Object) = oRow.Value.Item(oRowIndex)
|
|
||||||
oColumnIsEmpty = oValue.Count = 0
|
|
||||||
Next
|
|
||||||
|
|
||||||
If oColumnIsEmpty Then
|
|
||||||
oIndexesToRemove.Add(oRowIndex)
|
|
||||||
End If
|
|
||||||
Next
|
|
||||||
|
|
||||||
_logger.Debug("Removing {0} empty rows.", oIndexesToRemove)
|
|
||||||
|
|
||||||
|
|
||||||
' order indexes to remove descending to avoid indexOutOfRange errors
|
|
||||||
If oIndexesToRemove.Count > 0 Then
|
|
||||||
oIndexesToRemove = oIndexesToRemove.
|
|
||||||
OrderByDescending(Function(oIndex) oIndex).
|
|
||||||
ToList()
|
|
||||||
End If
|
|
||||||
|
|
||||||
' now remove all empty rows.
|
|
||||||
For Each oIndex In oIndexesToRemove
|
|
||||||
For Each oRow In oPropertyList
|
|
||||||
oRow.Value.RemoveAt(oIndex)
|
|
||||||
Next
|
|
||||||
Next
|
|
||||||
|
|
||||||
' decrease row count by rows removed
|
|
||||||
oRowCount -= oIndexesToRemove.Count
|
|
||||||
|
|
||||||
' Structure of oPropertyList
|
' Structure of oPropertyList
|
||||||
' [ # Propertyname # Row 1 # Row 2
|
' [ # Propertyname # Row 1 # Row 2
|
||||||
' PositionsMenge: [BilledQuantity1, BilledQuantity2, ...],
|
' PositionsMenge: [BilledQuantity1, BilledQuantity2, ...],
|
||||||
|
|||||||
@ -60,7 +60,7 @@ Public Class PropertyValues
|
|||||||
|
|
||||||
If IsArray(Obj) And Not oHasIndex Then
|
If IsArray(Obj) And Not oHasIndex Then
|
||||||
Dim oCurrentPart As String = oPart
|
Dim oCurrentPart As String = oPart
|
||||||
Dim oSplitString As String() = New String() {"." & oCurrentPart & "."}
|
Dim oSplitString As String() = New String() {oCurrentPart & "."}
|
||||||
Dim oPathFragments = PropertyName.Split(oSplitString, StringSplitOptions.None)
|
Dim oPathFragments = PropertyName.Split(oSplitString, StringSplitOptions.None)
|
||||||
Dim oResults As New List(Of Object)
|
Dim oResults As New List(Of Object)
|
||||||
|
|
||||||
@ -72,10 +72,6 @@ Public Class PropertyValues
|
|||||||
For Each oArrayItem In Obj
|
For Each oArrayItem In Obj
|
||||||
Dim oResult As List(Of Object) = GetPropValue(oArrayItem, oPathFragments(1))
|
Dim oResult As List(Of Object) = GetPropValue(oArrayItem, oPathFragments(1))
|
||||||
|
|
||||||
'If Not IsNothing(oResult) AndAlso oResult.Count > 0 Then
|
|
||||||
' oResults.Add(oResult.Item(0))
|
|
||||||
'End If
|
|
||||||
|
|
||||||
If Not IsNothing(oResult) Then
|
If Not IsNothing(oResult) Then
|
||||||
oResults.Add(oResult)
|
oResults.Add(oResult)
|
||||||
End If
|
End If
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user