Commit Graph

648 Commits

Author SHA1 Message Date
Christopher Lam
b94440b16a Bug 798588 - sx scrubbing was using incorrect free function
the GHashTable values are gnc_numeric*.
2022-08-06 16:25:42 -07:00
Christopher Lam
ea56d67797 [gnc-sx-instance-model.c] indent attributes properly 2022-08-06 16:25:42 -07:00
Christopher Lam
0b5a4cd298 Merge branch 'maint' 2022-08-03 20:38:08 +08:00
Christopher Lam
67a1b7a873 [gnc-sx-instance-model] free GHashTable keys when destroying 2022-07-30 13:43:06 +08:00
Christopher Lam
ebf3439558 [gnc-sx-instance-model] free some GHashTable keys & Values 2022-07-29 12:56:02 +08:00
Christopher Lam
7c2a249511 [gnc-sx-instance-model.c] refactor Scrub function
This scrubbing function calls xaccTransRollbackEdit which is
leaky. Instead of trying to fix xaccTransRollbackEdit which requires
superhuman skills, it's easiest to track the changes separately in a
GList, and use xaccTransBeginEdit/xaccTransCommitEdit only if
necessary.
2022-07-29 12:47:10 +08:00
Christopher Lam
c16840b840 more leaks because qof_instance_get returns a new char* 2022-07-21 07:46:40 +08:00
John Ralls
f4c27d4494 Move gnc_ui_account_get_tax_info_string to gnc-locale-tax.c
To prevent a circular dependency between libgnc-app-utils and
libgnucash-guile.
2022-07-17 10:00:23 -07:00
John Ralls
3e2f7bc66a Create separate shared library for expression parser and SX instance model.
These functions depend on both libgnc-app-utils and libgnucash-guile,
creating a circular dependency when the app-utils bindings are added to
libgnucash-guile.
2022-07-16 18:20:17 -07:00
John Ralls
47904a858e Fix distcheck in master.
Several gnc-optiondb dependencies left out of tarball.
2022-07-16 18:15:57 -07:00
John Ralls
1e6c679e71 Merge branch 'maint' 2022-06-14 12:53:16 -07:00
John Ralls
564d73a553 Bug 798531 - Selecting "Print" from the file menu on a report...
crashes gnucash

Ensure that every call to gnc_prefs_get_string correctly handles both
a NULL or empty string return value without crashing or leaking.
2022-05-20 14:33:29 -07:00
Christopher Lam
a5cae6c5eb Don't export undefined functions 2022-05-05 09:46:49 +08:00
Robert Fewell
ee7ed89b68 This partly fixes the currency and commodity combos
With these changes the currency works but the commodity allows you to
set the commodity but will crash if you save config or leave report
open, this was tested on the 'Price scatter plot' report. Fixed with
John's commit a8e6a59
2022-05-03 16:55:55 +01:00
Robert Fewell
db6a8f809b Tax Tables combo does not set the active one
Fixed by correcting spelling of tax table qof type, should
'gncTaxTable'. Also fixed setting tax table combo to 'none' when page
reset button used.
2022-05-03 16:55:55 +01:00
Robert Fewell
0b67a91217 Fix the option GncOptionRangeValue
The GncOptionRangeValue can be used with integers or doubles, the
default being doubles. When used for setting the plot width/height,
integers are used so all ValueTypes need to be integers other wise
the when create_range_spinner is used you end up with the upper_bound
value being G_MAXDOUBLE, a 309 character wide spin button. To
differentiate the two, use 'set_alternate(true)' for integers.
2022-05-03 16:55:48 +01:00
Robert Fewell
506eb38493 Update Chart Width/Height Plot setting
The new plot setting does both settings, values above 100 are treated
as pixels and ones below are treated as a percentage. This means the
maximum valid setting must be higher and also the tooltip needs to be
changed.
2022-05-03 15:44:24 +01:00
John Ralls
1a186b953e [C++options] Correct handling of multichoice scheme option types.
Includes tests for save-to-scheme for each type.
2022-05-02 11:28:28 -07:00
John Ralls
a8e6a59bf8 [C++options] Fix Guile crash when restoring some reports.
In particular those with commodity options or those using a stylesheet
whose name has spaces like "Head or Tail".
2022-04-29 11:16:25 -07:00
Christopher Lam
dc620d4b24 Merge branch 'maint' 2022-04-22 13:43:47 +08:00
Christopher Lam
394e0a4b71 [gnc-sx-instance-model.c] leak: don't strdup char* for xaccTransSetNotes
For a while now, xaccTransSetNotes would strdup the notes. Don't need
to strdup it beforehand.
2022-04-19 22:59:51 +08:00
John Ralls
95487eb4a0 Merge branch 'maint'
# Conflicts:
#	gnucash/gnome/window-reconcile2.c
#	libgnucash/app-utils/options.scm
#	libgnucash/engine/gnc-numeric.cpp
2022-04-14 18:02:17 -07:00
luz paz
8adedc2248 Fix various typos
Found via `codespell -q 3 -S *.po,./po,*.min.js,./ChangeLog*,./NEWS,./borrowed,./doc/README*,./AUTHORS,./libgnucash/tax/us/txf-de*,./data/accounts -L ans,ba,cas,dragable,gae,iff,iif,mut,nd,numer,parm,parms,startd,stoll`
2022-04-08 14:12:50 -04:00
Robert Fewell
ae220b86a4 [C++options] Fix Ubuntu test failure. 2022-04-07 14:28:02 +01:00
Robert Fewell
83373563c3 Counter formats stored in wrong place.
The Book Options, counter formats were being stored under the 'options'
tree but need to be stored in the 'counter_format' tree similar to the
'counters' tree.
2022-04-07 10:33:11 +01:00
John Ralls
29bdd9b526 [C++options] Fix Ubuntu test failure. 2022-03-31 13:12:45 -07:00
John Ralls
1fddf70e21 [C++options] Fix previous month and previous quarter at the end of March
.

Because March has more days than February the previous month offset was
getting normalized back to the current month--th 29 February this
year is really 1 March, so normalizing before setting the day caused
begin/end previous month to return the begin/end of the current month.
That probably happened on the 31st of May, July, October, and December
as well, I just hadn't managed to test on those days. Switching the
normalization to after calculating the day of the month broke the
previous quarter calculation because now the month was out of range, so
normalize month & year first.
2022-03-31 12:27:58 -07:00
John Ralls
abd1a0b3f1 Merge branch 'c++options' 2022-03-29 15:58:22 -07:00
John Ralls
109efe62b8 Rework default non-currency commodity namespace.
Separate the "All noncurrency" convenience category in the commodity
selector and the default non-commodity namespace proposed by the QIF
importer because they have different functions.

Also remove the namespace guessing code from qif-dialog because with
only one default non-currency namespace there's nothing to guess.
2022-03-24 18:10:32 -07:00
John Ralls
4fe83c3b32 [C++options] Remove GncOptionValue<SCM>.
No longer needed.
2022-03-21 14:08:06 -07:00
John Ralls
278aa484d7 [C++options] Implement new GncOptionValue type GncOptionReportPlacement.
For multicolumn reports so that we don't have to pass Scheme values.
2022-03-21 13:58:50 -07:00
Christopher Lam
cf1282501e Use original guile variable names changed in #1073
The changes 09296dfb96, 1373233cd0 and 189db58e6 had caused
inconsistencies. Best restore original guile variable names using
underscore, bound to strings instead of functions returning strings.
2022-03-20 12:38:09 +08:00
Christopher Lam
5993ebf4d4 Merge branch 'maint' 2022-03-18 20:37:07 +08:00
John Ralls
30e6c8ab11 [gnc-optiondb.i]Explicitly include array.
Xcode-13.3 errors without it.
2022-03-15 16:16:50 -07:00
John Ralls
572cb6b1d1 Banish gnc_get_optiondb_from_dispatcher to gnc-report.cpp.
Puts it closer to its points of use and removes it with its Scheme
dependency from libgnucash.
2022-03-14 10:32:08 -07:00
John Ralls
e63baa6270 Merge Bob Fewell's 'rtl' into maint. 2022-03-14 09:25:42 -07:00
Robert Fewell
f8fc796c95 Bug797501 - Currency symbols in Hebrew (RTL) language
When Gnucash is run in Hebrew which is a RTL language, on the accounts
page the tree view is displaying the required number as the following...

TreeView entry is   '1,500.00 ₪' or '-1,500.00 ₪'
TreeModel string is '₪ 1,500.00‬' or '₪ 1,500.00-‬'

This seems to be down to the GTK 'Unicode Bidirectional Text Algorithm'
which is changing the representation of the model string based on the
first strongly typed character, in this case the Israeli shekel sign.

To fix this, when creating the displayed monetary amount insert a BiDi
ltr isolate uni-character at the start of the string.
2022-03-14 10:05:46 +00:00
John Ralls
d4c3c30b1a Use GUIDs to represent QofInstances instead of pointers.
Converting them to pointers for Scheme to use. Prevents
dangling pointers when the user deletes a QofInstance as long as the
Scheme report code re-fetches its pointers from the options when it's
regenerated.
2022-03-12 17:58:23 -08:00
Christopher Lam
193a7aae5d Merge branch 'maint' 2022-03-12 15:18:43 +08:00
Frank H. Ellenberger
09296dfb96 Drop commodity-table.scm, no longer required after adjusting qif-dialog-utils 2022-03-01 19:58:11 -08:00
John Ralls
c1c75e8f81 Revert "Revert "Merge Stefan Bayer's 'SepaInternalTransfer' into maint.""
The original merge was of a PR based on master into maint, bringing
along all of the development changes in master along with it. We don't
want that so the merge was reverted and the PR's two changes
cherry-picked in. That fixed maint, but then the next regular merge of
maint into master naturally included that revert commit undoing the
changes in master. Not so good. Reverting the revert, this commit,
restores the changes, albeit with messed up history.
2022-01-08 15:10:53 -08:00
Christopher Lam
5603acba31 Merge branch 'maint' 2022-01-06 21:32:41 +08:00
John Ralls
a7a643f7f2 Store option commodities and namespace and mnemonic instead of pointer.
Protects against crashes caused by the user deleting the commodity and
allows the option to work if a deleted commodity is recreated.
2022-01-03 14:47:18 -08:00
John Ralls
65bd860249 Fix relative_date_to_time64 calculations.
Where the date requested extends beyond the start or end of the year.
2022-01-01 16:05:06 -08:00
John Ralls
6841e5b5c8 Replace GncOptionValue<const QofInstance*> with GncOptionQofInstanceValue.
That stores its values as a pair of <QofIdType, gncGUID> so that it
won't have dangling ptrs if the instance gets deleted.
2021-12-30 12:21:56 -08:00
John Ralls
11225d9741 c++options: Remove gnc:options-data 2021-12-15 14:54:41 -08:00
John Ralls
16dc15964c c++options: Remove the callback registration functions. 2021-12-15 14:32:39 -08:00
John Ralls
759376eb13 c++options: Fix multicolumn report 2021-12-15 14:13:47 -08:00
John Ralls
18edc17541 c++options remove stray debugging comment. 2021-12-14 14:20:20 -08:00
John Ralls
b5d0c42505 c++options: Put copyright and FSF header comment on gnc-optiondb.i. 2021-12-14 12:06:39 -08:00