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.SetName( aNewFont.GetName() );
_aFont.SetFamily( aNewFont.GetFamily() ); _aFont.SetFamily( aNewFont.GetFamily() );
_aFont.SetStyleName( aNewFont.GetStyleName() ); _aFont.SetStyleName( aNewFont.GetStyleName() );
}
if ( rCopyFrom.IsValid( VALID_FONTCOLOR ) )
_aFont.SetColor( aNewFont.GetColor() ); _aFont.SetColor( aNewFont.GetColor() );
if ( rCopyFrom.IsValid( VALID_SYMBOL ) )
SetSymbol( rCopyFrom.GetSymbol() ); SetSymbol( rCopyFrom.GetSymbol() );
if ( rCopyFrom.IsValid( VALID_BITMAP ) )
SetGraphicObject( rCopyFrom.GetGraphicObject() ); SetGraphicObject( rCopyFrom.GetGraphicObject() );
if ( rCopyFrom.IsValid( VALID_SCALE ) )
SetScale( rCopyFrom.GetScale() ); SetScale( rCopyFrom.GetScale() );
if ( rCopyFrom.IsValid( VALID_START ) )
SetStart( rCopyFrom.GetStart() ); SetStart( rCopyFrom.GetStart() );
if ( rCopyFrom.IsValid( VALID_STYLE ) )
SetStyle( rCopyFrom.GetStyle() ); SetStyle( rCopyFrom.GetStyle() );
if ( rCopyFrom.IsValid( VALID_PREVTEXT ) )
SetPrevText( rCopyFrom.GetPrevText() ); SetPrevText( rCopyFrom.GetPrevText() );
if ( rCopyFrom.IsValid( VALID_FOLLOWTEXT ) )
SetFollowText( rCopyFrom.GetFollowText() ); 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();
...@@ -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