[Libreoffice-commits] core.git: Branch 'libreoffice-4-1' - editeng/source
Michael Stahl
mstahl at redhat.com
Thu Aug 29 04:53:56 PDT 2013
editeng/source/items/numitem.cxx | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
New commits:
commit 09a894477f326af5683a8f5e51038e0c88453806
Author: Michael Stahl <mstahl at redhat.com>
Date: Wed Aug 28 23:19:43 2013 +0200
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 at documentfoundation.org>
Tested-by: Fridrich Strba <fridrich at documentfoundation.org>
diff --git a/editeng/source/items/numitem.cxx b/editeng/source/items/numitem.cxx
index 973dd63..7090abc 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;
More information about the Libreoffice-commits
mailing list