*height = document->priv->max_height;
}
+gboolean
+ev_document_check_dimensions (EvDocument *document)
+{
+ g_return_val_if_fail (EV_IS_DOCUMENT (document), FALSE);
+
+ return (document->priv->max_width > 0 && document->priv->max_height > 0);
+}
+
gint
ev_document_get_max_label_len (EvDocument *document)
{
void ev_document_get_max_page_size (EvDocument *document,
gdouble *width,
gdouble *height);
+gboolean ev_document_check_dimensions (EvDocument *document);
gint ev_document_get_max_label_len (EvDocument *document);
gboolean ev_document_has_text_page_labels (EvDocument *document);
gboolean ev_document_find_page_by_label (EvDocument *document,
return page_cache;
}
-gboolean
-ev_page_cache_check_dimensions (EvPageCache *page_cache)
-{
- gdouble document_width, document_height;
-
- ev_document_get_max_page_size (page_cache->document,
- &document_width, &document_height);
-
- return (document_width > 0 && document_height > 0);
-}
-
gint
ev_page_cache_get_current_page (EvPageCache *page_cache)
{
EvPageCache *ev_page_cache_get (EvDocument *document);
-gboolean ev_page_cache_check_dimensions (EvPageCache *page_cache);
-
G_END_DECLS
#endif /* __EV_PAGE_CACHE_H__ */
if (!EV_IS_DOCUMENT_THUMBNAILS (document) ||
ev_document_get_n_pages (document) <= 0 ||
- !ev_page_cache_check_dimensions (priv->page_cache)) {
+ !ev_document_check_dimensions (document)) {
return;
}
if (!EV_IS_DOCUMENT_THUMBNAILS (document) ||
ev_document_get_n_pages (document) <= 0 ||
- !ev_page_cache_check_dimensions (ev_window->priv->page_cache)) {
+ !ev_document_check_dimensions (document)) {
return;
}
/* Restart the current page */
page = CLAMP (ev_link_dest_get_page (ev_window->priv->dest),
0,
- ev_document_get_n_pages (ev_window->priv->document) - 1);
+ ev_document_get_n_pages (document) - 1);
ev_page_cache_set_current_page (ev_window->priv->page_cache, page);
g_object_unref (ev_window->priv->dest);
ev_window->priv->dest = NULL;
}
- if (ev_document_get_n_pages (ev_window->priv->document) <= 0) {
+ if (ev_document_get_n_pages (document) <= 0) {
ev_window_warning_message (ev_window, "%s",
_("The document contains no pages"));
- } else if (!ev_page_cache_check_dimensions (ev_window->priv->page_cache)) {
+ } else if (!ev_document_check_dimensions (document)) {
ev_window_warning_message (ev_window, "%s",
_("The document contains only empty pages"));
} else {