diff options
author | Michael Stahl <mstahl@redhat.com> | 2013-08-28 23:19:43 +0200 |
---|---|---|
committer | Fridrich Strba <fridrich@documentfoundation.org> | 2013-08-29 11:53:22 +0000 |
commit | 09a894477f326af5683a8f5e51038e0c88453806 (patch) | |
tree | 9276c7c3db268071589c06759996db25cab65c2a | |
parent | 9888a00405dc320e12ca2fc12446b85572144795 (diff) |
fdo#68648: SvxNumRule: serialize the aFmtsSet flags too
The constructor of SvxNumRule initializes aFmts[i] with a format but
always sets aFmtsSet[i] to false, so SvxNumRule::Store()
and SvxNumRule::SvxNumRule(SvStream &rStream) need to be able
to round-trip that combination to prevent spurious numberings.
It is unlikely that this class is serialized in the table auto-format
files but i haven't checked; this change does not change the size of the
serialization so shouldn't cause trouble anyway.
(regression from a95cce27295f9cd255fa72eaded00972e3efb69b)
Change-Id: I589ea108ac069624aaa7b26cdc3bfe8182b15851
(cherry picked from commit 4b798d89a55714218dc9a7de161f93f9c4d6fc80)
Reviewed-on: https://gerrit.libreoffice.org/5671
Reviewed-by: Fridrich Strba <fridrich@documentfoundation.org>
Tested-by: Fridrich Strba <fridrich@documentfoundation.org>
-rw-r--r-- | editeng/source/items/numitem.cxx | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/editeng/source/items/numitem.cxx b/editeng/source/items/numitem.cxx index 973dd63a03b0..7090abc4b268 100644 --- a/editeng/source/items/numitem.cxx +++ b/editeng/source/items/numitem.cxx @@ -694,15 +694,15 @@ SvxNumRule::SvxNumRule( SvStream &rStream ) for (sal_uInt16 i = 0; i < SVX_MAX_NUM; i++) { rStream >> nTmp16; - sal_Bool hasNumberingFormat = nTmp16; + sal_Bool hasNumberingFormat = nTmp16 & 1; + aFmtsSet[i] = nTmp16 & 2; // fdo#68648 reset flag if ( hasNumberingFormat ){ aFmts[i] = new SvxNumberFormat( rStream ); - aFmtsSet[i] = sal_True; } else { aFmts[i] = 0; - aFmtsSet[i] = sal_False; + aFmtsSet[i] = sal_False; // actually only false is valid } } //second nFeatureFlags for new versions @@ -727,9 +727,10 @@ SvStream& SvxNumRule::Store( SvStream &rStream ) sal_Bool bConvertBulletFont = ( rStream.GetVersion() <= SOFFICE_FILEFORMAT_50 ) && ( rStream.GetVersion() ); for(sal_uInt16 i = 0; i < SVX_MAX_NUM; i++) { + sal_uInt16 nSetFlag(aFmtsSet[i] ? 2 : 0); // fdo#68648 store that too if(aFmts[i]) { - rStream << sal_uInt16(1); + rStream << sal_uInt16(1 | nSetFlag); if(bConvertBulletFont && aFmts[i]->GetBulletFont()) { if(!pConverter) @@ -740,7 +741,7 @@ SvStream& SvxNumRule::Store( SvStream &rStream ) aFmts[i]->Store(rStream, pConverter); } else - rStream << sal_uInt16(0); + rStream << sal_uInt16(0 | nSetFlag); } //second save of nFeatureFlags for new versions rStream<<(sal_uInt16)nFeatureFlags; |