I have installed Pinta 1.0 on Windows XP sp3.
1. Open Pinta.
2. Select Text object from tools.
3. Type in some text like: test
4. Close image <CTRL>+W.
5. Press <CTRL>+W again (it looks stupid to close a non-existing image, I have just accidently pressed this combination). Exception is displayed. Pinta does not crashes, just an exception is trown and I can still work with Pinta.
=================
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.InvalidOperationException: Tried to get WorkspaceManager.ActiveDocument when there are no open Documents. Check HasOpenDocuments first.
at Pinta.Core.WorkspaceManager.get_ActiveDocument() in c:\Users\Jonathan\Documents\Visual Studio 2010\Projects\Pinta\Pinta.Core\Managers\WorkspaceManager.cs:line 51
at Pinta.Tools.TextTool.RedrawText(Boolean showCursor, Boolean useToolLayer) in C:\Users\Jonathan\Documents\Visual Studio 2010\Projects\Pinta\Pinta.Tools\TextTool\TextTool.cs:line 652
at Pinta.Tools.TextTool.OnKeyDown(DrawingArea canvas, KeyPressEventArgs args) in C:\Users\Jonathan\Documents\Visual Studio 2010\Projects\Pinta\Pinta.Tools\TextTool\TextTool.cs:line 580
at Pinta.Core.BaseTool.DoKeyPress(DrawingArea canvas, KeyPressEventArgs args) in c:\Users\Jonathan\Documents\Visual Studio 2010\Projects\Pinta\Pinta.Core\Classes\BaseTool.cs:line 123
at Pinta.Gui.Widgets.PintaCanvas.PintaCanvas_KeyPressEvent(Object o, KeyPressEventArgs e) in c:\Users\Jonathan\Documents\Visual Studio 2010\Projects\Pinta\Pinta.Gui.Widgets\Widgets\Canvas\PintaCanvas.cs:line 238
--- End of inner exception stack trace ---
at System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
at System.RuntimeMethodHandle.InvokeMethodFast(Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
at System.Delegate.DynamicInvokeImpl(Object[] args)
at GLib.Signal.ClosureInvokedCB(Object o, ClosureInvokedArgs args)
at GLib.SignalClosure.Invoke(ClosureInvokedArgs args)
at GLib.SignalClosure.MarshalCallback(IntPtr raw_closure, IntPtr return_val, UInt32 n_param_vals, IntPtr param_values, IntPtr invocation_hint, IntPtr marshal_data)
=================
Fixed: https:/ /github. com/PintaProjec t/Pinta/ commit/ 479dcef02f3306b a44920e0c623951 5da1a4c6ed
Just had to ensure that the text tool's work was committed (i.e. exited the editing mode) before closing the document