summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorMaxim Monastirsky <momonasmon@gmail.com>2015-06-22 02:51:21 +0300
committerMaxim Monastirsky <momonasmon@gmail.com>2015-07-05 14:55:16 +0300
commit18992f308d7f1d9b972cb307666e4a4a18778eea (patch)
tree59c4feb67b847ebe750eb66e08b407b52decf227 /svx
parent4604a6a7cd66907fc29e01aacf2146f17fa19d34 (diff)
Convert NUM_PAGETYPE_ to a scoped enum
Change-Id: Iddc194a0d8f77e307c05bd3dfef1fc30568173c1
Diffstat (limited to 'svx')
-rw-r--r--svx/source/dialog/svxbmpnumvalueset.cxx29
-rw-r--r--svx/source/tbxctrls/bulletsnumbering.cxx5
2 files changed, 13 insertions, 21 deletions
diff --git a/svx/source/dialog/svxbmpnumvalueset.cxx b/svx/source/dialog/svxbmpnumvalueset.cxx
index b3855f692e7b..5d11b04cd47c 100644
--- a/svx/source/dialog/svxbmpnumvalueset.cxx
+++ b/svx/source/dialog/svxbmpnumvalueset.cxx
@@ -64,11 +64,6 @@ using namespace com::sun::star::text;
using namespace com::sun::star::container;
using namespace com::sun::star::style;
-#define NUM_PAGETYPE_BULLET 0
-#define NUM_PAGETYPE_SINGLENUM 1
-#define NUM_PAGETYPE_NUM 2
-#define NUM_PAGETYPE_BMP 3
-
static const sal_Char cNumberingType[] = "NumberingType";
static const sal_Char cValue[] = "Value";
static const sal_Char cParentNumbering[] = "ParentNumbering";
@@ -166,9 +161,9 @@ void SvxNumValueSet::UserDraw( const UserDrawEvent& rUDEvt )
aRuleFont.SetSize(aSize);
aRuleFont.SetColor(aTextColor);
aRuleFont.SetFillColor(aBackColor);
- if(nPageType == NUM_PAGETYPE_BULLET)
+ if(ePageType == NumberingPageType::BULLET)
aFont = aRuleFont;
- else if(nPageType == NUM_PAGETYPE_NUM)
+ else if(ePageType == NumberingPageType::OUTLINE)
{
aSize.Height() = nRectHeight/8;
}
@@ -192,7 +187,7 @@ void SvxNumValueSet::UserDraw( const UserDrawEvent& rUDEvt )
aLineColor.Invert();
pVDev->SetLineColor(aLineColor);
// Draw line only once
- if(nPageType != NUM_PAGETYPE_NUM)
+ if(ePageType != NumberingPageType::OUTLINE)
{
Point aStart(aBLPos.X() + nRectWidth *25 / 100,0);
Point aEnd(aBLPos.X() + nRectWidth * 9 / 10,0);
@@ -210,8 +205,8 @@ void SvxNumValueSet::UserDraw( const UserDrawEvent& rUDEvt )
*pVDev );
// Now comes the text
const OUString sValue(cValue);
- if( NUM_PAGETYPE_SINGLENUM == nPageType ||
- NUM_PAGETYPE_BULLET == nPageType )
+ if( NumberingPageType::SINGLENUM == ePageType ||
+ NumberingPageType::BULLET == ePageType )
{
Point aStart(aBLPos.X() + nRectWidth / 9,0);
for( sal_uInt16 i = 0; i < 3; i++ )
@@ -219,7 +214,7 @@ void SvxNumValueSet::UserDraw( const UserDrawEvent& rUDEvt )
sal_uInt16 nY = 11 + i * 33;
aStart.Y() = aBLPos.Y() + nRectHeight * nY / 100;
OUString sText;
- if(nPageType == NUM_PAGETYPE_BULLET)
+ if(ePageType == NumberingPageType::BULLET)
{
sText = OUString( aBulletTypes[nItemId - 1] );
aStart.Y() -= pDev->GetTextHeight()/2;
@@ -250,7 +245,7 @@ void SvxNumValueSet::UserDraw( const UserDrawEvent& rUDEvt )
pDev->DrawText(aStart, sText);
}
}
- else if(NUM_PAGETYPE_NUM == nPageType )
+ else if(NumberingPageType::OUTLINE == ePageType )
{
// Outline numbering has to be painted into the virtual device
// to get correct lines
@@ -392,7 +387,7 @@ void SvxNumValueSet::UserDraw( const UserDrawEvent& rUDEvt )
SvxNumValueSet::SvxNumValueSet(vcl::Window* pParent, WinBits nWinBits)
: ValueSet(pParent, nWinBits)
- , nPageType(0)
+ , ePageType(NumberingPageType::BULLET)
, bHTMLMode(false)
, pVDev(NULL)
{
@@ -400,17 +395,17 @@ SvxNumValueSet::SvxNumValueSet(vcl::Window* pParent, WinBits nWinBits)
VCL_BUILDER_FACTORY_ARGS(SvxNumValueSet, WB_TABSTOP)
-void SvxNumValueSet::init(sal_uInt16 nType)
+void SvxNumValueSet::init(NumberingPageType eType)
{
aLineColor = COL_LIGHTGRAY;
- nPageType = nType;
+ ePageType = eType;
bHTMLMode = false;
pVDev = NULL;
SetColCount( 4 );
SetLineCount( 2 );
SetStyle( GetStyle() | WB_ITEMBORDER | WB_DOUBLEBORDER );
- if(NUM_PAGETYPE_BULLET == nType)
+ if(NumberingPageType::BULLET == eType)
{
for ( sal_uInt16 i = 0; i < 8; i++ )
{
@@ -477,7 +472,7 @@ VCL_BUILDER_FACTORY_ARGS(SvxBmpNumValueSet, WB_TABSTOP)
void SvxBmpNumValueSet::init()
{
- SvxNumValueSet::init(NUM_PAGETYPE_BMP);
+ SvxNumValueSet::init(NumberingPageType::BITMAP);
bGrfNotFound = false;
GalleryExplorer::BeginLocking(GALLERY_THEME_BULLETS);
SetStyle( GetStyle() | WB_VSCROLL );
diff --git a/svx/source/tbxctrls/bulletsnumbering.cxx b/svx/source/tbxctrls/bulletsnumbering.cxx
index 894c67a69ff6..b61ec20dfc49 100644
--- a/svx/source/tbxctrls/bulletsnumbering.cxx
+++ b/svx/source/tbxctrls/bulletsnumbering.cxx
@@ -31,9 +31,6 @@
#include <vcl/toolbox.hxx>
#include <vcl/settings.hxx>
-#define NUM_PAGETYPE_BULLET 0
-#define NUM_PAGETYPE_SINGLENUM 1
-
class NumberingToolBoxControl;
class NumberingPopup : public svtools::ToolbarMenu
@@ -90,7 +87,7 @@ NumberingPopup::NumberingPopup( NumberingToolBoxControl& rController,
{
WinBits nBits = WB_TABSTOP | WB_MENUSTYLEVALUESET | WB_FLATVALUESET | WB_NO_DIRECTSELECT;
mpValueSet = VclPtr<SvxNumValueSet>::Create( this, nBits );
- mpValueSet->init( mbBulletItem ? NUM_PAGETYPE_BULLET : NUM_PAGETYPE_SINGLENUM );
+ mpValueSet->init( mbBulletItem ? NumberingPageType::BULLET : NumberingPageType::SINGLENUM );
if ( !mbBulletItem )
{