gnucash master: Multiple changes pushed

John Ralls jralls at code.gnucash.org
Mon Mar 13 14:59:18 EDT 2017


Updated	 via  https://github.com/Gnucash/gnucash/commit/744fc296 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/a44c621f (commit)
	from  https://github.com/Gnucash/gnucash/commit/d9303023 (commit)



commit 744fc29680fbf075dbb1f14666733448e1dbec60
Author: John Ralls <jralls at ceridwen.us>
Date:   Mon Mar 13 11:55:09 2017 -0700

    Require ICU.
    
    Note that Boost::regex and Boost::locale must also be built with ICU
    support.

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 34e4668..252f7bc 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -345,6 +345,8 @@ IF(APPLE)
   ENDIF()
 ENDIF(APPLE)
 
+# FIND_PACKAGE(LibXslt) eats PKG_CONFIG_EXECUTABLE, so preserve it.
+SET(GNC_PKG_CONFIG_EXE ${PKG_CONFIG_EXECUTABLE})
 # ############################################################
 
 # xsltproc
@@ -354,6 +356,7 @@ IF (NOT LIBXSLT_FOUND)
    MESSAGE(SEND_ERROR "libxslt library not found.")
 ENDIF(NOT LIBXSLT_FOUND)
 # ############################################################
+SET(PKG_CONFIG_EXECUTABLE ${GNC_PKG_CONFIG_EXE})
 
 # libdbi
 FIND_PATH (LIBDBI_INCLUDE_PATH dbi/dbi.h HINTS ${CMAKE_PREFIX_PATH}/libdbi/include)
@@ -399,6 +402,10 @@ GET_FILENAME_COMPONENT(PERL_DIR ${PERL_EXECUTABLE} DIRECTORY)
 
 FIND_PROGRAM(POD2MAN_EXECUTABLE pod2man HINTS ${PERL_DIR})
 
+#ICU
+GNC_PKG_CHECK_MODULES (ICU4C REQUIRED icu-uc)
+GNC_PKG_CHECK_MODULES (ICU4C_I18N REQUIRED icu-i18n)
+
 #BOOST
 IF (APPLE)
   # I suppose I would rather use the shared Boost libraries here, but the Boost install procedure
diff --git a/README.dependencies b/README.dependencies
index 28764eb..8109bf0 100644
--- a/README.dependencies
+++ b/README.dependencies
@@ -69,7 +69,10 @@ libgnomecanvas		2.0
 [lib]goffice		0.7.0
 libxml2			2.5.10
 libxslt
-boost			1.50.0
+ICU                                             International Compnents for
+                                                Unicode
+boost			1.50.0                  locale and regex libs must be
+                                                built with ICU support.
 swig			2.0.10			Only required to build from git
 						or SVN.
 webkit			1.0
diff --git a/configure.ac b/configure.ac
index de17907..ecbc4d7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -140,6 +140,10 @@ AM_CONDITIONAL([CLANG], [test "x$ac_cv_CLANG" = "xyes"])
 ###--------------------------------------------------------
 ### Begin C++ dependencies
 ###--------------------------------------------------------
+PKG_CHECK_MODULES(ICU4C, icu-uc, [ac_cv_ICU4C=yes], [ac_cv_ICU4C=no])
+PKG_CHECK_MODULES(ICU4C_I18N, icu-i18n, [ac_cv_ICU4C=yes], [ac_cv_ICU4C=no])
+if test x$ac_cv_ICU4C != xyes; then
+    AC_MSG_ERROR([ICU4C was not found and is required to build GnuCash.])
 AX_BOOST_BASE([1.53.0], [ac_cv_BOOST=yes], [ac_cv_BOOST=no])
 if test x$ac_cv_BOOST != xyes; then
     AC_MSG_ERROR([Boost 1.53.0 or later was not found and is required to build GnuCash])
diff --git a/src/import-export/csv-imp/CMakeLists.txt b/src/import-export/csv-imp/CMakeLists.txt
index 46690e6..5c926d1 100644
--- a/src/import-export/csv-imp/CMakeLists.txt
+++ b/src/import-export/csv-imp/CMakeLists.txt
@@ -48,18 +48,19 @@ ADD_LIBRARY(gncmod-csv-import ${csv_import_noinst_HEADERS} ${csv_import_SOURCES}
 TARGET_LINK_LIBRARIES(
   gncmod-csv-import
   ${Boost_LIBRARIES}
+  ${ICU4C_I18N_LDFLAGS}
   gncmod-generic-import
   gncmod-gnome-utils
   gncmod-app-utils
   gncmod-engine
   gnc-core-utils
-  gnc-module
-  icuuc icui18n icudata)
+  gnc-module)
 
 
 TARGET_COMPILE_DEFINITIONS(gncmod-csv-import PRIVATE -DG_LOG_DOMAIN=\"gnc.import.csv\")
 
 TARGET_INCLUDE_DIRECTORIES(gncmod-csv-import PRIVATE
+     ${ICU4C_I18N_INCLUDE_DIRS}
      ${CMAKE_SOURCE_DIR}/lib
      ${CMAKE_SOURCE_DIR}/lib/goffice
 )
diff --git a/src/import-export/csv-imp/Makefile.am b/src/import-export/csv-imp/Makefile.am
index 35003e4..548d55a 100644
--- a/src/import-export/csv-imp/Makefile.am
+++ b/src/import-export/csv-imp/Makefile.am
@@ -47,6 +47,7 @@ libgncmod_csv_import_la_LIBADD = \
   ${top_builddir}/src/libqof/qof/libgnc-qof.la \
   ${GLIB_LIBS} \
   ${GTK_LIBS} \
+  ${ICU4C_I18N_LIBS} \
   ${BOOST_LDFLAGS} \
   -lboost_regex \
   -lboost_locale
@@ -67,6 +68,7 @@ AM_CPPFLAGS = \
   ${GUILE_CFLAGS} \
   ${GLIB_CFLAGS} \
   ${GTK_CFLAGS} \
+  ${ICU4C_I18N_CFLAGS} \
   ${BOOST_CPPFLAGS}
 
 uidir = $(GNC_UI_DIR)

commit a44c621f2b501d3faad7c67be784270f0ab9a31a
Author: John Ralls <jralls at ceridwen.us>
Date:   Sun Mar 12 10:56:48 2017 -0700

    Change 'uint' to 'uint32_t'.
    
    'uint' is a non-standard typedef not supported by MinGW.

diff --git a/src/import-export/csv-imp/assistant-csv-trans-import.cpp b/src/import-export/csv-imp/assistant-csv-trans-import.cpp
index 4af46aa..6dbe0fd 100644
--- a/src/import-export/csv-imp/assistant-csv-trans-import.cpp
+++ b/src/import-export/csv-imp/assistant-csv-trans-import.cpp
@@ -119,15 +119,15 @@ public:
             gpointer userdata);
 private:
     /* helper functions to manage the context menu for fixed with columns */
-    uint get_new_col_rel_pos (GtkTreeViewColumn *tcol, int dx);
+    uint32_t get_new_col_rel_pos (GtkTreeViewColumn *tcol, int dx);
     void fixed_context_menu (GdkEventButton *event, int col, int dx);
     /* helper function to calculate row colors for the preview table (to visualize status) */
     void preview_row_fill_state_cells (GtkListStore *store, GtkTreeIter *iter,
             std::string& err_msg, bool skip);
     /* helper function to create preview header cell combo boxes listing available column types */
-    GtkWidget* preview_cbox_factory (GtkTreeModel* model, uint colnum);
+    GtkWidget* preview_cbox_factory (GtkTreeModel* model, uint32_t colnum);
     /* helper function to set rendering parameters for preview data columns */
-    void preview_style_column (uint col_num, GtkTreeModel* model);
+    void preview_style_column (uint32_t col_num, GtkTreeModel* model);
 
     GtkAssistant    *csv_imp_asst;
 
@@ -1167,7 +1167,7 @@ static GnumericPopupMenuElement const popup_elements[] =
     { nullptr, nullptr, 0, 0, 0 },
 };
 
-uint CsvImpTransAssist::get_new_col_rel_pos (GtkTreeViewColumn *tcol, int dx)
+uint32_t CsvImpTransAssist::get_new_col_rel_pos (GtkTreeViewColumn *tcol, int dx)
 {
     auto renderers = gtk_cell_layout_get_cells (GTK_CELL_LAYOUT(tcol));
     auto cell = GTK_CELL_RENDERER(renderers->data);
@@ -1180,7 +1180,7 @@ uint CsvImpTransAssist::get_new_col_rel_pos (GtkTreeViewColumn *tcol, int dx)
     int width;
     pango_layout_get_pixel_size (layout, &width, nullptr);
     if (width < 1) width = 1;
-    uint charindex = (dx + width / 2) / width;
+    uint32_t charindex = (dx + width / 2) / width;
     g_object_unref (layout);
     pango_font_description_free (font_desc);
 
@@ -1349,7 +1349,7 @@ CsvImpTransAssist::preview_row_fill_state_cells (GtkListStore *store, GtkTreeIte
  * with valid column types and selects the given column type
  */
 GtkWidget*
-CsvImpTransAssist::preview_cbox_factory (GtkTreeModel* model, uint colnum)
+CsvImpTransAssist::preview_cbox_factory (GtkTreeModel* model, uint32_t colnum)
 {
     GtkTreeIter iter;
     auto cbox = gtk_combo_box_new_with_model(model);
@@ -1383,7 +1383,7 @@ CsvImpTransAssist::preview_cbox_factory (GtkTreeModel* model, uint colnum)
 }
 
 void
-CsvImpTransAssist::preview_style_column (uint col_num, GtkTreeModel* model)
+CsvImpTransAssist::preview_style_column (uint32_t col_num, GtkTreeModel* model)
 {
     auto col = gtk_tree_view_get_column (treeview, col_num);
     auto renderer = static_cast<GtkCellRenderer*>(gtk_tree_view_column_get_cell_renderers(col)->data);
@@ -1479,7 +1479,7 @@ void CsvImpTransAssist::preview_refresh_table ()
         /* Fill the data cells. */
         for (auto cell_str_it = std::get<0>(parse_line).cbegin(); cell_str_it != std::get<0>(parse_line).cend(); cell_str_it++)
         {
-            uint pos = PREV_N_FIXED_COLS + cell_str_it - std::get<0>(parse_line).cbegin();
+            uint32_t pos = PREV_N_FIXED_COLS + cell_str_it - std::get<0>(parse_line).cbegin();
             gtk_list_store_set (store, &iter, pos, cell_str_it->c_str(), -1);
         }
     }
@@ -1522,7 +1522,7 @@ void CsvImpTransAssist::preview_refresh_table ()
 
     /* Reset column attributes as they are undefined after recreating the model */
     auto combostore = make_column_header_model (tx_imp->multi_split());
-    for (uint i = 0; i < ntcols; i++)
+    for (uint32_t i = 0; i < ntcols; i++)
         preview_style_column (i, combostore);
 
     /* Release our reference for the stores to allow proper memory management. */
diff --git a/src/import-export/csv-imp/gnc-csv-trans-settings.cpp b/src/import-export/csv-imp/gnc-csv-trans-settings.cpp
index 017c3a8..82b436e 100644
--- a/src/import-export/csv-imp/gnc-csv-trans-settings.cpp
+++ b/src/import-export/csv-imp/gnc-csv-trans-settings.cpp
@@ -261,7 +261,7 @@ CsvTransSettings::load (void)
     gsize list_len;
     gchar** col_types_str = g_key_file_get_string_list (keyfile, group.c_str(), CSV_COL_TYPES,
             &list_len, &key_error);
-    for (uint i = 0; i < list_len; i++)
+    for (uint32_t i = 0; i < list_len; i++)
     {
         auto col_types_it = std::find_if (gnc_csv_col_type_strs.begin(),
                 gnc_csv_col_type_strs.end(), test_prop_type_str (col_types_str[i]));
@@ -287,7 +287,7 @@ CsvTransSettings::load (void)
     m_column_widths.clear();
     gint *col_widths_int = g_key_file_get_integer_list (keyfile, group.c_str(), CSV_COL_WIDTHS,
             &list_len, &key_error);
-    for (uint i = 0; i < list_len; i++)
+    for (uint32_t i = 0; i < list_len; i++)
     {
         if (col_widths_int[i] > 0)
             m_column_widths.push_back(col_widths_int[i]);
diff --git a/src/import-export/csv-imp/gnc-csv-trans-settings.hpp b/src/import-export/csv-imp/gnc-csv-trans-settings.hpp
index 6837aef..490eb66 100644
--- a/src/import-export/csv-imp/gnc-csv-trans-settings.hpp
+++ b/src/import-export/csv-imp/gnc-csv-trans-settings.hpp
@@ -89,14 +89,14 @@ std::string   m_encoding;                     // File encoding
 bool          m_multi_split;                  // Assume multiple lines per transaction
 int           m_date_format;                  // Date Active id
 int           m_currency_format;              // Currency Active id
-uint          m_skip_start_lines;             // Number of header rows to skip
-uint          m_skip_end_lines;               // Number of footer rows to skip
+uint32_t          m_skip_start_lines;             // Number of header rows to skip
+uint32_t          m_skip_end_lines;               // Number of footer rows to skip
 bool          m_skip_alt_lines;               // Skip alternate rows
 std::string   m_separators;                   // Separators for csv format
 
 Account      *m_base_account;                 // Base account
 std::vector<GncTransPropType> m_column_types; // The Column types in order
-std::vector<uint> m_column_widths;            // The Column widths
+std::vector<uint32_t> m_column_widths;            // The Column widths
 
 bool          m_load_error;                   // Was there an error while parsing the state file ?
 };
diff --git a/src/import-export/csv-imp/gnc-fw-tokenizer.cpp b/src/import-export/csv-imp/gnc-fw-tokenizer.cpp
index 0f8d671..18fb2f5 100644
--- a/src/import-export/csv-imp/gnc-fw-tokenizer.cpp
+++ b/src/import-export/csv-imp/gnc-fw-tokenizer.cpp
@@ -12,19 +12,19 @@
 #include <boost/algorithm/string.hpp>
 
 void
-GncFwTokenizer::columns(const std::vector<uint>& cols)
+GncFwTokenizer::columns(const std::vector<uint32_t>& cols)
 {
     m_col_vec = cols;
 }
 
-std::vector<uint>
+std::vector<uint32_t>
 GncFwTokenizer::get_columns()
 {
     return m_col_vec;
 }
 
 
-bool GncFwTokenizer::col_can_delete (uint col_num)
+bool GncFwTokenizer::col_can_delete (uint32_t col_num)
 {
     auto last_col = m_col_vec.size() - 1;
     if (col_num >= last_col)
@@ -33,7 +33,7 @@ bool GncFwTokenizer::col_can_delete (uint col_num)
         return true;
 }
 
-void GncFwTokenizer::col_delete (uint col_num)
+void GncFwTokenizer::col_delete (uint32_t col_num)
 {
     if (!col_can_delete (col_num))
         return;
@@ -42,7 +42,7 @@ void GncFwTokenizer::col_delete (uint col_num)
     m_col_vec.erase (m_col_vec.begin() + col_num);
 }
 
-bool GncFwTokenizer::col_can_narrow (uint col_num)
+bool GncFwTokenizer::col_can_narrow (uint32_t col_num)
 {
     // Can't narrow the last column, it always sticks to the end of the parseable data
     auto last_col = m_col_vec.size() - 1;
@@ -52,7 +52,7 @@ bool GncFwTokenizer::col_can_narrow (uint col_num)
         return true;
 }
 
-void GncFwTokenizer::col_narrow (uint col_num)
+void GncFwTokenizer::col_narrow (uint32_t col_num)
 {
     if (!col_can_narrow (col_num))
         return;
@@ -65,7 +65,7 @@ void GncFwTokenizer::col_narrow (uint col_num)
         m_col_vec.erase (m_col_vec.begin() + col_num);
 }
 
-bool GncFwTokenizer::col_can_widen (uint col_num)
+bool GncFwTokenizer::col_can_widen (uint32_t col_num)
 {
     // Can't widen the last column, it always sticks to the end of the parseable data
     auto last_col = m_col_vec.size() - 1;
@@ -75,7 +75,7 @@ bool GncFwTokenizer::col_can_widen (uint col_num)
         return true;
 }
 
-void GncFwTokenizer::col_widen (uint col_num)
+void GncFwTokenizer::col_widen (uint32_t col_num)
 {
     if (!col_can_widen (col_num))
         return;
@@ -88,20 +88,20 @@ void GncFwTokenizer::col_widen (uint col_num)
         m_col_vec.erase (m_col_vec.begin() + col_num + 1);
 }
 
-bool GncFwTokenizer::col_can_split (uint col_num, uint position)
+bool GncFwTokenizer::col_can_split (uint32_t col_num, uint32_t position)
 {
     auto last_col = m_col_vec.size() - 1;
     if (col_num > last_col)
         return false;
 
-    uint col_end = m_col_vec[col_num];
+    uint32_t col_end = m_col_vec[col_num];
     if (position < 1 || position >= col_end)
         return false;
     else
         return true;
 }
 
-void GncFwTokenizer::col_split (uint col_num, uint position)
+void GncFwTokenizer::col_split (uint32_t col_num, uint32_t position)
 {
     if (col_can_split (col_num, position))
     {
@@ -138,7 +138,7 @@ void GncFwTokenizer::load_file(const std::string& path)
          * - widening the last column to widen to the longest line or
          * - deleting columns/narrowing the last one to reduce to the longest line
          */
-        uint total_width = 0;
+        uint32_t total_width = 0;
         for (auto col_width : m_col_vec)
             total_width += col_width;
 
diff --git a/src/import-export/csv-imp/gnc-fw-tokenizer.hpp b/src/import-export/csv-imp/gnc-fw-tokenizer.hpp
index 975b2ac..f1e30dd 100644
--- a/src/import-export/csv-imp/gnc-fw-tokenizer.hpp
+++ b/src/import-export/csv-imp/gnc-fw-tokenizer.hpp
@@ -57,27 +57,27 @@ public:
     GncFwTokenizer& operator=(GncFwTokenizer&&) = default;      // move assignment
     ~GncFwTokenizer() = default;                                // destructor
 
-    void columns(const std::vector<uint>& cols = std::vector<uint>());
-    std::vector<uint> get_columns();
-    uint get_column (uint num);
+    void columns(const std::vector<uint32_t>& cols = std::vector<uint32_t>());
+    std::vector<uint32_t> get_columns();
+    uint32_t get_column (uint32_t num);
 
     // Column manipulators
-    bool col_can_delete (uint col_num);
-    void col_delete (uint col_num);
-    bool col_can_narrow (uint col_num);
-    void col_narrow (uint col_num);
-    bool col_can_widen (uint col_num);
-    void col_widen (uint col_num);
-    bool col_can_split (uint col_num, uint position);
-    void col_split (uint col_num, uint position);
+    bool col_can_delete (uint32_t col_num);
+    void col_delete (uint32_t col_num);
+    bool col_can_narrow (uint32_t col_num);
+    void col_narrow (uint32_t col_num);
+    bool col_can_widen (uint32_t col_num);
+    void col_widen (uint32_t col_num);
+    bool col_can_split (uint32_t col_num, uint32_t position);
+    void col_split (uint32_t col_num, uint32_t position);
 
     void load_file (const std::string& path) override;
     int  tokenize() override;
 
 
 private:
-    std::vector<uint> m_col_vec;
-    uint m_longest_line = 0;
+    std::vector<uint32_t> m_col_vec;
+    uint32_t m_longest_line = 0;
 };
 
 #endif
diff --git a/src/import-export/csv-imp/gnc-tx-import.cpp b/src/import-export/csv-imp/gnc-tx-import.cpp
index b7f73f4..2e102d4 100644
--- a/src/import-export/csv-imp/gnc-tx-import.cpp
+++ b/src/import-export/csv-imp/gnc-tx-import.cpp
@@ -146,7 +146,7 @@ void GncTxImport::multi_split (bool multi_split)
 {
     auto trans_prop_seen = false;
     m_settings.m_multi_split = multi_split;
-    for (uint i = 0; i < m_settings.m_column_types.size(); i++)
+    for (uint32_t i = 0; i < m_settings.m_column_types.size(); i++)
     {
         auto old_prop = m_settings.m_column_types[i];
         auto is_trans_prop = ((old_prop > GncTransPropType::NONE)
@@ -262,7 +262,7 @@ void GncTxImport::encoding (const std::string& encoding)
 
 std::string GncTxImport::encoding () { return m_settings.m_encoding; }
 
-void GncTxImport::update_skipped_lines(boost::optional<uint> start, boost::optional<uint> end,
+void GncTxImport::update_skipped_lines(boost::optional<uint32_t> start, boost::optional<uint32_t> end,
         boost::optional<bool> alt, boost::optional<bool> errors)
 {
     if (start)
@@ -274,7 +274,7 @@ void GncTxImport::update_skipped_lines(boost::optional<uint> start, boost::optio
     if (errors)
         m_skip_errors = *errors;
 
-    for (uint i = 0; i < m_parsed_lines.size(); i++)
+    for (uint32_t i = 0; i < m_parsed_lines.size(); i++)
     {
         std::get<4>(m_parsed_lines[i]) =
             ((i < skip_start_lines()) ||             // start rows to skip
@@ -285,8 +285,8 @@ void GncTxImport::update_skipped_lines(boost::optional<uint> start, boost::optio
     }
 }
 
-uint GncTxImport::skip_start_lines () { return m_settings.m_skip_start_lines; }
-uint GncTxImport::skip_end_lines () { return m_settings.m_skip_end_lines; }
+uint32_t GncTxImport::skip_start_lines () { return m_settings.m_skip_start_lines; }
+uint32_t GncTxImport::skip_end_lines () { return m_settings.m_skip_end_lines; }
 bool GncTxImport::skip_alt_lines () { return m_settings.m_skip_alt_lines; }
 bool GncTxImport::skip_err_lines () { return m_skip_errors; }
 
@@ -396,7 +396,7 @@ void GncTxImport::tokenize (bool guessColTypes)
     if (!m_tokenizer)
         return;
 
-    uint max_cols = 0;
+    uint32_t max_cols = 0;
     m_tokenizer->tokenize();
     m_parsed_lines.clear();
     for (auto tokenized_line : m_tokenizer->get_tokens())
@@ -420,7 +420,7 @@ void GncTxImport::tokenize (bool guessColTypes)
     m_settings.m_column_types.resize(max_cols, GncTransPropType::NONE);
 
     /* Force reinterpretation of already set columns and/or base_account */
-    for (uint i = 0; i < m_settings.m_column_types.size(); i++)
+    for (uint32_t i = 0; i < m_settings.m_column_types.size(); i++)
         set_column_type (i, m_settings.m_column_types[i], true);
     if (m_settings.m_base_account)
     {
@@ -738,7 +738,7 @@ GncTxImport::check_for_column_type (GncTransPropType type)
 }
 
 /* A helper function intended to be called only from set_column_type */
-void GncTxImport::update_pre_trans_props (uint row, uint col, GncTransPropType prop_type)
+void GncTxImport::update_pre_trans_props (uint32_t row, uint32_t col, GncTransPropType prop_type)
 {
     if ((prop_type == GncTransPropType::NONE) || (prop_type > GncTransPropType::TRANS_PROPS))
         return; /* Only deal with transaction related properties. */
@@ -791,7 +791,7 @@ void GncTxImport::update_pre_trans_props (uint row, uint col, GncTransPropType p
 }
 
 /* A helper function intended to be called only from set_column_type */
-void GncTxImport::update_pre_split_props (uint row, uint col, GncTransPropType prop_type)
+void GncTxImport::update_pre_split_props (uint32_t row, uint32_t col, GncTransPropType prop_type)
 {
     if ((prop_type > GncTransPropType::SPLIT_PROPS) || (prop_type <= GncTransPropType::TRANS_PROPS))
         return; /* Only deal with split related properties. */
@@ -823,7 +823,7 @@ void GncTxImport::update_pre_split_props (uint row, uint col, GncTransPropType p
 
 
 void
-GncTxImport::set_column_type (uint position, GncTransPropType type, bool force)
+GncTxImport::set_column_type (uint32_t position, GncTransPropType type, bool force)
 {
     if (position >= m_settings.m_column_types.size())
         return;
@@ -855,7 +855,7 @@ GncTxImport::set_column_type (uint position, GncTransPropType type, bool force)
         std::get<3>(*parsed_lines_it)->set_date_format (m_settings.m_date_format);
         std::get<3>(*parsed_lines_it)->set_currency_format (m_settings.m_currency_format);
 
-        uint row = parsed_lines_it - m_parsed_lines.begin();
+        uint32_t row = parsed_lines_it - m_parsed_lines.begin();
 
         /* If the column type actually changed, first reset the property
          * represented by the old column type
@@ -901,10 +901,10 @@ GncTxImport::accounts ()
     auto accts = std::set<std::string>();
     auto acct_col_it = std::find (m_settings.m_column_types.begin(),
                            m_settings.m_column_types.end(), GncTransPropType::ACCOUNT);
-    uint acct_col = acct_col_it - m_settings.m_column_types.begin();
+    uint32_t acct_col = acct_col_it - m_settings.m_column_types.begin();
     auto tacct_col_it = std::find (m_settings.m_column_types.begin(),
                            m_settings.m_column_types.end(), GncTransPropType::TACCOUNT);
-    uint tacct_col = tacct_col_it - m_settings.m_column_types.begin();
+    uint32_t tacct_col = tacct_col_it - m_settings.m_column_types.begin();
 
     /* Iterate over all parsed lines */
     auto odd_line = false;
diff --git a/src/import-export/csv-imp/gnc-tx-import.hpp b/src/import-export/csv-imp/gnc-tx-import.hpp
index 4072cc3..c763827 100644
--- a/src/import-export/csv-imp/gnc-tx-import.hpp
+++ b/src/import-export/csv-imp/gnc-tx-import.hpp
@@ -116,10 +116,10 @@ public:
     void encoding (const std::string& encoding);
     std::string encoding ();
 
-    void update_skipped_lines (boost::optional<uint> start, boost::optional<uint> end,
+    void update_skipped_lines (boost::optional<uint32_t> start, boost::optional<uint32_t> end,
                                boost::optional<bool> alt, boost::optional<bool> errors);
-    uint skip_start_lines ();
-    uint skip_end_lines ();
+    uint32_t skip_start_lines ();
+    uint32_t skip_end_lines ();
     bool skip_alt_lines ();
     bool skip_err_lines ();
 
@@ -146,7 +146,7 @@ public:
      */
     void create_transactions ();
     bool check_for_column_type (GncTransPropType type);
-    void set_column_type (uint position, GncTransPropType type, bool force = false);
+    void set_column_type (uint32_t position, GncTransPropType type, bool force = false);
     std::vector<GncTransPropType> column_types ();
 
     std::set<std::string> accounts ();
@@ -178,8 +178,8 @@ private:
     /* Two internal helper functions that should only be called from within
      * set_column_type for consistency (otherwise error messages may not be (re)set)
      */
-    void update_pre_trans_props (uint row, uint col, GncTransPropType prop_type);
-    void update_pre_split_props (uint row, uint col, GncTransPropType prop_type);
+    void update_pre_trans_props (uint32_t row, uint32_t col, GncTransPropType prop_type);
+    void update_pre_split_props (uint32_t row, uint32_t col, GncTransPropType prop_type);
 
     struct CsvTranSettings;
     CsvTransSettings m_settings;



Summary of changes:
 CMakeLists.txt                                     |  7 ++++++
 README.dependencies                                |  5 ++++-
 configure.ac                                       |  4 ++++
 src/import-export/csv-imp/CMakeLists.txt           |  5 +++--
 src/import-export/csv-imp/Makefile.am              |  2 ++
 .../csv-imp/assistant-csv-trans-import.cpp         | 18 +++++++--------
 .../csv-imp/gnc-csv-trans-settings.cpp             |  4 ++--
 .../csv-imp/gnc-csv-trans-settings.hpp             |  6 ++---
 src/import-export/csv-imp/gnc-fw-tokenizer.cpp     | 24 ++++++++++----------
 src/import-export/csv-imp/gnc-fw-tokenizer.hpp     | 26 +++++++++++-----------
 src/import-export/csv-imp/gnc-tx-import.cpp        | 26 +++++++++++-----------
 src/import-export/csv-imp/gnc-tx-import.hpp        | 12 +++++-----
 12 files changed, 78 insertions(+), 61 deletions(-)



More information about the gnucash-changes mailing list