From 721d0dfe70323d31e26394cfb32056a7ceec96c7 Mon Sep 17 00:00:00 2001 From: Eike Rathke Date: Fri, 19 Apr 2013 13:26:01 +0200 Subject: Revert "Revert "fix fdo#47018 Impress paste destroy bullet"" This reverts commit 674a40fe830748b63eafeaf07e0932e2e0a81ba6. And restores a95cce27295f9cd255fa72eaded00972e3efb69b with the exception that the sal_Int8 to sal_uInt16 change is omitted. This stream length change causes loading of autoformats to fail, which are stored in binary format, i.e. in user config's autotbl.fmt, loaded and stored in Calc's ScAutoFormat sc/source/core/tool/autoform.cxx and Writer's SwTableAutoFmtTbl sw/source/core/doc/tblafmt.cxx Change-Id: I59f5d3b1c7e1011a8db304855b2fcf28971e7cb1 --- editeng/source/items/numitem.cxx | 103 +++++++++++++++++++++++++++++++++++++-- 1 file changed, 98 insertions(+), 5 deletions(-) (limited to 'editeng/source') diff --git a/editeng/source/items/numitem.cxx b/editeng/source/items/numitem.cxx index 7c3ec9c89f09..7ef42e01cfac 100644 --- a/editeng/source/items/numitem.cxx +++ b/editeng/source/items/numitem.cxx @@ -28,6 +28,7 @@ #include #include #include +#include #include #include #include @@ -177,6 +178,59 @@ SvxNumberFormat::SvxNumberFormat(const SvxNumberFormat& rFormat) : *this = rFormat; } +SvxNumberFormat::SvxNumberFormat( SvStream &rStream ) +{ + sal_uInt16 nTmp16; + sal_Int32 nTmp32; + rStream >> nTmp16; // Version number + + rStream >> nTmp16; SetNumberingType( nTmp16 ); + rStream >> nTmp16; eNumAdjust = ( SvxAdjust )nTmp16; + rStream >> nTmp16; nInclUpperLevels = nTmp16; + rStream >> nStart; + rStream >> nTmp16; cBullet = (sal_Unicode)nTmp16; + + rStream >> nFirstLineOffset; + rStream >> nAbsLSpace; + rStream >> nLSpace; + + rStream >> nCharTextDistance; + + sPrefix = rStream.ReadUniOrByteString( rStream.GetStreamCharSet() ); + sSuffix = rStream.ReadUniOrByteString( rStream.GetStreamCharSet() ); + sCharStyleName = rStream.ReadUniOrByteString( rStream.GetStreamCharSet() ); + + sal_uInt16 hasGraphicBrush = 0; + rStream >> hasGraphicBrush; + if ( hasGraphicBrush ) + { + pGraphicBrush = new SvxBrushItem( SID_ATTR_BRUSH ); + pGraphicBrush = (SvxBrushItem*)(pGraphicBrush->Create( rStream, BRUSH_GRAPHIC_VERSION )); + } + else pGraphicBrush = 0; + rStream >> nTmp16; eVertOrient = nTmp16; + + sal_uInt16 hasBulletFont = 0; + rStream >> hasBulletFont; + if ( hasBulletFont ) + { + pBulletFont = new Font( ); + rStream >> *pBulletFont; + } + else pBulletFont = NULL; + rStream >> aGraphicSize; + + rStream >> nBulletColor; + rStream >> nBulletRelSize; + rStream >> nTmp16; SetShowSymbol( nTmp16 ); + + rStream >> nTmp16; mePositionAndSpaceMode = ( SvxNumPositionAndSpaceMode )nTmp16; + rStream >> nTmp16; meLabelFollowedBy = ( LabelFollowedBy )nTmp16; + rStream >> nTmp32; mnListtabPos = nTmp32; + rStream >> nTmp32; mnFirstLineIndent = nTmp32; + rStream >> nTmp32; mnIndentAt = nTmp32; + +} SvxNumberFormat::~SvxNumberFormat() { delete pGraphicBrush; @@ -253,6 +307,11 @@ SvStream& SvxNumberFormat::Store(SvStream &rStream, FontToSubsFontConverter pC return rStream; } +SvxNumberFormat* SvxNumberFormat::Create( SvStream &rStream ) +{ + return new SvxNumberFormat( rStream ); +} + SvxNumberFormat& SvxNumberFormat::operator=( const SvxNumberFormat& rFormat ) { if (& rFormat == this) { return *this; } @@ -621,7 +680,41 @@ SvxNumRule::SvxNumRule(const SvxNumRule& rCopy) } } -SvStream& SvxNumRule::Store(SvStream &rStream) +SvxNumRule::SvxNumRule( SvStream &rStream ) +{ + sal_uInt16 nTmp16; + rStream >> nTmp16; // NUM_ITEM_VERSION + rStream >> nLevelCount; + + // first nFeatureFlags of old Versions + rStream >> nTmp16; nFeatureFlags = nTmp16; + rStream >> nTmp16; bContinuousNumbering = nTmp16; + rStream >> nTmp16; eNumberingType = ( SvxNumRuleType )nTmp16; + + for (sal_uInt16 i = 0; i < SVX_MAX_NUM; i++) + { + rStream >> nTmp16; + sal_Bool hasNumberingFormat = nTmp16; + if ( hasNumberingFormat ){ + aFmts[i] = new SvxNumberFormat( rStream ); + aFmtsSet[i] = sal_True; + } + else + { + aFmts[i] = 0; + aFmtsSet[i] = sal_False; + } + } + //second nFeatureFlags for new versions + rStream >> nTmp16; nFeatureFlags = nTmp16; +} + +SvxNumRule* SvxNumRule::Create( SvStream & rStream ) +{ + return new SvxNumRule( rStream ); +} + +SvStream& SvxNumRule::Store( SvStream &rStream ) { rStream<<(sal_uInt16)NUMITEM_VERSION_03; rStream<