diff options
author | Justin Luth <justin_luth@sil.org> | 2018-08-16 15:49:37 +0300 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2018-08-29 11:20:15 +0200 |
commit | 2127581728ae61eca7470b288c21d1c02754fb5b (patch) | |
tree | 69880cc61b4e54013200a74853449205196a7b34 /sw/source/filter/ww8/ww8par6.cxx | |
parent | 41427a5682ba83167f3b0abfa0e1e61b9ea6fa9d (diff) |
tdf#119232 ww8import: even page means default to start on page 2
I didn't see this mentioned in the sprm documentation,
but that is how MS Word seems to implement it.
Change-Id: I5b86ecf99a884e768877cdb0e71f43cdb9f2ad76
Reviewed-on: https://gerrit.libreoffice.org/59221
Reviewed-by: Justin Luth <justin_luth@sil.org>
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Diffstat (limited to 'sw/source/filter/ww8/ww8par6.cxx')
-rw-r--r-- | sw/source/filter/ww8/ww8par6.cxx | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/sw/source/filter/ww8/ww8par6.cxx b/sw/source/filter/ww8/ww8par6.cxx index cc43a90d4077..7844ef2a07e9 100644 --- a/sw/source/filter/ww8/ww8par6.cxx +++ b/sw/source/filter/ww8/ww8par6.cxx @@ -874,6 +874,8 @@ void wwSectionManager::CreateSep(const long nTextPos) const sal_uInt16* pIds = eVer <= ww::eWW2 ? aVer2Ids0 : eVer <= ww::eWW7 ? aVer67Ids0 : aVer8Ids0; + SprmResult aRes = pSep->HasSprm(pIds[0]); + const sal_uInt8* pSprmBkc = aRes.pSprm; if (!maSegments.empty()) { // Type of break: break codes are: @@ -882,8 +884,6 @@ void wwSectionManager::CreateSep(const long nTextPos) // 2 New page // 3 Even page // 4 Odd page - SprmResult aRes = pSep->HasSprm(pIds[0]); - const sal_uInt8* pSprmBkc = aRes.pSprm; if (pSprmBkc && aRes.nRemainingData >= 1) aNewSection.maSep.bkc = *pSprmBkc; } @@ -1036,7 +1036,13 @@ void wwSectionManager::CreateSep(const long nTextPos) aNewSection.maSep.pgnStart = ReadUSprm( pSep, pIds[7], 0 ); - SprmResult aRes; + // if the document's first page number is unspecified, but it starts with an even page break, + // then set the first page number to two + if ( maSegments.empty() && !aNewSection.maSep.fPgnRestart && pSprmBkc && *pSprmBkc == 3 ) + { + aNewSection.maSep.pgnStart = 2; + aNewSection.maSep.fPgnRestart = 1; + } if (eVer >= ww::eWW6) { |