projects
/
platform
/
core
/
csapi
/
tizenfx.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
55ad667
)
[NUI] Fix some SVACE issues.
author
zhouhao02
<haozhou.zhou@samsung.com>
Fri, 17 Nov 2023 08:26:02 +0000
(16:26 +0800)
committer
Eunki Hong
<h.pichulia@gmail.com>
Tue, 5 Dec 2023 06:39:03 +0000
(15:39 +0900)
src/Tizen.NUI.Components/Controls/RecyclerView/ItemSource/MarshalingObservableCollection.cs
patch
|
blob
|
history
src/Tizen.NUI.Components/Controls/RecyclerView/ItemSource/ObservableGroupedSource.cs
patch
|
blob
|
history
src/Tizen.NUI.Components/Controls/RecyclerView/ItemSource/ObservableItemSource.cs
patch
|
blob
|
history
diff --git
a/src/Tizen.NUI.Components/Controls/RecyclerView/ItemSource/MarshalingObservableCollection.cs
b/src/Tizen.NUI.Components/Controls/RecyclerView/ItemSource/MarshalingObservableCollection.cs
index
92dc48f
..
44074d8
100755
(executable)
--- a/
src/Tizen.NUI.Components/Controls/RecyclerView/ItemSource/MarshalingObservableCollection.cs
+++ b/
src/Tizen.NUI.Components/Controls/RecyclerView/ItemSource/MarshalingObservableCollection.cs
@@
-110,7
+110,7
@@
namespace Tizen.NUI.Components
void Move(NotifyCollectionChangedEventArgs args)
{
void Move(NotifyCollectionChangedEventArgs args)
{
-
var count = args.OldItems.Count
;
+
int count = args.OldItems?.Count ?? 0
;
for (int n = 0; n < count; n++)
{
for (int n = 0; n < count; n++)
{
@@
-124,7
+124,8
@@
namespace Tizen.NUI.Components
void Remove(NotifyCollectionChangedEventArgs args)
{
void Remove(NotifyCollectionChangedEventArgs args)
{
- var startIndex = args.OldStartingIndex + args.OldItems.Count - 1;
+ int count=args.OldItems?.Count ?? 0;
+ int startIndex = args.OldStartingIndex + count - 1;
for (int n = startIndex; n >= args.OldStartingIndex; n--)
{
RemoveAt(n);
for (int n = startIndex; n >= args.OldStartingIndex; n--)
{
RemoveAt(n);
diff --git
a/src/Tizen.NUI.Components/Controls/RecyclerView/ItemSource/ObservableGroupedSource.cs
b/src/Tizen.NUI.Components/Controls/RecyclerView/ItemSource/ObservableGroupedSource.cs
index
a0247d5
..
9357843
100755
(executable)
--- a/
src/Tizen.NUI.Components/Controls/RecyclerView/ItemSource/ObservableGroupedSource.cs
+++ b/
src/Tizen.NUI.Components/Controls/RecyclerView/ItemSource/ObservableGroupedSource.cs
@@
-337,7
+337,7
@@
namespace Tizen.NUI.Components
}
// If we have a start index, we can be more clever about removing the group(s) (and get the nifty animations)
}
// If we have a start index, we can be more clever about removing the group(s) (and get the nifty animations)
-
var groupCount = args.OldItems.Count
;
+
int groupCount = args.OldItems?.Count ?? 0
;
var absolutePosition = GetAbsolutePosition(groups[groupIndex], 0);
var absolutePosition = GetAbsolutePosition(groups[groupIndex], 0);
@@
-360,9
+360,15
@@
namespace Tizen.NUI.Components
void Replace(NotifyCollectionChangedEventArgs args)
{
void Replace(NotifyCollectionChangedEventArgs args)
{
- var groupCount = args.NewItems.Count;
-
- if (groupCount != args.OldItems.Count)
+ var newItems = args.NewItems;
+ var oldItems = args.OldItems;
+ if(newItems == null || oldItems == null)
+ {
+ return;
+ }
+ int groupCount = newItems.Count;
+ int oldCount = oldItems.Count;
+ if (groupCount != oldCount)
{
// The original and replacement sets are of unequal size; this means that most everything currently in
// view will have to be updated. So just reload the whole thing.
{
// The original and replacement sets are of unequal size; this means that most everything currently in
// view will have to be updated. So just reload the whole thing.
@@
-370,8
+376,8
@@
namespace Tizen.NUI.Components
return;
}
return;
}
- var newStartIndex = args.NewStartingIndex > -1 ? args.NewStartingIndex : groupSource.IndexOf(
args.N
ewItems[0]);
- var oldStartIndex = args.OldStartingIndex > -1 ? args.OldStartingIndex : groupSource.IndexOf(
args.O
ldItems[0]);
+ var newStartIndex = args.NewStartingIndex > -1 ? args.NewStartingIndex : groupSource.IndexOf(
n
ewItems[0]);
+ var oldStartIndex = args.OldStartingIndex > -1 ? args.OldStartingIndex : groupSource.IndexOf(
o
ldItems[0]);
var newItemCount = CountItemsInGroups(newStartIndex, groupCount);
var oldItemCount = CountItemsInGroups(oldStartIndex, groupCount);
var newItemCount = CountItemsInGroups(newStartIndex, groupCount);
var oldItemCount = CountItemsInGroups(oldStartIndex, groupCount);
@@
-402,7
+408,7
@@
namespace Tizen.NUI.Components
void Move(NotifyCollectionChangedEventArgs args)
{
void Move(NotifyCollectionChangedEventArgs args)
{
- var itemCount = CountItemsInGroups(args.OldStartingIndex, args.OldItems
.Count
);
+ var itemCount = CountItemsInGroups(args.OldStartingIndex, args.OldItems
?.Count ?? 0
);
var start = Math.Min(args.OldStartingIndex, args.NewStartingIndex);
var end = Math.Max(args.OldStartingIndex, args.NewStartingIndex) + itemCount;
var start = Math.Min(args.OldStartingIndex, args.NewStartingIndex);
var end = Math.Max(args.OldStartingIndex, args.NewStartingIndex) + itemCount;
diff --git
a/src/Tizen.NUI.Components/Controls/RecyclerView/ItemSource/ObservableItemSource.cs
b/src/Tizen.NUI.Components/Controls/RecyclerView/ItemSource/ObservableItemSource.cs
index
616485d
..
a70b4ca
100755
(executable)
--- a/
src/Tizen.NUI.Components/Controls/RecyclerView/ItemSource/ObservableItemSource.cs
+++ b/
src/Tizen.NUI.Components/Controls/RecyclerView/ItemSource/ObservableItemSource.cs
@@
-187,7
+187,7
@@
namespace Tizen.NUI.Components
startIndex = AdjustPositionForHeader(startIndex);
// If we have a start index, we can be more clever about removing the item(s) (and get the nifty animations)
startIndex = AdjustPositionForHeader(startIndex);
// If we have a start index, we can be more clever about removing the item(s) (and get the nifty animations)
-
var count = args.OldItems.Count
;
+
int count = args.OldItems?.Count ?? 0
;
if (count == 1)
{
if (count == 1)
{
@@
-200,11
+200,18
@@
namespace Tizen.NUI.Components
void Replace(NotifyCollectionChangedEventArgs args)
{
void Replace(NotifyCollectionChangedEventArgs args)
{
+ var newItems = args.NewItems;
+ var oldItems = args.OldItems;
+ if (newItems == null || oldItems == null)
+ {
+ return;
+ }
var startIndex = args.NewStartingIndex > -1 ? args.NewStartingIndex : IndexOf(args.NewItems[0]);
startIndex = AdjustPositionForHeader(startIndex);
var startIndex = args.NewStartingIndex > -1 ? args.NewStartingIndex : IndexOf(args.NewItems[0]);
startIndex = AdjustPositionForHeader(startIndex);
- var newCount = args.NewItems.Count;
-
- if (newCount == args.OldItems.Count)
+
+ int newCount = newItems.Count;
+ int oldCount = oldItems.Count;
+ if (newCount == oldCount)
{
// We are replacing one set of items with a set of equal size; we can do a simple item or range
// notification to the adapter
{
// We are replacing one set of items with a set of equal size; we can do a simple item or range
// notification to the adapter