rhbz#1065629: RTF import: don't drop nested cells if not enough \cellx

In this document written by "XMLmind XSL-FO Converter" there are less
\cellx than \cell and thus when reading \nestrow/\row a whole buffered
nested table \cell is lost and then subsequently the rest of the nested
table too.  Try to fix that by counting both \cell and \cellx and
replaying until the maximum of those.

Cannot count \intbl since we synthesize that in various places.

(regression in LO 3.5)

(cherry picked from commit 07ef4cf096015f0e427ffd17cd26bb6837e75481)
Conflicts:
	sw/qa/extras/rtfimport/rtfimport.cxx

Reviewed-on: https://gerrit.libreoffice.org/8101
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>

Conflicts:
	sw/qa/extras/rtfimport/rtfimport.cxx

Change-Id: I3b64ad94af842e076611418589a0c83bd18841c6
fdo#73773: Check if the *document* is closing, not the *app*.

Otherwise it would crash if the app has multiple document instances open
and only one of them is being closed.

(cherry picked from commit 76bdf523981d2bd983dac4e01bc5cc934118a73f)

Conflicts:
	sc/source/ui/app/inputhdl.cxx

Change-Id: Ib6e370037ab6097c9c6eff8035249663944b3a6c
Reviewed-on: https://gerrit.libreoffice.org/8055
Tested-by: Caolán McNamara <caolanm@redhat.com>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Resolves: fdo#69925 Wiki Publisher Extension is not working

Regression from http://cgit.freedesktop.org/libreoffice/core/commit/?id=b80d8c695e6b6ded231e67ed9a80bcd1f1250c03
"compareTo" has been replaced by "==", so we compared the equality ot the pointers on the objects instead of the content of the strings
To make it simple and since we compare String objects, let's simply use "equals" method

Change-Id: I65bc1a87751297411fdbe722d3f49bce5e291638
(cherry picked from commit 9e2d1d21f9a58e320444f6eaea2f006530bbd2cb)
Signed-off-by: Michael Stahl <mstahl@redhat.com>