Skip to content

Commit

Permalink
[SX-book.cpp] convert to c++
Browse files Browse the repository at this point in the history
  • Loading branch information
christopherlam committed May 31, 2024
1 parent 35a0e77 commit 5b1bb11
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 9 deletions.
2 changes: 1 addition & 1 deletion libgnucash/engine/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ set (engine_SOURCES
Recurrence.cpp
Query.cpp
SchedXaction.c
SX-book.c
SX-book.cpp
SX-ttinfo.c
Scrub.cpp
Scrub2.cpp
Expand Down
12 changes: 5 additions & 7 deletions libgnucash/engine/SX-book.c → libgnucash/engine/SX-book.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
static Account *
gnc_collection_get_template_root( const QofCollection *col )
{
return qof_collection_get_data (col);
return GNC_ACCOUNT(qof_collection_get_data (col));
}

Account *
Expand Down Expand Up @@ -141,7 +141,7 @@ sxtg_is_dirty(const QofCollection *col)
descendants = gnc_account_get_descendants(root);
for (node = descendants; node; node = g_list_next(node))
{
if (qof_instance_is_dirty(node->data))
if (qof_instance_is_dirty(QOF_INSTANCE(node->data)))
{
dirty = TRUE;
break;
Expand Down Expand Up @@ -195,7 +195,7 @@ static QofObject sxtg_object_def =
SchedXactions*
gnc_collection_get_schedxactions(const QofCollection *col)
{
SchedXactions *rtn = qof_collection_get_data(col);
auto rtn = GNC_SCHEDXACTIONS (qof_collection_get_data(col));
// @@assert(rtn != null);
return rtn;
}
Expand Down Expand Up @@ -260,10 +260,9 @@ static void
book_sxes_setup(QofBook *book)
{
QofCollection *col;
SchedXactions *sxes;

col = qof_book_get_collection(book, GNC_ID_SCHEDXACTION);
sxes = g_object_new (GNC_TYPE_SCHEDXACTIONS, NULL);
auto sxes = GNC_SCHEDXACTIONS (g_object_new (GNC_TYPE_SCHEDXACTIONS, NULL));
g_assert(sxes);
qof_instance_init_data(&sxes->inst, GNC_ID_SXES, book);
sxes->sx_list = NULL;
Expand All @@ -275,10 +274,9 @@ static void
book_sxes_end(QofBook* book)
{
QofCollection *col;
SchedXactions *sxes;

col = qof_book_get_collection(book, GNC_ID_SCHEDXACTION);
sxes = qof_collection_get_data(col);
auto sxes = GNC_SCHEDXACTIONS (qof_collection_get_data(col));
if (sxes != NULL)
{
g_list_free(sxes->sx_list);
Expand Down
2 changes: 1 addition & 1 deletion po/POTFILES.in
Original file line number Diff line number Diff line change
Expand Up @@ -691,7 +691,7 @@ libgnucash/engine/ScrubBudget.c
libgnucash/engine/ScrubBusiness.c
libgnucash/engine/Scrub.cpp
libgnucash/engine/Split.cpp
libgnucash/engine/SX-book.c
libgnucash/engine/SX-book.cpp
libgnucash/engine/SX-ttinfo.c
libgnucash/engine/Transaction.cpp
libgnucash/engine/TransLog.cpp
Expand Down

0 comments on commit 5b1bb11

Please sign in to comment.