[Libreoffice-commits] core.git: sw/source
Noel Grandin
noelgrandin at gmail.com
Thu Mar 31 09:35:11 UTC 2016
sw/source/core/text/itrform2.cxx | 6 +++---
sw/source/core/text/pormulti.cxx | 10 +++++-----
sw/source/core/text/pormulti.hxx | 10 +++++-----
3 files changed, 13 insertions(+), 13 deletions(-)
New commits:
commit 8138dae8577b4fcc30bd269516d9213587f6d732
Author: Noel Grandin <noelgrandin at gmail.com>
Date: Wed Mar 30 16:54:15 2016 +0200
tdf#84938 convert SW_MC_* to scoped enum
Change-Id: Id2a64dd31e5e1a61ac5873255e1452ca9bff97e3
Reviewed-on: https://gerrit.libreoffice.org/23655
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin at gmail.com>
diff --git a/sw/source/core/text/itrform2.cxx b/sw/source/core/text/itrform2.cxx
index dc853e1..f8c1d41 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 d7b7ec9..762e8f8 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 0659db9..8bcf409 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;
};
More information about the Libreoffice-commits
mailing list