diff options
author | Adam Co <rattles2013@gmail.com> | 2013-08-29 17:16:44 +0300 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2013-10-22 09:53:53 +0200 |
commit | c2ccd20c0fd92bddfff76447754541705e3eb8f3 (patch) | |
tree | cd912865f00efcfd559530bc6ff1bfbeb57065cf /sw/source/ui/inc | |
parent | Improve test assertion (diff) | |
download | core-c2ccd20c0fd92bddfff76447754541705e3eb8f3.tar.gz core-c2ccd20c0fd92bddfff76447754541705e3eb8f3.zip |
fdo#44689: fix for specific case of page restart-value 0
This bug fix is for roundtripping a DOCX that has
a specific 'start value' for the page numbers.
In most cases LO imports it ok.
However - until now - Word allowed you to start page number
from 0, while LO only allowed starting page numbers from 1.
This was because the 'start value' was stored in an 'unsigned int',
and the value '0' was used to mark 'there is no start value'.
This patch changes the way the 'start value' is stored
from 'unsigned int' to 'optional unsigned int'.
This way - if there is no value applied - the variable will hold NULL.
However - if a value is set - it can be 0 or more.
This meant also tweaking all the places that used to get this value,
so that now they handle an 'optional uint', instead of a 'uint'.
Conflicts:
sw/source/ui/inc/break.hxx
sw/source/ui/inc/wrtsh.hxx
sw/source/ui/shells/textsh1.cxx
sw/source/ui/utlui/uitool.cxx
sw/source/ui/wrtsh/wrtsh1.cxx
Change-Id: I6ad9d90e03b42c58eed2271477df43c20ad6f20a
Reviewed-on: https://gerrit.libreoffice.org/5681
Diffstat (limited to 'sw/source/ui/inc')
-rw-r--r-- | sw/source/ui/inc/break.hxx | 7 | ||||
-rw-r--r-- | sw/source/ui/inc/wrtsh.hxx | 3 |
2 files changed, 7 insertions, 3 deletions
diff --git a/sw/source/ui/inc/break.hxx b/sw/source/ui/inc/break.hxx index 9c427853ebaa..98b0db845bb0 100644 --- a/sw/source/ui/inc/break.hxx +++ b/sw/source/ui/inc/break.hxx @@ -1,3 +1,4 @@ + /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* * This file is part of the LibreOffice project. @@ -29,6 +30,8 @@ #include <vcl/field.hxx> +#include <boost/optional.hpp> + class SwWrtShell; class SwBreakDlg: public SvxStandardDialog @@ -44,7 +47,7 @@ class SwBreakDlg: public SvxStandardDialog OUString aTemplate; sal_uInt16 nKind; - sal_uInt16 nPgNum; + ::boost::optional<sal_uInt16> oPgNum; sal_Bool bHtmlMode; @@ -64,7 +67,7 @@ public: OUString GetTemplateName() { return aTemplate; } sal_uInt16 GetKind() { return nKind; } - sal_uInt16 GetPageNumber() { return nPgNum; } + ::boost::optional<sal_uInt16> GetPageNumber() { return oPgNum; } }; #endif diff --git a/sw/source/ui/inc/wrtsh.hxx b/sw/source/ui/inc/wrtsh.hxx index 3c6f7a373821..31d4f55cffd8 100644 --- a/sw/source/ui/inc/wrtsh.hxx +++ b/sw/source/ui/inc/wrtsh.hxx @@ -26,6 +26,7 @@ #include <swurl.hxx> #include <IMark.hxx> #include "navmgr.hxx" +#include <boost/optional.hpp> class Window; class SbxArray; @@ -294,7 +295,7 @@ typedef sal_Bool (SwWrtShell:: *FNSimpleMove)(); sal_Bool bRule = sal_False ); void InsertByWord( const OUString & ); - void InsertPageBreak(const OUString *pPageDesc = 0, sal_uInt16 nPgNum = 0 ); + void InsertPageBreak(const OUString *pPageDesc = 0, ::boost::optional<sal_uInt16> pPgNum = boost::none ); void InsertLineBreak(); void InsertColumnBreak(); void InsertFootnote(const OUString &, sal_Bool bEndNote = sal_False, sal_Bool bEdit = sal_True ); |