[glom] Base_DB_Table_Data(): Handle -1 for row/column DataModel counts.



commit 228727b7707b6468d293649fdda579c4991fa19c
Author: Murray Cumming <murrayc murrayc com>
Date:   Tue Mar 29 17:35:58 2016 +0200

    Base_DB_Table_Data(): Handle -1 for row/column DataModel counts.

 glom/base_db_table_data.cc |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/glom/base_db_table_data.cc b/glom/base_db_table_data.cc
index 80090d2..7a9837a 100644
--- a/glom/base_db_table_data.cc
+++ b/glom/base_db_table_data.cc
@@ -510,13 +510,13 @@ void Base_DB_Table_Data::refresh_related_fields(const LayoutFieldInRecord& field
       {
         auto iterFields = fieldsToGet.begin();
 
-        const guint cols_count = result->get_n_columns();
+        const auto cols_count = result->get_n_columns(); // -1 means unknown
         if(cols_count <= 0)
         {
           std::cerr << G_STRFUNC << ": The result had 0 columns\n";
         }
 
-        for(guint uiCol = 0; uiCol < cols_count; ++uiCol)
+        for(int uiCol = 0; uiCol < cols_count; ++uiCol)
         {
           const auto value = result->get_value_at(uiCol, 0 /* row */);
           auto layout_item = *iterFields;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]