Commit 7791d023 authored by Murray Cumming's avatar Murray Cumming
Browse files

Print Layout: Print Preview: Avoid warnings when there are no records yet.

* glom/print_layout/canvas_print_layout.cc: fill_with_data(): Do nothing,
and hint on stdout, if there are no records yet. This avoids several
real warnings later.
parent c4a21edb
2012-02-09 Murray Cumming <murrayc@murrayc.com>
Print Layout: Print Preview: Avoid warnings when there are no records yet.
* glom/print_layout/canvas_print_layout.cc: fill_with_data(): Do nothing,
and hint on stdout, if there are no records yet. This avoids several
real warnings later.
2012-02-08 Murray Cumming <murrayc@murrayc.com>
Print Layout: Avoid sometimes over-scaled images.
......
......@@ -2330,9 +2330,12 @@ void Frame_Glom::do_print_layout(const Glib::ustring& print_layout_name, bool pr
return;
}
//TODO: When expandingt items, avoid the page gaps that the print layout's designed
//TODO: When expanding items, avoid the page gaps that the print layout's design
//has added.
const FoundSet found_set = m_Notebook_Data.get_found_set_details();
//Note that found_set.m_where_clause could be empty if there are no records yet,
//and that is acceptable if this is for a print preview while designing the print layout.
PrintLayoutUtils::do_print_layout(print_layout, found_set,
preview, document, false /* do not avoid print margins */, transient_for);
}
......
......@@ -717,6 +717,14 @@ guint Canvas_PrintLayout::get_page_count() const
void Canvas_PrintLayout::fill_with_data(const FoundSet& found_set, bool avoid_page_margins)
{
if(found_set.m_where_clause.empty())
{
//This might help a developer/debugger:
//This is not an error.
std::cout << G_STRFUNC << ": Not attempting to show real data because the where_clause is empty, maybe because there are no records in the database yet." << std::endl;
return;
}
fill_with_data(m_items_group, found_set, avoid_page_margins);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment