RTF import: fix spurious page breaks at doc end (related: rhbz#1065629)

When a document ends with \sect it's possible that a spurious page break
is created.  In fact the spurious page break is always created by the
RTF importer, sometimes it is deleted again by
DomainMapper_Impl::RemoveLastParagraph() and sometimes not.

It is created because on the final \sect RTFDocumentImpl::sectBreak()
still calls startSectionGroup(), and the popState() for the \rtf1 group
then calls sectBreak() another time.

To prevent this, do not call startSectionGroup() from sectBreak() but
instead from setNeedSect(), and ensure that it is called as soon as
anything after \sect is read.

One unit test fails because the \page is not handled properly: the
conversion to \skbpage \sect \skbnone is not correct, because the \skb*
keywords are an exception and affect the \sect that precedes them, not
the following one; sending the \skbpage later unfortunately requires
additional cleanup later.

(cherry picked from commit e3f254ab8211fbab7541cde2100a35c875b0c240)
Signed-off-by: Luboš Luňák <l.lunak@centrum.cz>

Conflicts:
	sw/qa/extras/rtfimport/rtfimport.cxx
	writerfilter/source/rtftok/rtfdocumentimpl.cxx

Change-Id: I3c1a3bceb2c8b75bbecdc748170562451ce5f5c3
-Werror,-Wtautological-constant-out-of-range-compare

(If the underlying type of an unscoped enumeration is unfixed, it need not be
signed.)

Change-Id: I26a406504863512a0d3861ad8b28523b0a6dccaa
(cherry picked from commit 8899b47d2252fd1c2f58ba30558c4ec41d65e442)
Signed-off-by: Luboš Luňák <l.lunak@centrum.cz>
RTF import: fix paragraphs in header/footer

(cherry picked from commit 74b3f4f00766d199df3b017d056cf7a00ae52988)
Signed-off-by: Luboš Luňák <l.lunak@centrum.cz>

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

Change-Id: I91f04cad7a39428ce6f9555d18b974f0d45181f7