[glom] Find: Get criteria even when a field is on the layout twice.
- From: Murray Cumming <murrayc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glom] Find: Get criteria even when a field is on the layout twice.
- Date: Sun, 2 Oct 2011 21:55:53 +0000 (UTC)
commit 34be17cb47f569f25a8723f714ec7ac472e68bdd
Author: Murray Cumming <murrayc murrayc com>
Date: Sun Oct 2 23:49:12 2011 +0200
Find: Get criteria even when a field is on the layout twice.
* glom/mode_data/flowtablewithfields.cc: get_field_value():
Look at all the widgets for this field, instead of just the first one,
and keep looking until we find a non-empty value.
This is still rather arbitrary, but this method is only used for
find criteria, or should be.
ChangeLog | 10 ++++++++++
glom/mode_data/flowtablewithfields.cc | 12 ++++++++----
2 files changed, 18 insertions(+), 4 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 862aaec..bf0af2a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,15 @@
2011-10-02 Murray Cumming <murrayc murrayc com>
+ Find: Get criteria even when a field is on the layout twice.
+
+ * glom/mode_data/flowtablewithfields.cc: get_field_value():
+ Look at all the widgets for this field, instead of just the first one,
+ and keep looking until we find a non-empty value.
+ This is still rather arbitrary, but this method is only used for
+ find criteria, or should be.
+
+2011-10-02 Murray Cumming <murrayc murrayc com>
+
Find Mode: Do not show data in related records.
* glom/mode_data/box_data_portal.[h|cc]: Add a virtual set_find_mode().
diff --git a/glom/mode_data/flowtablewithfields.cc b/glom/mode_data/flowtablewithfields.cc
index fbc0e47..8fd25cf 100644
--- a/glom/mode_data/flowtablewithfields.cc
+++ b/glom/mode_data/flowtablewithfields.cc
@@ -783,12 +783,16 @@ void FlowTableWithFields::set_other_field_value(const sharedptr<const LayoutItem
Gnome::Gda::Value FlowTableWithFields::get_field_value(const sharedptr<const LayoutItem_Field>& field) const
{
type_list_const_widgets list_widgets = get_field(field, true);
- if(!list_widgets.empty())
+ for(type_list_const_widgets::const_iterator iter = list_widgets.begin();
+ iter != list_widgets.end(); ++iter)
{
- const DataWidget* datawidget = dynamic_cast<const DataWidget*>(*(list_widgets.begin()));
+ const DataWidget* datawidget = dynamic_cast<const DataWidget*>(*iter);
+ if(!datawidget)
+ continue;
- if(datawidget)
- return datawidget->get_value();
+ const Gnome::Gda::Value value = datawidget->get_value();
+ if(!Conversions::value_is_empty(value))
+ return value;
}
//g_warning("FlowTableWithFields::get_field_value(): returning null");
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]