diff options
author | Michael Stahl <mstahl@redhat.com> | 2017-03-01 12:39:54 +0100 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2017-03-01 12:42:10 +0100 |
commit | d36fa0589ab822dc617c65b4d0d3bf68c092ad37 (patch) | |
tree | 7306d39b6f853c7440abb581a2c60d5d0769d138 /sw/source | |
parent | 86463ec54dcdc562121bdb57b1ac4e85b135b2df (diff) |
tdf#77111 cui,sw: fix page number offset on paragraph dialog "Text Flow"
Commit c2ccd20c0fd92bddfff76447754541705e3eb8f3 introduced 0 as a valid
value for page number offset in sw core.
Unfortunately the paragraph dialog was not changed then; previously
page number 0 would do automatic numbering, but since then 0 was set as
the offset, and once you have a 0 offset there's no easy way to remove
it, you have to remove the whole page break.
* change the label before the text number edit widget to a checkbox
that disables the edit widget
* keep the id "labelPageNum" so that translations still work
* adapt SfxToSwPageDescAttr so it can not just set but also clear the
page number
* set initial value to 1; 0 is a really bad default since we can't
export it to ODF (see tdf#91306)
Change-Id: Ic4ca9e2562bb65ac359b305a2202f782e8598307
Diffstat (limited to 'sw/source')
-rw-r--r-- | sw/source/uibase/utlui/uitool.cxx | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/sw/source/uibase/utlui/uitool.cxx b/sw/source/uibase/utlui/uitool.cxx index b62aa6577022..3098777deb13 100644 --- a/sw/source/uibase/utlui/uitool.cxx +++ b/sw/source/uibase/utlui/uitool.cxx @@ -600,10 +600,25 @@ void SfxToSwPageDescAttr( const SwWrtShell& rShell, SfxItemSet& rSet ) bool bChanged = false; // Page number - if(SfxItemState::SET == rSet.GetItemState(SID_ATTR_PARA_PAGENUM, false, &pItem)) + switch (rSet.GetItemState(SID_ATTR_PARA_PAGENUM, false, &pItem)) { - aPgDesc.SetNumOffset(static_cast<const SfxUInt16Item*>(pItem)->GetValue()); - bChanged = true; + case SfxItemState::SET: + { + aPgDesc.SetNumOffset(static_cast<const SfxUInt16Item*>(pItem)->GetValue()); + bChanged = true; + break; + } + case SfxItemState::DISABLED: + { + bChanged = true; // default initialised aPgDesc clears the number + break; + } + case SfxItemState::UNKNOWN: + case SfxItemState::DEFAULT: + break; + default: + assert(false); // unexpected + break; } if( SfxItemState::SET == rSet.GetItemState( SID_ATTR_PARA_MODEL, false, &pItem )) { |