gnucash unstable: Multiple changes pushed

John Ralls jralls at code.gnucash.org
Tue Dec 26 18:37:19 EST 2017


Updated	 via  https://github.com/Gnucash/gnucash/commit/bbd2df6a (commit)
	 via  https://github.com/Gnucash/gnucash/commit/91727525 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/a6a46d7c (commit)
	 via  https://github.com/Gnucash/gnucash/commit/a17bc85a (commit)
	from  https://github.com/Gnucash/gnucash/commit/2f96b19c (commit)



commit bbd2df6a3bb39ae62d91ec4f740f3366209aa675
Author: John Ralls <jralls at ceridwen.us>
Date:   Sat Dec 23 14:27:04 2017 -0800

    Bug 791848 - GC 2.6.x does not handle ISO dates introduced with GC 2.7.
    
    Set a feature to prevent versions older that 2.6.20 from loading a
    database from which they cannot read the dates. Ideally we would do this
    only if the database is written to, but the current persistence design
    includes committing back to the database during the load so the net
    effect is that the flag would be set anyway.

diff --git a/libgnucash/backend/dbi/gnc-backend-dbi.cpp b/libgnucash/backend/dbi/gnc-backend-dbi.cpp
index bd50be6..68b8933 100644
--- a/libgnucash/backend/dbi/gnc-backend-dbi.cpp
+++ b/libgnucash/backend/dbi/gnc-backend-dbi.cpp
@@ -59,7 +59,7 @@ extern "C"
 #include "gnc-engine.h"
 #include "SX-book.h"
 #include "Recurrence.h"
-
+#include <gnc-features.h>
 #include "gnc-uri-utils.h"
 #include "gnc-filepath-utils.h"
 #include <gnc-path.h>
@@ -76,6 +76,7 @@ extern "C"
 #include <string>
 #include <iomanip>
 
+#include <qofsession.hpp>
 #include <gnc-backend-prov.hpp>
 #include "gnc-backend-dbi.h"
 #include "gnc-backend-dbi.hpp"
@@ -470,7 +471,6 @@ GncDbiBackend<DbType::DBI_SQLITE>::session_begin(QofSession* session,
      * Let's start logging */
     xaccLogSetBaseName (filepath.c_str());
     PINFO ("logpath=%s", filepath.c_str() ? filepath.c_str() : "(null)");
-
     LEAVE ("");
 }
 
@@ -830,6 +830,9 @@ GncDbiBackend<Type>::load (QofBook* book, QofBackendLoadType loadType)
 
     GncSqlBackend::load(book, loadType);
 
+    if (Type == DbType::DBI_SQLITE)
+        gnc_features_set_used(book, GNC_FEATURE_SQLITE3_ISO_DATES);
+
     if (GNUCASH_RESAVE_VERSION > get_table_version("Gnucash"))
     {
         /* The database was loaded with an older database schema or
diff --git a/libgnucash/engine/gnc-features.c b/libgnucash/engine/gnc-features.c
index 4d38fa7..ca4cb9b 100644
--- a/libgnucash/engine/gnc-features.c
+++ b/libgnucash/engine/gnc-features.c
@@ -47,6 +47,7 @@ static gncFeature known_features[] =
     { GNC_FEATURE_BOOK_CURRENCY, "User specifies a 'book-currency'; costs of other currencies/commodities tracked in terms of book-currency (requires at least GnuCash 2.7.0)" },
     { GNC_FEATURE_GUID_BAYESIAN, "Use account GUID as key for Bayesian data (requires at least GnuCash 2.6.12)" },
     { GNC_FEATURE_GUID_FLAT_BAYESIAN, "Use account GUID as key for bayesian data and store KVP flat (requires at least Gnucash 2.6.19)" },
+    { GNC_FEATURE_SQLITE3_ISO_DATES, "Use ISO formatted date-time strings in SQLite3 databases (requires at least GnuCash 2.6.20)"},
     { NULL },
 };
 
diff --git a/libgnucash/engine/gnc-features.h b/libgnucash/engine/gnc-features.h
index 2beca42..0386077 100644
--- a/libgnucash/engine/gnc-features.h
+++ b/libgnucash/engine/gnc-features.h
@@ -51,6 +51,7 @@ extern "C" {
 #define GNC_FEATURE_BOOK_CURRENCY "Use a Book-Currency"
 #define GNC_FEATURE_GUID_BAYESIAN "Account GUID based Bayesian data"
 #define GNC_FEATURE_GUID_FLAT_BAYESIAN "Account GUID based bayesian with flat KVP"
+#define GNC_FEATURE_SQLITE3_ISO_DATES "ISO-8601 formatted date strings in SQLite3 databases."
 
 /** @} */
 

commit 91727525b9cd3c12f4fa25268131b0161c6fc79e
Author: John Ralls <jralls at ceridwen.us>
Date:   Tue Dec 26 13:01:50 2017 -0800

    Enforce -Werror on C++ files and fix resulting errors.

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 5378340..a8a994b 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -515,6 +515,7 @@ SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++11")  # FIXME: should be -std=
 
 IF (UNIX)
   SET( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror -Wdeclaration-after-statement -Wno-pointer-sign -Wall -Wunused -Wmissing-prototypes -Wmissing-declarations  -Wno-unused")
+  SET( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror -Wdeclaration-after-statement -Wno-pointer-sign -Wall -Wunused -Wmissing-prototypes -Wmissing-declarations  -Wno-unused")
   SET( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-deprecated-declarations -std=gnu11")
   SET( CMAKE_C_FLAGS_RELEASE "-O3 ${CMAKE_C_FLAGS} -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2")
 ENDIF (UNIX)
diff --git a/common/test-core/CMakeLists.txt b/common/test-core/CMakeLists.txt
index 7774b9c..7d426fc 100644
--- a/common/test-core/CMakeLists.txt
+++ b/common/test-core/CMakeLists.txt
@@ -66,10 +66,12 @@ GNC_ADD_SCHEME_TARGETS(scm-test-core
 IF(NOT GTEST_SHARED_LIB)
   SET (lib_gtest_SOURCES ${GTEST_SRC_DIR}/src/gtest-all.cc)
   ADD_LIBRARY(gtest STATIC  ${lib_gtest_SOURCES})
+  TARGET_COMPILE_OPTIONS(gtest PRIVATE -Wno-missing-prototypes)
   TARGET_INCLUDE_DIRECTORIES(gtest PUBLIC ${GTEST_INCLUDE_DIR} ${GTEST_SRC_DIR})
 ENDIF()
 SET (lib_gmock_SOURCES ${GMOCK_SRC})
 ADD_LIBRARY(gmock STATIC  ${lib_gmock_SOURCES})
+TARGET_COMPILE_OPTIONS(gmock PRIVATE -Wno-missing-prototypes)
 TARGET_INCLUDE_DIRECTORIES(gmock PUBLIC
   ${GTEST_INCLUDE_DIR} ${GTEST_SRC_DIR}
   ${GMOCK_INCLUDE_DIR} ${GMOCK_SRC_DIR})
diff --git a/gnucash/import-export/csv-imp/assistant-csv-trans-import.cpp b/gnucash/import-export/csv-imp/assistant-csv-trans-import.cpp
index 9402f38..1bfa08e 100644
--- a/gnucash/import-export/csv-imp/assistant-csv-trans-import.cpp
+++ b/gnucash/import-export/csv-imp/assistant-csv-trans-import.cpp
@@ -355,12 +355,12 @@ static void csv_tximp_preview_currency_fmt_sel_cb (GtkComboBox* format_selector,
     info->preview_update_currency_format();
 }
 
-void csv_tximp_preview_col_type_changed_cb (GtkComboBox* cbox, CsvImpTransAssist* info)
+static void csv_tximp_preview_col_type_changed_cb (GtkComboBox* cbox, CsvImpTransAssist* info)
 {
     info->preview_update_col_type (cbox);
 }
 
-gboolean
+static bool
 csv_tximp_preview_treeview_clicked_cb (GtkTreeView* treeview, GdkEventButton* event,
                                         CsvImpTransAssist* info)
 {
@@ -1054,7 +1054,7 @@ CsvImpTransAssist::preview_update_currency_format ()
     preview_refresh_table ();
 }
 
-gboolean
+static gboolean
 csv_imp_preview_queue_rebuild_table (CsvImpTransAssist *assist)
 {
     assist->preview_refresh_table ();
@@ -1417,7 +1417,7 @@ CsvImpTransAssist::preview_style_column (uint32_t col_num, GtkTreeModel* model)
 
 /* Helper to create a shared store for the header comboboxes in the preview treeview.
  * It holds the possible column types */
-GtkTreeModel*
+static GtkTreeModel*
 make_column_header_model (bool multi_split)
 {
     auto combostore = gtk_list_store_new (2, G_TYPE_STRING, G_TYPE_INT);
diff --git a/libgnucash/backend/sql/gnc-price-sql.cpp b/libgnucash/backend/sql/gnc-price-sql.cpp
index f2cc188..85c440c 100644
--- a/libgnucash/backend/sql/gnc-price-sql.cpp
+++ b/libgnucash/backend/sql/gnc-price-sql.cpp
@@ -203,7 +203,7 @@ GncSqlPriceBackend::commit (GncSqlBackend* sql_be, QofInstance* inst)
     return is_ok;
 }
 
-gboolean
+static gboolean
 write_price (GNCPrice* p, gpointer data)
 {
     auto s = reinterpret_cast<write_objects_t*>(data);
diff --git a/libgnucash/engine/CMakeLists.txt b/libgnucash/engine/CMakeLists.txt
index 993eb5e..23f228c 100644
--- a/libgnucash/engine/CMakeLists.txt
+++ b/libgnucash/engine/CMakeLists.txt
@@ -235,6 +235,7 @@ ADD_LIBRARY (gncmod-engine
 TARGET_LINK_LIBRARIES(gncmod-engine gnc-core-utils gnc-module ${Boost_DATE_TIME_LIBRARIES}  ${Boost_REGEX_LIBRARIES} ${REGEX_LDFLAGS} ${GMODULE_LDFLAGS} ${GLIB2_LDFLAGS} ${GOBJECT_LDFLAGS} ${GUILE_LDFLAGS})
 
 TARGET_COMPILE_DEFINITIONS (gncmod-engine PRIVATE -DG_LOG_DOMAIN=\"gnc.engine\")
+TARGET_COMPILE_OPTIONS (gncmod-engine PRIVATE -Wno-deprecated-register)
 
 TARGET_INCLUDE_DIRECTORIES (gncmod-engine
     PRIVATE ${CMAKE_CURRENT_BINARY_DIR} # for iso-4217-currencies.c
diff --git a/libgnucash/engine/guid.cpp b/libgnucash/engine/guid.cpp
index 11aaebf..43b32fb 100644
--- a/libgnucash/engine/guid.cpp
+++ b/libgnucash/engine/guid.cpp
@@ -133,7 +133,7 @@ guid_null (void)
     return s_null_gncguid;
 }
 
-void
+static void
 guid_assign (GncGUID & target, gnc::GUID const & source)
 {
     memcpy (&target, &source, sizeof (GncGUID));
diff --git a/libgnucash/engine/qofinstance.cpp b/libgnucash/engine/qofinstance.cpp
index e82980c..cc7c46b 100644
--- a/libgnucash/engine/qofinstance.cpp
+++ b/libgnucash/engine/qofinstance.cpp
@@ -1247,7 +1247,7 @@ qof_instance_kvp_merge_guids (const QofInstance *target,
     g_return_if_fail (target != NULL);
     g_return_if_fail (donor != NULL);
 
-    if (! qof_instance_has_slot (donor, {path})) return;
+    if (! qof_instance_has_slot (donor, path)) return;
     auto v = donor->kvp_data->get_slot({path});
     if (v == NULL) return;
 
diff --git a/libgnucash/engine/qofsession.cpp b/libgnucash/engine/qofsession.cpp
index 2049b5b..fbebf26 100644
--- a/libgnucash/engine/qofsession.cpp
+++ b/libgnucash/engine/qofsession.cpp
@@ -701,12 +701,14 @@ void qof_session_load_backend (QofSession * session, const char * access_method)
     session->load_backend (access_method);
 }
 
-void qof_session_clear_error (QofSession * session)
+static void
+qof_session_clear_error (QofSession * session)
 {
     session->clear_error ();
 }
 
-void qof_session_destroy_backend (QofSession * session)
+static void
+qof_session_destroy_backend (QofSession * session)
 {
     session->destroy_backend ();
 }
diff --git a/libgnucash/engine/test/test-qofsession.cpp b/libgnucash/engine/test/test-qofsession.cpp
index 8e64370..38a7cc6 100644
--- a/libgnucash/engine/test/test-qofsession.cpp
+++ b/libgnucash/engine/test/test-qofsession.cpp
@@ -51,7 +51,8 @@ public:
     void export_coa(QofBook*);
 };
 
-void example_hook (QofSession & session)
+static void
+example_hook (QofSession & session)
 {
     hook_called = true;
 }
@@ -77,7 +78,8 @@ void QofSessionMockBackend::export_coa(QofBook * book)
     exported_book = book;
 }
 
-QofBackend * test_backend_factory ()
+static QofBackend*
+test_backend_factory ()
 {
     return new QofSessionMockBackend;
 }
@@ -90,7 +92,8 @@ struct MockProvider : public QofBackendProvider
     bool type_check (char const * type) {return true;}
 };
 
-QofBackendProvider_ptr get_provider ()
+static QofBackendProvider_ptr
+get_provider ()
 {
     return QofBackendProvider_ptr {new MockProvider {"Mock Backend", "file"}};
 }

commit a6a46d7cdcb032a878cd1c844c2636f7676e05d6
Author: John Ralls <jralls at ceridwen.us>
Date:   Sat Dec 23 15:40:01 2017 -0800

    Test struct tm* returns from gnc_gmtime and gnc_localtime
    
    To ensure that we don't crash for dereffing a nullptr.

diff --git a/common/base-typemaps.i b/common/base-typemaps.i
index 62c8f96..e9f7ac0 100644
--- a/common/base-typemaps.i
+++ b/common/base-typemaps.i
@@ -21,6 +21,7 @@
  * Boston, MA  02110-1301,  USA       gnu at gnu.org                   *
  *                                                                  *
 \********************************************************************/
+%include "constraints.i"
 
 typedef void * gpointer; // Not sure why SWIG doesn't figure this out.
 %typemap(newfree) gchar * "g_free($1);"
@@ -93,22 +94,25 @@ typedef char gchar;
 %typemap(out) struct tm * {
     SCM tm = scm_c_make_vector(11, SCM_UNDEFINED);
     struct tm* t = $1;
-    SCM_SIMPLE_VECTOR_SET(tm, 0, scm_from_int(t->tm_sec));
-    SCM_SIMPLE_VECTOR_SET(tm, 1, scm_from_int(t->tm_min));
-    SCM_SIMPLE_VECTOR_SET(tm, 2, scm_from_int(t->tm_hour));
-    SCM_SIMPLE_VECTOR_SET(tm, 3, scm_from_int(t->tm_mday));
-    SCM_SIMPLE_VECTOR_SET(tm, 4, scm_from_int(t->tm_mon));
-    SCM_SIMPLE_VECTOR_SET(tm, 5, scm_from_int(t->tm_year));
-    SCM_SIMPLE_VECTOR_SET(tm, 6, scm_from_int(t->tm_wday));
-    SCM_SIMPLE_VECTOR_SET(tm, 7, scm_from_int(t->tm_yday));
-    SCM_SIMPLE_VECTOR_SET(tm, 8, scm_from_int(t->tm_isdst));
+    if (t != NULL)
+    {
+        SCM_SIMPLE_VECTOR_SET(tm, 0, scm_from_int(t->tm_sec));
+        SCM_SIMPLE_VECTOR_SET(tm, 1, scm_from_int(t->tm_min));
+        SCM_SIMPLE_VECTOR_SET(tm, 2, scm_from_int(t->tm_hour));
+        SCM_SIMPLE_VECTOR_SET(tm, 3, scm_from_int(t->tm_mday));
+        SCM_SIMPLE_VECTOR_SET(tm, 4, scm_from_int(t->tm_mon));
+        SCM_SIMPLE_VECTOR_SET(tm, 5, scm_from_int(t->tm_year));
+        SCM_SIMPLE_VECTOR_SET(tm, 6, scm_from_int(t->tm_wday));
+        SCM_SIMPLE_VECTOR_SET(tm, 7, scm_from_int(t->tm_yday));
+        SCM_SIMPLE_VECTOR_SET(tm, 8, scm_from_int(t->tm_isdst));
 %#ifdef HAVE_STRUCT_TM_GMTOFF
-    SCM_SIMPLE_VECTOR_SET(tm, 9, scm_from_long(t->tm_gmtoff));
-    SCM_SIMPLE_VECTOR_SET(tm, 10, scm_from_locale_string(t->tm_zone?t->tm_zone:"Unset"));
+        SCM_SIMPLE_VECTOR_SET(tm, 9, scm_from_long(t->tm_gmtoff));
+        SCM_SIMPLE_VECTOR_SET(tm, 10, scm_from_locale_string(t->tm_zone?t->tm_zone:"Unset"));
 %#else
-    SCM_SIMPLE_VECTOR_SET(tm, 9, scm_from_long(0));
-    SCM_SIMPLE_VECTOR_SET(tm, 10, scm_from_locale_string("GMT"));
+        SCM_SIMPLE_VECTOR_SET(tm, 9, scm_from_long(0));
+        SCM_SIMPLE_VECTOR_SET(tm, 10, scm_from_locale_string("GMT"));
 %#endif
+     }
     $result = tm;
  }
  
@@ -117,22 +121,25 @@ typedef char gchar;
 %typemap(argout) struct tm * {
     struct tm* t = $1;
     SCM tm = $input;
-    SCM_SIMPLE_VECTOR_SET(tm, 0, scm_from_int(t->tm_sec));
-    SCM_SIMPLE_VECTOR_SET(tm, 1, scm_from_int(t->tm_min));
-    SCM_SIMPLE_VECTOR_SET(tm, 2, scm_from_int(t->tm_hour));
-    SCM_SIMPLE_VECTOR_SET(tm, 3, scm_from_int(t->tm_mday));
-    SCM_SIMPLE_VECTOR_SET(tm, 4, scm_from_int(t->tm_mon));
-    SCM_SIMPLE_VECTOR_SET(tm, 5, scm_from_int(t->tm_year));
-    SCM_SIMPLE_VECTOR_SET(tm, 6, scm_from_int(t->tm_wday));
-    SCM_SIMPLE_VECTOR_SET(tm, 7, scm_from_int(t->tm_yday));
-    SCM_SIMPLE_VECTOR_SET(tm, 8, scm_from_int(t->tm_isdst));
+    if (t == NULL)
+    {
+        SCM_SIMPLE_VECTOR_SET(tm, 0, scm_from_int(t->tm_sec));
+        SCM_SIMPLE_VECTOR_SET(tm, 1, scm_from_int(t->tm_min));
+        SCM_SIMPLE_VECTOR_SET(tm, 2, scm_from_int(t->tm_hour));
+        SCM_SIMPLE_VECTOR_SET(tm, 3, scm_from_int(t->tm_mday));
+        SCM_SIMPLE_VECTOR_SET(tm, 4, scm_from_int(t->tm_mon));
+        SCM_SIMPLE_VECTOR_SET(tm, 5, scm_from_int(t->tm_year));
+        SCM_SIMPLE_VECTOR_SET(tm, 6, scm_from_int(t->tm_wday));
+        SCM_SIMPLE_VECTOR_SET(tm, 7, scm_from_int(t->tm_yday));
+        SCM_SIMPLE_VECTOR_SET(tm, 8, scm_from_int(t->tm_isdst));
 %#ifdef HAVE_STRUCT_TM_GMTOFF
-    SCM_SIMPLE_VECTOR_SET(tm, 9, scm_from_long(t->tm_gmtoff));
-    SCM_SIMPLE_VECTOR_SET(tm, 10, scm_from_locale_string(t->tm_zone?t->tm_zone:"Unset"));
+        SCM_SIMPLE_VECTOR_SET(tm, 9, scm_from_long(t->tm_gmtoff));
+        SCM_SIMPLE_VECTOR_SET(tm, 10, scm_from_locale_string(t->tm_zone?t->tm_zone:"Unset"));
 %#else
-    SCM_SIMPLE_VECTOR_SET(tm, 9, scm_from_long(0));
-    SCM_SIMPLE_VECTOR_SET(tm, 10, scm_from_locale_string("GMT"));
+        SCM_SIMPLE_VECTOR_SET(tm, 9, scm_from_long(0));
+        SCM_SIMPLE_VECTOR_SET(tm, 10, scm_from_locale_string("GMT"));
 %#endif
+     }
  }
 
 %define GLIST_HELPER_INOUT(ListType, ElemSwigType)
diff --git a/gnucash/gnome-utils/gnc-cell-renderer-date.c b/gnucash/gnome-utils/gnc-cell-renderer-date.c
index 210c04a..e47a386 100644
--- a/gnucash/gnome-utils/gnc-cell-renderer-date.c
+++ b/gnucash/gnome-utils/gnc-cell-renderer-date.c
@@ -437,7 +437,8 @@ gcrd_time2dmy (time64 raw_time, gint *day, gint *month, gint *year)
     struct tm * timeinfo;
   
     timeinfo = gnc_localtime (&raw_time);
- 
+    if (timeinfo == NULL)
+        return FALSE;
     *day = timeinfo->tm_mday;
     *month = timeinfo->tm_mon + 1;
     *year = timeinfo->tm_year + 1900;
diff --git a/gnucash/gnome/assistant-loan.c b/gnucash/gnome/assistant-loan.c
index 9ed3257..26370f5 100644
--- a/gnucash/gnome/assistant-loan.c
+++ b/gnucash/gnome/assistant-loan.c
@@ -1091,11 +1091,14 @@ loan_info_page_save( GtkAssistant *assistant, gpointer user_data )
 
         tmpTT = gnc_date_edit_get_date( ldd->prmStartDateGDE );
         tmpTm = gnc_localtime ( &tmpTT );
-        g_date_set_dmy( ldd->ld.startDate,
-                        tmpTm->tm_mday,
-                        (tmpTm->tm_mon + 1),
-                        (1900 + tmpTm->tm_year) );
-	gnc_tm_free (tmpTm);
+        if (tmpTm)
+        {
+            g_date_set_dmy( ldd->ld.startDate,
+                            tmpTm->tm_mday,
+                            (tmpTm->tm_mon + 1),
+                            (1900 + tmpTm->tm_year) );
+            gnc_tm_free (tmpTm);
+        }
     }
 
     /* len / periods */
diff --git a/libgnucash/engine/Transaction.c b/libgnucash/engine/Transaction.c
index 5fc7c7e..17e019e 100644
--- a/libgnucash/engine/Transaction.c
+++ b/libgnucash/engine/Transaction.c
@@ -2426,10 +2426,13 @@ xaccTransGetDatePostedGDate (const Transaction *trans)
               */
              time64 time = xaccTransGetDate(trans);
              struct tm *stm = gnc_gmtime(&time);
-             g_date_set_dmy(&result, stm->tm_mday,
-                            (GDateMonth)(stm->tm_mon + 1),
-                            stm->tm_year + 1900);
-             free(stm);
+             if (stm)
+             {
+                 g_date_set_dmy(&result, stm->tm_mday,
+                                (GDateMonth)(stm->tm_mon + 1),
+                                stm->tm_year + 1900);
+                 free(stm);
+             }
         }
     }
     return result;

commit a17bc85a022339dad4fa125257b86f1878cb0b36
Author: John Ralls <jralls at ceridwen.us>
Date:   Sat Dec 23 14:25:15 2017 -0800

    Enable reading undelimited YYYYMMDDHHMMSS time strings.
    
    For backwards compatibility with 2.4 and 2.6 SQLite3 databases.

diff --git a/libgnucash/engine/gnc-datetime.cpp b/libgnucash/engine/gnc-datetime.cpp
index 5af0683..2bec648 100644
--- a/libgnucash/engine/gnc-datetime.cpp
+++ b/libgnucash/engine/gnc-datetime.cpp
@@ -314,8 +314,15 @@ GncDateTimeImpl::GncDateTimeImpl(const std::string str) :
         input_facet->set_iso_extended_format();
         PTime pdt(not_a_date_time);
         ss >> pdt;
+        if (pdt.is_special())
+        {
+            input_facet->format("%Y%m%d%H%M%S");
+            ss.clear(); //Reset to the beginning.
+            ss.seekg(0);
+            ss >> pdt;
+        }
         m_time = LDT(pdt.date(), pdt.time_of_day(), tzptr,
-                     LDTBase::NOT_DATE_TIME_ON_ERROR);
+                         LDTBase::NOT_DATE_TIME_ON_ERROR);
     }
     catch(boost::gregorian::bad_year)
     {



Summary of changes:
 CMakeLists.txt                                     |  1 +
 common/base-typemaps.i                             | 59 ++++++++++++----------
 common/test-core/CMakeLists.txt                    |  2 +
 gnucash/gnome-utils/gnc-cell-renderer-date.c       |  3 +-
 gnucash/gnome/assistant-loan.c                     | 13 +++--
 .../csv-imp/assistant-csv-trans-import.cpp         |  8 +--
 libgnucash/backend/dbi/gnc-backend-dbi.cpp         |  7 ++-
 libgnucash/backend/sql/gnc-price-sql.cpp           |  2 +-
 libgnucash/engine/CMakeLists.txt                   |  1 +
 libgnucash/engine/Transaction.c                    | 11 ++--
 libgnucash/engine/gnc-datetime.cpp                 |  9 +++-
 libgnucash/engine/gnc-features.c                   |  1 +
 libgnucash/engine/gnc-features.h                   |  1 +
 libgnucash/engine/guid.cpp                         |  2 +-
 libgnucash/engine/qofinstance.cpp                  |  2 +-
 libgnucash/engine/qofsession.cpp                   |  6 ++-
 libgnucash/engine/test/test-qofsession.cpp         |  9 ++--
 17 files changed, 86 insertions(+), 51 deletions(-)



More information about the gnucash-changes mailing list