Commit 7e6112d8 authored by Sebastian Ramacher's avatar Sebastian Ramacher

Use the appropriate constant

Signed-off-by: Sebastian Ramacher's avatarSebastian Ramacher <sebastian+dev@ramacher.at>
parent 8b701f60
......@@ -196,7 +196,7 @@ handle_method_call(GDBusConnection* UNUSED(connection),
/* methods that require an open document */
if (g_strcmp0(method_name, "GotoPage") == 0) {
gint page = 0;
gint page = ZATHURA_PAGE_NUMBER_UNSPECIFIED;
g_variant_get(parameters, "(i)", &page);
bool ret = true;
......@@ -209,7 +209,7 @@ handle_method_call(GDBusConnection* UNUSED(connection),
GVariant* result = g_variant_new("(b)", ret);
g_dbus_method_invocation_return_value(invocation, result);
} else if (g_strcmp0(method_name, "HighlightRects") == 0) {
gint page = 0;
gint page = ZATHURA_PAGE_NUMBER_UNSPECIFIED;
GVariantIter* iter = NULL;
g_variant_get(parameters, "(ia(dddd))", &page, &iter);
......@@ -369,7 +369,7 @@ zathura_dbus_synctex_position(const char* filename, const char* position)
return false;
}
int page = -1;
int page = ZATHURA_PAGE_NUMBER_UNSPECIFIED;
girara_list_t* rectangles = synctex_rectangles_from_position(filename, position, &page);
if (rectangles == NULL) {
return false;
......
......@@ -147,7 +147,7 @@ synctex_rectangles_from_position(const char* filename, const char* position, int
}
}
*page = -1;
*page = ZATHURA_PAGE_NUMBER_UNSPECIFIED;
int current_page;
girara_list_t* hitlist = girara_list_new2(g_free);;
zathura_rectangle_t* rectangle = NULL;
......@@ -167,7 +167,7 @@ synctex_rectangles_from_position(const char* filename, const char* position, int
case SYNCTEX_PROP_PAGE:
if (g_scanner_get_next_token(scanner) == G_TOKEN_INT) {
current_page = g_scanner_cur_value(scanner).v_int;
if (*page == -1) {
if (*page == ZATHURA_PAGE_NUMBER_UNSPECIFIED) {
*page = current_page;
}
......
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