summaryrefslogtreecommitdiff
path: root/cui
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2016-08-24 15:06:35 +0200
committerNoel Grandin <noel@peralex.com>2016-08-25 08:40:00 +0200
commit3aa7db4586c53a0815b74cc514ff8a6541dc7e01 (patch)
treeb3dba2d12d3ef9738239c814184211fe75afa505 /cui
parentce51b64947f120c592853aec2d01542dcd2cc2c0 (diff)
convert SvxAnchorIds to scoped enum
Change-Id: I4375fa07eb6ac81b21b904e965e4c2f9600ca99a
Diffstat (limited to 'cui')
-rw-r--r--cui/source/factory/dlgfact.cxx8
-rw-r--r--cui/source/factory/dlgfact.hxx4
-rw-r--r--cui/source/inc/labdlg.hxx5
-rw-r--r--cui/source/inc/swpossizetabpage.hxx3
-rw-r--r--cui/source/inc/transfrm.hxx13
-rw-r--r--cui/source/tabpages/labdlg.cxx8
-rw-r--r--cui/source/tabpages/swpossizetabpage.cxx6
-rw-r--r--cui/source/tabpages/transfrm.cxx8
8 files changed, 25 insertions, 30 deletions
diff --git a/cui/source/factory/dlgfact.cxx b/cui/source/factory/dlgfact.cxx
index c1f3644801b2..39ec6d2ab749 100644
--- a/cui/source/factory/dlgfact.cxx
+++ b/cui/source/factory/dlgfact.cxx
@@ -921,7 +921,7 @@ SfxAbstractTabDialog* AbstractDialogFactory_Impl::CreateTextTabDialog( vcl::Wind
// TabDialog that use functionality of the drawing layer and add AnchorTypes -- for SvxCaptionTabDialog
AbstractSvxCaptionDialog* AbstractDialogFactory_Impl::CreateCaptionDialog( vcl::Window* pParent,
const SdrView* pView,
- sal_uInt16 nAnchorTypes )
+ SvxAnchorIds nAnchorTypes )
{
VclPtrInstance<SvxCaptionTabDialog> pDlg( pParent, pView, nAnchorTypes );
return new AbstractSvxCaptionDialog_Impl( pDlg );
@@ -1095,7 +1095,7 @@ SfxAbstractTabDialog* AbstractDialogFactory_Impl::CreateSvxBorderBackgroundDlg(
AbstractSvxTransformTabDialog* AbstractDialogFactory_Impl::CreateSvxTransformTabDialog( vcl::Window* pParent,
const SfxItemSet* pAttr,
const SdrView* pView,
- sal_uInt16 nAnchorTypes )
+ SvxAnchorIds nAnchorTypes )
{
VclPtrInstance<SvxTransformTabDialog> pDlg( pParent, pAttr,pView, nAnchorTypes);
return new AbstractSvxTransformTabDialog_Impl( pDlg );
@@ -1113,14 +1113,14 @@ SfxAbstractTabDialog* AbstractDialogFactory_Impl::CreateSchTransformTabDialog( v
{
case RID_SCH_TransformTabDLG_SVXPAGE_ANGLE :
{
- pDlg.reset( VclPtr<SvxTransformTabDialog>::Create( pParent, pAttr,pSdrView, bSizeTabPage ? SVX_OBJ_NOPROTECT : SVX_OBJ_NOPROTECT|SVX_OBJ_NORESIZE) );
+ pDlg.reset( VclPtr<SvxTransformTabDialog>::Create( pParent, pAttr,pSdrView, bSizeTabPage ? SvxAnchorIds::NoProtect : SvxAnchorIds::NoProtect|SvxAnchorIds::NoResize) );
pDlg->RemoveTabPage( "RID_SVXPAGE_ANGLE" );
pDlg->RemoveTabPage( "RID_SVXPAGE_SLANT" );
}
break;
case RID_SCH_TransformTabDLG_SVXPAGE_SLANT:
{
- pDlg.reset(VclPtr<SvxTransformTabDialog>::Create ( pParent, pAttr,pSdrView, bSizeTabPage ? SVX_OBJ_NOPROTECT : SVX_OBJ_NOPROTECT|SVX_OBJ_NORESIZE ) );
+ pDlg.reset(VclPtr<SvxTransformTabDialog>::Create ( pParent, pAttr,pSdrView, bSizeTabPage ? SvxAnchorIds::NoProtect : SvxAnchorIds::NoProtect|SvxAnchorIds::NoResize ) );
pDlg->RemoveTabPage( "RID_SVXPAGE_SLANT" );
}
break;
diff --git a/cui/source/factory/dlgfact.hxx b/cui/source/factory/dlgfact.hxx
index 1196aa3556dc..4790b8054400 100644
--- a/cui/source/factory/dlgfact.hxx
+++ b/cui/source/factory/dlgfact.hxx
@@ -476,7 +476,7 @@ public:
const SfxItemSet& rSet) override;
virtual AbstractSvxCaptionDialog* CreateCaptionDialog( vcl::Window* pParent,
const SdrView* pView,
- sal_uInt16 nAnchorTypes = 0 ) override;
+ SvxAnchorIds nAnchorTypes = SvxAnchorIds::NONE ) override;
virtual AbstractSvxDistributeDialog* CreateSvxDistributeDialog(const SfxItemSet& rAttr) override;
virtual SfxAbstractInsertObjectDialog* CreateInsertObjectDialog( vcl::Window* pParent, const OUString& rCommmand,
const css::uno::Reference < css::embed::XStorage >& xStor,
@@ -509,7 +509,7 @@ public:
virtual AbstractSvxTransformTabDialog* CreateSvxTransformTabDialog( vcl::Window* pParent,
const SfxItemSet* pAttr,
const SdrView* pView,
- sal_uInt16 nAnchorTypes = 0) override ;
+ SvxAnchorIds nAnchorTypes = SvxAnchorIds::NONE) override ;
virtual SfxAbstractTabDialog* CreateSchTransformTabDialog( vcl::Window* pParent,
const SfxItemSet* pAttr,
const SdrView* pSdrView,
diff --git a/cui/source/inc/labdlg.hxx b/cui/source/inc/labdlg.hxx
index a7b10648b434..e431abb0065f 100644
--- a/cui/source/inc/labdlg.hxx
+++ b/cui/source/inc/labdlg.hxx
@@ -26,6 +26,7 @@
#include <sfx2/tabdlg.hxx>
#include <svx/sxctitm.hxx>
#include <svx/sxcecitm.hxx>
+#include <svx/anchorid.hxx>
class SdrView;
@@ -101,7 +102,7 @@ class SvxCaptionTabDialog : public SfxTabDialog
{
private:
const SdrView* pView;
- sal_uInt16 nAnchorCtrls;
+ SvxAnchorIds nAnchorCtrls;
sal_uInt16 m_nSwPosSizePageId;
sal_uInt16 m_nPositionSizePageId;
sal_uInt16 m_nCaptionPageId;
@@ -112,7 +113,7 @@ private:
public:
SvxCaptionTabDialog(vcl::Window* pParent, const SdrView* pView,
- sal_uInt16 nAnchorTypes = 0);
+ SvxAnchorIds nAnchorTypes = SvxAnchorIds::NONE);
/// link for the Writer to validate positions
void SetValidateFramePosLink( const Link<SvxSwFrameValidation&,void>& rLink );
diff --git a/cui/source/inc/swpossizetabpage.hxx b/cui/source/inc/swpossizetabpage.hxx
index 611ebc01003d..5142d6dfaeaf 100644
--- a/cui/source/inc/swpossizetabpage.hxx
+++ b/cui/source/inc/swpossizetabpage.hxx
@@ -31,6 +31,7 @@
struct FrmMap;
class SdrView;
struct SvxSwFrameValidation;
+enum class SvxAnchorIds;
class SvxSwPosSizeTabPage : public SfxTabPage
{
@@ -136,7 +137,7 @@ public:
virtual DeactivateRC DeactivatePage( SfxItemSet* pSet ) override;
- void EnableAnchorTypes(sal_uInt16 nAnchorEnable);
+ void EnableAnchorTypes(SvxAnchorIds nAnchorEnable);
void SetValidateFramePosLink( const Link<SvxSwFrameValidation&,void>& rLink )
{m_aValidateLink = rLink;}
diff --git a/cui/source/inc/transfrm.hxx b/cui/source/inc/transfrm.hxx
index 2857e451cc76..7e9077758e54 100644
--- a/cui/source/inc/transfrm.hxx
+++ b/cui/source/inc/transfrm.hxx
@@ -21,6 +21,7 @@
#include <svx/dlgctrl.hxx>
#include <svx/dialcontrol.hxx>
+#include <svx/anchorid.hxx>
#include <vcl/fixed.hxx>
@@ -35,14 +36,6 @@ class SdrView;
|*
\************************************************************************/
-/** put this into the nAnchorTypes parameter of the SvxTransformTabDialog c'tor
- to disable the size controls */
-const sal_uInt16 SVX_OBJ_NORESIZE = 0x0100;
-
-/** put this into the nAnchorTypes parameter of the SvxTransformTabDialog c'tor
- to disable the protect controls */
-const sal_uInt16 SVX_OBJ_NOPROTECT = 0x0200;
-
struct SvxSwFrameValidation;
class SvxTransformTabDialog : public SfxTabDialog
{
@@ -53,7 +46,7 @@ class SvxTransformTabDialog : public SfxTabDialog
private:
const SdrView* pView;
- sal_uInt16 nAnchorCtrls;
+ SvxAnchorIds nAnchorCtrls;
Link<SvxSwFrameValidation&,void> aValidateLink;
virtual void PageCreated( sal_uInt16 nId, SfxTabPage &rPage ) override;
@@ -62,7 +55,7 @@ public:
SvxTransformTabDialog( vcl::Window* pParent, const SfxItemSet* pAttr,
const SdrView* pView,
- sal_uInt16 nAnchorTypes = 0);
+ SvxAnchorIds nAnchorTypes = SvxAnchorIds::NONE);
//link for the Writer to validate positions
void SetValidateFramePosLink( const Link<SvxSwFrameValidation&,void>& rLink );
diff --git a/cui/source/tabpages/labdlg.cxx b/cui/source/tabpages/labdlg.cxx
index 2c01f5381630..3c2d3e9c0fdf 100644
--- a/cui/source/tabpages/labdlg.cxx
+++ b/cui/source/tabpages/labdlg.cxx
@@ -507,7 +507,7 @@ void SvxCaptionTabPage::FillValueSet()
SvxCaptionTabDialog::SvxCaptionTabDialog(vcl::Window* pParent, const SdrView* pSdrView,
- sal_uInt16 nAnchorTypes)
+ SvxAnchorIds nAnchorTypes)
: SfxTabDialog( pParent, "CalloutDialog", "cui/ui/calloutdialog.ui")
, pView(pSdrView)
, nAnchorCtrls(nAnchorTypes)
@@ -518,7 +518,7 @@ SvxCaptionTabDialog::SvxCaptionTabDialog(vcl::Window* pParent, const SdrView* pS
assert(pView); //Keine gueltige View Uebergeben!
//different positioning page in Writer
- if (nAnchorCtrls & 0x00ff)
+ if (nAnchorCtrls & (SvxAnchorIds::Paragraph | SvxAnchorIds::Character | SvxAnchorIds::Page | SvxAnchorIds::Fly))
{
m_nSwPosSizePageId = AddTabPage("RID_SVXPAGE_SWPOSSIZE", SvxSwPosSizeTabPage::Create,
SvxSwPosSizeTabPage::GetRanges );
@@ -540,10 +540,10 @@ void SvxCaptionTabDialog::PageCreated( sal_uInt16 nId, SfxTabPage &rPage )
{
static_cast<SvxPositionSizeTabPage&>( rPage ).SetView( pView );
static_cast<SvxPositionSizeTabPage&>( rPage ).Construct();
- if( nAnchorCtrls & SVX_OBJ_NORESIZE )
+ if( nAnchorCtrls & SvxAnchorIds::NoResize )
static_cast<SvxPositionSizeTabPage&>( rPage ).DisableResize();
- if( nAnchorCtrls & SVX_OBJ_NOPROTECT )
+ if( nAnchorCtrls & SvxAnchorIds::NoProtect )
static_cast<SvxPositionSizeTabPage&>( rPage ).DisableProtect();
}
else if (nId == m_nSwPosSizePageId)
diff --git a/cui/source/tabpages/swpossizetabpage.cxx b/cui/source/tabpages/swpossizetabpage.cxx
index 6fcd7cc97238..053495cccca3 100644
--- a/cui/source/tabpages/swpossizetabpage.cxx
+++ b/cui/source/tabpages/swpossizetabpage.cxx
@@ -1096,11 +1096,11 @@ DeactivateRC SvxSwPosSizeTabPage::DeactivatePage( SfxItemSet* _pSet )
return DeactivateRC::LeavePage;
}
-void SvxSwPosSizeTabPage::EnableAnchorTypes(sal_uInt16 nAnchorEnable)
+void SvxSwPosSizeTabPage::EnableAnchorTypes(SvxAnchorIds nAnchorEnable)
{
- if((nAnchorEnable & SVX_OBJ_AT_FLY))
+ if((nAnchorEnable & SvxAnchorIds::Fly))
m_pToFrameRB->Show();
- if(!(nAnchorEnable & SVX_OBJ_PAGE))
+ if(!(nAnchorEnable & SvxAnchorIds::Page))
m_pToPageRB->Enable(false);
}
diff --git a/cui/source/tabpages/transfrm.cxx b/cui/source/tabpages/transfrm.cxx
index b570a604206e..90cede794f54 100644
--- a/cui/source/tabpages/transfrm.cxx
+++ b/cui/source/tabpages/transfrm.cxx
@@ -88,7 +88,7 @@ const sal_uInt16 SvxSlantTabPage::pSlantRanges[] =
\************************************************************************/
SvxTransformTabDialog::SvxTransformTabDialog( vcl::Window* pParent, const SfxItemSet* pAttr,
- const SdrView* pSdrView, sal_uInt16 nAnchorTypes )
+ const SdrView* pSdrView, SvxAnchorIds nAnchorTypes )
: SfxTabDialog( pParent
,"PositionAndSizeDialog"
,"cui/ui/positionsizedialog.ui"
@@ -101,7 +101,7 @@ SvxTransformTabDialog::SvxTransformTabDialog( vcl::Window* pParent, const SfxIte
DBG_ASSERT(pView, "no valid view (!)");
//different positioning page in Writer
- if(nAnchorCtrls & 0x00ff)
+ if(nAnchorCtrls & (SvxAnchorIds::Paragraph | SvxAnchorIds::Character | SvxAnchorIds::Page | SvxAnchorIds::Fly))
{
nSWPosSize = AddTabPage("RID_SVXPAGE_SWPOSSIZE", SvxSwPosSizeTabPage::Create, SvxSwPosSizeTabPage::GetRanges);
RemoveTabPage("RID_SVXPAGE_POSITION_SIZE");
@@ -125,12 +125,12 @@ void SvxTransformTabDialog::PageCreated(sal_uInt16 nId, SfxTabPage &rPage)
rSvxPos.SetView(pView);
rSvxPos.Construct();
- if(nAnchorCtrls & SVX_OBJ_NORESIZE)
+ if(nAnchorCtrls & SvxAnchorIds::NoResize)
{
rSvxPos.DisableResize();
}
- if(nAnchorCtrls & SVX_OBJ_NOPROTECT)
+ if(nAnchorCtrls & SvxAnchorIds::NoProtect)
{
rSvxPos.DisableProtect();
rSvxPos.UpdateControlStates();