From d5c3b4af0cb82d9d7693092faa2a2d89a1e89d18 Mon Sep 17 00:00:00 2001 From: Robert Fewell <14uBobIT@gmail.com> Date: Fri, 7 Jun 2019 13:38:56 +0100 Subject: [PATCH] Make the blank split read only If the transactions are read only or voided and selected for editing a blank split is added that allows you to change the transaction so in these cases make the blank split read only. --- .../register/ledger-core/split-register-model.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/gnucash/register/ledger-core/split-register-model.c b/gnucash/register/ledger-core/split-register-model.c index f05dcd118c..1e45fbc03b 100644 --- a/gnucash/register/ledger-core/split-register-model.c +++ b/gnucash/register/ledger-core/split-register-model.c @@ -1954,7 +1954,19 @@ gnc_split_register_cursor_is_readonly (VirtualLocation virt_loc, char type; split = gnc_split_register_get_split (reg, virt_loc.vcell_loc); - if (!split) return FALSE; + + if (!split) // this could be the blank split + { + txn = gnc_split_register_get_current_trans (reg); + + if (txn) // get the current trans and see if read_only required + { + if (xaccTransGetReadOnly (txn) + || xaccTransIsReadonlyByPostedDate (txn)) + return (TRUE); + } + return FALSE; + } txn = xaccSplitGetParent (split); if (!txn) return FALSE;