Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 280833 | Differences between
and this patch

Collapse All | Expand All

(-)epdfview-0.1.7.orig/src/IDocument.cxx (-1 / +1 lines)
Lines 82-88 Link Here
82
            errorMessage = g_strdup (_("No error."));
82
            errorMessage = g_strdup (_("No error."));
83
            break;
83
            break;
84
        case DocumentErrorOpenFile:
84
        case DocumentErrorOpenFile:
85
            errorMessage = g_strdup (_("File not found."));
85
            errorMessage = g_strdup (_("Cannot open or load file."));
86
            break;
86
            break;
87
        case DocumentErrorBadCatalog:
87
        case DocumentErrorBadCatalog:
88
            errorMessage = g_strdup (_("Couldn't read the page catalog."));
88
            errorMessage = g_strdup (_("Couldn't read the page catalog."));
(-)epdfview-0.1.7.orig/src/PDFDocument.cxx (-20 / +20 lines)
Lines 246-272 Link Here
246
    // Check if the document couldn't be opened successfully and why.
246
    // Check if the document couldn't be opened successfully and why.
247
    if ( NULL == newDocument )
247
    if ( NULL == newDocument )
248
    {
248
    {
249
        // Poppler's glib wrapper passes the Poppler error code unless the
250
        // error is that the file is encrypted. We want to set our own
251
        // error code in this case.
252
        DocumentError errorCode = DocumentErrorNone;
249
        DocumentError errorCode = DocumentErrorNone;
253
        if ( POPPLER_ERROR == loadError->domain )
250
	gchar *errorMessage = 0;
254
        {
251
255
            errorCode = DocumentErrorEncrypted;
252
	// Obtain error code from Poppler.
256
        }
253
	switch ( loadError->code )
257
        else
254
	{
258
        {
255
	    case POPPLER_ERROR_OPEN_FILE:
259
            // OK, the glib's wrapper don't pass the error code directly
256
	    case POPPLER_ERROR_INVALID:
260
            // from Poppler. Instead returns G_FILE_ERROR_FAILED and a
257
		errorCode = DocumentErrorOpenFile;
261
            // non translated string.
258
	        break;
262
            // Maybe I'm wrong (very probable) but that's a wrong way.
259
	    case POPPLER_ERROR_BAD_CATALOG:
263
            // So I'm reading the error code from the error string...
260
		errorCode = DocumentErrorBadCatalog;
264
            sscanf (loadError->message, "Failed to load document (error %d)",
261
		break;
265
                    (gint *)&errorCode);
262
	    case POPPLER_ERROR_DAMAGED:
266
        }
263
		errorCode = DocumentErrorDamaged;
267
        g_error_free (loadError);
264
		break;
268
        // Get our error message.
265
	    case POPPLER_ERROR_ENCRYPTED:
269
        gchar *errorMessage = IDocument::getErrorMessage (errorCode);
266
		errorCode = DocumentErrorEncrypted;
267
		break;
268
	}
269
	errorMessage = IDocument::getErrorMessage (errorCode);
270
        g_set_error (error,
270
        g_set_error (error,
271
                     EPDFVIEW_DOCUMENT_ERROR, errorCode,
271
                     EPDFVIEW_DOCUMENT_ERROR, errorCode,
272
                     _("Failed to load document '%s'.\n%s\n"),
272
                     _("Failed to load document '%s'.\n%s\n"),

Return to bug 280833