• R/O
  • SSH
  • HTTPS

utable: 提交


Commit MetaInfo

修訂731 (tree)
時間2022-04-28 11:03:35
作者shuetsu

Log Message

ClipboardPasteでペースト先を指定可能にした

Change Summary

差異

--- utable/trunk/table/Range.vb (revision 730)
+++ utable/trunk/table/Range.vb (revision 731)
@@ -389,22 +389,26 @@
389389 End Sub
390390
391391 Public Sub ClipboardPaste()
392- Me.ClipboardPaste(False)
392+ Me.ClipboardPaste(False, Me.FocusField)
393393 End Sub
394394
395395 Public Sub ClipboardPaste(ByVal addRecord As Boolean)
396- If Clipboard.ContainsText AndAlso Me.FocusField IsNot Nothing Then
396+ ClipboardPaste(addRecord, Me.FocusField)
397+ End Sub
398+
399+ Public Sub ClipboardPaste(ByVal addRecord As Boolean, field As CField)
400+ If Clipboard.ContainsText AndAlso field IsNot Nothing Then
397401 Using Me.RenderBlock
398402 Using Me.EditBlock
399403 Dim v As List(Of List(Of String)) = _ParseClipboard(Clipboard.GetText)
400- If Me.SelectRange IsNot Nothing AndAlso _
401- Me.SelectRange.Rows Mod v.Count = 0 AndAlso _
404+ If Me.SelectRange IsNot Nothing AndAlso
405+ Me.SelectRange.Rows Mod v.Count = 0 AndAlso
402406 Me.SelectRange.Cols Mod v(0).Count = 0 Then
403407 Me._ClipboardPaste_toRangeRepeat(v)
404408 ElseIf v.Count = 1 AndAlso v(0).Count = 1 Then
405- Me._ClipboardPaste_toField(Me.FocusField, v(0)(0))
409+ Me._ClipboardPaste_toField(v(0)(0), field)
406410 Else
407- Me._ClipboardPaste_toRange(v, addRecord)
411+ Me._ClipboardPaste_toRange(v, addRecord, field)
408412 End If
409413 End Using
410414 End Using
@@ -411,20 +415,20 @@
411415 End If
412416 End Sub
413417
414- Private Sub _ClipboardPaste_toField(ByVal field As CField, ByVal v As String)
415- If field IsNot Nothing AndAlso _
416- field.Focusable AndAlso _
418+ Private Sub _ClipboardPaste_toField(v As String, field As CField)
419+ If field IsNot Nothing AndAlso
420+ field.Focusable AndAlso
417421 field.Editable.Equals(EAllow.ALLOW) Then
418422 field.Desc.Provider.Clipboard(field) = v
419423 End If
420424 End Sub
421425
422- Private Sub _ClipboardPaste_toRange(ByVal v As List(Of List(Of String)), ByVal addRecord As Boolean)
426+ Private Sub _ClipboardPaste_toRange(v As List(Of List(Of String)), addRecord As Boolean, field As CField)
423427 If addRecord Then
424428 Me._ClipboardPaste_AddRecord(v.Count)
425429 End If
426- Dim range As CRange = Me.CreateRange(Me.FocusField, _
427- Me.FocusField.TopLevelContent.LayoutCache.SelectableRows.Count - 1, _
430+ Dim range As CRange = Me.CreateRange(field,
431+ field.TopLevelContent.LayoutCache.SelectableRows.Count - 1,
428432 Me.LayoutCache.SelectableCols.Count - 1)
429433 If range IsNot Nothing Then
430434 For i As Integer = 0 To v.Count - 1
@@ -435,7 +439,7 @@
435439 If j >= range.FieldMatrix(i).Count Then
436440 Exit For
437441 End If
438- Me._ClipboardPaste_toField(range.FieldMatrix(i)(j), v(i)(j))
442+ Me._ClipboardPaste_toField(v(i)(j), range.FieldMatrix(i)(j))
439443 Next
440444 Next
441445 End If
@@ -449,7 +453,7 @@
449453 Dim _i As Integer = i Mod rows
450454 For j As Integer = 0 To range.FieldMatrix(i).Count - 1
451455 Dim _j As Integer = j Mod cols
452- Me._ClipboardPaste_toField(range.FieldMatrix(i)(j), v(_i)(_j))
456+ Me._ClipboardPaste_toField(v(_i)(_j), range.FieldMatrix(i)(j))
453457 Next
454458 Next
455459 End Sub
Show on old repository browser