Copy/paste using Text inside Pinta is producing crash

Bug #998629 reported by grofaty on 2012-05-13
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Pinta
High
Olivier Dufour

Bug Description

Pinta latest development on Ubuntu 12.04. I see copy/paste is working if pasting from external application e.g. text editor, but doing the same thing inside Pinta and crash appears:
1. Text object from Tools.
2. Type in some text like: test
3. Use <Shift>+<right arrow> to mark text.
4. <Ctrl>+C to copy text
5. Move mouse to some area on canvas and left-click. Bellow error appears.

=============
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.ArgumentOutOfRangeException: Argument is out of range.
Parameter name: index
  at System.Collections.Generic.List`1[System.String].get_Item (Int32 index) [0x00000] in <filename unknown>:0
  at Pinta.Tools.TextEngine.ForeachLine (Int32 startLine, Int32 startPos, Int32 len, Pinta.Tools.Action action) [0x00000] in <filename unknown>:0
  at Pinta.Tools.TextEngine.get_SelectionRectangles () [0x00000] in <filename unknown>:0
  at Pinta.Tools.TextTool.RedrawText (Boolean showCursor, Boolean useToolLayer) [0x00000] in <filename unknown>:0
  at Pinta.Tools.TextTool.OnMouseDown (Gtk.DrawingArea canvas, Gtk.ButtonPressEventArgs args, PointD point) [0x00000] in <filename unknown>:0
  at Pinta.Core.BaseTool.DoMouseDown (Gtk.DrawingArea canvas, Gtk.ButtonPressEventArgs args, PointD point) [0x00000] in <filename unknown>:0
  at Pinta.Gui.Widgets.PintaCanvas.<PintaCanvas>m__E (System.Object sender, Gtk.ButtonPressEventArgs e) [0x00000] in <filename unknown>:0
  at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&)
  at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in <filename unknown>:0
  --- End of inner exception stack trace ---
  at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in <filename unknown>:0
  at System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) [0x00000] in <filename unknown>:0
  at System.Delegate.DynamicInvokeImpl (System.Object[] args) [0x00000] in <filename unknown>:0
  at System.MulticastDelegate.DynamicInvokeImpl (System.Object[] args) [0x00000] in <filename unknown>:0
  at System.Delegate.DynamicInvoke (System.Object[] args) [0x00000] in <filename unknown>:0
  at GLib.Signal.ClosureInvokedCB (System.Object o, GLib.ClosureInvokedArgs args) [0x00000] in <filename unknown>:0
  at GLib.SignalClosure.Invoke (GLib.ClosureInvokedArgs args) [0x00000] in <filename unknown>:0
  at GLib.SignalClosure.MarshalCallback (IntPtr raw_closure, IntPtr return_val, UInt32 n_param_vals, IntPtr param_values, IntPtr invocation_hint, IntPtr marshal_data) [0x00000] in <filename unknown>:0

grofaty (grofaty) on 2012-05-13
summary: - Copy/paste inside Pinta is not working
+ Copy/paste inside Pinta is producing crash

I have tested different revisions from git and it looks like this is not a regression bug. This was already introduced on May 6 in revision: ec93eb10780ebfeecad3cae541ca1d2619a58883 when first this feature was introduced into Pinta.

Olivier Dufour (olivier-duff) wrote :

easy fix:
add in TextEngine Clear () :
selectionRelativeIndex = 0;

grofaty (grofaty) on 2012-05-13
summary: - Copy/paste inside Pinta is producing crash
+ Copy/paste using Text inside Pinta is producing crash
Olivier Dufour (olivier-duff) wrote :

The bug is 100% replicable.
pull request sent in order to fix that :
https://github.com/PintaProject/Pinta/pull/23
wait for commit

Changed in pinta:
status: New → Confirmed
tags: added: crash easy-to-fix text-tool
Changed in pinta:
assignee: nobody → Olivier Dufour (olivier-duff)
Changed in pinta:
importance: Undecided → High
milestone: none → 1.4
grofaty (grofaty) on 2012-05-13
Changed in pinta:
status: Confirmed → In Progress
Cameron White (cameronwhite91) wrote :

The pull request has now been merged: https://github.com/PintaProject/Pinta/pull/23

Changed in pinta:
status: In Progress → Fix Committed
grofaty (grofaty) on 2012-09-27
Changed in pinta:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers