summaryrefslogtreecommitdiff
path: root/editeng
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2013-04-19 11:15:52 +0200
committerStephan Bergmann <sbergman@redhat.com>2013-04-19 11:46:31 +0200
commit98d594abd42c5aa33d6981f4dd19582c2d345705 (patch)
tree600cee7d76ca1dd85206d4894cd45d1171d949a7 /editeng
parent26d092b3635680248f8b176564409e6c0c24bfbf (diff)
Revert "fix fdo#47018 Impress paste destroy bullet"
This reverts commit a95cce27295f9cd255fa72eaded00972e3efb69b, it lead to live- lock in JunitTest_sc_unoapi, where SvxBoxItem::Create (editeng/source/items/frmitems.cxx) failed to break out of the while(true) loop, apparently because it kept reading past the end of rStrm, so cLine wouldn't be updated. (That code would need to be made more robust, but I do not know how best to flag errors from SvxBoxItem::Create?) What looks suspicious about the changes of a95cce27295f9cd255fa72eaded00972e3efb69b at least to editeng/source/items/frmitems.cxx is that it changes the stream's format, now reading/writing a 16 bit value where it previously read/wrote an 8 bit value (SvStream /does/ support sal_Int8, btw). Change-Id: I1a46746559dcf8e1ea8be63a9a0cf2d32ccc69a1
Diffstat (limited to 'editeng')
-rw-r--r--editeng/inc/editeng/numitem.hxx9
-rw-r--r--editeng/source/items/frmitems.cxx5
-rw-r--r--editeng/source/items/numitem.cxx103
3 files changed, 10 insertions, 107 deletions
diff --git a/editeng/inc/editeng/numitem.hxx b/editeng/inc/editeng/numitem.hxx
index f17e9cf56026..86f4aef59503 100644
--- a/editeng/inc/editeng/numitem.hxx
+++ b/editeng/inc/editeng/numitem.hxx
@@ -157,12 +157,10 @@ public:
explicit SvxNumberFormat( sal_Int16 nNumberingType,
SvxNumPositionAndSpaceMode ePositionAndSpaceMode = LABEL_WIDTH_AND_POSITION );
SvxNumberFormat(const SvxNumberFormat& rFormat);
- SvxNumberFormat( SvStream & rStream );
virtual ~SvxNumberFormat();
SvStream& Store(SvStream &rStream, FontToSubsFontConverter pConverter);
- SvxNumberFormat* Create(SvStream& rStream );
SvxNumberFormat& operator=( const SvxNumberFormat& );
sal_Bool operator==( const SvxNumberFormat& ) const;
@@ -254,7 +252,6 @@ public:
eDefaultNumberFormatPositionAndSpaceMode
= SvxNumberFormat::LABEL_WIDTH_AND_POSITION );
SvxNumRule(const SvxNumRule& rCopy);
- SvxNumRule(SvStream &rStream);
virtual ~SvxNumRule();
int operator==( const SvxNumRule& ) const;
@@ -263,7 +260,7 @@ public:
SvxNumRule& operator=( const SvxNumRule& );
SvStream& Store(SvStream &rStream);
- SvxNumRule* Create(SvStream &rStream);
+
const SvxNumberFormat* Get(sal_uInt16 nLevel)const;
const SvxNumberFormat& GetLevel(sal_uInt16 nLevel)const;
void SetLevel(sal_uInt16 nLevel, const SvxNumberFormat& rFmt, sal_Bool bIsValid = sal_True);
@@ -297,9 +294,9 @@ public:
virtual ~SvxNumBulletItem();
virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
- virtual SfxPoolItem* Create(SvStream &rStream, sal_uInt16 nItemVersion) const;
+ virtual SfxPoolItem* Create(SvStream &, sal_uInt16) const;
sal_uInt16 GetVersion( sal_uInt16 nFileVersion ) const;
- virtual SvStream& Store(SvStream &rStream, sal_uInt16 nItemVersion ) const;
+ virtual SvStream& Store(SvStream &, sal_uInt16 nItemVersion ) const;
virtual int operator==( const SfxPoolItem& ) const;
SvxNumRule* GetNumRule() const {return pNumRule;}
diff --git a/editeng/source/items/frmitems.cxx b/editeng/source/items/frmitems.cxx
index b8ec78affb55..8741e69778de 100644
--- a/editeng/source/items/frmitems.cxx
+++ b/editeng/source/items/frmitems.cxx
@@ -3475,7 +3475,7 @@ SvxBrushItem::SvxBrushItem( SvStream& rStream, sal_uInt16 nVersion,
if ( nVersion >= BRUSH_GRAPHIC_VERSION )
{
sal_uInt16 nDoLoad = 0;
- sal_uInt16 nPos;
+ sal_Int8 nPos;
rStream >> nDoLoad;
@@ -3892,8 +3892,7 @@ SvStream& SvxBrushItem::Store( SvStream& rStream , sal_uInt16 /*nItemVersion*/ )
// UNICODE: rStream << *pStrFilter;
rStream.WriteUniOrByteString(*pStrFilter, rStream.GetStreamCharSet());
}
- // SvStream doesn't support sal_Int8
- rStream << (sal_uInt16)eGraphicPos;
+ rStream << (sal_Int8)eGraphicPos;
return rStream;
}
diff --git a/editeng/source/items/numitem.cxx b/editeng/source/items/numitem.cxx
index 7ef42e01cfac..7c3ec9c89f09 100644
--- a/editeng/source/items/numitem.cxx
+++ b/editeng/source/items/numitem.cxx
@@ -28,7 +28,6 @@
#include <editeng/editids.hrc>
#include <editeng/editrids.hrc>
#include <editeng/numdef.hxx>
-#include <editeng/eeitem.hxx>
#include <vcl/graph.hxx>
#include <vcl/window.hxx>
#include <vcl/svapp.hxx>
@@ -178,59 +177,6 @@ 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;
@@ -307,11 +253,6 @@ 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; }
@@ -680,41 +621,7 @@ SvxNumRule::SvxNumRule(const SvxNumRule& rCopy)
}
}
-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 )
+SvStream& SvxNumRule::Store(SvStream &rStream)
{
rStream<<(sal_uInt16)NUMITEM_VERSION_03;
rStream<<nLevelCount;
@@ -724,7 +631,7 @@ SvStream& SvxNumRule::Store( SvStream &rStream )
rStream<<(sal_uInt16)eNumberingType;
FontToSubsFontConverter pConverter = 0;
- sal_Bool bConvertBulletFont = ( rStream.GetVersion() <= SOFFICE_FILEFORMAT_50 ) && ( rStream.GetVersion() );
+ sal_Bool bConvertBulletFont = rStream.GetVersion() <= SOFFICE_FILEFORMAT_50;
for(sal_uInt16 i = 0; i < SVX_MAX_NUM; i++)
{
if(aFmts[i])
@@ -749,6 +656,7 @@ SvStream& SvxNumRule::Store( SvStream &rStream )
return rStream;
}
+
SvxNumRule::~SvxNumRule()
{
for(sal_uInt16 i = 0; i < SVX_MAX_NUM; i++)
@@ -935,10 +843,9 @@ SvxNumBulletItem::SvxNumBulletItem(SvxNumRule& rRule, sal_uInt16 _nWhich ) :
{
}
-SfxPoolItem* SvxNumBulletItem::Create(SvStream &rStream, sal_uInt16 /*nItemVersion*/ ) const
+SfxPoolItem* SvxNumBulletItem::Create(SvStream &s, sal_uInt16 n) const
{
- SvxNumRule aNumRule( rStream );
- return new SvxNumBulletItem( aNumRule, EE_PARA_NUMBULLET );
+ return SfxPoolItem::Create(s, n );
}
SvxNumBulletItem::SvxNumBulletItem(const SvxNumBulletItem& rCopy) :