diff options
author | Michael Stahl <mstahl@redhat.com> | 2013-08-28 23:19:43 +0200 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2013-08-28 23:30:35 +0200 |
commit | 4b798d89a55714218dc9a7de161f93f9c4d6fc80 (patch) | |
tree | 65246efc2c99c146fe179035a97b5449572b59e8 /editeng | |
parent | 1e3c5948c35cd0b2178b1cf204709ed36c6123c7 (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
Diffstat (limited to 'editeng')
-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 1a9e800c7d26..e4684d840e1f 100644 --- a/editeng/source/items/numitem.cxx +++ b/editeng/source/items/numitem.cxx @@ -693,15 +693,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 @@ -726,9 +726,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) @@ -739,7 +740,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; |