Kaydet (Commit) 721d0dfe authored tarafından Eike Rathke's avatar Eike Rathke

Revert "Revert "fix fdo#47018 Impress paste destroy bullet""

This reverts commit 674a40fe830748b63eafeaf07e0932e2e0a81ba6.

And restores a95cce27 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
üst 533f708c
...@@ -157,10 +157,12 @@ public: ...@@ -157,10 +157,12 @@ public:
explicit SvxNumberFormat( sal_Int16 nNumberingType, explicit SvxNumberFormat( sal_Int16 nNumberingType,
SvxNumPositionAndSpaceMode ePositionAndSpaceMode = LABEL_WIDTH_AND_POSITION ); SvxNumPositionAndSpaceMode ePositionAndSpaceMode = LABEL_WIDTH_AND_POSITION );
SvxNumberFormat(const SvxNumberFormat& rFormat); SvxNumberFormat(const SvxNumberFormat& rFormat);
SvxNumberFormat( SvStream & rStream );
virtual ~SvxNumberFormat(); virtual ~SvxNumberFormat();
SvStream& Store(SvStream &rStream, FontToSubsFontConverter pConverter); SvStream& Store(SvStream &rStream, FontToSubsFontConverter pConverter);
SvxNumberFormat* Create(SvStream& rStream );
SvxNumberFormat& operator=( const SvxNumberFormat& ); SvxNumberFormat& operator=( const SvxNumberFormat& );
sal_Bool operator==( const SvxNumberFormat& ) const; sal_Bool operator==( const SvxNumberFormat& ) const;
...@@ -252,6 +254,7 @@ public: ...@@ -252,6 +254,7 @@ public:
eDefaultNumberFormatPositionAndSpaceMode eDefaultNumberFormatPositionAndSpaceMode
= SvxNumberFormat::LABEL_WIDTH_AND_POSITION ); = SvxNumberFormat::LABEL_WIDTH_AND_POSITION );
SvxNumRule(const SvxNumRule& rCopy); SvxNumRule(const SvxNumRule& rCopy);
SvxNumRule(SvStream &rStream);
virtual ~SvxNumRule(); virtual ~SvxNumRule();
int operator==( const SvxNumRule& ) const; int operator==( const SvxNumRule& ) const;
...@@ -260,7 +263,7 @@ public: ...@@ -260,7 +263,7 @@ public:
SvxNumRule& operator=( const SvxNumRule& ); SvxNumRule& operator=( const SvxNumRule& );
SvStream& Store(SvStream &rStream); SvStream& Store(SvStream &rStream);
SvxNumRule* Create(SvStream &rStream);
const SvxNumberFormat* Get(sal_uInt16 nLevel)const; const SvxNumberFormat* Get(sal_uInt16 nLevel)const;
const SvxNumberFormat& GetLevel(sal_uInt16 nLevel)const; const SvxNumberFormat& GetLevel(sal_uInt16 nLevel)const;
void SetLevel(sal_uInt16 nLevel, const SvxNumberFormat& rFmt, sal_Bool bIsValid = sal_True); void SetLevel(sal_uInt16 nLevel, const SvxNumberFormat& rFmt, sal_Bool bIsValid = sal_True);
...@@ -294,9 +297,9 @@ public: ...@@ -294,9 +297,9 @@ public:
virtual ~SvxNumBulletItem(); virtual ~SvxNumBulletItem();
virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const; virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
virtual SfxPoolItem* Create(SvStream &, sal_uInt16) const; virtual SfxPoolItem* Create(SvStream &rStream, sal_uInt16 nItemVersion) const;
sal_uInt16 GetVersion( sal_uInt16 nFileVersion ) const; sal_uInt16 GetVersion( sal_uInt16 nFileVersion ) const;
virtual SvStream& Store(SvStream &, sal_uInt16 nItemVersion ) const; virtual SvStream& Store(SvStream &rStream, sal_uInt16 nItemVersion ) const;
virtual int operator==( const SfxPoolItem& ) const; virtual int operator==( const SfxPoolItem& ) const;
SvxNumRule* GetNumRule() const {return pNumRule;} SvxNumRule* GetNumRule() const {return pNumRule;}
......
...@@ -28,6 +28,7 @@ ...@@ -28,6 +28,7 @@
#include <editeng/editids.hrc> #include <editeng/editids.hrc>
#include <editeng/editrids.hrc> #include <editeng/editrids.hrc>
#include <editeng/numdef.hxx> #include <editeng/numdef.hxx>
#include <editeng/eeitem.hxx>
#include <vcl/graph.hxx> #include <vcl/graph.hxx>
#include <vcl/window.hxx> #include <vcl/window.hxx>
#include <vcl/svapp.hxx> #include <vcl/svapp.hxx>
...@@ -177,6 +178,59 @@ SvxNumberFormat::SvxNumberFormat(const SvxNumberFormat& rFormat) : ...@@ -177,6 +178,59 @@ SvxNumberFormat::SvxNumberFormat(const SvxNumberFormat& rFormat) :
*this = 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() SvxNumberFormat::~SvxNumberFormat()
{ {
delete pGraphicBrush; delete pGraphicBrush;
...@@ -253,6 +307,11 @@ SvStream& SvxNumberFormat::Store(SvStream &rStream, FontToSubsFontConverter pC ...@@ -253,6 +307,11 @@ SvStream& SvxNumberFormat::Store(SvStream &rStream, FontToSubsFontConverter pC
return rStream; return rStream;
} }
SvxNumberFormat* SvxNumberFormat::Create( SvStream &rStream )
{
return new SvxNumberFormat( rStream );
}
SvxNumberFormat& SvxNumberFormat::operator=( const SvxNumberFormat& rFormat ) SvxNumberFormat& SvxNumberFormat::operator=( const SvxNumberFormat& rFormat )
{ {
if (& rFormat == this) { return *this; } if (& rFormat == this) { return *this; }
...@@ -621,7 +680,41 @@ SvxNumRule::SvxNumRule(const SvxNumRule& rCopy) ...@@ -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<<(sal_uInt16)NUMITEM_VERSION_03;
rStream<<nLevelCount; rStream<<nLevelCount;
...@@ -631,7 +724,7 @@ SvStream& SvxNumRule::Store(SvStream &rStream) ...@@ -631,7 +724,7 @@ SvStream& SvxNumRule::Store(SvStream &rStream)
rStream<<(sal_uInt16)eNumberingType; rStream<<(sal_uInt16)eNumberingType;
FontToSubsFontConverter pConverter = 0; FontToSubsFontConverter pConverter = 0;
sal_Bool bConvertBulletFont = rStream.GetVersion() <= SOFFICE_FILEFORMAT_50; sal_Bool bConvertBulletFont = ( rStream.GetVersion() <= SOFFICE_FILEFORMAT_50 ) && ( rStream.GetVersion() );
for(sal_uInt16 i = 0; i < SVX_MAX_NUM; i++) for(sal_uInt16 i = 0; i < SVX_MAX_NUM; i++)
{ {
if(aFmts[i]) if(aFmts[i])
...@@ -656,7 +749,6 @@ SvStream& SvxNumRule::Store(SvStream &rStream) ...@@ -656,7 +749,6 @@ SvStream& SvxNumRule::Store(SvStream &rStream)
return rStream; return rStream;
} }
SvxNumRule::~SvxNumRule() SvxNumRule::~SvxNumRule()
{ {
for(sal_uInt16 i = 0; i < SVX_MAX_NUM; i++) for(sal_uInt16 i = 0; i < SVX_MAX_NUM; i++)
...@@ -843,9 +935,10 @@ SvxNumBulletItem::SvxNumBulletItem(SvxNumRule& rRule, sal_uInt16 _nWhich ) : ...@@ -843,9 +935,10 @@ SvxNumBulletItem::SvxNumBulletItem(SvxNumRule& rRule, sal_uInt16 _nWhich ) :
{ {
} }
SfxPoolItem* SvxNumBulletItem::Create(SvStream &s, sal_uInt16 n) const SfxPoolItem* SvxNumBulletItem::Create(SvStream &rStream, sal_uInt16 /*nItemVersion*/ ) const
{ {
return SfxPoolItem::Create(s, n ); SvxNumRule aNumRule( rStream );
return new SvxNumBulletItem( aNumRule, EE_PARA_NUMBULLET );
} }
SvxNumBulletItem::SvxNumBulletItem(const SvxNumBulletItem& rCopy) : SvxNumBulletItem::SvxNumBulletItem(const SvxNumBulletItem& rCopy) :
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment