gnucash master: Multiple changes pushed

John Ralls jralls at code.gnucash.org
Mon May 4 18:55:20 EDT 2015


Updated	 via  https://github.com/Gnucash/gnucash/commit/d4c537a9 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/577aa3fe (commit)
	 via  https://github.com/Gnucash/gnucash/commit/0b55c746 (commit)
	from  https://github.com/Gnucash/gnucash/commit/42cca364 (commit)



commit d4c537a9a5c083df3d2d736cda23692ab73d2633
Merge: 42cca36 577aa3f
Author: John Ralls <jralls at ceridwen.us>
Date:   Mon May 4 15:54:45 2015 -0700

    Merge branch 'boost-date'
    
    Fix a couple more bugs which manifest on Fedora.


commit 577aa3fe02acb982c9e3063b096219107097dc5b
Author: John Ralls <jralls at ceridwen.us>
Date:   Mon May 4 15:53:23 2015 -0700

    Catch out-of-range exception at beginning and end of TZFile on Fedora.

diff --git a/src/libqof/qof/gnc-timezone.cpp b/src/libqof/qof/gnc-timezone.cpp
index 7cc3b56..b244b91 100644
--- a/src/libqof/qof/gnc-timezone.cpp
+++ b/src/libqof/qof/gnc-timezone.cpp
@@ -562,34 +562,41 @@ TimeZoneProvider::TimeZoneProvider(const std::string& tzname) :  zone_vector {}
 	auto this_time = ptime(date(1970, 1, 1),
 			       time_duration(txi->timestamp / 3600, 0,
 					     txi->timestamp % 3600));
-	auto this_year = this_time.date().year();
-	//Initial case
-	if (last_time.is_not_a_date_time())
-	    zone_vector.push_back(zone_no_dst(this_year - 1, last_info));
-	//gap in transitions > 1 year, non-dst zone
-	//change. In the last case the exact date of the change will be
-	//wrong because boost::local_date::timezone isn't able to
-	//represent it. For GnuCash's purposes this isn't likely to be
-	//important as the last time this sort of transition happened
-	//was 1946, but we have to handle the case in order to parse
-	//the tz file.
-	else if (this_year - last_time.date().year() > 1 ||
-	    last_info->info.isdst == this_info->info.isdst)
+	try
 	{
-	    zone_vector.push_back(zone_no_dst(this_year, last_info));
-	}
+	    auto this_year = this_time.date().year();
+	    //Initial case
+	    if (last_time.is_not_a_date_time())
+		zone_vector.push_back(zone_no_dst(this_year - 1, last_info));
+	    //gap in transitions > 1 year, non-dst zone
+	    //change. In the last case the exact date of the change will be
+	    //wrong because boost::local_date::timezone isn't able to
+	    //represent it. For GnuCash's purposes this isn't likely to be
+	    //important as the last time this sort of transition happened
+	    //was 1946, but we have to handle the case in order to parse
+	    //the tz file.
+	    else if (this_year - last_time.date().year() > 1 ||
+		     last_info->info.isdst == this_info->info.isdst)
+	    {
+		zone_vector.push_back(zone_no_dst(this_year, last_info));
+	    }
 
-	else
-	{
-	    DSTRule::DSTRule new_rule(last_info, this_info,
-			     last_time, this_time);
-	    if (new_rule != last_rule)
+	    else
 	    {
-		last_rule = new_rule;
-		zone_vector.push_back(zone_from_rule (this_time.date().year(),
-						      new_rule));
+		DSTRule::DSTRule new_rule(last_info, this_info,
+					  last_time, this_time);
+		if (new_rule != last_rule)
+		{
+		    last_rule = new_rule;
+		    zone_vector.push_back(zone_from_rule (this_time.date().year(),
+							  new_rule));
+		}
 	    }
 	}
+	catch(boost::gregorian::bad_year err)
+	{
+	    continue;
+	}
 	last_time = this_time;
 	last_info = this_info;
     }

commit 0b55c746c866f21a324c2667d008914c075707ac
Author: John Ralls <jralls at ceridwen.us>
Date:   Mon May 4 15:52:35 2015 -0700

    Link libgtest to test-kvp-value on Fedora.

diff --git a/src/libqof/qof/test/Makefile.am b/src/libqof/qof/test/Makefile.am
index f81ddc0..6d17953 100644
--- a/src/libqof/qof/test/Makefile.am
+++ b/src/libqof/qof/test/Makefile.am
@@ -40,7 +40,8 @@ test_kvp_value_SOURCES = \
     test-kvp-frame.cpp
 test_kvp_value_LDADD = \
 	$(top_builddir)/$(MODULEPATH)/libgnc-qof.la \
-         $(GLIB_LIBS) \
+        $(GLIB_LIBS) \
+	$(GTEST_LIBS) \
 	$(BOOST_LDFLAGS)
 
 if !GOOGLE_TEST_LIBS
@@ -50,7 +51,7 @@ test_kvp_value_LDADD += $(top_builddir)/src/test-core/libgtest.a
 endif
 
 test_kvp_value_CPPFLAGS = \
-    -I$(GTEST_HEADERS) \
+    $(GTEST_HEADERS) \
     -I$(top_srcdir)/$(MODULEPATH) \
     $(GLIB_CFLAGS) \
     $(BOOST_CPPFLAGS)
@@ -62,8 +63,7 @@ test_gnc_int128_SOURCES = \
         gtest-gnc-int128.cpp
 test_gnc_int128_CPPFLAGS = -I${GTEST_HEADERS}
 
-
-test_gnc_int128_LDADD = $(GTEST_LIBS)
+test_gnc_int128_LDADD = ${GTEST_LIBS}
 if !GOOGLE_TEST_LIBS
 nodist_test_gnc_int128_SOURCES = \
         ${GTEST_SRC}/src/gtest_main.cc



Summary of changes:
 src/libqof/qof/gnc-timezone.cpp | 53 +++++++++++++++++++++++------------------
 src/libqof/qof/test/Makefile.am |  8 +++----
 2 files changed, 34 insertions(+), 27 deletions(-)



More information about the gnucash-changes mailing list