Description: <short summary of the patch>
 TODO: Put a short summary on the line above and replace this paragraph
 with a longer explanation of this change. Complete the meta-information
 with other relevant fields (see below for details). To make it easier, the
 information below has been extracted from the changelog. Adjust it or drop
 it.
 .
 djview4 (4.11-2) unstable; urgency=medium
 .
   * track upstream fixes and translations
   * debhelper 12
   * bump policy
   * chromium-browser is now chromium (closes: #933494)
Author: Barak A. Pearlmutter <bap@debian.org>
Bug-Debian: https://bugs.debian.org/933494

---
The information above should follow the Patch Tagging Guidelines, please
checkout http://dep.debian.net/deps/dep3/ to learn about the format. Here
are templates for supplementary fields that you might want to add:

Origin: <vendor|upstream|other>, <url of original patch>
Bug: <url in upstream bugtracker>
Bug-Debian: https://bugs.debian.org/<bugnumber>
Bug-Ubuntu: https://launchpad.net/bugs/<bugnumber>
Forwarded: <no|not-needed|url proving that it has been forwarded>
Reviewed-By: <name and email of someone who approved the patch>
Last-Update: 2019-08-03

--- djview4-4.11.orig/mac/make_djview_bundle.sh
+++ djview4-4.11/mac/make_djview_bundle.sh
@@ -69,6 +69,10 @@ done
     run ln -s "$target"  "$bundle/$d" || exit
 done
 
+# misc copies
+run cp ../src/djview.1 $bundle/share/man/man1
+run cp $bundle/Resources/qt.conf $bundle/MacOS
+
 # merge MacOS, bin, and plugins directories
 run mv $bundle/bin/* $bundle/MacOS || exit
 run rmdir $bundle/bin || exit
@@ -87,33 +91,42 @@ done
 
 # copy needed qt plugins
 ( cd "$QTDIR" ; \
-  ls -1 plugins/{platforms,imageformats,printsupport}/*.dylib | \
+  ls -1 plugins/{platforms,imageformats,styles,printsupport}/*.dylib | \
+  grep -v libqwebgl.dylib | \
   grep -v _debug.dylib ) | \
 while read plugin ; do
   run mkdir -p $bundle/$(dirname "$plugin") || exit
   run cp "$QTDIR/$plugin" $bundle/"$plugin" || exit
 done
 
+
+
 # copy needed libraries  
-for lib in \
-    $(otool -L $bundle/MacOS/djview | awk '/^\t/{print $1}') \
-    $(otool -L $bundle/MacOS/platforms/libqcocoa.dylib | awk '/^\t/{print $1}') 
-do
-  case "$lib" in 
-    $BREWDIR/*) 
+for loader in \
+    $bundle/MacOS/djview \
+    $bundle/MacOS/*/*.dylib 
+do 
+  for lib in $(otool -L $loader | awk '/^\t/{print $1}') 
+  do
+    if [ $(basename "$lib") != $(basename "$loader") ]
+    then
+      case "$lib" in 
+      $BREWDIR/*) 
         libname=$(basename "$lib")
 	test -r "./$bundle/lib/$libname" || \
 	    run cp "$lib" "./$bundle/lib/$libname" || exit ;;
-    @rpath/*)
+      @rpath/*)
         libname=$(basename "$lib")
         lib="$QTDIR/lib${lib/#@rpath//}"
 	test -r "./$bundle/lib/$libname" || \
 	    run cp "$lib" "./$bundle/lib/$libname" || exit ;;
-    $QTDIR/*)
+      $QTDIR/*)
         libname=$(basename "$lib")
 	test -r "./$bundle/lib/$libname" || \
 	    run cp "$lib" "./$bundle/lib/$libname" || exit ;;
-  esac
+      esac
+    fi
+  done
 done
 
 # copy translations
--- djview4-4.11.orig/nsdejavu/npsdk/prcpucfg.h
+++ djview4-4.11/nsdejavu/npsdk/prcpucfg.h
@@ -236,7 +236,7 @@
 #define PR_BYTES_PER_WORD_LOG2  3
 #define PR_BYTES_PER_DWORD_LOG2 3
 
-#elif defined(__x86_64__)
+#elif defined(__x86_64__) && !defined(__ILP32__)
 
 #define IS_LITTLE_ENDIAN 1
 #undef  IS_BIG_ENDIAN
@@ -282,6 +282,51 @@
 #define PR_BYTES_PER_WORD_LOG2  3
 #define PR_BYTES_PER_DWORD_LOG2 3
 
+#elif defined(__x86_64__) && defined(__ILP32__)
+
+#define IS_LITTLE_ENDIAN 1
+#undef  IS_BIG_ENDIAN
+
+#define PR_BYTES_PER_BYTE   1
+#define PR_BYTES_PER_SHORT  2
+#define PR_BYTES_PER_INT    4
+#define PR_BYTES_PER_INT64  8
+#define PR_BYTES_PER_LONG   4
+#define PR_BYTES_PER_FLOAT  4
+#define PR_BYTES_PER_DOUBLE 8
+#define PR_BYTES_PER_WORD   8
+#define PR_BYTES_PER_DWORD  8
+
+#define PR_BITS_PER_BYTE    8
+#define PR_BITS_PER_SHORT   16
+#define PR_BITS_PER_INT     32
+#define PR_BITS_PER_INT64   64
+#define PR_BITS_PER_LONG    32
+#define PR_BITS_PER_FLOAT   32
+#define PR_BITS_PER_DOUBLE  64
+#define PR_BITS_PER_WORD    64
+
+#define PR_BITS_PER_BYTE_LOG2   3
+#define PR_BITS_PER_SHORT_LOG2  4
+#define PR_BITS_PER_INT_LOG2    5
+#define PR_BITS_PER_INT64_LOG2  6
+#define PR_BITS_PER_LONG_LOG2   5
+#define PR_BITS_PER_FLOAT_LOG2  5
+#define PR_BITS_PER_DOUBLE_LOG2 6
+#define PR_BITS_PER_WORD_LOG2   6
+
+#define PR_ALIGN_OF_SHORT   2
+#define PR_ALIGN_OF_INT     4
+#define PR_ALIGN_OF_LONG    4
+#define PR_ALIGN_OF_INT64   8
+#define PR_ALIGN_OF_FLOAT   4
+#define PR_ALIGN_OF_DOUBLE  8
+#define PR_ALIGN_OF_POINTER 8
+#define PR_ALIGN_OF_WORD    8
+
+#define PR_BYTES_PER_WORD_LOG2  2
+#define PR_BYTES_PER_DWORD_LOG2 3
+
 #elif defined(__mc68000__)
 
 #undef  IS_LITTLE_ENDIAN
--- djview4-4.11.orig/src/djview_es.ts
+++ djview4-4.11/src/djview_es.ts
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="utf-8"?>
 <!DOCTYPE TS>
-<TS version="2.0" language="es">
+<TS version="2.1" language="es">
 <context>
     <name>Generic</name>
     <message>
@@ -535,7 +535,7 @@
         <source>Rotate page image clockwise.</source>
         <translation>Girar página en sentido horario.</translation>
     </message>
-    <message utf8="true">
+    <message>
         <location filename="qdjview.cpp" line="643"/>
         <source>Rotate &amp;0°</source>
         <comment>Rotate|</comment>
@@ -546,7 +546,7 @@
         <source>Set natural page orientation.</source>
         <translation>Ajustar orientación natural.</translation>
     </message>
-    <message utf8="true">
+    <message>
         <location filename="qdjview.cpp" line="649"/>
         <source>Rotate &amp;90°</source>
         <comment>Rotate|</comment>
@@ -557,7 +557,7 @@
         <source>Turn page on its left side.</source>
         <translation>Girar páagina sobre su lado izquuierdo.</translation>
     </message>
-    <message utf8="true">
+    <message>
         <location filename="qdjview.cpp" line="655"/>
         <source>Rotate &amp;180°</source>
         <comment>Rotate|</comment>
@@ -568,7 +568,7 @@
         <source>Turn page upside-down.</source>
         <translation>Girar página al revés.</translation>
     </message>
-    <message utf8="true">
+    <message>
         <location filename="qdjview.cpp" line="661"/>
         <source>Rotate &amp;270°</source>
         <comment>Rotate|</comment>
@@ -1335,7 +1335,7 @@ Nombre de archgivo &apos;%1&apos; no tie
     <message>
         <location filename="qdjview.cpp" line="4042"/>
         <source> (in other window.)</source>
-        <translation>(en otra ventana)</translation>
+        <translation> (en otra ventana.)</translation>
     </message>
     <message>
         <location filename="qdjview.cpp" line="4131"/>
@@ -1425,7 +1425,7 @@ Nombre de archgivo &apos;%1&apos; no tie
         <source>Save into the clipboard a maparea annotation expression for program djvused.</source>
         <translation>Guarddar en el portapapeles una expresión de la anotación de Mapa de Imágenes para el programa djvused.</translation>
     </message>
-    <message utf8="true">
+    <message>
         <location filename="qdjview.cpp" line="4359"/>
         <source>&lt;html&gt;&lt;h2&gt;DjVuLibre DjView %1&lt;/h2&gt;%2&lt;p&gt;Viewer for DjVu documents&lt;br&gt;&lt;a href=%3&gt;%3&lt;/a&gt;&lt;br&gt;Copyright © 2006-- Léon Bottou.&lt;/p&gt;&lt;p align=justify&gt;&lt;small&gt;This program is free software. You can redistribute or modify it under the terms of the GNU General Public License as published by the Free Software Foundation. This program is distributed &lt;i&gt;without any warranty&lt;/i&gt;. See the GNU General Public License for more details.&lt;/small&gt;&lt;/p&gt;&lt;/html&gt;</source>
         <translation>&lt;html&gt;&lt;h2&gt;DjVuLibre DjView %1&lt;/h2&gt;%2&lt;p&gt;Visor para documentos DjVu&lt;br&gt;&lt;a href=%3&gt;%3&lt;/a&gt;&lt;br&gt;Copyright © 2006-- Léon Bottou.&lt;/p&gt;&lt;p align=justify&gt;&lt;small&gt;Este programa es software libre. Usted puede redistribuirlo o modificarlo bajo los términos de la GNU General Public License publicada por la Free Software Foundation. Este programa es distribuido &lt;i&gt;sin garantía alguna&lt;/i&gt;. Ver la GNU General Public License para mayor información.&lt;/small&gt;&lt;/p&gt;&lt;/html&gt;</translation>
@@ -1515,7 +1515,8 @@ Opciones comunes incluyen:
 -page=&lt;page&gt;~~~Ir a página &lt;page&gt;.
 -zoom=&lt;zoom&gt;~~~Ajustar ampliación en un factor &lt;zoom&gt;.
 -continuous=&lt;yn&gt;~~~Ajustar desplazamiento continuo.
--sidebyside=&lt;yn&gt;~~~Ajustar vista de dos páginas.</translation>
+-sidebyside=&lt;yn&gt;~~~Ajustar vista de dos páginas.
+</translation>
     </message>
 </context>
 <context>
@@ -1804,7 +1805,7 @@ Do you want to replace it?</source>
     <message>
         <location filename="qdjviewexportps2.ui" line="76"/>
         <source> %</source>
-        <translation>%</translation>
+        <translation> %</translation>
     </message>
     <message>
         <location filename="qdjviewexportps2.ui" line="100"/>
@@ -1847,7 +1848,7 @@ Do you want to replace it?</source>
     <message>
         <location filename="qdjviewexportps3.ui" line="55"/>
         <source>Sheets per booklet: </source>
-        <translation>Hojas por folleto:</translation>
+        <translation>Hojas por folleto: </translation>
     </message>
     <message>
         <location filename="qdjviewexportps3.ui" line="62"/>
@@ -1857,12 +1858,12 @@ Do you want to replace it?</source>
     <message>
         <location filename="qdjviewexportps3.ui" line="65"/>
         <source>at most </source>
-        <translation>a lo sumo</translation>
+        <translation>a lo sumo </translation>
     </message>
     <message>
         <location filename="qdjviewexportps3.ui" line="98"/>
         <source>Print </source>
-        <translation>Imprimir</translation>
+        <translation>Imprimir </translation>
     </message>
     <message>
         <location filename="qdjviewexportps3.ui" line="112"/>
@@ -1882,12 +1883,12 @@ Do you want to replace it?</source>
     <message>
         <location filename="qdjviewexportps3.ui" line="153"/>
         <source>Shift rectos and versos by </source>
-        <translation>Cambiar delantera y trasera por</translation>
+        <translation>Cambiar delantera y trasera por </translation>
     </message>
     <message>
         <location filename="qdjviewexportps3.ui" line="160"/>
         <source> points.</source>
-        <translation>puntos.</translation>
+        <translation> puntos.</translation>
     </message>
     <message>
         <location filename="qdjviewexportps3.ui" line="196"/>
@@ -1897,7 +1898,7 @@ Do you want to replace it?</source>
     <message>
         <location filename="qdjviewexportps3.ui" line="203"/>
         <source> points</source>
-        <translation>puntos</translation>
+        <translation> puntos</translation>
     </message>
     <message>
         <location filename="qdjviewexportps3.ui" line="216"/>
@@ -1970,7 +1971,7 @@ Do you want to replace it?</source>
     <message>
         <location filename="qdjviewexportprn.ui" line="117"/>
         <source> %</source>
-        <translation>%</translation>
+        <translation> %</translation>
     </message>
     <message>
         <location filename="qdjviewexportprn.ui" line="141"/>
@@ -2008,12 +2009,12 @@ Do you want to replace it?</source>
     <message>
         <location filename="qdjviewexporttiff.ui" line="37"/>
         <source>Maximum image resolution </source>
-        <translation>Resolución máxima de imagen</translation>
+        <translation>Resolución máxima de imagen </translation>
     </message>
     <message>
         <location filename="qdjviewexporttiff.ui" line="44"/>
         <source> dpi</source>
-        <translation>dpi</translation>
+        <translation> dpi</translation>
     </message>
     <message>
         <location filename="qdjviewexporttiff.ui" line="76"/>
@@ -2061,12 +2062,12 @@ Do you want to replace it?</source>
     <message>
         <location filename="qdjviewsidebar.cpp" line="1625"/>
         <source>Find Previous (Shift+F3) </source>
-        <translation>Buscar anterior (Shift+F3)</translation>
+        <translation>Buscar anterior (Shift+F3) </translation>
     </message>
     <message>
         <location filename="qdjviewsidebar.cpp" line="1630"/>
         <source>Find Next (F3) </source>
-        <translation>Buscar siguiente (F3)</translation>
+        <translation>Buscar siguiente (F3) </translation>
     </message>
     <message>
         <location filename="qdjviewsidebar.cpp" line="1636"/>
@@ -2203,7 +2204,7 @@ Do you want to replace it?</source>
     <message>
         <location filename="qdjviewinfodialog.ui" line="108"/>
         <source>File: </source>
-        <translation>Archivo:</translation>
+        <translation>Archivo: </translation>
     </message>
     <message>
         <location filename="qdjviewinfodialog.ui" line="154"/>
@@ -2260,7 +2261,7 @@ Do you want to replace it?</source>
         <source>Waiting for data...</source>
         <translation>Esperando datos...</translation>
     </message>
-    <message utf8="true">
+    <message>
         <location filename="qdjviewdialogs.cpp" line="502"/>
         <source>Page #%1 - « %2 »</source>
         <translation>Página #%1 - « %2 »</translation>
@@ -2350,17 +2351,17 @@ Do you want to replace it?</source>
     <message>
         <location filename="qdjviewdialogs.cpp" line="588"/>
         <source> Page </source>
-        <translation>Página </translation>
+        <translation> Página </translation>
     </message>
     <message>
         <location filename="qdjviewdialogs.cpp" line="590"/>
         <source> Thumbnails </source>
-        <translation>Miniatura </translation>
+        <translation> Miniatura </translation>
     </message>
     <message>
         <location filename="qdjviewdialogs.cpp" line="592"/>
         <source> Shared </source>
-        <translation>Compartido </translation>
+        <translation> Compartido </translation>
     </message>
 </context>
 <context>
@@ -2404,12 +2405,12 @@ Do you want to replace it?</source>
     <message>
         <location filename="qdjviewdialogs.cpp" line="662"/>
         <source> Key </source>
-        <translation>Clave</translation>
+        <translation> Clave </translation>
     </message>
     <message>
         <location filename="qdjviewdialogs.cpp" line="662"/>
         <source> Value </source>
-        <translation>Valor</translation>
+        <translation> Valor </translation>
     </message>
     <message>
         <location filename="qdjviewdialogs.cpp" line="706"/>
@@ -2623,7 +2624,7 @@ Do you want to replace it?</source>
     <message>
         <location filename="qdjviewprefsdialog.ui" line="234"/>
         <source> dpi</source>
-        <translation>dpi</translation>
+        <translation> dpi</translation>
     </message>
     <message>
         <location filename="qdjviewprefsdialog.ui" line="268"/>
@@ -2698,7 +2699,7 @@ Do you want to replace it?</source>
     <message>
         <location filename="qdjviewprefsdialog.ui" line="415"/>
         <source>Timer:  </source>
-        <translation>Avanzar cada: </translation>
+        <translation>Avanzar cada:  </translation>
     </message>
     <message>
         <location filename="qdjviewprefsdialog.ui" line="428"/>
@@ -2814,7 +2815,7 @@ Do you want to replace it?</source>
     <message>
         <location filename="qdjviewprefsdialog.ui" line="780"/>
         <source> pixels</source>
-        <translation>pixeles</translation>
+        <translation> pixeles</translation>
     </message>
     <message>
         <location filename="qdjviewprefsdialog.ui" line="816"/>
@@ -2865,17 +2866,17 @@ Do you want to replace it?</source>
         <location filename="qdjviewprefsdialog.ui" line="949"/>
         <location filename="qdjviewprefsdialog.ui" line="962"/>
         <source> MB</source>
-        <translation>MB</translation>
+        <translation> MB</translation>
     </message>
     <message>
         <location filename="qdjviewprefsdialog.ui" line="978"/>
         <source>&amp;Decoded page cache: </source>
-        <translation>Cache de páginas &amp;decodificadas:</translation>
+        <translation>Cache de páginas &amp;decodificadas: </translation>
     </message>
     <message>
         <location filename="qdjviewprefsdialog.ui" line="988"/>
         <source>&amp;Pixel cache: </source>
-        <translation>Cache de &amp;pixeles:</translation>
+        <translation>Cache de &amp;pixeles: </translation>
     </message>
     <message>
         <location filename="qdjviewprefsdialog.ui" line="1015"/>
@@ -3044,7 +3045,7 @@ Do you want to replace it?</source>
     <message>
         <location filename="qdjviewprintdialog.ui" line="182"/>
         <source>Printer name: </source>
-        <translation>Nombre impresora:</translation>
+        <translation>Nombre impresora: </translation>
     </message>
     <message>
         <location filename="qdjviewprintdialog.ui" line="207"/>
--- djview4-4.11.orig/src/qdjviewdialogs.cpp
+++ djview4-4.11/src/qdjviewdialogs.cpp
@@ -772,6 +772,7 @@ metadataFill(QTableWidget *table, QMap<Q
   int nkeys = keys.size();
   table->setRowCount(nkeys);
   table->setSortingEnabled(false);
+  table->setWordWrap(false);
   for(int j = 0; j < nkeys; j++)
     {
       QTableWidgetItem *kitem = new QTableWidgetItem(keys[j]);
--- djview4-4.11.orig/src/qdjviewprefs.cpp
+++ djview4-4.11/src/qdjviewprefs.cpp
@@ -1156,8 +1156,10 @@ QDjViewPrefsDialog::reset()
         case QDjView::STANDALONE_SLIDESHOW:
           d->saved[i].remember = false;
           d->saved[i].zoom = QDjVuWidget::ZOOM_FITPAGE;
+          /* FALLTHRU */
         case QDjView::STANDALONE_FULLSCREEN:
           d->saved[i].options &= ~(optMSS|optS|optT);
+          /* FALLTHRU */
         case QDjView::STANDALONE:
           break;
         case QDjView::EMBEDDED_PLUGIN:
--- djview4-4.11.orig/src/qdjvuwidget.cpp
+++ djview4-4.11/src/qdjvuwidget.cpp
@@ -1932,7 +1932,7 @@ QDjVuPrivate::pageinfoPage(QDjVuPage *pa
         case DDJVU_JOB_OK:
           if (p)
             getAnnotationsAndText(p);
-          // no break!
+          /* FALLTHRU */
         case DDJVU_JOB_STARTED:
           if (p && p->dpi <= 0)
             {
@@ -4374,12 +4374,14 @@ QDjVuPrivate::paintHiddenText(QImage &im
                     case 2:
                       paint.translate(dw, dh);
                       paint.rotate(180);
+                      /* FALLTHRU */
                     default:
                       paint.scale(dw/bw, dh/bh);
                       break;
                     case 3:
                       paint.translate(dw, dh);
                       paint.rotate(180);
+                      /* FALLTHRU */
                     case 1:
                       paint.translate(dw, 0);
                       paint.rotate(90);
--- djview4-4.11.orig/src/tiff2pdf.c
+++ djview4-4.11/src/tiff2pdf.c
@@ -85,11 +85,28 @@
 #ifndef TIFFmin
 # define TIFFmin(A,B) ((A)<(B)?(A):(B))
 #endif
+#ifndef TIFFclip
+# define TIFFclip(A,B) ((A)<(0)?(0):((A)>(B)?(B):(A)))
+#endif
 
 #ifdef HAVE_GETOPT_H
 # include <getopt.h>
 #endif
 
+#if defined(_WIN32) && defined(_MSC_VER)
+# ifndef HAVE_SNPRINTF
+static int
+snprintf(char* str, size_t size, const char* format, ...)
+{
+  int count;
+  va_list ap;
+  va_start(ap, format);
+  count = vsnprintf(str, size, format, ap);
+  va_end(ap);
+  return count;
+}
+# endif
+#endif
 
 
 #ifndef HAVE_GETOPT_H
@@ -3848,8 +3865,8 @@ t2p_sample_rgbaa_to_rgb(tdata_t data, ui
     /* For the 3 first samples, there is overlapping between souce and
        destination, so use memmove().
        See http://bugzilla.maptools.org/show_bug.cgi?id=2577 */
-    for(i = 0; i < 3 && i < samplecount; i++)
-        memmove((uint8*)data + i * 3, (uint8*)data + i * 4, 3);
+	for(i = 0; i < 3 && i < samplecount; i++)
+		memmove((uint8*)data + i * 3, (uint8*)data + i * 4, 3);
 	for(; i < samplecount; i++)
 		memcpy((uint8*)data + i * 3, (uint8*)data + i * 4, 3);
 
@@ -4266,13 +4283,13 @@ void t2p_pdf_currenttime(T2P* t2p)
 
 	currenttime = localtime(&timenow);
 	snprintf(t2p->pdf_datetime, sizeof(t2p->pdf_datetime),
-		 "D:%.4d%.2d%.2d%.2d%.2d%.2d",
-		 (currenttime->tm_year + 1900) % 65536,
-		 (currenttime->tm_mon + 1) % 256,
-		 (currenttime->tm_mday) % 256,
-		 (currenttime->tm_hour) % 256,
-		 (currenttime->tm_min) % 256,
-		 (currenttime->tm_sec) % 256);
+             "D:%.4d%.2d%.2d%.2d%.2d%.2d",
+             TIFFclip( (currenttime->tm_year + 1900) % 65536 , 9999),
+             TIFFclip( (currenttime->tm_mon + 1) % 256 , 99),
+             TIFFclip( (currenttime->tm_mday) % 256 , 99),
+             TIFFclip( (currenttime->tm_hour) % 256 , 99),
+             TIFFclip( (currenttime->tm_min) % 256 , 99),
+             TIFFclip( (currenttime->tm_sec) % 256 , 99));
 
 	return;
 }
