HaikuDepot: List: Changed parameter order for Replace()

(index first)
This commit is contained in:
Stephan Aßmus
2013-09-05 10:58:16 +02:00
parent a452d51705
commit 036fabe903
2 changed files with 4 additions and 4 deletions
+1 -1
View File
@@ -172,7 +172,7 @@ public:
}
inline bool Replace(const ItemType& copyFrom, int32 index)
inline bool Replace(int32 index, const ItemType& copyFrom)
{
if (index < 0 || index >= (int32)fCount)
return false;
+3 -3
View File
@@ -99,7 +99,7 @@ Paragraph::Insert(int32 offset, const TextSpan& newSpan)
TextSpan span = fTextSpans.ItemAtFast(index);
if (span.Style() == newSpan.Style()) {
span.Insert(offset, newSpan.Text());
return fTextSpans.Replace(span, index);
return fTextSpans.Replace(index, span);
}
if (offset == 0) {
@@ -108,7 +108,7 @@ Paragraph::Insert(int32 offset, const TextSpan& newSpan)
TextSpan span = fTextSpans.ItemAtFast(index - 1);
if (span.Style() == newSpan.Style()) {
span.Insert(span.CharCount(), newSpan.Text());
return fTextSpans.Replace(span, index - 1);
return fTextSpans.Replace(index - 1, span);
}
}
// Just insert the new span before the one at index
@@ -119,7 +119,7 @@ Paragraph::Insert(int32 offset, const TextSpan& newSpan)
TextSpan spanBefore = span.SubSpan(0, offset);
TextSpan spanAfter = span.SubSpan(offset, span.CharCount() - offset);
return fTextSpans.Replace(spanBefore, index)
return fTextSpans.Replace(index, spanBefore)
&& fTextSpans.Add(newSpan, index + 1)
&& fTextSpans.Add(spanAfter, index + 2);
}