summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noelgrandin@gmail.com>2016-03-30 16:54:15 +0200
committerNoel Grandin <noelgrandin@gmail.com>2016-03-31 09:34:50 +0000
commit8138dae8577b4fcc30bd269516d9213587f6d732 (patch)
tree5c61ba07a1407decefd252312c0b8c49ac160cf5
parent6439005484bdf6754b910b1ce025b3fb33b6623f (diff)
tdf#84938 convert SW_MC_* to scoped enum
Change-Id: Id2a64dd31e5e1a61ac5873255e1452ca9bff97e3 Reviewed-on: https://gerrit.libreoffice.org/23655 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
-rw-r--r--sw/source/core/text/itrform2.cxx6
-rw-r--r--sw/source/core/text/pormulti.cxx10
-rw-r--r--sw/source/core/text/pormulti.hxx10
3 files changed, 13 insertions, 13 deletions
diff --git a/sw/source/core/text/itrform2.cxx b/sw/source/core/text/itrform2.cxx
index dc853e119617..f8c1d418c94d 100644
--- a/sw/source/core/text/itrform2.cxx
+++ b/sw/source/core/text/itrform2.cxx
@@ -1246,9 +1246,9 @@ SwLinePortion *SwTextFormatter::NewPortion( SwTextFormatInfo &rInf )
{
SwMultiPortion* pTmp = nullptr;
- if ( SW_MC_BIDI == pCreate->nId )
+ if ( SwMultiCreatorId::Bidi == pCreate->nId )
pTmp = new SwBidiPortion( nEnd, pCreate->nLevel );
- else if ( SW_MC_RUBY == pCreate->nId )
+ else if ( SwMultiCreatorId::Ruby == pCreate->nId )
{
Seek( rInf.GetIdx() );
bool bRubyTop = false;
@@ -1269,7 +1269,7 @@ SwLinePortion *SwTextFormatter::NewPortion( SwTextFormatInfo &rInf )
*GetTextFrame()->GetTextNode()->getIDocumentSettingAccess(),
nEnd, 0, pRubyPos );
}
- else if( SW_MC_ROTATE == pCreate->nId )
+ else if( SwMultiCreatorId::Rotate == pCreate->nId )
pTmp = new SwRotatedPortion( *pCreate, nEnd,
GetTextFrame()->IsRightToLeft() );
else
diff --git a/sw/source/core/text/pormulti.cxx b/sw/source/core/text/pormulti.cxx
index d7b7ec980be5..762e8f886551 100644
--- a/sw/source/core/text/pormulti.cxx
+++ b/sw/source/core/text/pormulti.cxx
@@ -551,7 +551,7 @@ SwRubyPortion::SwRubyPortion( const SwMultiCreator& rCreate, const SwFont& rFnt,
: SwMultiPortion( nEnd )
{
SetRuby();
- OSL_ENSURE( SW_MC_RUBY == rCreate.nId, "Ruby expected" );
+ OSL_ENSURE( SwMultiCreatorId::Ruby == rCreate.nId, "Ruby expected" );
OSL_ENSURE( RES_TXTATR_CJK_RUBY == rCreate.pAttr->Which(), "Wrong attribute" );
const SwFormatRuby& rRuby = rCreate.pAttr->GetRuby();
nAdjustment = rRuby.GetAdjustment();
@@ -823,7 +823,7 @@ SwMultiCreator* SwTextSizeInfo::GetMultiCreator( sal_Int32 &rPos,
SwMultiCreator *pRet = new SwMultiCreator;
pRet->pItem = nullptr;
pRet->pAttr = nullptr;
- pRet->nId = SW_MC_BIDI;
+ pRet->nId = SwMultiCreatorId::Bidi;
pRet->nLevel = nCurrLevel + 1;
return pRet;
}
@@ -895,7 +895,7 @@ SwMultiCreator* SwTextSizeInfo::GetMultiCreator( sal_Int32 &rPos,
SwMultiCreator *pRet = new SwMultiCreator;
pRet->pItem = nullptr;
pRet->pAttr = pRuby;
- pRet->nId = SW_MC_RUBY;
+ pRet->nId = SwMultiCreatorId::Ruby;
pRet->nLevel = GetTextFrame()->IsRightToLeft() ? 1 : 0;
return pRet;
}
@@ -933,7 +933,7 @@ SwMultiCreator* SwTextSizeInfo::GetMultiCreator( sal_Int32 &rPos,
pRet->pAttr = nullptr;
aEnd.push_front( GetText().getLength() );
}
- pRet->nId = SW_MC_DOUBLE;
+ pRet->nId = SwMultiCreatorId::Double;
pRet->nLevel = GetTextFrame()->IsRightToLeft() ? 1 : 0;
// n2Lines is the index of the last 2-line-attribute, which contains
@@ -1020,7 +1020,7 @@ SwMultiCreator* SwTextSizeInfo::GetMultiCreator( sal_Int32 &rPos,
{ // The winner is a rotate-attribute,
// the end of the multiportion depends on the following attributes...
SwMultiCreator *pRet = new SwMultiCreator;
- pRet->nId = SW_MC_ROTATE;
+ pRet->nId = SwMultiCreatorId::Rotate;
// We note the endpositions of the 2-line attributes in aEnd as stack
std::deque< sal_Int32 > aEnd;
diff --git a/sw/source/core/text/pormulti.hxx b/sw/source/core/text/pormulti.hxx
index 0659db9c373b..8bcf409e2c6c 100644
--- a/sw/source/core/text/pormulti.hxx
+++ b/sw/source/core/text/pormulti.hxx
@@ -36,16 +36,16 @@ class SwFont;
// or a poolitem.
// The GetMultiCreator-function fills this structure and
// the Ctor of the SwMultiPortion uses it.
-#define SW_MC_DOUBLE 0
-#define SW_MC_RUBY 1
-#define SW_MC_ROTATE 2
-#define SW_MC_BIDI 3
+enum class SwMultiCreatorId
+{
+ Double, Ruby, Rotate, Bidi
+};
struct SwMultiCreator
{
const SwTextAttr* pAttr;
const SfxPoolItem* pItem;
- sal_uInt8 nId;
+ SwMultiCreatorId nId;
sal_uInt8 nLevel;
};