Kaydet (Commit) ccea3b67 authored tarafından Noel Grandin's avatar Noel Grandin

the valid flags in SvxBulletItem are unused

Change-Id: Ifd06179e42edc916002e8b0feaabd888852f1aa6
üst 87174021
...@@ -105,7 +105,6 @@ SvxBulletItem::SvxBulletItem( sal_uInt16 _nWhich ) : SfxPoolItem( _nWhich ) ...@@ -105,7 +105,6 @@ SvxBulletItem::SvxBulletItem( sal_uInt16 _nWhich ) : SfxPoolItem( _nWhich )
{ {
SetDefaultFont_Impl(); SetDefaultFont_Impl();
SetDefaults_Impl(); SetDefaults_Impl();
nValidMask = 0xFFFF;
} }
SvxBulletItem::SvxBulletItem( SvStream& rStrm, sal_uInt16 _nWhich ) SvxBulletItem::SvxBulletItem( SvStream& rStrm, sal_uInt16 _nWhich )
...@@ -163,8 +162,6 @@ SvxBulletItem::SvxBulletItem( SvStream& rStrm, sal_uInt16 _nWhich ) ...@@ -163,8 +162,6 @@ SvxBulletItem::SvxBulletItem( SvStream& rStrm, sal_uInt16 _nWhich )
// UNICODE: rStrm >> aFollowText; // UNICODE: rStrm >> aFollowText;
aFollowText = rStrm.ReadUniOrByteString(rStrm.GetStreamCharSet()); aFollowText = rStrm.ReadUniOrByteString(rStrm.GetStreamCharSet());
nValidMask = 0xFFFF;
} }
SvxBulletItem::SvxBulletItem( const SvxBulletItem& rItem) : SfxPoolItem( rItem ) SvxBulletItem::SvxBulletItem( const SvxBulletItem& rItem) : SfxPoolItem( rItem )
...@@ -178,7 +175,6 @@ SvxBulletItem::SvxBulletItem( const SvxBulletItem& rItem) : SfxPoolItem( rItem ) ...@@ -178,7 +175,6 @@ SvxBulletItem::SvxBulletItem( const SvxBulletItem& rItem) : SfxPoolItem( rItem )
nWidth = rItem.nWidth; nWidth = rItem.nWidth;
nScale = rItem.nScale; nScale = rItem.nScale;
cSymbol = rItem.cSymbol; cSymbol = rItem.cSymbol;
nValidMask = rItem.nValidMask;
} }
...@@ -237,29 +233,17 @@ void SvxBulletItem::CopyValidProperties( const SvxBulletItem& rCopyFrom ) ...@@ -237,29 +233,17 @@ void SvxBulletItem::CopyValidProperties( const SvxBulletItem& rCopyFrom )
{ {
vcl::Font _aFont = GetFont(); vcl::Font _aFont = GetFont();
vcl::Font aNewFont = rCopyFrom.GetFont(); vcl::Font aNewFont = rCopyFrom.GetFont();
if ( rCopyFrom.IsValid( VALID_FONTNAME ) ) _aFont.SetName( aNewFont.GetName() );
{ _aFont.SetFamily( aNewFont.GetFamily() );
_aFont.SetName( aNewFont.GetName() ); _aFont.SetStyleName( aNewFont.GetStyleName() );
_aFont.SetFamily( aNewFont.GetFamily() ); _aFont.SetColor( aNewFont.GetColor() );
_aFont.SetStyleName( aNewFont.GetStyleName() ); SetSymbol( rCopyFrom.GetSymbol() );
} SetGraphicObject( rCopyFrom.GetGraphicObject() );
if ( rCopyFrom.IsValid( VALID_FONTCOLOR ) ) SetScale( rCopyFrom.GetScale() );
_aFont.SetColor( aNewFont.GetColor() ); SetStart( rCopyFrom.GetStart() );
if ( rCopyFrom.IsValid( VALID_SYMBOL ) ) SetStyle( rCopyFrom.GetStyle() );
SetSymbol( rCopyFrom.GetSymbol() ); SetPrevText( rCopyFrom.GetPrevText() );
if ( rCopyFrom.IsValid( VALID_BITMAP ) ) SetFollowText( rCopyFrom.GetFollowText() );
SetGraphicObject( rCopyFrom.GetGraphicObject() );
if ( rCopyFrom.IsValid( VALID_SCALE ) )
SetScale( rCopyFrom.GetScale() );
if ( rCopyFrom.IsValid( VALID_START ) )
SetStart( rCopyFrom.GetStart() );
if ( rCopyFrom.IsValid( VALID_STYLE ) )
SetStyle( rCopyFrom.GetStyle() );
if ( rCopyFrom.IsValid( VALID_PREVTEXT ) )
SetPrevText( rCopyFrom.GetPrevText() );
if ( rCopyFrom.IsValid( VALID_FOLLOWTEXT ) )
SetFollowText( rCopyFrom.GetFollowText() );
SetFont( _aFont ); SetFont( _aFont );
} }
...@@ -272,8 +256,7 @@ bool SvxBulletItem::operator==( const SfxPoolItem& rItem ) const ...@@ -272,8 +256,7 @@ bool SvxBulletItem::operator==( const SfxPoolItem& rItem ) const
const SvxBulletItem& rBullet = static_cast<const SvxBulletItem&>(rItem); const SvxBulletItem& rBullet = static_cast<const SvxBulletItem&>(rItem);
// Compare with ValidMask, otherwise no put possible in a AttrSet if the // Compare with ValidMask, otherwise no put possible in a AttrSet if the
// item differs only in terms of the ValidMask from an existing one. // item differs only in terms of the ValidMask from an existing one.
if( nValidMask != rBullet.nValidMask || if( nStyle != rBullet.nStyle ||
nStyle != rBullet.nStyle ||
nScale != rBullet.nScale || nScale != rBullet.nScale ||
nWidth != rBullet.nWidth || nWidth != rBullet.nWidth ||
nStart != rBullet.nStart || nStart != rBullet.nStart ||
......
...@@ -20,10 +20,10 @@ ...@@ -20,10 +20,10 @@
#define INCLUDED_EDITENG_BULLETITEM_HXX #define INCLUDED_EDITENG_BULLETITEM_HXX
#include <editeng/editengdllapi.h> #include <editeng/editengdllapi.h>
#include <o3tl/typed_flags_set.hxx> #include <svl/poolitem.hxx>
#include <svtools/grfmgr.hxx>
#include <vcl/font.hxx>
// define ----------------------------------------------------------------
// Styles // Styles
enum class SvxBulletStyle enum class SvxBulletStyle
...@@ -38,21 +38,6 @@ enum class SvxBulletStyle ...@@ -38,21 +38,6 @@ enum class SvxBulletStyle
BMP = 128 BMP = 128
}; };
// Valid-Bits
// First, only the values that are changed by the dialogue ...
#define VALID_FONTCOLOR 0x0001
#define VALID_FONTNAME 0x0002
#define VALID_SYMBOL 0x0004
#define VALID_BITMAP 0x0008
#define VALID_SCALE 0x0010
#define VALID_START 0x0020
#define VALID_STYLE 0x0040
#define VALID_PREVTEXT 0x0080
#define VALID_FOLLOWTEXT 0x0100
#include <svl/poolitem.hxx>
#include <vcl/font.hxx>
#include <svtools/grfmgr.hxx>
// class SvxBulletItem --------------------------------------------------- // class SvxBulletItem ---------------------------------------------------
class EDITENG_DLLPUBLIC SvxBulletItem : public SfxPoolItem class EDITENG_DLLPUBLIC SvxBulletItem : public SfxPoolItem
...@@ -66,8 +51,6 @@ class EDITENG_DLLPUBLIC SvxBulletItem : public SfxPoolItem ...@@ -66,8 +51,6 @@ class EDITENG_DLLPUBLIC SvxBulletItem : public SfxPoolItem
long nWidth; long nWidth;
sal_uInt16 nScale; sal_uInt16 nScale;
sal_Unicode cSymbol; sal_Unicode cSymbol;
sal_uInt16 nValidMask; // Only temporary for GetAttribs / setAttribs,
// because of the large Bullets
void SetDefaultFont_Impl(); void SetDefaultFont_Impl();
void SetDefaults_Impl(); void SetDefaults_Impl();
...@@ -108,9 +91,9 @@ public: ...@@ -108,9 +91,9 @@ public:
void SetFont( const vcl::Font& rNew) { aFont = rNew; } void SetFont( const vcl::Font& rNew) { aFont = rNew; }
void SetScale( sal_uInt16 nNew ) { nScale = nNew; } void SetScale( sal_uInt16 nNew ) { nScale = nNew; }
virtual sal_uInt16 GetVersion(sal_uInt16 nFileVersion) const SAL_OVERRIDE; virtual sal_uInt16 GetVersion(sal_uInt16 nFileVersion) const SAL_OVERRIDE;
virtual bool operator==( const SfxPoolItem& ) const SAL_OVERRIDE; virtual bool operator==( const SfxPoolItem& ) const SAL_OVERRIDE;
virtual bool GetPresentation( SfxItemPresentation ePres, virtual bool GetPresentation( SfxItemPresentation ePres,
SfxMapUnit eCoreMetric, SfxMapUnit eCoreMetric,
SfxMapUnit ePresMetric, SfxMapUnit ePresMetric,
OUString &rText, const IntlWrapper * = 0 ) const SAL_OVERRIDE; OUString &rText, const IntlWrapper * = 0 ) const SAL_OVERRIDE;
...@@ -118,16 +101,6 @@ public: ...@@ -118,16 +101,6 @@ public:
static void StoreFont( SvStream&, const vcl::Font& ); static void StoreFont( SvStream&, const vcl::Font& );
static vcl::Font CreateFont( SvStream&, sal_uInt16 nVer ); static vcl::Font CreateFont( SvStream&, sal_uInt16 nVer );
sal_uInt16& GetValidMask() { return nValidMask; }
sal_uInt16 GetValidMask() const { return nValidMask; }
sal_uInt16 IsValid( sal_uInt16 nFlag ) const { return nValidMask & nFlag; }
void SetValid( sal_uInt16 nFlag, bool bValid )
{
if ( bValid )
nValidMask |= nFlag;
else
nValidMask &= ~nFlag;
}
void CopyValidProperties( const SvxBulletItem& rCopyFrom ); void CopyValidProperties( const SvxBulletItem& rCopyFrom );
}; };
......
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