summaryrefslogtreecommitdiffstats
path: root/cui
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2016-08-17 15:30:15 +0200
committerNoel Grandin <noel@peralex.com>2016-08-18 08:49:02 +0200
commitfde3facbc8bdeb820d828183948eceaec66e525a (patch)
treeb1794802326e6958267e308b04b1ba72f29c2c9d /cui
parentconvert ProjectionType to scoped enum (diff)
downloadcore-fde3facbc8bdeb820d828183948eceaec66e525a.tar.gz
core-fde3facbc8bdeb820d828183948eceaec66e525a.zip
convert PageType to scoped enum
and move it inside CUI, since it's only used there Change-Id: I83ac1afaa60da9fb34480363a351608b133154cb
Diffstat (limited to 'cui')
-rw-r--r--cui/source/dialogs/sdrcelldlg.cxx2
-rw-r--r--cui/source/inc/cuitabarea.hxx47
-rw-r--r--cui/source/inc/cuitabline.hxx16
-rw-r--r--cui/source/tabpages/tabarea.cxx2
-rw-r--r--cui/source/tabpages/tabline.cxx2
-rw-r--r--cui/source/tabpages/tparea.cxx27
-rw-r--r--cui/source/tabpages/tpbitmap.cxx6
-rw-r--r--cui/source/tabpages/tpcolor.cxx12
-rw-r--r--cui/source/tabpages/tpgradnt.cxx6
-rw-r--r--cui/source/tabpages/tphatch.cxx6
-rw-r--r--cui/source/tabpages/tpline.cxx21
-rw-r--r--cui/source/tabpages/tplnedef.cxx15
-rw-r--r--cui/source/tabpages/tplneend.cxx11
-rw-r--r--cui/source/tabpages/tppattern.cxx6
-rw-r--r--cui/source/tabpages/tpshadow.cxx10
-rw-r--r--cui/source/tabpages/tptrans.cxx10
16 files changed, 109 insertions, 90 deletions
diff --git a/cui/source/dialogs/sdrcelldlg.cxx b/cui/source/dialogs/sdrcelldlg.cxx
index 392d9fb6cf80..3fd53db146f0 100644
--- a/cui/source/dialogs/sdrcelldlg.cxx
+++ b/cui/source/dialogs/sdrcelldlg.cxx
@@ -51,7 +51,7 @@ void SvxFormatCellsDialog::PageCreated( sal_uInt16 nId, SfxTabPage &rPage )
rAreaPage.SetGradientList( mpGradientList );
rAreaPage.SetHatchingList( mpHatchingList );
rAreaPage.SetBitmapList( mpBitmapList );
- rAreaPage.SetPageType( PT_AREA );
+ rAreaPage.SetPageType( PageType::Area );
rAreaPage.SetDlgType( 1 );
rAreaPage.SetPos( 0 );
rAreaPage.Construct();
diff --git a/cui/source/inc/cuitabarea.hxx b/cui/source/inc/cuitabarea.hxx
index db9a99c3d241..23d393711ae2 100644
--- a/cui/source/inc/cuitabarea.hxx
+++ b/cui/source/inc/cuitabarea.hxx
@@ -38,6 +38,19 @@
class SdrModel;
class SvxBitmapCtl;
+enum class PageType
+{
+ Area,
+ Gradient,
+ Hatch,
+ Bitmap,
+ Color,
+ Shadow,
+ Transparence,
+ Unknown = 0xFFFF
+};
+
+
/************************************************************************/
class SvxAreaTabDialog : public SfxTabDialog
@@ -73,7 +86,7 @@ private:
ChangeType mnGradientListState;
ChangeType mnHatchingListState;
- sal_uInt16 mnPageType;
+ PageType mnPageType;
sal_Int32 mnPos;
bool mbAreaTP;
@@ -122,7 +135,7 @@ class SvxTransparenceTabPage : public SvxTabPage
const SfxItemSet& rOutAttrs;
RECT_POINT eRP;
- sal_uInt16 nPageType;
+ PageType nPageType;
sal_uInt16 nDlgType;
// main selection
@@ -184,7 +197,7 @@ public:
virtual DeactivateRC DeactivatePage(SfxItemSet* pSet) override;
virtual void PointChanged(vcl::Window* pWindow, RECT_POINT eRP) override;
- void SetPageType(sal_uInt16 nInType) { nPageType = nInType; }
+ void SetPageType(PageType nInType) { nPageType = nInType; }
void SetDlgType(sal_uInt16 nInType) { nDlgType = nInType; }
virtual void PageCreated(const SfxAllItemSet& aSet) override;
};
@@ -227,7 +240,7 @@ private:
ChangeType* m_pnGradientListState;
ChangeType* m_pnHatchingListState;
- sal_uInt16 m_nPageType;
+ PageType m_nPageType;
sal_uInt16 m_nDlgType;
sal_Int32 m_nPos;
@@ -288,7 +301,7 @@ public:
{ m_pHatchingList = pHtchLst; }
void SetBitmapList( XBitmapListRef const & pBmpLst) { m_pBitmapList = pBmpLst; }
- void SetPageType( sal_uInt16 nInType ) { m_nPageType = nInType; }
+ void SetPageType( PageType nInType ) { m_nPageType = nInType; }
void SetDlgType( sal_uInt16 nInType ) { m_nDlgType = nInType; }
void SetPos( sal_uInt16 nInPos ) { m_nPos = nInPos; }
void SetAreaTP( bool* pIn ) { m_pbAreaTP = pIn; }
@@ -320,7 +333,7 @@ private:
XColorListRef m_pColorList;
ChangeType* m_pnColorListState;
- sal_uInt16 m_nPageType;
+ PageType m_nPageType;
sal_uInt16 m_nDlgType;
bool* m_pbAreaTP;
@@ -348,7 +361,7 @@ public:
virtual void PointChanged( vcl::Window* pWindow, RECT_POINT eRP ) override;
void SetColorList( XColorListRef const & pColorList ) { m_pColorList = pColorList; }
- void SetPageType( sal_uInt16 nInType ) { m_nPageType = nInType; }
+ void SetPageType( PageType nInType ) { m_nPageType = nInType; }
void SetDlgType( sal_uInt16 nInType ) { m_nDlgType = nInType; }
void SetAreaTP( bool* pIn ) { m_pbAreaTP = pIn; }
void SetColorChgd( ChangeType* pIn ) { m_pnColorListState = pIn; }
@@ -389,7 +402,7 @@ private:
ChangeType* m_pnGradientListState;
ChangeType* m_pnColorListState;
- sal_uInt16* m_pPageType;
+ PageType* m_pPageType;
sal_uInt16 m_nDlgType;
sal_Int32* m_pPos;
bool* m_pbAreaTP;
@@ -433,7 +446,7 @@ public:
void SetGradientList( XGradientListRef const & pGrdLst)
{ m_pGradientList = pGrdLst; }
- void SetPageType( sal_uInt16* pInType ) { m_pPageType = pInType; }
+ void SetPageType( PageType* pInType ) { m_pPageType = pInType; }
void SetDlgType( sal_uInt16 nInType ) { m_nDlgType = nInType; }
void SetPos( sal_Int32* pInPos ) { m_pPos = pInPos; }
void SetAreaTP( bool* pIn ) { m_pbAreaTP = pIn; }
@@ -469,7 +482,7 @@ private:
ChangeType* m_pnHatchingListState;
ChangeType* m_pnColorListState;
- sal_uInt16* m_pPageType;
+ PageType* m_pPageType;
sal_uInt16 m_nDlgType;
sal_Int32* m_pPos;
bool* m_pbAreaTP;
@@ -517,7 +530,7 @@ public:
void SetHatchingList( XHatchListRef const & pHtchLst)
{ m_pHatchingList = pHtchLst; }
- void SetPageType( sal_uInt16* pInType ) { m_pPageType = pInType; }
+ void SetPageType( PageType* pInType ) { m_pPageType = pInType; }
void SetDlgType( sal_uInt16 nInType ) { m_nDlgType = nInType; }
void SetPos( sal_Int32* pInPos ) { m_pPos = pInPos; }
void SetAreaTP( bool* pIn ) { m_pbAreaTP = pIn; }
@@ -563,7 +576,7 @@ private:
double m_fObjectWidth;
double m_fObjectHeight;
- sal_uInt16* m_nPageType;
+ PageType* m_nPageType;
sal_uInt16 m_nDlgType;
sal_Int32* m_nPos;
@@ -612,7 +625,7 @@ public:
void SetBitmapList( const XBitmapListRef& pBmpLst) { m_pBitmapList = pBmpLst; }
- void SetPageType( sal_uInt16* pInType ) { m_nPageType = pInType; }
+ void SetPageType( PageType* pInType ) { m_nPageType = pInType; }
void SetDlgType( sal_uInt16 nInType ) { m_nDlgType = nInType; }
void SetPos( sal_Int32* pInPos ) { m_nPos = pInPos; }
void SetAreaTP( bool* pIn ) { m_pbAreaTP = pIn; }
@@ -646,7 +659,7 @@ private:
ChangeType* m_pnPatternListState;
ChangeType* m_pnColorListState;
- sal_uInt16* m_pPageType;
+ PageType* m_pPageType;
sal_uInt16 m_nDlgType;
sal_Int32* m_pPos;
bool* m_pbAreaTP;
@@ -686,7 +699,7 @@ public:
void SetColorList( XColorListRef const & pColorList ) { m_pColorList = pColorList; }
void SetPatternList( XPatternListRef const & pPatternList) { m_pPatternList = pPatternList; }
- void SetPageType( sal_uInt16* pInType ) { m_pPageType = pInType; }
+ void SetPageType( PageType* pInType ) { m_pPageType = pInType; }
void SetDlgType( sal_uInt16 nInType ) { m_nDlgType = nInType; }
void SetPos( sal_Int32* pInPos ) { m_pPos = pInPos; }
void SetAreaTP( bool* pIn ) { m_pbAreaTP = pIn; }
@@ -753,7 +766,7 @@ private:
XColorListRef pColorList;
ChangeType* pnColorListState;
- sal_uInt16* pPageType;
+ PageType* pPageType;
sal_uInt16 nDlgType;
sal_Int32* pPos;
bool* pbAreaTP;
@@ -816,7 +829,7 @@ public:
void SaveToViewFrame( SfxViewFrame *pViewFrame );
void SetupForViewFrame( SfxViewFrame *pViewFrame );
- void SetPageType( sal_uInt16* pInType ) { pPageType = pInType; }
+ void SetPageType( PageType* pInType ) { pPageType = pInType; }
void SetDlgType( sal_uInt16 nInType ) { nDlgType = nInType; }
void SetPos( sal_Int32* pInPos ) { pPos = pInPos; }
void SetAreaTP( bool* pIn ) { pbAreaTP = pIn; }
diff --git a/cui/source/inc/cuitabline.hxx b/cui/source/inc/cuitabline.hxx
index a3df4fb20522..f2398ad17c1c 100644
--- a/cui/source/inc/cuitabline.hxx
+++ b/cui/source/inc/cuitabline.hxx
@@ -24,6 +24,8 @@
#include <svx/tabline.hxx>
#include <svx/tabarea.hxx>
+enum class PageType;
+
class SvxLineTabDialog : public SfxTabDialog
{
sal_uInt16 m_nLineTabPage;
@@ -49,7 +51,7 @@ private:
ChangeType nDashListState;
ChangeType mnColorListState;
- sal_uInt16 nPageType;
+ PageType nPageType;
sal_Int32 nPosDashLb;
sal_Int32 nPosLineEndLb;
bool mbAreaTP;
@@ -157,7 +159,7 @@ private:
ChangeType* m_pnLineEndListState;
ChangeType* m_pnDashListState;
ChangeType* m_pnColorListState;
- sal_uInt16 m_nPageType;
+ PageType m_nPageType;
sal_uInt16 m_nDlgType;
sal_Int32* m_pPosDashLb;
sal_Int32* m_pPosLineEndLb;
@@ -224,7 +226,7 @@ public:
void SetLineEndList( XLineEndListRef const & pLneEndLst) { m_pLineEndList = pLneEndLst; }
void SetObjSelected( bool bHasObj ) { m_bObjSelected = bHasObj; }
- void SetPageType( sal_uInt16 nInType ) { m_nPageType = nInType; }
+ void SetPageType( PageType nInType ) { m_nPageType = nInType; }
void SetDlgType( sal_uInt16 nInType ) { m_nDlgType = nInType; }
void SetPosDashLb( sal_Int32* pInPos ) { m_pPosDashLb = pInPos; }
void SetPosLineEndLb( sal_Int32* pInPos ) { m_pPosLineEndLb = pInPos; }
@@ -274,7 +276,7 @@ private:
XDashListRef pDashList;
ChangeType* pnDashListState;
- sal_uInt16* pPageType;
+ PageType* pPageType;
sal_uInt16 nDlgType;
sal_Int32* pPosDashLb;
@@ -317,7 +319,7 @@ public:
void SetDashList( XDashListRef const & pDshLst ) { pDashList = pDshLst; }
void SetObjSelected( bool bHasObj ) { bObjSelected = bHasObj; }
- void SetPageType( sal_uInt16* pInType ) { pPageType = pInType; }
+ void SetPageType( PageType* pInType ) { pPageType = pInType; }
void SetDlgType( sal_uInt16 nInType ) { nDlgType = nInType; }
void SetPosDashLb( sal_Int32* pInPos ) { pPosDashLb = pInPos; }
@@ -356,7 +358,7 @@ private:
XLineEndListRef pLineEndList;
ChangeType* pnLineEndListState;
- sal_uInt16* pPageType;
+ PageType* pPageType;
sal_uInt16 nDlgType;
sal_Int32* pPosLineEndLb;
@@ -388,7 +390,7 @@ public:
void SetPolyObj( const SdrObject* pObj ) { pPolyObj = pObj; }
void SetObjSelected( bool bHasObj ) { bObjSelected = bHasObj; }
- void SetPageType( sal_uInt16* pInType ) { pPageType = pInType; }
+ void SetPageType( PageType* pInType ) { pPageType = pInType; }
void SetDlgType( sal_uInt16 nInType ) { nDlgType = nInType; }
void SetPosLineEndLb( sal_Int32* pInPos ) { pPosLineEndLb = pInPos; }
diff --git a/cui/source/tabpages/tabarea.cxx b/cui/source/tabpages/tabarea.cxx
index e403d45f5ebb..a3813ae8df29 100644
--- a/cui/source/tabpages/tabarea.cxx
+++ b/cui/source/tabpages/tabarea.cxx
@@ -73,7 +73,7 @@ SvxAreaTabDialog::SvxAreaTabDialog
mnPatternListState ( ChangeType::NONE ),
mnGradientListState ( ChangeType::NONE ),
mnHatchingListState ( ChangeType::NONE ),
- mnPageType( PT_AREA ),
+ mnPageType( PageType::Area ),
mnPos( 0 ),
mbAreaTP( false )
{
diff --git a/cui/source/tabpages/tabline.cxx b/cui/source/tabpages/tabline.cxx
index 65a2e5268074..6441aadfe019 100644
--- a/cui/source/tabpages/tabline.cxx
+++ b/cui/source/tabpages/tabline.cxx
@@ -63,7 +63,7 @@ SvxLineTabDialog::SvxLineTabDialog
nLineEndListState( ChangeType::NONE ),
nDashListState( ChangeType::NONE ),
mnColorListState( ChangeType::NONE ),
- nPageType( 0 ), // We use it here primarily to get the right attributes with FillItemSet
+ nPageType( PageType::Area ), // We use it here primarily to get the right attributes with FillItemSet
nPosDashLb( 0 ),
nPosLineEndLb( 0 ),
mbAreaTP( false )
diff --git a/cui/source/tabpages/tparea.cxx b/cui/source/tabpages/tparea.cxx
index 1673ae32a891..3dd275b7edc8 100644
--- a/cui/source/tabpages/tparea.cxx
+++ b/cui/source/tabpages/tparea.cxx
@@ -89,7 +89,7 @@ SvxAreaTabPage::SvxAreaTabPage( vcl::Window* pParent, const SfxItemSet& rInAttrs
m_pnGradientListState(&maFixed_ChangeType),
m_pnHatchingListState(&maFixed_ChangeType),
- m_nPageType(0),
+ m_nPageType(PageType::Area),
m_nDlgType(0),
m_nPos(0),
@@ -195,7 +195,7 @@ void SvxAreaTabPage::ActivatePage( const SfxItemSet& rSet )
const SfxUInt16Item* pPageTypeItem = rSet.GetItem<SfxUInt16Item>(SID_PAGE_TYPE, false);
const SfxUInt16Item* pPosItem = rSet.GetItem<SfxUInt16Item>(SID_TABPAGE_POS, false);
if (pPageTypeItem)
- SetPageType(pPageTypeItem->GetValue());
+ SetPageType((PageType) pPageTypeItem->GetValue());
if (pPosItem)
SetPos(pPosItem->GetValue());
if( m_nDlgType == 0 ) // area dialog
@@ -288,32 +288,33 @@ void SvxAreaTabPage::ActivatePage( const SfxItemSet& rSet )
{
switch( m_nPageType )
{
- case PT_GRADIENT:
+ case PageType::Gradient:
m_pTypeLB->SelectEntryPos( drawing::FillStyle_GRADIENT );
m_pLbGradient->SelectEntryPos( _nPos );
ClickGradientHdl_Impl();
break;
- case PT_HATCH:
+ case PageType::Hatch:
m_pTypeLB->SelectEntryPos( drawing::FillStyle_HATCH );
m_pLbHatching->SelectEntryPos( _nPos );
ClickHatchingHdl_Impl();
break;
- case PT_BITMAP:
+ case PageType::Bitmap:
m_pTypeLB->SelectEntryPos( drawing::FillStyle_BITMAP );
m_pLbBitmap->SelectEntryPos( _nPos );
ClickBitmapHdl_Impl();
break;
- case PT_COLOR:
+ case PageType::Color:
m_pTypeLB->SelectEntryPos( drawing::FillStyle_SOLID );
m_pLbColor->SelectEntryPos( _nPos );
ClickColorHdl_Impl();
break;
+ default: break;
}
}
- m_nPageType = PT_AREA;
+ m_nPageType = PageType::Area;
}
}
}
@@ -329,7 +330,7 @@ DeactivateRC SvxAreaTabPage::DeactivatePage( SfxItemSet* _pSet )
{
case drawing::FillStyle_GRADIENT:
{
- m_nPageType = PT_GRADIENT;
+ m_nPageType = PageType::Gradient;
m_nPos = m_pLbGradient->GetSelectEntryPos();
if( nPosOrig != m_nPos )
*m_pnGradientListState |= ChangeType::MODIFIED;
@@ -337,7 +338,7 @@ DeactivateRC SvxAreaTabPage::DeactivatePage( SfxItemSet* _pSet )
break;
case drawing::FillStyle_HATCH:
{
- m_nPageType = PT_HATCH;
+ m_nPageType = PageType::Hatch;
m_nPos = m_pLbHatching->GetSelectEntryPos();
if( nPosOrig != m_nPos )
*m_pnHatchingListState |= ChangeType::MODIFIED;
@@ -345,7 +346,7 @@ DeactivateRC SvxAreaTabPage::DeactivatePage( SfxItemSet* _pSet )
break;
case drawing::FillStyle_BITMAP:
{
- m_nPageType = PT_BITMAP;
+ m_nPageType = PageType::Bitmap;
m_nPos = m_pLbBitmap->GetSelectEntryPos();
if( nPosOrig != m_nPos )
*m_pnBitmapListState |= ChangeType::MODIFIED;
@@ -353,7 +354,7 @@ DeactivateRC SvxAreaTabPage::DeactivatePage( SfxItemSet* _pSet )
break;
case drawing::FillStyle_SOLID:
{
- m_nPageType = PT_COLOR;
+ m_nPageType = PageType::Color;
m_nPos = m_pLbColor->GetSelectEntryPos();
if( nPosOrig != m_nPos )
*m_pnColorListState |= ChangeType::MODIFIED;
@@ -532,7 +533,7 @@ bool SvxAreaTabPage::FillItemSet( SfxItemSet* rAttrs )
}
break;
}
- rAttrs->Put (SfxUInt16Item(SID_PAGE_TYPE,m_nPageType));
+ rAttrs->Put (SfxUInt16Item(SID_PAGE_TYPE, (sal_uInt16)m_nPageType));
rAttrs->Put (SfxUInt16Item(SID_TABPAGE_POS,m_nPos));
}
@@ -914,7 +915,7 @@ void SvxAreaTabPage::PageCreated(const SfxAllItemSet& aSet)
if (pBitmapListItem)
SetBitmapList(pBitmapListItem->GetBitmapList());
if (pPageTypeItem)
- SetPageType(pPageTypeItem->GetValue());
+ SetPageType((PageType) pPageTypeItem->GetValue());
if (pDlgTypeItem)
SetDlgType(pDlgTypeItem->GetValue());
if (pPosItem)
diff --git a/cui/source/tabpages/tpbitmap.cxx b/cui/source/tabpages/tpbitmap.cxx
index 5646ad1159b3..b1735502f07b 100644
--- a/cui/source/tabpages/tpbitmap.cxx
+++ b/cui/source/tabpages/tpbitmap.cxx
@@ -183,12 +183,12 @@ void SvxBitmapTabPage::ActivatePage( const SfxItemSet& )
{
*m_pbAreaTP = false;
- if( *m_nPageType == PT_BITMAP && *m_nPos != LISTBOX_ENTRY_NOTFOUND )
+ if( *m_nPageType == PageType::Bitmap && *m_nPos != LISTBOX_ENTRY_NOTFOUND )
{
sal_uInt16 nId = m_pBitmapLB->GetItemId( static_cast<size_t>( *m_nPos ) );
m_pBitmapLB->SelectItem(nId);
}
- *m_nPageType = PT_BITMAP;
+ *m_nPageType = PageType::Bitmap;
*m_nPos = LISTBOX_ENTRY_NOTFOUND;
}
}
@@ -207,7 +207,7 @@ bool SvxBitmapTabPage::FillItemSet( SfxItemSet* rAttrs )
{
if( m_nDlgType == 0 && !*m_pbAreaTP )
{
- if(PT_BITMAP == *m_nPageType)
+ if(PageType::Bitmap == *m_nPageType)
{
rAttrs->Put(XFillStyleItem(drawing::FillStyle_BITMAP));
size_t nPos = m_pBitmapLB->GetSelectItemPos();
diff --git a/cui/source/tabpages/tpcolor.cxx b/cui/source/tabpages/tpcolor.cxx
index 912d338e2ab7..b78f6eaca210 100644
--- a/cui/source/tabpages/tpcolor.cxx
+++ b/cui/source/tabpages/tpcolor.cxx
@@ -59,12 +59,12 @@ using namespace com::sun::star;
struct SvxColorTabPageShadow
{
- sal_uInt16 nUnknownType;
+ PageType nUnknownType;
sal_Int32 nUnknownPos;
bool bIsAreaTP;
ChangeType nChangeType;
SvxColorTabPageShadow()
- : nUnknownType( COLORPAGE_UNKNOWN )
+ : nUnknownType( PageType::Unknown )
, nUnknownPos( LISTBOX_ENTRY_NOTFOUND )
, bIsAreaTP( false )
, nChangeType( ChangeType::NONE )
@@ -268,14 +268,14 @@ void SvxColorTabPage::ActivatePage( const SfxItemSet& )
if( pColorList.is() )
{
- if( *pPageType == PT_COLOR && *pPos != LISTBOX_ENTRY_NOTFOUND )
+ if( *pPageType == PageType::Color && *pPos != LISTBOX_ENTRY_NOTFOUND )
{
m_pValSetColorList->SelectItem( m_pValSetColorList->GetItemId( static_cast<size_t>(*pPos) ) );
const XColorEntry* pEntry = pColorList->GetColor(*pPos);
aPreviousColor = pEntry->GetColor();
ChangeColor(pEntry->GetColor());
}
- else if( *pPageType == PT_COLOR && *pPos == LISTBOX_ENTRY_NOTFOUND )
+ else if( *pPageType == PageType::Color && *pPos == LISTBOX_ENTRY_NOTFOUND )
{
const SfxPoolItem* pPoolItem = nullptr;
if( SfxItemState::SET == rOutAttrs.GetItemState( GetWhich( XATTR_FILLCOLOR ), true, &pPoolItem ) )
@@ -300,7 +300,7 @@ void SvxColorTabPage::ActivatePage( const SfxItemSet& )
SelectValSetHdl_Impl( m_pValSetColorList );
- *pPageType = PT_COLOR;
+ *pPageType = PageType::Color;
*pPos = LISTBOX_ENTRY_NOTFOUND;
}
}
@@ -357,7 +357,7 @@ long SvxColorTabPage::CheckChanges_Impl()
bool SvxColorTabPage::FillItemSet( SfxItemSet* rSet )
{
if( ( nDlgType != 0 ) ||
- ( *pPageType == PT_COLOR && !*pbAreaTP ) )
+ ( *pPageType == PageType::Color && !*pbAreaTP ) )
{
maPaletteManager.AddRecentColor( aCurrentColor );
rSet->Put( XFillColorItem( OUString(), aCurrentColor ) );
diff --git a/cui/source/tabpages/tpgradnt.cxx b/cui/source/tabpages/tpgradnt.cxx
index 7f343595f42d..f63877be1eb1 100644
--- a/cui/source/tabpages/tpgradnt.cxx
+++ b/cui/source/tabpages/tpgradnt.cxx
@@ -235,7 +235,7 @@ void SvxGradientTabPage::ActivatePage( const SfxItemSet& )
else
aString += aURL.getBase();
- if ( *m_pPageType == PT_GRADIENT && *m_pPos != LISTBOX_ENTRY_NOTFOUND )
+ if ( *m_pPageType == PageType::Gradient && *m_pPos != LISTBOX_ENTRY_NOTFOUND )
{
sal_uInt16 nId = m_pGradientLB->GetItemId( static_cast<size_t>( *m_pPos ) );
m_pGradientLB->SelectItem( nId );
@@ -243,7 +243,7 @@ void SvxGradientTabPage::ActivatePage( const SfxItemSet& )
// colors could have been deleted
ChangeGradientHdl_Impl();
- *m_pPageType = PT_GRADIENT;
+ *m_pPageType = PageType::Gradient;
*m_pPos = LISTBOX_ENTRY_NOTFOUND;
}
}
@@ -326,7 +326,7 @@ long SvxGradientTabPage::CheckChanges_Impl()
bool SvxGradientTabPage::FillItemSet( SfxItemSet* rSet )
{
- if( m_nDlgType == 0 && *m_pPageType == PT_GRADIENT && !*m_pbAreaTP )
+ if( m_nDlgType == 0 && *m_pPageType == PageType::Gradient && !*m_pbAreaTP )
{
// CheckChanges(); <-- duplicate inquiry ?
diff --git a/cui/source/tabpages/tphatch.cxx b/cui/source/tabpages/tphatch.cxx
index 2c59788f7b4f..7c8a6f7caae3 100644
--- a/cui/source/tabpages/tphatch.cxx
+++ b/cui/source/tabpages/tphatch.cxx
@@ -209,7 +209,7 @@ void SvxHatchTabPage::ActivatePage( const SfxItemSet& rSet )
else
aString += aURL.getBase();
- if( *m_pPageType == PT_HATCH && *m_pPos != LISTBOX_ENTRY_NOTFOUND )
+ if( *m_pPageType == PageType::Hatch && *m_pPos != LISTBOX_ENTRY_NOTFOUND )
{
sal_uInt16 nId = m_pHatchLB->GetItemId( static_cast<size_t>( *m_pPos ) );
m_pHatchLB->SelectItem( nId );
@@ -217,7 +217,7 @@ void SvxHatchTabPage::ActivatePage( const SfxItemSet& rSet )
// colors could have been deleted
ChangeHatchHdl_Impl();
- *m_pPageType = PT_HATCH;
+ *m_pPageType = PageType::Hatch;
*m_pPos = LISTBOX_ENTRY_NOTFOUND;
}
}
@@ -331,7 +331,7 @@ bool SvxHatchTabPage::FillItemSet( SfxItemSet* rSet )
{
if( m_nDlgType == 0 && !*m_pbAreaTP ) // area dialog
{
- if( *m_pPageType == PT_HATCH )
+ if( *m_pPageType == PageType::Hatch )
{
// CheckChanges(); <-- duplicate inquiry ?
diff --git a/cui/source/tabpages/tpline.cxx b/cui/source/tabpages/tpline.cxx
index f3cfa0389441..85d02b3d4e04 100644
--- a/cui/source/tabpages/tpline.cxx
+++ b/cui/source/tabpages/tpline.cxx
@@ -51,6 +51,7 @@
#include <svx/dialmgr.hxx>
#include <svx/dialogs.hrc>
#include <vcl/settings.hxx>
+#include <cuitabarea.hxx>
#define MAX_BMP_WIDTH 16
#define MAX_BMP_HEIGHT 16
@@ -103,7 +104,7 @@ SvxLineTabPage::SvxLineTabPage
m_pnLineEndListState( nullptr ),
m_pnDashListState( nullptr ),
m_pnColorListState( nullptr ),
- m_nPageType ( 0 ),
+ m_nPageType( PageType::Area ),
m_nDlgType(0),
m_pPosDashLb(nullptr),
@@ -555,7 +556,7 @@ void SvxLineTabPage::ActivatePage( const SfxItemSet& rSet )
{
const CntUInt16Item* pPageTypeItem = rSet.GetItem<CntUInt16Item>(SID_PAGE_TYPE, false);
if (pPageTypeItem)
- SetPageType(pPageTypeItem->GetValue());
+ SetPageType((PageType) pPageTypeItem->GetValue());
if( m_nDlgType == 0 && m_pDashList.is() )
{
sal_Int32 nPos;
@@ -634,12 +635,12 @@ void SvxLineTabPage::ActivatePage( const SfxItemSet& rSet )
// Evaluate if another TabPage set another fill type
if( m_pLbLineStyle->GetSelectEntryPos() != 0 )
{
- if( m_nPageType == 2 ) // 1
+ if( m_nPageType == PageType::Hatch ) // 1
{
m_pLbLineStyle->SelectEntryPos( *m_pPosDashLb + 2 ); // +2 due to SOLID and INVISIBLE
ChangePreviewHdl_Impl( nullptr );
}
- if( m_nPageType == 3 )
+ if( m_nPageType == PageType::Bitmap )
{
m_pLbStartStyle->SelectEntryPos( *m_pPosLineEndLb + 1 );// +1 due to SOLID
m_pLbEndStyle->SelectEntryPos( *m_pPosLineEndLb + 1 );// +1 due to SOLID
@@ -667,7 +668,7 @@ void SvxLineTabPage::ActivatePage( const SfxItemSet& rSet )
ChangePreviewHdl_Impl( nullptr );
}
- m_nPageType = 0;
+ m_nPageType = PageType::Area;
}
// Page does not yet exist in the ctor, that's why we do it here!
@@ -684,7 +685,7 @@ DeactivateRC SvxLineTabPage::DeactivatePage( SfxItemSet* _pSet )
{
if( m_nDlgType == 0 ) // Line dialog
{
- m_nPageType = 1; // possibly for extensions
+ m_nPageType = PageType::Gradient; // possibly for extensions
*m_pPosDashLb = m_pLbLineStyle->GetSelectEntryPos() - 2;// First entry SOLID!!!
sal_Int32 nPos = m_pLbStartStyle->GetSelectEntryPos();
if( nPos != LISTBOX_ENTRY_NOTFOUND )
@@ -706,7 +707,7 @@ bool SvxLineTabPage::FillItemSet( SfxItemSet* rAttrs )
bool bModified = false;
// To prevent modifications to the list, we do not set other page's items.
- if( m_nDlgType != 0 || m_nPageType != 2 )
+ if( m_nDlgType != 0 || m_nPageType != PageType::Hatch )
{
nPos = m_pLbLineStyle->GetSelectEntryPos();
if( nPos != LISTBOX_ENTRY_NOTFOUND &&
@@ -790,7 +791,7 @@ bool SvxLineTabPage::FillItemSet( SfxItemSet* rAttrs )
}
}
- if( m_nDlgType != 0 || m_nPageType != 3 )
+ if( m_nDlgType != 0 || m_nPageType != PageType::Bitmap )
{
// Line start
nPos = m_pLbStartStyle->GetSelectEntryPos();
@@ -978,7 +979,7 @@ bool SvxLineTabPage::FillItemSet( SfxItemSet* rAttrs )
}
}
}
- rAttrs->Put (CntUInt16Item(SID_PAGE_TYPE,m_nPageType));
+ rAttrs->Put (CntUInt16Item(SID_PAGE_TYPE, (sal_uInt16)m_nPageType));
return bModified;
}
@@ -1811,7 +1812,7 @@ void SvxLineTabPage::PageCreated(const SfxAllItemSet& aSet)
if (pLineEndListItem)
SetLineEndList(pLineEndListItem->GetLineEndList());
if (pPageTypeItem)
- SetPageType(pPageTypeItem->GetValue());
+ SetPageType((PageType) pPageTypeItem->GetValue());
if (pDlgTypeItem)
SetDlgType(pDlgTypeItem->GetValue());
Construct();
diff --git a/cui/source/tabpages/tplnedef.cxx b/cui/source/tabpages/tplnedef.cxx
index b4282dfe7ba4..0620d442ab5e 100644
--- a/cui/source/tabpages/tplnedef.cxx
+++ b/cui/source/tabpages/tplnedef.cxx
@@ -43,6 +43,7 @@
#include <svx/dialmgr.hxx>
#include <svx/dialogs.hrc>
#include <o3tl/make_unique.hxx>
+#include "cuitabarea.hxx"
#define XOUT_WIDTH 150
@@ -192,7 +193,7 @@ void SvxLineDefTabPage::ActivatePage( const SfxItemSet& )
// ActivatePage() is called before the dialog receives PageCreated() !!!
if( pDashList.is() )
{
- if( *pPageType == 1 &&
+ if( *pPageType == PageType::Gradient &&
*pPosDashLb != LISTBOX_ENTRY_NOTFOUND )
{
m_pLbLineStyles->SelectEntryPos( *pPosDashLb );
@@ -209,7 +210,7 @@ void SvxLineDefTabPage::ActivatePage( const SfxItemSet& )
aURL.Append( pDashList->GetName() );
DBG_ASSERT( aURL.GetProtocol() != INetProtocol::NotValid, "invalid URL" );
- *pPageType = 0; // 2
+ *pPageType = PageType::Area; // 2
*pPosDashLb = LISTBOX_ENTRY_NOTFOUND;
}
}
@@ -284,7 +285,7 @@ bool SvxLineDefTabPage::FillItemSet( SfxItemSet* rAttrs )
{
if( nDlgType == 0 ) // line dialog
{
- if( *pPageType == 2 )
+ if( *pPageType == PageType::Hatch )
{
FillDash_Impl();
@@ -380,7 +381,7 @@ void SvxLineDefTabPage::SelectLinestyleHdl_Impl(ListBox* p)
// only if there was an entry selected in the ListBox.
// If it was called via Reset(), then p is == NULL
if( p )
- *pPageType = 2;
+ *pPageType = PageType::Hatch;
}
}
@@ -581,7 +582,7 @@ IMPL_LINK_NOARG_TYPED(SvxLineDefTabPage, ClickAddHdl_Impl, Button*, void)
*pnDashListState |= ChangeType::MODIFIED;
- *pPageType = 2;
+ *pPageType = PageType::Hatch;
// save values for changes recognition (-> method)
m_pNumFldNumber1->SaveValue();
@@ -655,7 +656,7 @@ IMPL_LINK_NOARG_TYPED(SvxLineDefTabPage, ClickModifyHdl_Impl, Button*, void)
*pnDashListState |= ChangeType::MODIFIED;
- *pPageType = 2;
+ *pPageType = PageType::Hatch;
// save values for changes recognition (-> method)
m_pNumFldNumber1->SaveValue();
@@ -695,7 +696,7 @@ IMPL_LINK_NOARG_TYPED(SvxLineDefTabPage, ClickDeleteHdl_Impl, Button*, void)
m_pLbLineStyles->SelectEntryPos( 0 );
SelectLinestyleHdl_Impl( nullptr );
- *pPageType = 0; // style should not be taken
+ *pPageType = PageType::Area; // style should not be taken
*pnDashListState |= ChangeType::MODIFIED;
diff --git a/cui/source/tabpages/tplneend.cxx b/cui/source/tabpages/tplneend.cxx
index c17b18f7e14f..6412f7ba8e64 100644
--- a/cui/source/tabpages/tplneend.cxx
+++ b/cui/source/tabpages/tplneend.cxx
@@ -34,6 +34,7 @@
#include <svx/xpool.hxx>
#include <svx/xtable.hxx>
#include "cuitabline.hxx"
+#include "cuitabarea.hxx"
#include <svx/svxdlg.hxx>
#include <dialmgr.hxx>
#include "svx/dlgutil.hxx"
@@ -174,7 +175,7 @@ void SvxLineEndDefTabPage::ActivatePage( const SfxItemSet& )
aURL.Append( pLineEndList->GetName() );
DBG_ASSERT( aURL.GetProtocol() != INetProtocol::NotValid, "invalid URL" );
- *pPageType = 0; // 3
+ *pPageType = PageType::Area; // 3
*pPosLineEndLb = LISTBOX_ENTRY_NOTFOUND;
}
}
@@ -220,7 +221,7 @@ bool SvxLineEndDefTabPage::FillItemSet( SfxItemSet* rSet )
{
if( nDlgType == 0 ) // line dialog
{
- if( *pPageType == 3 )
+ if( *pPageType == PageType::Bitmap )
{
CheckChanges_Impl();
@@ -299,7 +300,7 @@ IMPL_LINK_NOARG_TYPED(SvxLineEndDefTabPage, SelectLineEndHdl_Impl, ListBox&, voi
// Is not set before, in order to only take the new style,
// if there is an entry selected in the ListBox
- *pPageType = 3;
+ *pPageType = PageType::Bitmap;
}
}
@@ -377,7 +378,7 @@ IMPL_LINK_NOARG_TYPED(SvxLineEndDefTabPage, ClickModifyHdl_Impl, Button*, void)
// Flag fuer modifiziert setzen
*pnLineEndListState |= ChangeType::MODIFIED;
- *pPageType = 3;
+ *pPageType = PageType::Bitmap;
}
else
{
@@ -513,7 +514,7 @@ IMPL_LINK_NOARG_TYPED(SvxLineEndDefTabPage, ClickDeleteHdl_Impl, Button*, void)
m_pLbLineEnds->SelectEntryPos( 0 );
SelectLineEndHdl_Impl( *m_pLbLineEnds );
- *pPageType = 0; // LineEnd shall not be taken over
+ *pPageType = PageType::Area; // LineEnd shall not be taken over
*pnLineEndListState |= ChangeType::MODIFIED;
diff --git a/cui/source/tabpages/tppattern.cxx b/cui/source/tabpages/tppattern.cxx
index 773b7440f0b8..8c1a3f8c3168 100644
--- a/cui/source/tabpages/tppattern.cxx
+++ b/cui/source/tabpages/tppattern.cxx
@@ -226,7 +226,7 @@ void SvxPatternTabPage::ActivatePage( const SfxItemSet& )
else
aString += aURL.getBase();
- if( *m_pPageType == PT_BITMAP && *m_pPos != LISTBOX_ENTRY_NOTFOUND )
+ if( *m_pPageType == PageType::Bitmap && *m_pPos != LISTBOX_ENTRY_NOTFOUND )
{
sal_uInt16 nId = m_pPatternLB->GetItemId( static_cast<size_t>( *m_pPos ) );
m_pPatternLB->SelectItem( nId );
@@ -234,7 +234,7 @@ void SvxPatternTabPage::ActivatePage( const SfxItemSet& )
// colors could have been deleted
ChangePatternHdl_Impl( m_pPatternLB );
- *m_pPageType = PT_BITMAP;
+ *m_pPageType = PageType::Bitmap;
*m_pPos = LISTBOX_ENTRY_NOTFOUND;
}
}
@@ -257,7 +257,7 @@ bool SvxPatternTabPage::FillItemSet( SfxItemSet* _rOutAttrs )
{
if( m_nDlgType == 0 && !*m_pbAreaTP ) // area dialog
{
- if(PT_BITMAP == *m_pPageType)
+ if(PageType::Bitmap == *m_pPageType)
{
_rOutAttrs->Put(XFillStyleItem(drawing::FillStyle_BITMAP));
size_t nPos = m_pPatternLB->GetSelectItemPos();
diff --git a/cui/source/tabpages/tpshadow.cxx b/cui/source/tabpages/tpshadow.cxx
index a363fc509ebb..01f99fc9313a 100644
--- a/cui/source/tabpages/tpshadow.cxx
+++ b/cui/source/tabpages/tpshadow.cxx
@@ -56,7 +56,7 @@ SvxShadowTabPage::SvxShadowTabPage( vcl::Window* pParent, const SfxItemSet& rInA
m_rOutAttrs ( rInAttrs ),
m_eRP ( RP_LT ),
m_pnColorListState ( nullptr ),
- m_nPageType ( 0 ),
+ m_nPageType ( PageType::Area ),
m_nDlgType ( 0 ),
m_pbAreaTP ( nullptr ),
m_aXFillAttr ( rInAttrs.GetPool() ),
@@ -195,7 +195,7 @@ void SvxShadowTabPage::ActivatePage( const SfxItemSet& rSet )
const SfxUInt16Item* pPageTypeItem = rSet.GetItem<SfxUInt16Item>(SID_PAGE_TYPE, false);
if (pPageTypeItem)
- SetPageType(pPageTypeItem->GetValue());
+ SetPageType((PageType) pPageTypeItem->GetValue());
if( m_nDlgType == 0 )
{
@@ -242,7 +242,7 @@ void SvxShadowTabPage::ActivatePage( const SfxItemSet& rSet )
m_pCtlXRectPreview->SetRectangleAttributes( rAttribs );
ModifyShadowHdl_Impl( *m_pMtrTransparent );
}
- m_nPageType = PT_SHADOW;
+ m_nPageType = PageType::Shadow;
}
}
}
@@ -361,7 +361,7 @@ bool SvxShadowTabPage::FillItemSet( SfxItemSet* rAttrs )
}
}
- rAttrs->Put (CntUInt16Item(SID_PAGE_TYPE,m_nPageType));
+ rAttrs->Put (CntUInt16Item(SID_PAGE_TYPE, (sal_uInt16)m_nPageType));
return bModified;
}
@@ -550,7 +550,7 @@ void SvxShadowTabPage::PageCreated(const SfxAllItemSet& aSet)
if (pColorListItem)
SetColorList(pColorListItem->GetColorList());
if (pPageTypeItem)
- SetPageType(pPageTypeItem->GetValue());
+ SetPageType((PageType) pPageTypeItem->GetValue());
if (pDlgTypeItem)
SetDlgType(pDlgTypeItem->GetValue());
Construct();
diff --git a/cui/source/tabpages/tptrans.cxx b/cui/source/tabpages/tptrans.cxx
index 5b936bd7bc7d..1809549fad36 100644
--- a/cui/source/tabpages/tptrans.cxx
+++ b/cui/source/tabpages/tptrans.cxx
@@ -242,7 +242,7 @@ SvxTransparenceTabPage::SvxTransparenceTabPage(vcl::Window* pParent, const SfxIt
rInAttrs),
rOutAttrs ( rInAttrs ),
eRP ( RP_LT ),
- nPageType (0),
+ nPageType ( PageType::Area ),
nDlgType (0),
bBitmap ( false ),
aXFillAttr ( rInAttrs.GetPool() ),
@@ -397,7 +397,7 @@ bool SvxTransparenceTabPage::FillItemSet(SfxItemSet* rAttrs)
rAttrs->Put(aShadowItem);
bModified = true;
}
- rAttrs->Put (CntUInt16Item(SID_PAGE_TYPE,nPageType));
+ rAttrs->Put(CntUInt16Item(SID_PAGE_TYPE, (sal_uInt16)nPageType));
return bModified;
}
@@ -474,10 +474,10 @@ void SvxTransparenceTabPage::ActivatePage(const SfxItemSet& rSet)
{
const CntUInt16Item* pPageTypeItem = rSet.GetItem<CntUInt16Item>(SID_PAGE_TYPE, false);
if (pPageTypeItem)
- SetPageType(pPageTypeItem->GetValue());
+ SetPageType((PageType) pPageTypeItem->GetValue());
if(nDlgType == 0) // area dialog
- nPageType = PT_TRANSPARENCE;
+ nPageType = PageType::Transparence;
InitPreview ( rSet );
}
@@ -571,7 +571,7 @@ void SvxTransparenceTabPage::PageCreated(const SfxAllItemSet& aSet)
const SfxUInt16Item* pDlgTypeItem = aSet.GetItem<SfxUInt16Item>(SID_DLG_TYPE, false);
if (pPageTypeItem)
- SetPageType(pPageTypeItem->GetValue());
+ SetPageType((PageType) pPageTypeItem->GetValue());
if (pDlgTypeItem)
SetDlgType(pDlgTypeItem->GetValue());
}