[Libreoffice-commits] core.git: 5 commits - cui/source editeng/source filter/source include/editeng sc/source sd/source svx/source sw/source
Noel Grandin
noel at peralex.com
Thu Mar 26 00:42:11 PDT 2015
cui/source/tabpages/numpages.cxx | 34 ++++++++---------
editeng/source/editeng/eerdll.cxx | 2 -
editeng/source/items/bulitem.cxx | 74 ++++++++++++++-----------------------
editeng/source/items/numitem.cxx | 16 ++++----
editeng/source/uno/unonrule.cxx | 4 +-
filter/source/msfilter/svdfppt.cxx | 14 +++----
include/editeng/bulletitem.hxx | 72 +++++++++---------------------------
include/editeng/numitem.hxx | 55 ++++++++++++++++-----------
sc/source/ui/unoobj/styleuno.cxx | 2 -
sd/source/core/drawdoc4.cxx | 6 +--
sd/source/core/stlpool.cxx | 5 +-
sd/source/ui/dlg/dlgolbul.cxx | 4 +-
sd/source/ui/func/fuolbull.cxx | 2 -
sd/source/ui/view/viewshel.cxx | 2 -
svx/source/sidebar/nbdtmg.cxx | 12 ++++--
svx/source/unodraw/unomod.cxx | 2 -
sw/source/core/doc/number.cxx | 11 ++---
sw/source/uibase/shells/txtnum.cxx | 4 +-
18 files changed, 140 insertions(+), 181 deletions(-)
New commits:
commit ccea3b6721da2dbf7a319c6e3e24428429cdf3ba
Author: Noel Grandin <noel at peralex.com>
Date: Thu Mar 26 09:38:35 2015 +0200
the valid flags in SvxBulletItem are unused
Change-Id: Ifd06179e42edc916002e8b0feaabd888852f1aa6
diff --git a/editeng/source/items/bulitem.cxx b/editeng/source/items/bulitem.cxx
index a7bd2e2..1a5738d 100644
--- a/editeng/source/items/bulitem.cxx
+++ b/editeng/source/items/bulitem.cxx
@@ -105,7 +105,6 @@ SvxBulletItem::SvxBulletItem( sal_uInt16 _nWhich ) : SfxPoolItem( _nWhich )
{
SetDefaultFont_Impl();
SetDefaults_Impl();
- nValidMask = 0xFFFF;
}
SvxBulletItem::SvxBulletItem( SvStream& rStrm, sal_uInt16 _nWhich )
@@ -163,8 +162,6 @@ SvxBulletItem::SvxBulletItem( SvStream& rStrm, sal_uInt16 _nWhich )
// UNICODE: rStrm >> aFollowText;
aFollowText = rStrm.ReadUniOrByteString(rStrm.GetStreamCharSet());
-
- nValidMask = 0xFFFF;
}
SvxBulletItem::SvxBulletItem( const SvxBulletItem& rItem) : SfxPoolItem( rItem )
@@ -178,7 +175,6 @@ SvxBulletItem::SvxBulletItem( const SvxBulletItem& rItem) : SfxPoolItem( rItem )
nWidth = rItem.nWidth;
nScale = rItem.nScale;
cSymbol = rItem.cSymbol;
- nValidMask = rItem.nValidMask;
}
@@ -237,29 +233,17 @@ void SvxBulletItem::CopyValidProperties( const SvxBulletItem& rCopyFrom )
{
vcl::Font _aFont = GetFont();
vcl::Font aNewFont = rCopyFrom.GetFont();
- if ( rCopyFrom.IsValid( VALID_FONTNAME ) )
- {
- _aFont.SetName( aNewFont.GetName() );
- _aFont.SetFamily( aNewFont.GetFamily() );
- _aFont.SetStyleName( aNewFont.GetStyleName() );
- }
- if ( rCopyFrom.IsValid( VALID_FONTCOLOR ) )
- _aFont.SetColor( aNewFont.GetColor() );
- if ( rCopyFrom.IsValid( VALID_SYMBOL ) )
- SetSymbol( rCopyFrom.GetSymbol() );
- if ( rCopyFrom.IsValid( VALID_BITMAP ) )
- 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() );
-
+ _aFont.SetName( aNewFont.GetName() );
+ _aFont.SetFamily( aNewFont.GetFamily() );
+ _aFont.SetStyleName( aNewFont.GetStyleName() );
+ _aFont.SetColor( aNewFont.GetColor() );
+ SetSymbol( rCopyFrom.GetSymbol() );
+ SetGraphicObject( rCopyFrom.GetGraphicObject() );
+ SetScale( rCopyFrom.GetScale() );
+ SetStart( rCopyFrom.GetStart() );
+ SetStyle( rCopyFrom.GetStyle() );
+ SetPrevText( rCopyFrom.GetPrevText() );
+ SetFollowText( rCopyFrom.GetFollowText() );
SetFont( _aFont );
}
@@ -272,8 +256,7 @@ bool SvxBulletItem::operator==( const SfxPoolItem& rItem ) const
const SvxBulletItem& rBullet = static_cast<const SvxBulletItem&>(rItem);
// Compare with ValidMask, otherwise no put possible in a AttrSet if the
// item differs only in terms of the ValidMask from an existing one.
- if( nValidMask != rBullet.nValidMask ||
- nStyle != rBullet.nStyle ||
+ if( nStyle != rBullet.nStyle ||
nScale != rBullet.nScale ||
nWidth != rBullet.nWidth ||
nStart != rBullet.nStart ||
diff --git a/include/editeng/bulletitem.hxx b/include/editeng/bulletitem.hxx
index a9a1f68..68c5b69 100644
--- a/include/editeng/bulletitem.hxx
+++ b/include/editeng/bulletitem.hxx
@@ -20,10 +20,10 @@
#define INCLUDED_EDITENG_BULLETITEM_HXX
#include <editeng/editengdllapi.h>
-#include <o3tl/typed_flags_set.hxx>
-
+#include <svl/poolitem.hxx>
+#include <svtools/grfmgr.hxx>
+#include <vcl/font.hxx>
-// define ----------------------------------------------------------------
// Styles
enum class SvxBulletStyle
@@ -38,21 +38,6 @@ enum class SvxBulletStyle
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 EDITENG_DLLPUBLIC SvxBulletItem : public SfxPoolItem
@@ -66,8 +51,6 @@ class EDITENG_DLLPUBLIC SvxBulletItem : public SfxPoolItem
long nWidth;
sal_uInt16 nScale;
sal_Unicode cSymbol;
- sal_uInt16 nValidMask; // Only temporary for GetAttribs / setAttribs,
- // because of the large Bullets
void SetDefaultFont_Impl();
void SetDefaults_Impl();
@@ -108,9 +91,9 @@ public:
void SetFont( const vcl::Font& rNew) { aFont = rNew; }
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 GetPresentation( SfxItemPresentation ePres,
+ virtual bool GetPresentation( SfxItemPresentation ePres,
SfxMapUnit eCoreMetric,
SfxMapUnit ePresMetric,
OUString &rText, const IntlWrapper * = 0 ) const SAL_OVERRIDE;
@@ -118,16 +101,6 @@ public:
static void StoreFont( SvStream&, const vcl::Font& );
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 );
};
commit 871740210e5608e619b37297b47362f534f7ed8d
Author: Noel Grandin <noel at peralex.com>
Date: Thu Mar 26 08:59:20 2015 +0200
bullet justification in SvxBulletItem is unused
Change-Id: Ib303c89f84a95eed96cfccfc947c2b4d6919ab95
diff --git a/editeng/source/items/bulitem.cxx b/editeng/source/items/bulitem.cxx
index 592c878..a7bd2e2 100644
--- a/editeng/source/items/bulitem.cxx
+++ b/editeng/source/items/bulitem.cxx
@@ -114,7 +114,6 @@ SvxBulletItem::SvxBulletItem( SvStream& rStrm, sal_uInt16 _nWhich )
, nStart(0)
, nStyle(SvxBulletStyle::ABC_BIG)
, nScale(0)
- , nJustify(0)
{
sal_uInt16 nTmp1;
rStrm.ReadUInt16( nTmp1 );
@@ -149,7 +148,8 @@ SvxBulletItem::SvxBulletItem( SvStream& rStrm, sal_uInt16 _nWhich )
sal_Int32 nTmp(0);
rStrm.ReadInt32( nTmp ); nWidth = nTmp;
rStrm.ReadUInt16( nStart );
- rStrm.ReadUChar( nJustify );
+ sal_uInt8 nTmpInt8(0);
+ rStrm.ReadUChar( nTmpInt8 ); // used to be nJustify
char cTmpSymbol(0);
rStrm.ReadChar( cTmpSymbol );
@@ -178,7 +178,6 @@ SvxBulletItem::SvxBulletItem( const SvxBulletItem& rItem) : SfxPoolItem( rItem )
nWidth = rItem.nWidth;
nScale = rItem.nScale;
cSymbol = rItem.cSymbol;
- nJustify = rItem.nJustify;
nValidMask = rItem.nValidMask;
}
@@ -221,7 +220,6 @@ void SvxBulletItem::SetDefaults_Impl()
nWidth = 1200; // 1.2cm
nStart = 1;
nStyle = SvxBulletStyle::N123;
- nJustify = BJ_HLEFT | BJ_VCENTER;
cSymbol = ' ';
nScale = 75;
}
@@ -277,7 +275,6 @@ bool SvxBulletItem::operator==( const SfxPoolItem& rItem ) const
if( nValidMask != rBullet.nValidMask ||
nStyle != rBullet.nStyle ||
nScale != rBullet.nScale ||
- nJustify != rBullet.nJustify ||
nWidth != rBullet.nWidth ||
nStart != rBullet.nStart ||
cSymbol != rBullet.cSymbol ||
@@ -353,7 +350,7 @@ SvStream& SvxBulletItem::Store( SvStream& rStrm, sal_uInt16 /*nItemVersion*/ ) c
}
rStrm.WriteInt32( nWidth );
rStrm.WriteUInt16( nStart );
- rStrm.WriteUChar( nJustify );
+ rStrm.WriteUChar( 0 ); // used to be nJustify
rStrm.WriteChar( OUStringToOString(OUString(cSymbol), aFont.GetCharSet()).toChar() );
rStrm.WriteUInt16( nScale );
diff --git a/include/editeng/bulletitem.hxx b/include/editeng/bulletitem.hxx
index f3ae1be..a9a1f68 100644
--- a/include/editeng/bulletitem.hxx
+++ b/include/editeng/bulletitem.hxx
@@ -20,6 +20,7 @@
#define INCLUDED_EDITENG_BULLETITEM_HXX
#include <editeng/editengdllapi.h>
+#include <o3tl/typed_flags_set.hxx>
// define ----------------------------------------------------------------
@@ -37,14 +38,6 @@ enum class SvxBulletStyle
BMP = 128
};
-// Justification
-#define BJ_HLEFT 0x01
-#define BJ_HRIGHT 0x02
-#define BJ_HCENTER 0x04
-#define BJ_VTOP 0x08
-#define BJ_VBOTTOM 0x10
-#define BJ_VCENTER 0x20
-
// Valid-Bits
// First, only the values that are changed by the dialogue ...
#define VALID_FONTCOLOR 0x0001
@@ -73,7 +66,6 @@ class EDITENG_DLLPUBLIC SvxBulletItem : public SfxPoolItem
long nWidth;
sal_uInt16 nScale;
sal_Unicode cSymbol;
- sal_uInt8 nJustify;
sal_uInt16 nValidMask; // Only temporary for GetAttribs / setAttribs,
// because of the large Bullets
@@ -100,7 +92,6 @@ public:
sal_uInt16 GetStart() const { return nStart; }
long GetWidth() const { return nWidth; }
SvxBulletStyle GetStyle() const { return nStyle; }
- sal_uInt8 GetJustification() const { return nJustify; }
vcl::Font GetFont() const { return aFont; }
sal_uInt16 GetScale() const { return nScale; }
@@ -114,7 +105,6 @@ public:
void SetStart( sal_uInt16 nNew ) { nStart = nNew; }
void SetWidth( long nNew ) { nWidth = nNew; }
void SetStyle( SvxBulletStyle nNew ) { nStyle = nNew; }
- void SetJustification( sal_uInt8 nNew ) { nJustify = nNew; }
void SetFont( const vcl::Font& rNew) { aFont = rNew; }
void SetScale( sal_uInt16 nNew ) { nScale = nNew; }
commit ce46c98dbeb3364684843daa5b269c74fce2af64
Author: Noel Grandin <noel at peralex.com>
Date: Wed Mar 25 15:58:38 2015 +0200
convert BS_ constants to SvxBulletStyle enum class
Change-Id: I8d68394c29b7602b21f8d972552aa7226778d3ff
diff --git a/editeng/source/items/bulitem.cxx b/editeng/source/items/bulitem.cxx
index 0936d98..592c878 100644
--- a/editeng/source/items/bulitem.cxx
+++ b/editeng/source/items/bulitem.cxx
@@ -112,13 +112,15 @@ SvxBulletItem::SvxBulletItem( SvStream& rStrm, sal_uInt16 _nWhich )
: SfxPoolItem(_nWhich)
, pGraphicObject(NULL)
, nStart(0)
- , nStyle(0)
+ , nStyle(SvxBulletStyle::ABC_BIG)
, nScale(0)
, nJustify(0)
{
- rStrm.ReadUInt16( nStyle );
+ sal_uInt16 nTmp1;
+ rStrm.ReadUInt16( nTmp1 );
+ nStyle = static_cast<SvxBulletStyle>(nTmp1);
- if( nStyle != BS_BMP )
+ if( nStyle != SvxBulletStyle::BMP )
aFont = CreateFont( rStrm, BULITEM_VERSION );
else
{
@@ -138,7 +140,7 @@ SvxBulletItem::SvxBulletItem( SvStream& rStrm, sal_uInt16 _nWhich )
if( aBmp.IsEmpty() )
{
rStrm.Seek( nOldPos );
- nStyle = BS_NONE;
+ nStyle = SvxBulletStyle::NONE;
}
else
pGraphicObject = new GraphicObject( aBmp );
@@ -218,7 +220,7 @@ void SvxBulletItem::SetDefaults_Impl()
pGraphicObject = NULL;
nWidth = 1200; // 1.2cm
nStart = 1;
- nStyle = BS_123;
+ nStyle = SvxBulletStyle::N123;
nJustify = BJ_HLEFT | BJ_VCENTER;
cSymbol = ' ';
nScale = 75;
@@ -283,10 +285,10 @@ bool SvxBulletItem::operator==( const SfxPoolItem& rItem ) const
aFollowText != rBullet.aFollowText )
return false;
- if( ( nStyle != BS_BMP ) && ( aFont != rBullet.aFont ) )
+ if( ( nStyle != SvxBulletStyle::BMP ) && ( aFont != rBullet.aFont ) )
return false;
- if( nStyle == BS_BMP )
+ if( nStyle == SvxBulletStyle::BMP )
{
if( ( pGraphicObject && !rBullet.pGraphicObject ) || ( !pGraphicObject && rBullet.pGraphicObject ) )
return false;
@@ -307,7 +309,7 @@ bool SvxBulletItem::operator==( const SfxPoolItem& rItem ) const
SvStream& SvxBulletItem::Store( SvStream& rStrm, sal_uInt16 /*nItemVersion*/ ) const
{
// Correction for empty bitmap
- if( ( nStyle == BS_BMP ) &&
+ if( ( nStyle == SvxBulletStyle::BMP ) &&
( !pGraphicObject || ( GRAPHIC_NONE == pGraphicObject->GetType() ) || ( GRAPHIC_DEFAULT == pGraphicObject->GetType() ) ) )
{
if( pGraphicObject )
@@ -316,12 +318,12 @@ SvStream& SvxBulletItem::Store( SvStream& rStrm, sal_uInt16 /*nItemVersion*/ ) c
const_cast< SvxBulletItem* >( this )->pGraphicObject = NULL;
}
- const_cast< SvxBulletItem* >( this )->nStyle = BS_NONE;
+ const_cast< SvxBulletItem* >( this )->nStyle = SvxBulletStyle::NONE;
}
- rStrm.WriteUInt16( nStyle );
+ rStrm.WriteUInt16( static_cast<sal_uInt16>(nStyle) );
- if( nStyle != BS_BMP )
+ if( nStyle != SvxBulletStyle::BMP )
StoreFont( rStrm, aFont );
else
{
diff --git a/include/editeng/bulletitem.hxx b/include/editeng/bulletitem.hxx
index 5af465b..f3ae1be 100644
--- a/include/editeng/bulletitem.hxx
+++ b/include/editeng/bulletitem.hxx
@@ -25,14 +25,17 @@
// define ----------------------------------------------------------------
// Styles
-#define BS_ABC_BIG 0
-#define BS_ABC_SMALL 1
-#define BS_ROMAN_BIG 2
-#define BS_ROMAN_SMALL 3
-#define BS_123 4
-#define BS_NONE 5
-#define BS_BULLET 6
-#define BS_BMP 128
+enum class SvxBulletStyle
+{
+ ABC_BIG = 0,
+ ABC_SMALL = 1,
+ ROMAN_BIG = 2,
+ ROMAN_SMALL = 3,
+ N123 = 4,
+ NONE = 5,
+ BULLET = 6,
+ BMP = 128
+};
// Justification
#define BJ_HLEFT 0x01
@@ -66,7 +69,7 @@ class EDITENG_DLLPUBLIC SvxBulletItem : public SfxPoolItem
OUString aPrevText;
OUString aFollowText;
sal_uInt16 nStart;
- sal_uInt16 nStyle;
+ SvxBulletStyle nStyle;
long nWidth;
sal_uInt16 nScale;
sal_Unicode cSymbol;
@@ -96,7 +99,7 @@ public:
sal_uInt16 GetStart() const { return nStart; }
long GetWidth() const { return nWidth; }
- sal_uInt16 GetStyle() const { return nStyle; }
+ SvxBulletStyle GetStyle() const { return nStyle; }
sal_uInt8 GetJustification() const { return nJustify; }
vcl::Font GetFont() const { return aFont; }
sal_uInt16 GetScale() const { return nScale; }
@@ -110,7 +113,7 @@ public:
void SetStart( sal_uInt16 nNew ) { nStart = nNew; }
void SetWidth( long nNew ) { nWidth = nNew; }
- void SetStyle( sal_uInt16 nNew ) { nStyle = nNew; }
+ void SetStyle( SvxBulletStyle nNew ) { nStyle = nNew; }
void SetJustification( sal_uInt8 nNew ) { nJustify = nNew; }
void SetFont( const vcl::Font& rNew) { aFont = rNew; }
void SetScale( sal_uInt16 nNew ) { nScale = nNew; }
diff --git a/sd/source/core/drawdoc4.cxx b/sd/source/core/drawdoc4.cxx
index 881ccc0..8572e1e 100644
--- a/sd/source/core/drawdoc4.cxx
+++ b/sd/source/core/drawdoc4.cxx
@@ -238,7 +238,7 @@ void SdDrawDocument::CreateLayoutTemplates()
// BulletItem and BulletFont for title and outline
SvxBulletItem aBulletItem(EE_PARA_BULLET);
// Identical in all layers
- aBulletItem.SetStyle(BS_BULLET);
+ aBulletItem.SetStyle(SvxBulletStyle::BULLET);
aBulletItem.SetStart(1);
aBulletItem.SetScale(45); // In percent
@@ -1206,7 +1206,7 @@ void SdDrawDocument::SetTextDefaults() const
vcl::Font aBulletFont( SdStyleSheetPool::GetBulletFont() );
aBulletFont.SetSize(Size(0,846)); // 24 pt
aBulletItem.SetFont(aBulletFont);
- aBulletItem.SetStyle(BS_BULLET);
+ aBulletItem.SetStyle(SvxBulletStyle::BULLET);
aBulletItem.SetStart(1);
aBulletItem.SetScale(45); // In percent
aBulletItem.SetSymbol( 0x25CF ); // In points
commit 701343b1eea115e27a40ac93e59c0c1f0d2f6422
Author: Noel Grandin <noel at peralex.com>
Date: Wed Mar 25 15:05:00 2015 +0200
convert SvxNumRuleType to enum class
Change-Id: I4707b2f0325d2e39c11bb99ef687100eb55639e1
diff --git a/cui/source/tabpages/numpages.cxx b/cui/source/tabpages/numpages.cxx
index 4a39f89..531a4a7 100644
--- a/cui/source/tabpages/numpages.cxx
+++ b/cui/source/tabpages/numpages.cxx
@@ -3450,7 +3450,7 @@ IMPL_LINK_NOARG(SvxNumPositionTabPage, StandardHdl_Impl)
SvxNumRule aTmpNumRule( pActNum->GetFeatureFlags(),
pActNum->GetLevelCount(),
pActNum->IsContinuousNumbering(),
- SVX_RULETYPE_NUMBERING,
+ SvxNumRuleType::NUMBERING,
pActNum->GetLevel( 0 ).GetPositionAndSpaceMode() );
for(sal_uInt16 i = 0; i < pActNum->GetLevelCount(); i++)
{
diff --git a/editeng/source/items/numitem.cxx b/editeng/source/items/numitem.cxx
index 6d4fd8a..0e4e0f8 100644
--- a/editeng/source/items/numitem.cxx
+++ b/editeng/source/items/numitem.cxx
@@ -682,7 +682,7 @@ SvStream& SvxNumRule::Store( SvStream &rStream )
//first save of nFeatureFlags for old versions
rStream.WriteUInt16( static_cast<sal_uInt16>(nFeatureFlags) );
rStream.WriteUInt16( sal_uInt16(bContinuousNumbering) );
- rStream.WriteUInt16( eNumberingType );
+ rStream.WriteUInt16( static_cast<sal_uInt16>(eNumberingType) );
FontToSubsFontConverter pConverter = 0;
bool bConvertBulletFont = ( rStream.GetVersion() <= SOFFICE_FILEFORMAT_50 ) && ( rStream.GetVersion() );
@@ -782,7 +782,7 @@ const SvxNumberFormat& SvxNumRule::GetLevel(sal_uInt16 nLevel)const
DBG_ASSERT(nLevel < SVX_MAX_NUM, "Wrong Level" );
return ( ( nLevel < SVX_MAX_NUM ) && aFmts[nLevel] ) ?
- *aFmts[nLevel] : eNumberingType == SVX_RULETYPE_NUMBERING ?
+ *aFmts[nLevel] : eNumberingType == SvxNumRuleType::NUMBERING ?
*pStdNumFmt : *pStdOutlineNumFmt;
}
diff --git a/filter/source/msfilter/svdfppt.cxx b/filter/source/msfilter/svdfppt.cxx
index 2c52437..a016b85 100644
--- a/filter/source/msfilter/svdfppt.cxx
+++ b/filter/source/msfilter/svdfppt.cxx
@@ -4271,24 +4271,24 @@ PPTStyleSheet::PPTStyleSheet( const DffRecordHeader& rSlideHd, SvStream& rIn, Sd
case TSS_TYPE_PAGETITLE :
case TSS_TYPE_TITLE :
nLevels = 1;
- eNumRuleType = SVX_RULETYPE_NUMBERING;
+ eNumRuleType = SvxNumRuleType::NUMBERING;
break;
case TSS_TYPE_SUBTITLE :
nLevels = SVX_MAX_NUM;
- eNumRuleType = SVX_RULETYPE_NUMBERING;
+ eNumRuleType = SvxNumRuleType::NUMBERING;
break;
case TSS_TYPE_BODY :
case TSS_TYPE_HALFBODY :
case TSS_TYPE_QUARTERBODY :
nLevels = SVX_MAX_NUM;
- eNumRuleType = SVX_RULETYPE_PRESENTATION_NUMBERING;
+ eNumRuleType = SvxNumRuleType::PRESENTATION_NUMBERING;
break;
default :
case TSS_TYPE_NOTES :
case TSS_TYPE_UNUSED :
case TSS_TYPE_TEXT_IN_SHAPE :
nLevels = SVX_MAX_NUM;
- eNumRuleType = SVX_RULETYPE_NUMBERING;
+ eNumRuleType = SvxNumRuleType::NUMBERING;
break;
}
SvxNumRule aRule( SvxNumRuleFlags::BULLET_REL_SIZE | SvxNumRuleFlags::BULLET_COLOR |
@@ -4306,7 +4306,7 @@ PPTStyleSheet::PPTStyleSheet( const DffRecordHeader& rSlideHd, SvStream& rIn, Sd
{
for ( ;nDepth < nLevels; nDepth++ )
aRule.SetLevel( nDepth, aNumberFormat );
- if ( eNumRuleType == SVX_RULETYPE_PRESENTATION_NUMBERING )
+ if ( eNumRuleType == SvxNumRuleType::PRESENTATION_NUMBERING )
aRule.SetLevel( 0, aNumberFormat );
}
}
diff --git a/include/editeng/numitem.hxx b/include/editeng/numitem.hxx
index c749650..7a12b5b 100644
--- a/include/editeng/numitem.hxx
+++ b/include/editeng/numitem.hxx
@@ -230,12 +230,12 @@ namespace o3tl
template<> struct typed_flags<SvxNumRuleFlags> : is_typed_flags<SvxNumRuleFlags, 0x03df> {};
}
-enum SvxNumRuleType
+enum class SvxNumRuleType
{
- SVX_RULETYPE_NUMBERING,
- SVX_RULETYPE_OUTLINE_NUMBERING,
- SVX_RULETYPE_PRESENTATION_NUMBERING,
- SVX_RULETYPE_END
+ NUMBERING,
+ OUTLINE_NUMBERING,
+ PRESENTATION_NUMBERING,
+ END
};
class EDITENG_DLLPUBLIC SvxNumRule
@@ -254,7 +254,7 @@ public:
SvxNumRule( SvxNumRuleFlags nFeatures,
sal_uInt16 nLevels,
bool bCont,
- SvxNumRuleType eType = SVX_RULETYPE_NUMBERING,
+ SvxNumRuleType eType = SvxNumRuleType::NUMBERING,
SvxNumberFormat::SvxNumPositionAndSpaceMode
eDefaultNumberFormatPositionAndSpaceMode
= SvxNumberFormat::LABEL_WIDTH_AND_POSITION );
diff --git a/svx/source/sidebar/nbdtmg.cxx b/svx/source/sidebar/nbdtmg.cxx
index 8fff01f..543dda1 100644
--- a/svx/source/sidebar/nbdtmg.cxx
+++ b/svx/source/sidebar/nbdtmg.cxx
@@ -209,7 +209,7 @@ void NBOTypeMgrBase::ImplStore(const OUString& filename)
SvxNumRule aDefNumRule( SvxNumRuleFlags::BULLET_REL_SIZE | SvxNumRuleFlags::CONTINUOUS | SvxNumRuleFlags::BULLET_COLOR |
SvxNumRuleFlags::CHAR_TEXT_DISTANCE | SvxNumRuleFlags::SYMBOL_ALIGNMENT,
10, false,
- SVX_RULETYPE_NUMBERING,SvxNumberFormat::LABEL_ALIGNMENT);
+ SvxNumRuleType::NUMBERING, SvxNumberFormat::LABEL_ALIGNMENT);
sal_uInt16 mLevel = 0x1;
xOStm->WriteInt32( nItem );
ApplyNumRule(aDefNumRule,nItem,mLevel,false,true);
@@ -1514,7 +1514,7 @@ void OutlineTypeMgr::Init()
SvxNumRule aDefNumRule( SvxNumRuleFlags::BULLET_REL_SIZE | SvxNumRuleFlags::CONTINUOUS | SvxNumRuleFlags::BULLET_COLOR |
SvxNumRuleFlags::CHAR_TEXT_DISTANCE | SvxNumRuleFlags::SYMBOL_ALIGNMENT,
10, false,
- SVX_RULETYPE_NUMBERING,SvxNumberFormat::LABEL_ALIGNMENT);
+ SvxNumRuleType::NUMBERING, SvxNumberFormat::LABEL_ALIGNMENT);
for(sal_Int32 nItem = 0;
nItem < aOutlineAccess.getLength() && nItem < DEFAULT_NUM_VALUSET_COUNT;
diff --git a/sw/source/core/doc/number.cxx b/sw/source/core/doc/number.cxx
index 53a8d9d..eefe897 100644
--- a/sw/source/core/doc/number.cxx
+++ b/sw/source/core/doc/number.cxx
@@ -860,7 +860,7 @@ SvxNumRule SwNumRule::MakeSvxNumRule() const
SvxNumRule aRule(SvxNumRuleFlags::CONTINUOUS | SvxNumRuleFlags::CHAR_TEXT_DISTANCE | SvxNumRuleFlags::CHAR_STYLE |
SvxNumRuleFlags::ENABLE_LINKED_BMP | SvxNumRuleFlags::ENABLE_EMBEDDED_BMP,
MAXLEVEL, mbContinusNum,
- meRuleType == NUM_RULE ? SVX_RULETYPE_NUMBERING : SVX_RULETYPE_OUTLINE_NUMBERING );
+ meRuleType == NUM_RULE ? SvxNumRuleType::NUMBERING : SvxNumRuleType::OUTLINE_NUMBERING );
for( sal_uInt16 n = 0; n < MAXLEVEL; ++n )
{
SwNumFmt aNumFmt = Get(n);
commit 44101b295071484f4797a9d3140e5ea1a42bc431
Author: Noel Grandin <noel at peralex.com>
Date: Wed Mar 25 14:42:40 2015 +0200
convert NUM_ constants to enum clas
Change-Id: Id41ea91aaf618c7f3f323698c09caa7c8df2290a
diff --git a/cui/source/tabpages/numpages.cxx b/cui/source/tabpages/numpages.cxx
index d472852..4a39f89 100644
--- a/cui/source/tabpages/numpages.cxx
+++ b/cui/source/tabpages/numpages.cxx
@@ -1278,7 +1278,7 @@ void SvxNumOptionsTabPage::Reset( const SfxItemSet* rSet )
m_pSameLevelCB->Check(pActNum->IsContinuousNumbering());
// fill ColorListBox as needed
- if ( pActNum->IsFeatureSupported( NUM_BULLET_COLOR ) )
+ if ( pActNum->IsFeatureSupported( SvxNumRuleFlags::BULLET_COLOR ) )
{
SfxObjectShell* pDocSh = SfxObjectShell::Current();
DBG_ASSERT( pDocSh, "DocShell not found!" );
@@ -1311,11 +1311,11 @@ void SvxNumOptionsTabPage::Reset( const SfxItemSet* rSet )
bHTMLMode = 0 != (nHtmlMode&HTMLMODE_ON);
}
- bool bCharFmt = pActNum->IsFeatureSupported(NUM_CHAR_STYLE);
+ bool bCharFmt = pActNum->IsFeatureSupported(SvxNumRuleFlags::CHAR_STYLE);
m_pCharFmtFT->Show(bCharFmt);
m_pCharFmtLB->Show(bCharFmt);
- bool bContinuous = pActNum->IsFeatureSupported(NUM_CONTINUOUS);
+ bool bContinuous = pActNum->IsFeatureSupported(SvxNumRuleFlags::CONTINUOUS);
bool bAllLevel = bContinuous && !bHTMLMode;
m_pAllLevelFT->Show(bAllLevel);
@@ -1338,21 +1338,21 @@ void SvxNumOptionsTabPage::Reset( const SfxItemSet* rSet )
}
}
//one must be enabled
- if(!pActNum->IsFeatureSupported(NUM_ENABLE_LINKED_BMP))
+ if(!pActNum->IsFeatureSupported(SvxNumRuleFlags::ENABLE_LINKED_BMP))
{
sal_IntPtr nData = SVX_NUM_BITMAP|LINK_TOKEN;
sal_Int32 nPos = m_pFmtLB->GetEntryPos(reinterpret_cast<void*>(nData));
if(LISTBOX_ENTRY_NOTFOUND != nPos)
m_pFmtLB->RemoveEntry(nPos);
}
- else if(!pActNum->IsFeatureSupported(NUM_ENABLE_EMBEDDED_BMP))
+ else if(!pActNum->IsFeatureSupported(SvxNumRuleFlags::ENABLE_EMBEDDED_BMP))
{
sal_IntPtr nData = SVX_NUM_BITMAP;
sal_Int32 nPos = m_pFmtLB->GetEntryPos(reinterpret_cast<void*>(nData));
if(LISTBOX_ENTRY_NOTFOUND != nPos)
m_pFmtLB->RemoveEntry(nPos);
}
- if(pActNum->IsFeatureSupported(NUM_SYMBOL_ALIGNMENT))
+ if(pActNum->IsFeatureSupported(SvxNumRuleFlags::SYMBOL_ALIGNMENT))
{
m_pAlignFT->Show();
m_pAlignLB->Show();
@@ -1366,7 +1366,7 @@ void SvxNumOptionsTabPage::Reset( const SfxItemSet* rSet )
// MegaHack: because of a not-fixable 'design mistake/error' in Impress
// delete all kinds of numeric enumerations
- if(pActNum->IsFeatureSupported(NUM_NO_NUMBERS))
+ if(pActNum->IsFeatureSupported(SvxNumRuleFlags::NO_NUMBERS))
{
sal_Int32 nFmtCount = m_pFmtLB->GetEntryCount();
for(sal_Int32 i = nFmtCount; i; i--)
@@ -1407,8 +1407,8 @@ void SvxNumOptionsTabPage::InitControls()
sal_uInt16 nHighestLevel = 0;
OUString aEmptyStr;
- bool bBullColor = pActNum->IsFeatureSupported(NUM_BULLET_COLOR);
- bool bBullRelSize = pActNum->IsFeatureSupported(NUM_BULLET_REL_SIZE);
+ bool bBullColor = pActNum->IsFeatureSupported(SvxNumRuleFlags::BULLET_COLOR);
+ bool bBullRelSize = pActNum->IsFeatureSupported(SvxNumRuleFlags::BULLET_REL_SIZE);
for(sal_uInt16 i = 0; i < pActNum->GetLevelCount(); i++)
{
if(nActNumLvl & nMask)
@@ -1588,13 +1588,13 @@ void SvxNumOptionsTabPage::SwitchNumberType( sal_uInt8 nType, bool )
m_pSuffixFT->Show(bNumeric);
m_pSuffixED->Show(bNumeric);
- bool bCharFmt = pActNum->IsFeatureSupported(NUM_CHAR_STYLE);
+ bool bCharFmt = pActNum->IsFeatureSupported(SvxNumRuleFlags::CHAR_STYLE);
m_pCharFmtFT->Show(!bBitmap && bCharFmt);
m_pCharFmtLB->Show(!bBitmap && bCharFmt);
// this is rather misusage, as there is no own flag
// for complete numeration
- bool bAllLevelFeature = pActNum->IsFeatureSupported(NUM_CONTINUOUS);
+ bool bAllLevelFeature = pActNum->IsFeatureSupported(SvxNumRuleFlags::CONTINUOUS);
bool bAllLevel = bNumeric && bAllLevelFeature && !bHTMLMode;
m_pAllLevelFT->Show(bAllLevel);
m_pAllLevelNF->Show(bAllLevel);
@@ -1604,10 +1604,10 @@ void SvxNumOptionsTabPage::SwitchNumberType( sal_uInt8 nType, bool )
m_pBulletFT->Show(bBullet);
m_pBulletPB->Show(bBullet);
- bool bBullColor = pActNum->IsFeatureSupported(NUM_BULLET_COLOR);
+ bool bBullColor = pActNum->IsFeatureSupported(SvxNumRuleFlags::BULLET_COLOR);
m_pBulColorFT->Show(!bBitmap && bBullColor);
m_pBulColLB->Show(!bBitmap && bBullColor);
- bool bBullResSize = pActNum->IsFeatureSupported(NUM_BULLET_REL_SIZE);
+ bool bBullResSize = pActNum->IsFeatureSupported(SvxNumRuleFlags::BULLET_REL_SIZE);
m_pBulRelSizeFT->Show(!bBitmap && bBullResSize);
m_pBulRelSizeMF->Show(!bBitmap && bBullResSize);
@@ -1762,7 +1762,7 @@ IMPL_LINK( SvxNumOptionsTabPage, NumberTypeSelectHdl_Impl, ListBox *, pBox )
}
nMask <<= 1;
}
- bool bAllLevelFeature = pActNum->IsFeatureSupported(NUM_CONTINUOUS);
+ bool bAllLevelFeature = pActNum->IsFeatureSupported(SvxNumRuleFlags::CONTINUOUS);
if(bShowOrient && bAllLevelFeature)
{
m_pOrientFT->Show();
@@ -3090,9 +3090,9 @@ void SvxNumPositionTabPage::ShowControlsDependingOnPosAndSpaceMode()
m_pIndentFT->Show( !bLabelAlignmentPosAndSpaceModeActive );
m_pIndentMF->Show( !bLabelAlignmentPosAndSpaceModeActive );
m_pDistNumFT->Show( !bLabelAlignmentPosAndSpaceModeActive &&
- pActNum->IsFeatureSupported(NUM_CONTINUOUS) );
+ pActNum->IsFeatureSupported(SvxNumRuleFlags::CONTINUOUS) );
m_pDistNumMF->Show( !bLabelAlignmentPosAndSpaceModeActive &&
- pActNum->IsFeatureSupported(NUM_CONTINUOUS));
+ pActNum->IsFeatureSupported(SvxNumRuleFlags::CONTINUOUS));
m_pAlignFT->Show( !bLabelAlignmentPosAndSpaceModeActive );
m_pAlignLB->Show( !bLabelAlignmentPosAndSpaceModeActive );
diff --git a/editeng/source/editeng/eerdll.cxx b/editeng/source/editeng/eerdll.cxx
index 2a6b400..9250e23 100644
--- a/editeng/source/editeng/eerdll.cxx
+++ b/editeng/source/editeng/eerdll.cxx
@@ -101,7 +101,7 @@ SfxPoolItem** GlobalEditData::GetDefItems()
ppDefItems = new SfxPoolItem*[EDITITEMCOUNT];
// Paragraph attributes:
- SvxNumRule aDefaultNumRule( NUM_BULLET_REL_SIZE|NUM_BULLET_COLOR|NUM_CHAR_TEXT_DISTANCE,
+ SvxNumRule aDefaultNumRule( SvxNumRuleFlags::BULLET_REL_SIZE | SvxNumRuleFlags::BULLET_COLOR | SvxNumRuleFlags::CHAR_TEXT_DISTANCE,
SVX_MAX_NUM, false );
ppDefItems[0] = new SvxFrameDirectionItem( FRMDIR_HORI_LEFT_TOP, EE_PARA_WRITINGDIR );
diff --git a/editeng/source/items/numitem.cxx b/editeng/source/items/numitem.cxx
index 4b71f2a..6d4fd8a 100644
--- a/editeng/source/items/numitem.cxx
+++ b/editeng/source/items/numitem.cxx
@@ -573,7 +573,7 @@ OUString SvxNumberFormat::GetCharFmtName()const
sal_Int32 SvxNumRule::nRefCount = 0;
static SvxNumberFormat* pStdNumFmt = 0;
static SvxNumberFormat* pStdOutlineNumFmt = 0;
-SvxNumRule::SvxNumRule( sal_uLong nFeatures,
+SvxNumRule::SvxNumRule( SvxNumRuleFlags nFeatures,
sal_uInt16 nLevels,
bool bCont,
SvxNumRuleType eType,
@@ -591,7 +591,7 @@ SvxNumRule::SvxNumRule( sal_uLong nFeatures,
{
aFmts[i] = new SvxNumberFormat(SVX_NUM_CHARS_UPPER_LETTER);
// It is a distinction between writer and draw
- if(nFeatures & NUM_CONTINUOUS)
+ if(nFeatures & SvxNumRuleFlags::CONTINUOUS)
{
if ( eDefaultNumberFormatPositionAndSpaceMode ==
SvxNumberFormat::LABEL_WIDTH_AND_POSITION )
@@ -653,7 +653,7 @@ SvxNumRule::SvxNumRule( SvStream &rStream )
rStream.ReadUInt16( nLevelCount );
// first nFeatureFlags of old Versions
- rStream.ReadUInt16( nTmp16 ); nFeatureFlags = nTmp16;
+ rStream.ReadUInt16( nTmp16 ); nFeatureFlags = static_cast<SvxNumRuleFlags>(nTmp16);
rStream.ReadUInt16( nTmp16 ); bContinuousNumbering = nTmp16;
rStream.ReadUInt16( nTmp16 ); eNumberingType = ( SvxNumRuleType )nTmp16;
@@ -672,7 +672,7 @@ SvxNumRule::SvxNumRule( SvStream &rStream )
}
}
//second nFeatureFlags for new versions
- rStream.ReadUInt16( nTmp16 ); nFeatureFlags = nTmp16;
+ rStream.ReadUInt16( nTmp16 ); nFeatureFlags = static_cast<SvxNumRuleFlags>(nTmp16);
}
SvStream& SvxNumRule::Store( SvStream &rStream )
@@ -680,7 +680,7 @@ SvStream& SvxNumRule::Store( SvStream &rStream )
rStream.WriteUInt16( NUMITEM_VERSION_03 );
rStream.WriteUInt16( nLevelCount );
//first save of nFeatureFlags for old versions
- rStream.WriteUInt16( nFeatureFlags );
+ rStream.WriteUInt16( static_cast<sal_uInt16>(nFeatureFlags) );
rStream.WriteUInt16( sal_uInt16(bContinuousNumbering) );
rStream.WriteUInt16( eNumberingType );
@@ -705,7 +705,7 @@ SvStream& SvxNumRule::Store( SvStream &rStream )
rStream.WriteUInt16( 0 | nSetFlag );
}
//second save of nFeatureFlags for new versions
- rStream.WriteUInt16( nFeatureFlags );
+ rStream.WriteUInt16( static_cast<sal_uInt16>(nFeatureFlags) );
if(pConverter)
DestroyFontToSubsFontConverter(pConverter);
diff --git a/editeng/source/uno/unonrule.cxx b/editeng/source/uno/unonrule.cxx
index 5959a72..34e47d5 100644
--- a/editeng/source/uno/unonrule.cxx
+++ b/editeng/source/uno/unonrule.cxx
@@ -487,7 +487,7 @@ com::sun::star::uno::Reference< com::sun::star::container::XIndexReplace > SvxCr
}
else
{
- SvxNumRule aDefaultRule( NUM_BULLET_REL_SIZE|NUM_BULLET_COLOR|NUM_CHAR_TEXT_DISTANCE, SVX_MAX_NUM, false);
+ SvxNumRule aDefaultRule( SvxNumRuleFlags::BULLET_REL_SIZE | SvxNumRuleFlags::BULLET_COLOR | SvxNumRuleFlags::CHAR_TEXT_DISTANCE, SVX_MAX_NUM, false);
return new SvxUnoNumberingRules( aDefaultRule );
}
}
@@ -546,7 +546,7 @@ Reference< XAnyCompare > SvxCreateNumRuleCompare() throw()
::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexReplace > SvxCreateNumRule() throw()
{
- SvxNumRule aTempRule( 0, 10, false );
+ SvxNumRule aTempRule( SvxNumRuleFlags::NONE, 10, false );
return SvxCreateNumRule( &aTempRule );
}
diff --git a/filter/source/msfilter/svdfppt.cxx b/filter/source/msfilter/svdfppt.cxx
index 9947068..2c52437 100644
--- a/filter/source/msfilter/svdfppt.cxx
+++ b/filter/source/msfilter/svdfppt.cxx
@@ -4291,8 +4291,8 @@ PPTStyleSheet::PPTStyleSheet( const DffRecordHeader& rSlideHd, SvStream& rIn, Sd
eNumRuleType = SVX_RULETYPE_NUMBERING;
break;
}
- SvxNumRule aRule( NUM_BULLET_REL_SIZE | NUM_BULLET_COLOR |
- NUM_CHAR_TEXT_DISTANCE | NUM_SYMBOL_ALIGNMENT,
+ SvxNumRule aRule( SvxNumRuleFlags::BULLET_REL_SIZE | SvxNumRuleFlags::BULLET_COLOR |
+ SvxNumRuleFlags::CHAR_TEXT_DISTANCE | SvxNumRuleFlags::SYMBOL_ALIGNMENT,
nLevels, false, eNumRuleType );
for ( sal_uInt16 nCount = 0; nDepth < nLevels; nCount++ )
{
diff --git a/include/editeng/numitem.hxx b/include/editeng/numitem.hxx
index 664f4601..c749650 100644
--- a/include/editeng/numitem.hxx
+++ b/include/editeng/numitem.hxx
@@ -32,6 +32,7 @@
#include <com/sun/star/style/NumberingType.hpp>
#include <unotools/fontcvt.hxx>
#include <editeng/editengdllapi.h>
+#include <o3tl/typed_flags_set.hxx>
class SvxBrushItem;
namespace vcl { class Font; }
@@ -44,17 +45,6 @@ namespace com{namespace sun{ namespace star{
}}}
-//Feature-Flags (only sal_uInt16!)
-#define NUM_CONTINUOUS 0x0001 // consecutive numbers possible?
-#define NUM_CHAR_TEXT_DISTANCE 0x0002 // Distance Symbol<->Text?
-#define NUM_CHAR_STYLE 0x0004 // Character styles?
-#define NUM_BULLET_REL_SIZE 0x0008 // relative bullet size?
-#define NUM_BULLET_COLOR 0x0010 // Bullet color
-#define NUM_SYMBOL_ALIGNMENT 0x0040 // alignment to be shown in the options
-#define NUM_NO_NUMBERS 0x0080 // Numbering are not allowed
-#define NUM_ENABLE_LINKED_BMP 0x0100 // linked bitmaps are available
-#define NUM_ENABLE_EMBEDDED_BMP 0x0200 // embedded bitmaps are available
-
#define SVX_NO_NUM 200 // Marker for no numbering
#define SVX_NO_NUMLEVEL 0x20
@@ -221,6 +211,25 @@ public:
static OUString CreateRomanString( sal_uLong nNo, bool bUpper );
};
+//Feature-Flags (only sal_uInt16!)
+enum class SvxNumRuleFlags
+{
+ NONE = 0x0000,
+ CONTINUOUS = 0x0001, // consecutive numbers possible?
+ CHAR_TEXT_DISTANCE = 0x0002, // Distance Symbol<->Text?
+ CHAR_STYLE = 0x0004, // Character styles?
+ BULLET_REL_SIZE = 0x0008, // relative bullet size?
+ BULLET_COLOR = 0x0010, // Bullet color
+ SYMBOL_ALIGNMENT = 0x0040, // alignment to be shown in the options
+ NO_NUMBERS = 0x0080, // Numbering are not allowed
+ ENABLE_LINKED_BMP = 0x0100, // linked bitmaps are available
+ ENABLE_EMBEDDED_BMP = 0x0200 // embedded bitmaps are available
+};
+namespace o3tl
+{
+ template<> struct typed_flags<SvxNumRuleFlags> : is_typed_flags<SvxNumRuleFlags, 0x03df> {};
+}
+
enum SvxNumRuleType
{
SVX_RULETYPE_NUMBERING,
@@ -232,7 +241,7 @@ enum SvxNumRuleType
class EDITENG_DLLPUBLIC SvxNumRule
{
sal_uInt16 nLevelCount; // Number of supported levels
- sal_uInt32 nFeatureFlags; // What is supported?
+ SvxNumRuleFlags nFeatureFlags; // What is supported?
SvxNumRuleType eNumberingType; // Type of numbering
bool bContinuousNumbering; // sequential numbering
@@ -242,7 +251,7 @@ class EDITENG_DLLPUBLIC SvxNumRule
static sal_Int32 nRefCount;
com::sun::star::lang::Locale aLocale;
public:
- SvxNumRule( sal_uLong nFeatures,
+ SvxNumRule( SvxNumRuleFlags nFeatures,
sal_uInt16 nLevels,
bool bCont,
SvxNumRuleType eType = SVX_RULETYPE_NUMBERING,
@@ -270,10 +279,10 @@ public:
{bContinuousNumbering = bSet;}
sal_uInt16 GetLevelCount() const {return nLevelCount;}
- bool IsFeatureSupported(sal_uInt32 nFeature) const
- {return 0 != (nFeatureFlags & nFeature);}
- sal_uInt32 GetFeatureFlags() const {return nFeatureFlags;}
- void SetFeatureFlag( sal_uInt32 nFlag, bool bSet = true ) { if(bSet) nFeatureFlags |= nFlag; else nFeatureFlags &= ~nFlag; }
+ bool IsFeatureSupported(SvxNumRuleFlags nFeature) const
+ { return bool(nFeatureFlags & nFeature); }
+ SvxNumRuleFlags GetFeatureFlags() const {return nFeatureFlags;}
+ void SetFeatureFlag( SvxNumRuleFlags nFlag, bool bSet = true ) { if(bSet) nFeatureFlags |= nFlag; else nFeatureFlags &= ~nFlag; }
OUString MakeNumString( const SvxNodeNum&, bool bInclStrings = true ) const;
diff --git a/sc/source/ui/unoobj/styleuno.cxx b/sc/source/ui/unoobj/styleuno.cxx
index eeec6c1..1936a69 100644
--- a/sc/source/ui/unoobj/styleuno.cxx
+++ b/sc/source/ui/unoobj/styleuno.cxx
@@ -1169,7 +1169,7 @@ void SAL_CALL ScStyleObj::setName( const OUString& aNewName )
uno::Reference<container::XIndexReplace> ScStyleObj::CreateEmptyNumberingRules()
{
- SvxNumRule aRule( 0, 0, true ); // nothing supported
+ SvxNumRule aRule( SvxNumRuleFlags::NONE, 0, true ); // nothing supported
return SvxCreateNumRule( &aRule );
}
diff --git a/sd/source/core/drawdoc4.cxx b/sd/source/core/drawdoc4.cxx
index 1c2b66c..881ccc0 100644
--- a/sd/source/core/drawdoc4.cxx
+++ b/sd/source/core/drawdoc4.cxx
@@ -1221,7 +1221,7 @@ void SdDrawDocument::SetTextDefaults() const
aNumberFormat.SetStart(1);
aNumberFormat.SetNumAdjust(SVX_ADJUST_LEFT);
- SvxNumRule aNumRule( NUM_BULLET_REL_SIZE|NUM_BULLET_COLOR|NUM_CHAR_TEXT_DISTANCE, SVX_MAX_NUM, false);
+ SvxNumRule aNumRule( SvxNumRuleFlags::BULLET_REL_SIZE | SvxNumRuleFlags::BULLET_COLOR | SvxNumRuleFlags::CHAR_TEXT_DISTANCE, SVX_MAX_NUM, false);
//aNumberFormat.SetAbsLSpace( 0 );
//aNumberFormat.SetFirstLineOffset( 0 );
diff --git a/sd/source/core/stlpool.cxx b/sd/source/core/stlpool.cxx
index 564d7d3..d427b83 100644
--- a/sd/source/core/stlpool.cxx
+++ b/sd/source/core/stlpool.cxx
@@ -1107,7 +1107,7 @@ void SdStyleSheetPool::PutNumBulletItem( SfxStyleSheetBase* pSheet,
aNumberFormat.SetStart(1);
aNumberFormat.SetNumAdjust(SVX_ADJUST_LEFT);
- SvxNumRule aNumRule( NUM_BULLET_REL_SIZE|NUM_BULLET_COLOR|NUM_CHAR_TEXT_DISTANCE, SVX_MAX_NUM, false);
+ SvxNumRule aNumRule( SvxNumRuleFlags::BULLET_REL_SIZE | SvxNumRuleFlags::BULLET_COLOR | SvxNumRuleFlags::CHAR_TEXT_DISTANCE, SVX_MAX_NUM, false);
for( sal_uInt16 i = 0; i < aNumRule.GetLevelCount(); i++ )
{
@@ -1161,7 +1161,8 @@ void SdStyleSheetPool::PutNumBulletItem( SfxStyleSheetBase* pSheet,
aNumberFormat.SetStart(1);
aNumberFormat.SetNumAdjust(SVX_ADJUST_LEFT);
- SvxNumRule aNumRule( NUM_BULLET_REL_SIZE|NUM_BULLET_COLOR|NUM_CHAR_TEXT_DISTANCE|NUM_SYMBOL_ALIGNMENT,
+ SvxNumRule aNumRule( SvxNumRuleFlags::BULLET_REL_SIZE | SvxNumRuleFlags::BULLET_COLOR |
+ SvxNumRuleFlags::CHAR_TEXT_DISTANCE | SvxNumRuleFlags::SYMBOL_ALIGNMENT,
SVX_MAX_NUM, false );
for( sal_uInt16 i = 0; i < aNumRule.GetLevelCount(); i++ )
{
diff --git a/sd/source/ui/dlg/dlgolbul.cxx b/sd/source/ui/dlg/dlgolbul.cxx
index 4dd28b9..c3a7710 100644
--- a/sd/source/ui/dlg/dlgolbul.cxx
+++ b/sd/source/ui/dlg/dlgolbul.cxx
@@ -116,7 +116,7 @@ OutlineBulletDlg::OutlineBulletDlg(
if(pRule)
{
SvxNumRule aNewRule( *pRule );
- aNewRule.SetFeatureFlag( NUM_NO_NUMBERS, true );
+ aNewRule.SetFeatureFlag( SvxNumRuleFlags::NO_NUMBERS, true );
SvxNumBulletItem aNewItem( aNewRule, EE_PARA_NUMBULLET );
aInputSet.Put(aNewItem);
@@ -183,7 +183,7 @@ const SfxItemSet* OutlineBulletDlg::GetOutputItemSet() const
const SvxNumBulletItem* pBulletItem = static_cast<const SvxNumBulletItem*>(pOutputSet->GetItem(EE_PARA_NUMBULLET,true));
SvxNumRule* pRule = pBulletItem->GetNumRule();
if(pRule)
- pRule->SetFeatureFlag( NUM_NO_NUMBERS, false );
+ pRule->SetFeatureFlag( SvxNumRuleFlags::NO_NUMBERS, false );
}
return pOutputSet;
diff --git a/sd/source/ui/func/fuolbull.cxx b/sd/source/ui/func/fuolbull.cxx
index 55acf20..2ee2ddb 100644
--- a/sd/source/ui/func/fuolbull.cxx
+++ b/sd/source/ui/func/fuolbull.cxx
@@ -366,7 +366,7 @@ const SfxPoolItem* FuOutlineBullet::GetNumBulletItem(SfxItemSet& aNewAttr, sal_u
if(pLclRule)
{
SvxNumRule aNewRule( *pLclRule );
- aNewRule.SetFeatureFlag( NUM_NO_NUMBERS, true );
+ aNewRule.SetFeatureFlag( SvxNumRuleFlags::NO_NUMBERS, true );
SvxNumBulletItem aNewItem( aNewRule, EE_PARA_NUMBULLET );
aNewAttr.Put(aNewItem);
diff --git a/sd/source/ui/view/viewshel.cxx b/sd/source/ui/view/viewshel.cxx
index ce01af2..feb3b11 100644
--- a/sd/source/ui/view/viewshel.cxx
+++ b/sd/source/ui/view/viewshel.cxx
@@ -815,7 +815,7 @@ const SfxPoolItem* ViewShell::GetNumBulletItem(SfxItemSet& aNewAttr, sal_uInt16&
if(pRule)
{
SvxNumRule aNewRule( *pRule );
- aNewRule.SetFeatureFlag( NUM_NO_NUMBERS, true );
+ aNewRule.SetFeatureFlag( SvxNumRuleFlags::NO_NUMBERS, true );
SvxNumBulletItem aNewItem( aNewRule, EE_PARA_NUMBULLET );
aNewAttr.Put(aNewItem);
diff --git a/svx/source/sidebar/nbdtmg.cxx b/svx/source/sidebar/nbdtmg.cxx
index de02aa9..8fff01f 100644
--- a/svx/source/sidebar/nbdtmg.cxx
+++ b/svx/source/sidebar/nbdtmg.cxx
@@ -206,7 +206,9 @@ void NBOTypeMgrBase::ImplStore(const OUString& filename)
xOStm->WriteUInt32( nVersion );
for(sal_Int32 nItem = 0; nItem < DEFAULT_NUM_VALUSET_COUNT; nItem++ ) {
if (IsCustomized(nItem)) {
- SvxNumRule aDefNumRule( NUM_BULLET_REL_SIZE|NUM_CONTINUOUS|NUM_BULLET_COLOR|NUM_CHAR_TEXT_DISTANCE|NUM_SYMBOL_ALIGNMENT,10, false,
+ SvxNumRule aDefNumRule( SvxNumRuleFlags::BULLET_REL_SIZE | SvxNumRuleFlags::CONTINUOUS | SvxNumRuleFlags::BULLET_COLOR |
+ SvxNumRuleFlags::CHAR_TEXT_DISTANCE | SvxNumRuleFlags::SYMBOL_ALIGNMENT,
+ 10, false,
SVX_RULETYPE_NUMBERING,SvxNumberFormat::LABEL_ALIGNMENT);
sal_uInt16 mLevel = 0x1;
xOStm->WriteInt32( nItem );
@@ -1509,7 +1511,9 @@ void OutlineTypeMgr::Init()
{
aOutlineAccess = xDefNum->getDefaultOutlineNumberings( aLocale );
- SvxNumRule aDefNumRule( NUM_BULLET_REL_SIZE|NUM_CONTINUOUS|NUM_BULLET_COLOR|NUM_CHAR_TEXT_DISTANCE|NUM_SYMBOL_ALIGNMENT, 10, false,
+ SvxNumRule aDefNumRule( SvxNumRuleFlags::BULLET_REL_SIZE | SvxNumRuleFlags::CONTINUOUS | SvxNumRuleFlags::BULLET_COLOR |
+ SvxNumRuleFlags::CHAR_TEXT_DISTANCE | SvxNumRuleFlags::SYMBOL_ALIGNMENT,
+ 10, false,
SVX_RULETYPE_NUMBERING,SvxNumberFormat::LABEL_ALIGNMENT);
for(sal_Int32 nItem = 0;
diff --git a/svx/source/unodraw/unomod.cxx b/svx/source/unodraw/unomod.cxx
index b982b8b..68c0fe6 100644
--- a/svx/source/unodraw/unomod.cxx
+++ b/svx/source/unodraw/unomod.cxx
@@ -734,7 +734,7 @@ com::sun::star::uno::Reference< com::sun::star::container::XIndexReplace > SvxCr
}
else
{
- SvxNumRule aTempRule( 0, 10, false );
+ SvxNumRule aTempRule( SvxNumRuleFlags::NONE, 10, false );
return SvxCreateNumRule( &aTempRule );
}
}
diff --git a/sw/source/core/doc/number.cxx b/sw/source/core/doc/number.cxx
index 9108f09..53a8d9d 100644
--- a/sw/source/core/doc/number.cxx
+++ b/sw/source/core/doc/number.cxx
@@ -857,13 +857,10 @@ void SwNumRule::SetSvxRule(const SvxNumRule& rNumRule, SwDoc* pDoc)
SvxNumRule SwNumRule::MakeSvxNumRule() const
{
- SvxNumRule aRule(NUM_CONTINUOUS|NUM_CHAR_TEXT_DISTANCE|NUM_CHAR_STYLE|
- NUM_ENABLE_LINKED_BMP|NUM_ENABLE_EMBEDDED_BMP,
- MAXLEVEL, mbContinusNum,
- meRuleType ==
- NUM_RULE ?
- SVX_RULETYPE_NUMBERING :
- SVX_RULETYPE_OUTLINE_NUMBERING );
+ SvxNumRule aRule(SvxNumRuleFlags::CONTINUOUS | SvxNumRuleFlags::CHAR_TEXT_DISTANCE | SvxNumRuleFlags::CHAR_STYLE |
+ SvxNumRuleFlags::ENABLE_LINKED_BMP | SvxNumRuleFlags::ENABLE_EMBEDDED_BMP,
+ MAXLEVEL, mbContinusNum,
+ meRuleType == NUM_RULE ? SVX_RULETYPE_NUMBERING : SVX_RULETYPE_OUTLINE_NUMBERING );
for( sal_uInt16 n = 0; n < MAXLEVEL; ++n )
{
SwNumFmt aNumFmt = Get(n);
diff --git a/sw/source/uibase/shells/txtnum.cxx b/sw/source/uibase/shells/txtnum.cxx
index 14c975b..9886a8a 100644
--- a/sw/source/uibase/shells/txtnum.cxx
+++ b/sw/source/uibase/shells/txtnum.cxx
@@ -133,7 +133,7 @@ void SwTextShell::ExecEnterNum(SfxRequest &rReq)
}
}
if(bHtml)
- aRule.SetFeatureFlag(NUM_ENABLE_EMBEDDED_BMP, false);
+ aRule.SetFeatureFlag(SvxNumRuleFlags::ENABLE_EMBEDDED_BMP, false);
aSet.Put(SvxNumBulletItem(aRule));
OSL_ENSURE( GetShell().GetNumLevel() < MAXLEVEL,
@@ -171,7 +171,7 @@ void SwTextShell::ExecEnterNum(SfxRequest &rReq)
}
aSvxRule.SetLevel( n, aFmt, false );
}
- aSvxRule.SetFeatureFlag(NUM_ENABLE_EMBEDDED_BMP, false);
+ aSvxRule.SetFeatureFlag(SvxNumRuleFlags::ENABLE_EMBEDDED_BMP, false);
}
aSet.Put( SvxNumBulletItem( aSvxRule ) );
}
More information about the Libreoffice-commits
mailing list