summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2016-08-18 08:47:59 +0200
committerNoel Grandin <noel@peralex.com>2016-08-18 08:49:02 +0200
commit6fdfa13a096c55f5038c4a850cfb108d30143d4b (patch)
tree0c895f66159d0d7828a72e4d0a5f988205a8160e
parent55b74b454f4fceccfc05406b44919a5276e0b3ae (diff)
convert SdrCaptionEscDir to scoped enum
Change-Id: Iec6dfbdc65efde86ff24ddc51c48eb697bf4ead1
-rw-r--r--cui/source/inc/labdlg.hxx7
-rw-r--r--cui/source/tabpages/labdlg.cxx32
-rw-r--r--include/svx/sxcecitm.hxx4
-rw-r--r--sc/source/core/data/postit.cxx2
-rw-r--r--sc/source/core/tool/detfunc.cxx2
-rw-r--r--svx/source/svdraw/svdocapt.cxx16
-rw-r--r--xmloff/source/draw/sdpropls.cxx6
7 files changed, 36 insertions, 33 deletions
diff --git a/cui/source/inc/labdlg.hxx b/cui/source/inc/labdlg.hxx
index a7e77a73f26a..a7b10648b434 100644
--- a/cui/source/inc/labdlg.hxx
+++ b/cui/source/inc/labdlg.hxx
@@ -25,6 +25,7 @@
#include <svtools/valueset.hxx>
#include <sfx2/tabdlg.hxx>
#include <svx/sxctitm.hxx>
+#include <svx/sxcecitm.hxx>
class SdrView;
@@ -56,12 +57,12 @@ private:
SdrCaptionType nCaptionType;
sal_Int32 nGap;
- short nEscDir;
- bool bEscRel;
+ SdrCaptionEscDir nEscDir;
+ bool bEscRel;
sal_Int32 nEscAbs;
sal_Int32 nEscRel;
sal_Int32 nLineLen;
- bool bFitLineLen;
+ bool bFitLineLen;
sal_uInt16 nAnsatzRelPos;
sal_uInt16 nAnsatzTypePos;
diff --git a/cui/source/tabpages/labdlg.cxx b/cui/source/tabpages/labdlg.cxx
index 7bd9a2aaa150..1b18c5bdf076 100644
--- a/cui/source/tabpages/labdlg.cxx
+++ b/cui/source/tabpages/labdlg.cxx
@@ -74,7 +74,7 @@ SvxCaptionTabPage::SvxCaptionTabPage(vcl::Window* pParent, const SfxItemSet& rIn
: SfxTabPage(pParent, "CalloutPage", "cui/ui/calloutpage.ui", &rInAttrs)
, nCaptionType(SdrCaptionType::Type1)
, nGap(0)
- , nEscDir(0)
+ , nEscDir(SdrCaptionEscDir::Horizontal)
, bEscRel(false)
, nEscAbs(0)
, nEscRel(0)
@@ -187,12 +187,13 @@ bool SvxCaptionTabPage::FillItemSet( SfxItemSet* _rOutAttrs)
{
switch( nEscDir )
{
- case SDRCAPT_ESCHORIZONTAL: nEscDir=SDRCAPT_ESCVERTICAL;break;
- case SDRCAPT_ESCVERTICAL: nEscDir=SDRCAPT_ESCHORIZONTAL;break;
+ case SdrCaptionEscDir::Horizontal: nEscDir=SdrCaptionEscDir::Vertical;break;
+ case SdrCaptionEscDir::Vertical: nEscDir=SdrCaptionEscDir::Horizontal;break;
+ default: break;
}
}
- _rOutAttrs->Put( SdrCaptionEscDirItem( (SdrCaptionEscDir)nEscDir ) );
+ _rOutAttrs->Put( SdrCaptionEscDirItem( nEscDir ) );
bEscRel = m_pLB_ANSATZ_REL->IsVisible();
_rOutAttrs->Put( SdrCaptionEscIsRelItem( bEscRel ) );
@@ -287,7 +288,7 @@ void SvxCaptionTabPage::Reset( const SfxItemSet* )
nCaptionType = (SdrCaptionType)static_cast<const SdrCaptionTypeItem&>( rOutAttrs.Get( GetWhich( SDRATTR_CAPTIONTYPE ) ) ).GetValue();
bFitLineLen = static_cast<const SfxBoolItem&>( rOutAttrs.Get( GetWhich( SDRATTR_CAPTIONFITLINELEN ) ) ).GetValue();
- nEscDir = (short)static_cast<const SdrCaptionEscDirItem&>( rOutAttrs.Get( GetWhich( SDRATTR_CAPTIONESCDIR ) ) ).GetValue();
+ nEscDir = static_cast<const SdrCaptionEscDirItem&>( rOutAttrs.Get( GetWhich( SDRATTR_CAPTIONESCDIR ) ) ).GetValue();
bEscRel = static_cast<const SfxBoolItem&>( rOutAttrs.Get( GetWhich( SDRATTR_CAPTIONESCISREL ) ) ).GetValue();
// special treatment!!! XXX
@@ -295,8 +296,9 @@ void SvxCaptionTabPage::Reset( const SfxItemSet* )
{
switch( nEscDir )
{
- case SDRCAPT_ESCHORIZONTAL: nEscDir=SDRCAPT_ESCVERTICAL;break;
- case SDRCAPT_ESCVERTICAL: nEscDir=SDRCAPT_ESCHORIZONTAL;break;
+ case SdrCaptionEscDir::Horizontal: nEscDir=SdrCaptionEscDir::Vertical;break;
+ case SdrCaptionEscDir::Vertical: nEscDir=SdrCaptionEscDir::Horizontal;break;
+ default: break;
}
}
@@ -305,7 +307,7 @@ void SvxCaptionTabPage::Reset( const SfxItemSet* )
m_pMF_ABSTAND->SetValue( nGap );
- if( nEscDir == SDRCAPT_ESCHORIZONTAL )
+ if( nEscDir == SdrCaptionEscDir::Horizontal )
{
if( bEscRel )
{
@@ -321,7 +323,7 @@ void SvxCaptionTabPage::Reset( const SfxItemSet* )
m_pMF_ANSATZ->SetValue( nEscAbs );
}
}
- else if( nEscDir == SDRCAPT_ESCVERTICAL )
+ else if( nEscDir == SdrCaptionEscDir::Vertical )
{
if( bEscRel )
{
@@ -337,7 +339,7 @@ void SvxCaptionTabPage::Reset( const SfxItemSet* )
m_pMF_ANSATZ->SetValue( nEscAbs );
}
}
- else if( nEscDir == SDRCAPT_ESCBESTFIT )
+ else if( nEscDir == SdrCaptionEscDir::BestFit )
{
nAnsatzTypePos = AZ_OPTIMAL;
}
@@ -369,7 +371,7 @@ void SvxCaptionTabPage::SetupAnsatz_Impl( sal_uInt16 nType )
m_pFT_UM->Show();
m_pFT_ANSATZ_REL->Hide();
m_pLB_ANSATZ_REL->Hide();
- nEscDir = SDRCAPT_ESCBESTFIT;
+ nEscDir = SdrCaptionEscDir::BestFit;
break;
case AZ_VON_OBEN:
@@ -377,7 +379,7 @@ void SvxCaptionTabPage::SetupAnsatz_Impl( sal_uInt16 nType )
m_pFT_UM->Show();
m_pFT_ANSATZ_REL->Hide();
m_pLB_ANSATZ_REL->Hide();
- nEscDir = SDRCAPT_ESCHORIZONTAL;
+ nEscDir = SdrCaptionEscDir::Horizontal;
break;
case AZ_VON_LINKS:
@@ -385,7 +387,7 @@ void SvxCaptionTabPage::SetupAnsatz_Impl( sal_uInt16 nType )
m_pFT_UM->Show();
m_pFT_ANSATZ_REL->Hide();
m_pLB_ANSATZ_REL->Hide();
- nEscDir = SDRCAPT_ESCVERTICAL;
+ nEscDir = SdrCaptionEscDir::Vertical;
break;
case AZ_HORIZONTAL:
@@ -398,7 +400,7 @@ void SvxCaptionTabPage::SetupAnsatz_Impl( sal_uInt16 nType )
m_pFT_UM->Hide();
m_pFT_ANSATZ_REL->Show();
m_pLB_ANSATZ_REL->Show();
- nEscDir = SDRCAPT_ESCHORIZONTAL;
+ nEscDir = SdrCaptionEscDir::Horizontal;
break;
case AZ_VERTIKAL:
@@ -411,7 +413,7 @@ void SvxCaptionTabPage::SetupAnsatz_Impl( sal_uInt16 nType )
m_pFT_UM->Hide();
m_pFT_ANSATZ_REL->Show();
m_pLB_ANSATZ_REL->Show();
- nEscDir = SDRCAPT_ESCVERTICAL;
+ nEscDir = SdrCaptionEscDir::Vertical;
break;
}
}
diff --git a/include/svx/sxcecitm.hxx b/include/svx/sxcecitm.hxx
index 22e6024b004f..ba11540ceb16 100644
--- a/include/svx/sxcecitm.hxx
+++ b/include/svx/sxcecitm.hxx
@@ -25,14 +25,14 @@
#include <svx/sdmetitm.hxx>
#include <svx/svxdllapi.h>
-enum SdrCaptionEscDir {SDRCAPT_ESCHORIZONTAL,SDRCAPT_ESCVERTICAL,SDRCAPT_ESCBESTFIT};
+enum class SdrCaptionEscDir { Horizontal, Vertical, BestFit };
// class SdrCaptionEscDirItem
class SVX_DLLPUBLIC SdrCaptionEscDirItem: public SfxEnumItem {
public:
- SdrCaptionEscDirItem(SdrCaptionEscDir eDir=SDRCAPT_ESCHORIZONTAL): SfxEnumItem(SDRATTR_CAPTIONESCDIR,sal::static_int_cast< sal_uInt16 >(eDir)) {}
+ SdrCaptionEscDirItem(SdrCaptionEscDir eDir=SdrCaptionEscDir::Horizontal): SfxEnumItem(SDRATTR_CAPTIONESCDIR,sal::static_int_cast< sal_uInt16 >(eDir)) {}
SdrCaptionEscDirItem(SvStream& rIn) : SfxEnumItem(SDRATTR_CAPTIONESCDIR,rIn) {}
virtual SfxPoolItem* Clone(SfxItemPool* pPool=nullptr) const override;
virtual SfxPoolItem* Create(SvStream& rIn, sal_uInt16 nVer) const override;
diff --git a/sc/source/core/data/postit.cxx b/sc/source/core/data/postit.cxx
index d87287705464..18da0ce9367d 100644
--- a/sc/source/core/data/postit.cxx
+++ b/sc/source/core/data/postit.cxx
@@ -118,7 +118,7 @@ void ScCaptionUtil::SetDefaultItems( SdrCaptionObj& rCaption, ScDocument& rDoc )
aItemSet.Put( XLineStartCenterItem( false ) );
aItemSet.Put( XFillStyleItem( drawing::FillStyle_SOLID ) );
aItemSet.Put( XFillColorItem( OUString(), ScDetectiveFunc::GetCommentColor() ) );
- aItemSet.Put( SdrCaptionEscDirItem( SDRCAPT_ESCBESTFIT ) );
+ aItemSet.Put( SdrCaptionEscDirItem( SdrCaptionEscDir::BestFit ) );
// shadow
/* SdrShadowItem has sal_False, instead the shadow is set for the
diff --git a/sc/source/core/tool/detfunc.cxx b/sc/source/core/tool/detfunc.cxx
index 740174eeb3e5..b4d05d047239 100644
--- a/sc/source/core/tool/detfunc.cxx
+++ b/sc/source/core/tool/detfunc.cxx
@@ -234,7 +234,7 @@ ScCommentData::ScCommentData( ScDocument& rDoc, SdrModel* pModel ) :
// support the best position for the tail connector now that
// that notes can be resized and repositioned.
- aCaptionSet.Put( SdrCaptionEscDirItem( SDRCAPT_ESCBESTFIT) );
+ aCaptionSet.Put( SdrCaptionEscDirItem( SdrCaptionEscDir::BestFit) );
}
void ScCommentData::UpdateCaptionSet( const SfxItemSet& rItemSet )
diff --git a/svx/source/svdraw/svdocapt.cxx b/svx/source/svdraw/svdocapt.cxx
index 4ab3e82cc38f..4bcb20d23692 100644
--- a/svx/source/svdraw/svdocapt.cxx
+++ b/svx/source/svdraw/svdocapt.cxx
@@ -84,7 +84,7 @@ public:
bFixedAngle=false;
nAngle =4500;
nGap =0;
- eEscDir =SDRCAPT_ESCHORIZONTAL;
+ eEscDir =SdrCaptionEscDir::Horizontal;
bEscRel =true;
nEscRel =5000;
nEscAbs =0;
@@ -111,20 +111,20 @@ void ImpCaptParams::CalcEscPos(const Point& rTailPt, const Rectangle& rRect, Poi
nY+=rRect.Top();
Point aBestPt;
EscDir eBestDir=LKS;
- bool bTryH=eEscDir==SDRCAPT_ESCBESTFIT;
+ bool bTryH=eEscDir==SdrCaptionEscDir::BestFit;
if (!bTryH) {
if (eType!=SdrCaptionType::Type1) {
- bTryH=eEscDir==SDRCAPT_ESCHORIZONTAL;
+ bTryH=eEscDir==SdrCaptionEscDir::Horizontal;
} else {
- bTryH=eEscDir==SDRCAPT_ESCVERTICAL;
+ bTryH=eEscDir==SdrCaptionEscDir::Vertical;
}
}
- bool bTryV=eEscDir==SDRCAPT_ESCBESTFIT;
+ bool bTryV=eEscDir==SdrCaptionEscDir::BestFit;
if (!bTryV) {
if (eType!=SdrCaptionType::Type1) {
- bTryV=eEscDir==SDRCAPT_ESCVERTICAL;
+ bTryV=eEscDir==SdrCaptionEscDir::Vertical;
} else {
- bTryV=eEscDir==SDRCAPT_ESCHORIZONTAL;
+ bTryV=eEscDir==SdrCaptionEscDir::Horizontal;
}
}
@@ -153,7 +153,7 @@ void ImpCaptParams::CalcEscPos(const Point& rTailPt, const Rectangle& rRect, Poi
eBest2=UNT;
aBest2=aBtm;
}
- bool bTakeIt=eEscDir!=SDRCAPT_ESCBESTFIT;
+ bool bTakeIt=eEscDir!=SdrCaptionEscDir::BestFit;
if (!bTakeIt) {
BigInt aHorX(aBestPt.X()-aTl.X()); aHorX*=aHorX;
BigInt aHorY(aBestPt.Y()-aTl.Y()); aHorY*=aHorY;
diff --git a/xmloff/source/draw/sdpropls.cxx b/xmloff/source/draw/sdpropls.cxx
index 7b6be23b500b..19fcd4228291 100644
--- a/xmloff/source/draw/sdpropls.cxx
+++ b/xmloff/source/draw/sdpropls.cxx
@@ -714,9 +714,9 @@ static SvXMLEnumMapEntry const pXML_Fontwork_Form_Enum[] =
static SvXMLEnumMapEntry const pXML_Caption_Esc_Dir_Enum[] =
{
- { XML_HORIZONTAL, 0 }, //SDRCAPT_ESCHORIZONTAL,
- { XML_VERTICAL, 1 }, //SDRCAPT_ESCVERTICAL,
- { XML_AUTO, 2 }, //SDRCAPT_ESCBESTFIT,
+ { XML_HORIZONTAL, 0 }, //SdrCaptionEscDir::Horizontal,
+ { XML_VERTICAL, 1 }, //SdrCaptionEscDir::Vertical,
+ { XML_AUTO, 2 }, //SdrCaptionEscDir::BestFit,
{ XML_TOKEN_INVALID,0 }
};