summaryrefslogtreecommitdiff
path: root/sw/source/core/text
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2019-01-17 14:46:05 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2019-01-18 07:48:57 +0100
commit60b0526ea4929ce273de499f552a4d478a973d10 (patch)
treeab44643d929f24ce8520cf873853b38888d7b22a /sw/source/core/text
parent0b853017a29a927943313d7a2d9994c887ad335d (diff)
convert POR constants to scoped enum
Change-Id: Ia146f1f932cf4437e2e7e20722b0957a458979fd Reviewed-on: https://gerrit.libreoffice.org/66514 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw/source/core/text')
-rw-r--r--sw/source/core/text/EnhancedPDFExportHelper.cxx33
-rw-r--r--sw/source/core/text/inftxt.cxx32
-rw-r--r--sw/source/core/text/inftxt.hxx2
-rw-r--r--sw/source/core/text/itrform2.cxx8
-rw-r--r--sw/source/core/text/porexp.cxx4
-rw-r--r--sw/source/core/text/porexp.hxx4
-rw-r--r--sw/source/core/text/porfld.cxx20
-rw-r--r--sw/source/core/text/porfld.hxx2
-rw-r--r--sw/source/core/text/porfly.cxx2
-rw-r--r--sw/source/core/text/porfly.hxx2
-rw-r--r--sw/source/core/text/porftn.hxx2
-rw-r--r--sw/source/core/text/porglue.cxx8
-rw-r--r--sw/source/core/text/porhyph.hxx4
-rw-r--r--sw/source/core/text/porlay.cxx8
-rw-r--r--sw/source/core/text/porlin.cxx2
-rw-r--r--sw/source/core/text/porlin.hxx80
-rw-r--r--sw/source/core/text/pormulti.cxx2
-rw-r--r--sw/source/core/text/pormulti.hxx2
-rw-r--r--sw/source/core/text/porref.cxx6
-rw-r--r--sw/source/core/text/porref.hxx2
-rw-r--r--sw/source/core/text/porrst.cxx16
-rw-r--r--sw/source/core/text/porrst.hxx6
-rw-r--r--sw/source/core/text/portab.hxx8
-rw-r--r--sw/source/core/text/portox.cxx6
-rw-r--r--sw/source/core/text/portox.hxx2
-rw-r--r--sw/source/core/text/portxt.cxx8
-rw-r--r--sw/source/core/text/portxt.hxx2
-rw-r--r--sw/source/core/text/txtdrop.cxx2
-rw-r--r--sw/source/core/text/txtftn.cxx10
-rw-r--r--sw/source/core/text/txthyph.cxx16
-rw-r--r--sw/source/core/text/txttab.cxx26
-rw-r--r--sw/source/core/text/xmldump.cxx128
32 files changed, 228 insertions, 227 deletions
diff --git a/sw/source/core/text/EnhancedPDFExportHelper.cxx b/sw/source/core/text/EnhancedPDFExportHelper.cxx
index e4312738c5b2..69395167a38f 100644
--- a/sw/source/core/text/EnhancedPDFExportHelper.cxx
+++ b/sw/source/core/text/EnhancedPDFExportHelper.cxx
@@ -732,8 +732,8 @@ void SwTaggedPDFHelper::SetAttributes( vcl::PDFWriter::StructElement eType )
case vcl::PDFWriter::Span :
case vcl::PDFWriter::Quote :
case vcl::PDFWriter::Code :
- if( POR_HYPHSTR == pPor->GetWhichPor() || POR_SOFTHYPHSTR == pPor->GetWhichPor() ||
- POR_HYPH == pPor->GetWhichPor() || POR_SOFTHYPH == pPor->GetWhichPor() )
+ if( PortionType::HyphenStr == pPor->GetWhichPor() || PortionType::SoftHyphenStr == pPor->GetWhichPor() ||
+ PortionType::Hyphen == pPor->GetWhichPor() || PortionType::SoftHyphen == pPor->GetWhichPor() )
bActualText = true;
else
{
@@ -757,7 +757,7 @@ void SwTaggedPDFHelper::SetAttributes( vcl::PDFWriter::StructElement eType )
if ( bActualText )
{
OUString aActualText;
- if (pPor->GetWhichPor() == POR_SOFTHYPH || pPor->GetWhichPor() == POR_HYPH)
+ if (pPor->GetWhichPor() == PortionType::SoftHyphen || pPor->GetWhichPor() == PortionType::Hyphen)
aActualText = OUString(u'\x00ad'); // soft hyphen
else
aActualText = rInf.GetText().copy(sal_Int32(rInf.GetIdx()), sal_Int32(pPor->GetLen()));
@@ -1319,18 +1319,18 @@ void SwTaggedPDFHelper::BeginInlineStructureElements()
switch ( pPor->GetWhichPor() )
{
- case POR_HYPH :
- case POR_SOFTHYPH :
+ case PortionType::Hyphen :
+ case PortionType::SoftHyphen :
// Check for alternative spelling:
- case POR_HYPHSTR :
- case POR_SOFTHYPHSTR :
+ case PortionType::HyphenStr :
+ case PortionType::SoftHyphenStr :
nPDFType = vcl::PDFWriter::Span;
aPDFType = aSpanString;
break;
- case POR_LAY :
- case POR_TXT :
- case POR_PARA :
+ case PortionType::Lay :
+ case PortionType::Text :
+ case PortionType::Para :
{
std::pair<SwTextNode const*, sal_Int32> const pos(
pFrame->MapViewToModel(rInf.GetIdx()));
@@ -1391,12 +1391,12 @@ void SwTaggedPDFHelper::BeginInlineStructureElements()
}
break;
- case POR_FTN :
+ case PortionType::Footnote :
nPDFType = vcl::PDFWriter::Link;
aPDFType = aLinkString;
break;
- case POR_FLD :
+ case PortionType::Field :
{
// check field type:
TextFrameIndex const nIdx = static_cast<const SwFieldPortion*>(pPor)->IsFollow()
@@ -1420,12 +1420,13 @@ void SwTaggedPDFHelper::BeginInlineStructureElements()
}
break;
- case POR_TAB :
- case POR_TABRIGHT :
- case POR_TABCENTER :
- case POR_TABDECIMAL :
+ case PortionType::Table :
+ case PortionType::TabRight :
+ case PortionType::TabCenter :
+ case PortionType::TabDecimal :
nPDFType = vcl::PDFWriter::NonStructElement;
break;
+ default: break;
}
if ( USHRT_MAX != nPDFType )
diff --git a/sw/source/core/text/inftxt.cxx b/sw/source/core/text/inftxt.cxx
index b3318f656fad..2b9bdee32440 100644
--- a/sw/source/core/text/inftxt.cxx
+++ b/sw/source/core/text/inftxt.cxx
@@ -1270,33 +1270,33 @@ void SwTextPaintInfo::DrawBorder( const SwLinePortion &rPor ) const
}
void SwTextPaintInfo::DrawViewOpt( const SwLinePortion &rPor,
- const sal_uInt16 nWhich ) const
+ PortionType nWhich ) const
{
if( OnWin() && !IsMulti() )
{
bool bDraw = false;
switch( nWhich )
{
- case POR_FTN:
- case POR_QUOVADIS:
- case POR_NUMBER:
- case POR_FLD:
- case POR_URL:
- case POR_HIDDEN:
- case POR_TOX:
- case POR_REF:
- case POR_META:
- case POR_CONTROLCHAR:
+ case PortionType::Footnote:
+ case PortionType::QuoVadis:
+ case PortionType::Number:
+ case PortionType::Field:
+ case PortionType::Url:
+ case PortionType::Hidden:
+ case PortionType::Tox:
+ case PortionType::Ref:
+ case PortionType::Meta:
+ case PortionType::ControlChar:
if ( !GetOpt().IsPagePreview()
&& !GetOpt().IsReadonly()
&& SwViewOption::IsFieldShadings()
- && ( POR_NUMBER != nWhich
+ && ( PortionType::Number != nWhich
|| m_pFrame->GetTextNodeForParaProps()->HasMarkedLabel())) // #i27615#
{
bDraw = true;
}
break;
- case POR_INPUTFLD:
+ case PortionType::InputField:
// input field shading also in read-only mode
if ( !GetOpt().IsPagePreview()
&& SwViewOption::IsFieldShadings() )
@@ -1304,13 +1304,13 @@ void SwTextPaintInfo::DrawViewOpt( const SwLinePortion &rPor,
bDraw = true;
}
break;
- case POR_TAB:
+ case PortionType::Table:
if ( GetOpt().IsTab() ) bDraw = true;
break;
- case POR_SOFTHYPH:
+ case PortionType::SoftHyphen:
if ( GetOpt().IsSoftHyph() )bDraw = true;
break;
- case POR_BLANK:
+ case PortionType::Blank:
if ( GetOpt().IsHardBlank())bDraw = true;
break;
default:
diff --git a/sw/source/core/text/inftxt.hxx b/sw/source/core/text/inftxt.hxx
index d7a826635dc0..48f8400af8ca 100644
--- a/sw/source/core/text/inftxt.hxx
+++ b/sw/source/core/text/inftxt.hxx
@@ -414,7 +414,7 @@ public:
void DrawRedArrow( const SwLinePortion &rPor ) const;
void DrawPostIts( bool bScript ) const;
void DrawBackground( const SwLinePortion &rPor ) const;
- void DrawViewOpt( const SwLinePortion &rPor, const sal_uInt16 nWhich ) const;
+ void DrawViewOpt( const SwLinePortion &rPor, PortionType nWhich ) const;
void DrawBackBrush( const SwLinePortion &rPor ) const;
/**
diff --git a/sw/source/core/text/itrform2.cxx b/sw/source/core/text/itrform2.cxx
index 56ec331f1b6b..be10f475fe06 100644
--- a/sw/source/core/text/itrform2.cxx
+++ b/sw/source/core/text/itrform2.cxx
@@ -261,7 +261,7 @@ SwLinePortion *SwTextFormatter::Underflow( SwTextFormatInfo &rInf )
{
if( pPor->InTextGrp() && !pPor->InExpGrp() )
{
- const sal_uInt16 nOldWhich = m_pCurr->GetWhichPor();
+ const PortionType nOldWhich = m_pCurr->GetWhichPor();
*static_cast<SwLinePortion*>(m_pCurr) = *pPor;
m_pCurr->SetNextPortion( pPor->GetNextPortion() );
m_pCurr->SetWhichPor( nOldWhich );
@@ -829,7 +829,7 @@ void SwTextFormatter::CalcAscent( SwTextFormatInfo &rInf, SwLinePortion *pPor )
class SwMetaPortion : public SwTextPortion
{
public:
- SwMetaPortion() { SetWhichPor( POR_META ); }
+ SwMetaPortion() { SetWhichPor( PortionType::Meta ); }
virtual void Paint( const SwTextPaintInfo &rInf ) const override;
};
@@ -837,7 +837,7 @@ void SwMetaPortion::Paint( const SwTextPaintInfo &rInf ) const
{
if ( Width() )
{
- rInf.DrawViewOpt( *this, POR_META );
+ rInf.DrawViewOpt( *this, PortionType::Meta );
SwTextPortion::Paint( rInf );
}
}
@@ -1340,7 +1340,7 @@ SwLinePortion *SwTextFormatter::NewPortion( SwTextFormatInfo &rInf )
// aligned at the tab stop position. We store the width from the beginning of
// the tab stop portion up to the portion containing the decimal separator:
if (GetTextFrame()->GetDoc().getIDocumentSettingAccess().get(DocumentSettingId::TAB_COMPAT) /*rInf.GetVsh()->IsTabCompat();*/ &&
- POR_TABDECIMAL == pLastTabPortion->GetWhichPor() )
+ PortionType::TabDecimal == pLastTabPortion->GetWhichPor() )
{
OSL_ENSURE( rInf.X() >= pLastTabPortion->GetFix(), "Decimal tab stop position cannot be calculated" );
const sal_uInt16 nWidthOfPortionsUpToDecimalPosition = static_cast<sal_uInt16>(rInf.X() - pLastTabPortion->GetFix() );
diff --git a/sw/source/core/text/porexp.cxx b/sw/source/core/text/porexp.cxx
index 67e516ca2daf..2e090c5992e6 100644
--- a/sw/source/core/text/porexp.cxx
+++ b/sw/source/core/text/porexp.cxx
@@ -195,7 +195,7 @@ bool SwBlankPortion::Format( SwTextFormatInfo &rInf )
void SwBlankPortion::Paint( const SwTextPaintInfo &rInf ) const
{
if( !bMulti ) // No gray background for multiportion brackets
- rInf.DrawViewOpt( *this, POR_BLANK );
+ rInf.DrawViewOpt( *this, PortionType::Blank );
SwExpandPortion::Paint( rInf );
}
@@ -214,7 +214,7 @@ SwPostItsPortion::SwPostItsPortion( bool bScrpt )
: bScript( bScrpt )
{
nLineLength = TextFrameIndex(1);
- SetWhichPor( POR_POSTITS );
+ SetWhichPor( PortionType::PostIts );
}
void SwPostItsPortion::Paint( const SwTextPaintInfo &rInf ) const
diff --git a/sw/source/core/text/porexp.hxx b/sw/source/core/text/porexp.hxx
index 3373cdfda8eb..e787ae400e4b 100644
--- a/sw/source/core/text/porexp.hxx
+++ b/sw/source/core/text/porexp.hxx
@@ -25,7 +25,7 @@
class SwExpandPortion : public SwTextPortion
{
public:
- SwExpandPortion() { SetWhichPor( POR_EXP ); }
+ SwExpandPortion() { SetWhichPor( PortionType::Expand ); }
virtual bool Format( SwTextFormatInfo &rInf ) override;
virtual TextFrameIndex GetCursorOfst(sal_uInt16 nOfst) const override;
virtual bool GetExpText( const SwTextSizeInfo &rInf, OUString &rText ) const override;
@@ -43,7 +43,7 @@ class SwBlankPortion : public SwExpandPortion
public:
SwBlankPortion( sal_Unicode cCh, bool bMult = false )
: cChar( cCh ), bMulti( bMult )
- { cChar = cCh; SetLen(TextFrameIndex(1)); SetWhichPor( POR_BLANK ); }
+ { cChar = cCh; SetLen(TextFrameIndex(1)); SetWhichPor( PortionType::Blank ); }
virtual SwLinePortion *Compress() override;
virtual bool GetExpText( const SwTextSizeInfo &rInf, OUString &rText ) const override;
diff --git a/sw/source/core/text/porfld.cxx b/sw/source/core/text/porfld.cxx
index ff838aeb3e6b..95bba3bbc791 100644
--- a/sw/source/core/text/porfld.cxx
+++ b/sw/source/core/text/porfld.cxx
@@ -82,7 +82,7 @@ SwFieldPortion::SwFieldPortion( const OUString &rExpand, std::unique_ptr<SwFont>
, m_bNoLength( false )
, m_nAttrFieldType(0)
{
- SetWhichPor( POR_FLD );
+ SetWhichPor( PortionType::Field );
}
SwFieldPortion::SwFieldPortion( const SwFieldPortion& rField )
@@ -106,7 +106,7 @@ SwFieldPortion::SwFieldPortion( const SwFieldPortion& rField )
if ( rField.HasFont() )
m_pFont.reset( new SwFont( *rField.GetFont() ) );
- SetWhichPor( POR_FLD );
+ SetWhichPor( PortionType::Field );
}
SwFieldPortion::~SwFieldPortion()
@@ -432,7 +432,7 @@ void SwFieldPortion::Paint( const SwTextPaintInfo &rInf ) const
if( Width() && ( !m_bPlaceHolder || rInf.GetOpt().IsShowPlaceHolderFields() ) )
{
// A very liberal use of the background
- rInf.DrawViewOpt( *this, POR_FLD );
+ rInf.DrawViewOpt( *this, PortionType::Field );
SwExpandPortion::Paint( rInf );
}
}
@@ -480,7 +480,7 @@ void SwHiddenPortion::Paint( const SwTextPaintInfo &rInf ) const
if( Width() )
{
SwFontSave aSave( rInf, m_pFont.get() );
- rInf.DrawViewOpt( *this, POR_HIDDEN );
+ rInf.DrawViewOpt( *this, PortionType::Hidden );
SwExpandPortion::Paint( rInf );
}
}
@@ -502,7 +502,7 @@ SwNumberPortion::SwNumberPortion( const OUString &rExpand,
nMinDist( nMinDst ),
mbLabelAlignmentPosAndSpaceModeActive( bLabelAlignmentPosAndSpaceModeActive )
{
- SetWhichPor( POR_NUMBER );
+ SetWhichPor( PortionType::Number );
SetLeft( bLft );
SetHide( false );
SetCenter( bCntr );
@@ -655,7 +655,7 @@ void SwNumberPortion::Paint( const SwTextPaintInfo &rInf ) const
{
SwNumberPortion *pThis = const_cast<SwNumberPortion*>(this);
pThis->Width( nSumWidth );
- rInf.DrawViewOpt( *this, POR_NUMBER );
+ rInf.DrawViewOpt( *this, PortionType::Number );
pThis->Width( nOldWidth );
}
@@ -744,7 +744,7 @@ SwBulletPortion::SwBulletPortion( const sal_Unicode cBullet,
std::move(pFont), bLft, bCntr, nMinDst,
bLabelAlignmentPosAndSpaceModeActive )
{
- SetWhichPor( POR_BULLET );
+ SetWhichPor( PortionType::Bullet );
}
#define GRFNUM_SECURE 10
@@ -759,7 +759,7 @@ SwGrfNumPortion::SwGrfNumPortion(
bLabelAlignmentPosAndSpaceModeActive ),
pBrush( new SvxBrushItem(RES_BACKGROUND) ), nId( 0 )
{
- SetWhichPor( POR_GRFNUM );
+ SetWhichPor( PortionType::GrfNum );
SetAnimated( false );
m_bReplace = false;
if( pGrfBrush )
@@ -1063,7 +1063,7 @@ SwCombinedPortion::SwCombinedPortion( const OUString &rText )
, nProportion(55)
{
SetLen(TextFrameIndex(1));
- SetWhichPor( POR_COMBINED );
+ SetWhichPor( PortionType::Combined );
if( m_aExpand.getLength() > 6 )
m_aExpand = m_aExpand.copy( 0, 6 );
@@ -1092,7 +1092,7 @@ void SwCombinedPortion::Paint( const SwTextPaintInfo &rInf ) const
return;
rInf.DrawBackBrush( *this );
- rInf.DrawViewOpt( *this, POR_FLD );
+ rInf.DrawViewOpt( *this, PortionType::Field );
// do we have to repaint a post it portion?
if( rInf.OnWin() && mpNextPortion && !mpNextPortion->Width() )
diff --git a/sw/source/core/text/porfld.hxx b/sw/source/core/text/porfld.hxx
index 151404197cd9..4434f1e8c577 100644
--- a/sw/source/core/text/porfld.hxx
+++ b/sw/source/core/text/porfld.hxx
@@ -109,7 +109,7 @@ class SwHiddenPortion : public SwFieldPortion
public:
SwHiddenPortion( const OUString &rExpand, std::unique_ptr<SwFont> pFntL = nullptr )
: SwFieldPortion( rExpand, std::move(pFntL) )
- { SetLen(TextFrameIndex(1)); SetWhichPor( POR_HIDDEN ); }
+ { SetLen(TextFrameIndex(1)); SetWhichPor( PortionType::Hidden ); }
virtual void Paint( const SwTextPaintInfo &rInf ) const override;
virtual bool GetExpText( const SwTextSizeInfo &rInf, OUString &rText ) const override;
diff --git a/sw/source/core/text/porfly.cxx b/sw/source/core/text/porfly.cxx
index 8d4fe773d1d2..7c23bb17cae7 100644
--- a/sw/source/core/text/porfly.cxx
+++ b/sw/source/core/text/porfly.cxx
@@ -256,7 +256,7 @@ SwFlyCntPortion::SwFlyCntPortion()
, m_eAlign(sw::LineAlign::NONE)
{
nLineLength = TextFrameIndex(1);
- SetWhichPor(POR_FLYCNT);
+ SetWhichPor(PortionType::FlyCnt);
}
sw::FlyContentPortion::FlyContentPortion(SwFlyInContentFrame* pFly)
diff --git a/sw/source/core/text/porfly.hxx b/sw/source/core/text/porfly.hxx
index a38592a1be1e..e2c03600f770 100644
--- a/sw/source/core/text/porfly.hxx
+++ b/sw/source/core/text/porfly.hxx
@@ -34,7 +34,7 @@ class SwFlyPortion : public SwFixPortion
sal_uInt16 nBlankWidth;
public:
explicit SwFlyPortion( const SwRect &rFlyRect )
- : SwFixPortion(rFlyRect), nBlankWidth( 0 ) { SetWhichPor( POR_FLY ); }
+ : SwFixPortion(rFlyRect), nBlankWidth( 0 ) { SetWhichPor( PortionType::Fly ); }
sal_uInt16 GetBlankWidth( ) const { return nBlankWidth; }
void SetBlankWidth( const sal_uInt16 nNew ) { nBlankWidth = nNew; }
virtual void Paint( const SwTextPaintInfo &rInf ) const override;
diff --git a/sw/source/core/text/porftn.hxx b/sw/source/core/text/porftn.hxx
index 97b5275ed696..087687588010 100644
--- a/sw/source/core/text/porftn.hxx
+++ b/sw/source/core/text/porftn.hxx
@@ -52,7 +52,7 @@ class SwFootnoteNumPortion : public SwNumberPortion
public:
SwFootnoteNumPortion( const OUString &rExpand, std::unique_ptr<SwFont> pFntL )
: SwNumberPortion( rExpand, std::move(pFntL), true, false, 0, false )
- { SetWhichPor( POR_FTNNUM ); }
+ { SetWhichPor( PortionType::FootnoteNum ); }
};
class SwQuoVadisPortion : public SwFieldPortion
diff --git a/sw/source/core/text/porglue.cxx b/sw/source/core/text/porglue.cxx
index 30a525657540..d35a5be48ef8 100644
--- a/sw/source/core/text/porglue.cxx
+++ b/sw/source/core/text/porglue.cxx
@@ -31,7 +31,7 @@ SwGluePortion::SwGluePortion( const sal_uInt16 nInitFixWidth )
: nFixWidth( nInitFixWidth )
{
PrtWidth( nFixWidth );
- SetWhichPor( POR_GLUE );
+ SetWhichPor( PortionType::Glue );
}
TextFrameIndex SwGluePortion::GetCursorOfst(const sal_uInt16 nOfst) const
@@ -137,19 +137,19 @@ SwFixPortion::SwFixPortion( const SwRect &rRect )
:SwGluePortion( sal_uInt16(rRect.Width()) ), nFix( sal_uInt16(rRect.Left()) )
{
Height( sal_uInt16(rRect.Height()) );
- SetWhichPor( POR_FIX );
+ SetWhichPor( PortionType::Fix );
}
SwFixPortion::SwFixPortion()
: SwGluePortion(0), nFix(0)
{
- SetWhichPor( POR_FIX );
+ SetWhichPor( PortionType::Fix );
}
SwMarginPortion::SwMarginPortion()
:SwGluePortion( 0 )
{
- SetWhichPor( POR_MARGIN );
+ SetWhichPor( PortionType::Margin );
}
/**
diff --git a/sw/source/core/text/porhyph.hxx b/sw/source/core/text/porhyph.hxx
index b00bddc1cf5d..3ed5cf12da9f 100644
--- a/sw/source/core/text/porhyph.hxx
+++ b/sw/source/core/text/porhyph.hxx
@@ -26,7 +26,7 @@ class SwHyphPortion : public SwExpandPortion
public:
SwHyphPortion()
{
- SetWhichPor( POR_HYPH );
+ SetWhichPor( PortionType::Hyphen );
}
virtual bool GetExpText( const SwTextSizeInfo &rInf, OUString &rText ) const override;
virtual bool Format( SwTextFormatInfo &rInf ) override;
@@ -42,7 +42,7 @@ public:
explicit SwHyphStrPortion(const OUString &rStr)
: aExpand(rStr + "-")
{
- SetWhichPor( POR_HYPHSTR );
+ SetWhichPor( PortionType::HyphenStr );
}
virtual bool GetExpText( const SwTextSizeInfo &rInf, OUString &rText ) const override;
diff --git a/sw/source/core/text/porlay.cxx b/sw/source/core/text/porlay.cxx
index 7b646331e9b3..26ecefa20d5b 100644
--- a/sw/source/core/text/porlay.cxx
+++ b/sw/source/core/text/porlay.cxx
@@ -375,7 +375,7 @@ void SwLineLayout::CalcLine( SwTextFormatter &rLine, SwTextFormatInfo &rInf )
// portion spanning to the end or the next fixed portion
while( pPos )
{
- SAL_WARN_IF( POR_LIN == pPos->GetWhichPor(),
+ SAL_WARN_IF( PortionType::NONE == pPos->GetWhichPor(),
"sw.core", "SwLineLayout::CalcLine: don't use SwLinePortions !" );
// Null portions are eliminated. They can form if two FlyFrames
@@ -482,7 +482,7 @@ void SwLineLayout::CalcLine( SwTextFormatter &rLine, SwTextFormatInfo &rInf )
if( Height() < nPosHeight )
{
// Height is set to 0 when Init() is called.
- if (bIgnoreBlanksAndTabsForLineHeightCalculation && pPos->GetWhichPor() == POR_FLYCNT)
+ if (bIgnoreBlanksAndTabsForLineHeightCalculation && pPos->GetWhichPor() == PortionType::FlyCnt)
// Compat flag set: take the line height, if it's larger.
Height(std::max(nPosHeight, nLineHeight));
else
@@ -665,7 +665,7 @@ SwLineLayout::SwLineLayout()
m_bUnderscore( false )
{
ResetFlags();
- SetWhichPor( POR_LAY );
+ SetWhichPor( PortionType::Lay );
}
SwLinePortion *SwLineLayout::GetFirstPortion() const
@@ -2151,7 +2151,7 @@ SwParaPortion::SwParaPortion()
{
FormatReset();
m_bFlys = m_bFootnoteNum = m_bMargin = false;
- SetWhichPor( POR_PARA );
+ SetWhichPor( PortionType::Para );
}
SwParaPortion::~SwParaPortion()
diff --git a/sw/source/core/text/porlin.cxx b/sw/source/core/text/porlin.cxx
index 5cb568f89641..4dc4b671e966 100644
--- a/sw/source/core/text/porlin.cxx
+++ b/sw/source/core/text/porlin.cxx
@@ -72,7 +72,7 @@ SwLinePortion::SwLinePortion( ) :
mpNextPortion( nullptr ),
nLineLength( 0 ),
nAscent( 0 ),
- nWhichPor( POR_LIN ),
+ nWhichPor( PortionType::NONE ),
m_bJoinBorderWithPrev(false),
m_bJoinBorderWithNext(false)
{
diff --git a/sw/source/core/text/porlin.hxx b/sw/source/core/text/porlin.hxx
index 661eaf7b0534..2b45e7561e5a 100644
--- a/sw/source/core/text/porlin.hxx
+++ b/sw/source/core/text/porlin.hxx
@@ -60,7 +60,7 @@ protected:
SwLinePortion();
private:
- sal_uInt16 nWhichPor; // Who's who?
+ PortionType nWhichPor; // Who's who?
bool m_bJoinBorderWithPrev;
bool m_bJoinBorderWithNext;
@@ -93,49 +93,49 @@ public:
// Returns 0, if there's no payload
virtual SwLinePortion *Compress();
- void SetWhichPor( const sal_uInt16 nNew ) { nWhichPor = nNew; }
- sal_uInt16 GetWhichPor( ) const { return nWhichPor; }
+ void SetWhichPor( const PortionType nNew ) { nWhichPor = nNew; }
+ PortionType GetWhichPor( ) const { return nWhichPor; }
// Group queries
- bool InTextGrp() const { return (nWhichPor & PORGRP_TXT) != 0; }
- bool InGlueGrp() const { return (nWhichPor & PORGRP_GLUE) != 0; }
- bool InTabGrp() const { return (nWhichPor & PORGRP_TAB) != 0; }
- bool InHyphGrp() const { return (nWhichPor & PORGRP_HYPH) != 0; }
- bool InNumberGrp() const { return (nWhichPor & PORGRP_NUMBER) != 0; }
- bool InFixGrp() const { return (nWhichPor & PORGRP_FIX) != 0; }
- bool InFieldGrp() const { return (nWhichPor & PORGRP_FLD) != 0; }
- bool InToxRefGrp() const { return (nWhichPor & PORGRP_TOXREF) != 0; }
- bool InToxRefOrFieldGrp() const { return (nWhichPor & ( PORGRP_FLD | PORGRP_TOXREF )) != 0; }
- bool InExpGrp() const { return (nWhichPor & PORGRP_EXP) != 0; }
- bool InFixMargGrp() const { return (nWhichPor & PORGRP_FIXMARG) != 0; }
+ bool InTextGrp() const { return (sal_uInt16(nWhichPor) & PORGRP_TXT) != 0; }
+ bool InGlueGrp() const { return (sal_uInt16(nWhichPor) & PORGRP_GLUE) != 0; }
+ bool InTabGrp() const { return (sal_uInt16(nWhichPor) & PORGRP_TAB) != 0; }
+ bool InHyphGrp() const { return (sal_uInt16(nWhichPor) & PORGRP_HYPH) != 0; }
+ bool InNumberGrp() const { return (sal_uInt16(nWhichPor) & PORGRP_NUMBER) != 0; }
+ bool InFixGrp() const { return (sal_uInt16(nWhichPor) & PORGRP_FIX) != 0; }
+ bool InFieldGrp() const { return (sal_uInt16(nWhichPor) & PORGRP_FLD) != 0; }
+ bool InToxRefGrp() const { return (sal_uInt16(nWhichPor) & PORGRP_TOXREF) != 0; }
+ bool InToxRefOrFieldGrp() const { return (sal_uInt16(nWhichPor) & ( PORGRP_FLD | PORGRP_TOXREF )) != 0; }
+ bool InExpGrp() const { return (sal_uInt16(nWhichPor) & PORGRP_EXP) != 0; }
+ bool InFixMargGrp() const { return (sal_uInt16(nWhichPor) & PORGRP_FIXMARG) != 0; }
bool InSpaceGrp() const { return InTextGrp() || IsMultiPortion(); }
// Individual queries
- bool IsGrfNumPortion() const { return nWhichPor == POR_GRFNUM; }
- bool IsFlyCntPortion() const { return nWhichPor == POR_FLYCNT; }
- bool IsBlankPortion() const { return nWhichPor == POR_BLANK; }
- bool IsBreakPortion() const { return nWhichPor == POR_BRK; }
- bool IsErgoSumPortion() const { return nWhichPor == POR_ERGOSUM; }
- bool IsQuoVadisPortion() const { return nWhichPor == POR_QUOVADIS; }
- bool IsTabLeftPortion() const { return nWhichPor == POR_TABLEFT; }
- bool IsTabRightPortion() const { return nWhichPor == POR_TABRIGHT; }
- bool IsFootnoteNumPortion() const { return nWhichPor == POR_FTNNUM; }
- bool IsFootnotePortion() const { return nWhichPor == POR_FTN; }
- bool IsDropPortion() const { return nWhichPor == POR_DROP; }
- bool IsLayPortion() const { return nWhichPor == POR_LAY; }
- bool IsParaPortion() const { return nWhichPor == POR_PARA; }
- bool IsMarginPortion() const { return nWhichPor == POR_MARGIN; }
- bool IsFlyPortion() const { return nWhichPor == POR_FLY; }
- bool IsHolePortion() const { return nWhichPor == POR_HOLE; }
- bool IsSoftHyphPortion() const { return nWhichPor == POR_SOFTHYPH; }
- bool IsPostItsPortion() const { return nWhichPor == POR_POSTITS; }
- bool IsCombinedPortion() const { return nWhichPor == POR_COMBINED; }
- bool IsTextPortion() const { return nWhichPor == POR_TXT; }
- bool IsHangingPortion() const { return nWhichPor == POR_HNG; }
- bool IsKernPortion() const { return nWhichPor == POR_KERN; }
- bool IsArrowPortion() const { return nWhichPor == POR_ARROW; }
- bool IsMultiPortion() const { return nWhichPor == POR_MULTI; }
- bool IsNumberPortion() const { return nWhichPor == POR_NUMBER; } // #i23726#
- bool IsControlCharPortion() const { return nWhichPor == POR_CONTROLCHAR; }
+ bool IsGrfNumPortion() const { return nWhichPor == PortionType::GrfNum; }
+ bool IsFlyCntPortion() const { return nWhichPor == PortionType::FlyCnt; }
+ bool IsBlankPortion() const { return nWhichPor == PortionType::Blank; }
+ bool IsBreakPortion() const { return nWhichPor == PortionType::Break; }
+ bool IsErgoSumPortion() const { return nWhichPor == PortionType::ErgoSum; }
+ bool IsQuoVadisPortion() const { return nWhichPor == PortionType::QuoVadis; }
+ bool IsTabLeftPortion() const { return nWhichPor == PortionType::TabLeft; }
+ bool IsTabRightPortion() const { return nWhichPor == PortionType::TabRight; }
+ bool IsFootnoteNumPortion() const { return nWhichPor == PortionType::FootnoteNum; }
+ bool IsFootnotePortion() const { return nWhichPor == PortionType::Footnote; }
+ bool IsDropPortion() const { return nWhichPor == PortionType::Drop; }
+ bool IsLayPortion() const { return nWhichPor == PortionType::Lay; }
+ bool IsParaPortion() const { return nWhichPor == PortionType::Para; }
+ bool IsMarginPortion() const { return nWhichPor == PortionType::Margin; }
+ bool IsFlyPortion() const { return nWhichPor == PortionType::Fly; }
+ bool IsHolePortion() const { return nWhichPor == PortionType::Hole; }
+ bool IsSoftHyphPortion() const { return nWhichPor == PortionType::SoftHyphen; }
+ bool IsPostItsPortion() const { return nWhichPor == PortionType::PostIts; }
+ bool IsCombinedPortion() const { return nWhichPor == PortionType::Combined; }
+ bool IsTextPortion() const { return nWhichPor == PortionType::Text; }
+ bool IsHangingPortion() const { return nWhichPor == PortionType::Hanging; }
+ bool IsKernPortion() const { return nWhichPor == PortionType::Kern; }
+ bool IsArrowPortion() const { return nWhichPor == PortionType::Arrow; }
+ bool IsMultiPortion() const { return nWhichPor == PortionType::Multi; }
+ bool IsNumberPortion() const { return nWhichPor == PortionType::Number; } // #i23726#
+ bool IsControlCharPortion() const { return nWhichPor == PortionType::ControlChar; }
// Positioning
SwLinePortion *FindPrevPortion( const SwLinePortion *pRoot );
diff --git a/sw/source/core/text/pormulti.cxx b/sw/source/core/text/pormulti.cxx
index a5b349e20e98..af73cf028aad 100644
--- a/sw/source/core/text/pormulti.cxx
+++ b/sw/source/core/text/pormulti.cxx
@@ -1536,7 +1536,7 @@ void SwTextPainter::PaintMultiPortion( const SwRect &rPaint,
#if OSL_DEBUG_LEVEL > 1
// only paint first level bidi portions
if( rMulti.Width() > 1 && ! pEnvPor )
- GetInfo().DrawViewOpt( rMulti, POR_FLD );
+ GetInfo().DrawViewOpt( rMulti, PortionType::Field );
#endif
if ( bRubyInGrid && pGrid->IsSquaredMode() )
diff --git a/sw/source/core/text/pormulti.hxx b/sw/source/core/text/pormulti.hxx
index 1456136379e8..bb6b9f33d43f 100644
--- a/sw/source/core/text/pormulti.hxx
+++ b/sw/source/core/text/pormulti.hxx
@@ -106,7 +106,7 @@ protected:
, eRubyPosition( RubyPosition::ABOVE )
, nDirection(0)
{
- SetWhichPor(POR_MULTI);
+ SetWhichPor(PortionType::Multi);
SetLen(nEnd);
}
void SetDouble() { bDouble = true; }
diff --git a/sw/source/core/text/porref.cxx b/sw/source/core/text/porref.cxx
index a0c8156cee61..9ddb232d1417 100644
--- a/sw/source/core/text/porref.cxx
+++ b/sw/source/core/text/porref.cxx
@@ -27,7 +27,7 @@ void SwRefPortion::Paint( const SwTextPaintInfo &rInf ) const
{
if( Width() )
{
- rInf.DrawViewOpt( *this, POR_REF );
+ rInf.DrawViewOpt( *this, PortionType::Ref );
SwTextPortion::Paint( rInf );
}
}
@@ -37,7 +37,7 @@ SwLinePortion *SwIsoRefPortion::Compress() { return this; }
SwIsoRefPortion::SwIsoRefPortion() : nViewWidth(0)
{
SetLen(TextFrameIndex(1));
- SetWhichPor( POR_ISOREF );
+ SetWhichPor( PortionType::IsoRef );
}
sal_uInt16 SwIsoRefPortion::GetViewWidth( const SwTextSizeInfo &rInf ) const
@@ -64,7 +64,7 @@ bool SwIsoRefPortion::Format( SwTextFormatInfo &rInf )
void SwIsoRefPortion::Paint( const SwTextPaintInfo &rInf ) const
{
if( Width() )
- rInf.DrawViewOpt( *this, POR_REF );
+ rInf.DrawViewOpt( *this, PortionType::Ref );
}
void SwIsoRefPortion::HandlePortion( SwPortionHandler& rPH ) const
diff --git a/sw/source/core/text/porref.hxx b/sw/source/core/text/porref.hxx
index 7d5963a24de5..0c7dc85037b9 100644
--- a/sw/source/core/text/porref.hxx
+++ b/sw/source/core/text/porref.hxx
@@ -24,7 +24,7 @@
class SwRefPortion : public SwTextPortion
{
public:
- SwRefPortion(){ SetWhichPor( POR_REF ); }
+ SwRefPortion(){ SetWhichPor( PortionType::Ref ); }
virtual void Paint( const SwTextPaintInfo &rInf ) const override;
};
diff --git a/sw/source/core/text/porrst.cxx b/sw/source/core/text/porrst.cxx
index c00393358385..1f70727abd51 100644
--- a/sw/source/core/text/porrst.cxx
+++ b/sw/source/core/text/porrst.cxx
@@ -53,7 +53,7 @@ SwTmpEndPortion::SwTmpEndPortion( const SwLinePortion &rPortion )
{
Height( rPortion.Height() );
SetAscent( rPortion.GetAscent() );
- SetWhichPor( POR_TMPEND );
+ SetWhichPor( PortionType::TempEnd );
}
void SwTmpEndPortion::Paint( const SwTextPaintInfo &rInf ) const
@@ -77,7 +77,7 @@ SwBreakPortion::SwBreakPortion( const SwLinePortion &rPortion )
: SwLinePortion( rPortion )
{
nLineLength = TextFrameIndex(1);
- SetWhichPor( POR_BRK );
+ SetWhichPor( PortionType::Break );
}
TextFrameIndex SwBreakPortion::GetCursorOfst(const sal_uInt16) const
@@ -120,7 +120,7 @@ SwKernPortion::SwKernPortion( SwLinePortion &rPortion, short nKrn,
Height( rPortion.Height() );
SetAscent( rPortion.GetAscent() );
nLineLength = TextFrameIndex(0);
- SetWhichPor( POR_KERN );
+ SetWhichPor( PortionType::Kern );
if( nKern > 0 )
Width( nKern );
rPortion.Insert( this );
@@ -133,7 +133,7 @@ SwKernPortion::SwKernPortion( const SwLinePortion& rPortion ) :
SetAscent( rPortion.GetAscent() );
nLineLength = TextFrameIndex(0);
- SetWhichPor( POR_KERN );
+ SetWhichPor( PortionType::Kern );
}
void SwKernPortion::Paint( const SwTextPaintInfo &rInf ) const
@@ -142,7 +142,7 @@ void SwKernPortion::Paint( const SwTextPaintInfo &rInf ) const
{
// bBackground is set for Kerning Portions between two fields
if ( bBackground )
- rInf.DrawViewOpt( *this, POR_FLD );
+ rInf.DrawViewOpt( *this, PortionType::Field );
rInf.DrawBackBrush( *this );
if (GetJoinBorderWithNext() ||GetJoinBorderWithPrev())
@@ -183,7 +183,7 @@ SwArrowPortion::SwArrowPortion( const SwLinePortion &rPortion ) :
Height( rPortion.Height() );
SetAscent( rPortion.GetAscent() );
nLineLength = TextFrameIndex(0);
- SetWhichPor( POR_ARROW );
+ SetWhichPor( PortionType::Arrow );
}
SwArrowPortion::SwArrowPortion( const SwTextPaintInfo &rInf )
@@ -194,7 +194,7 @@ SwArrowPortion::SwArrowPortion( const SwTextPaintInfo &rInf )
rInf.GetTextFrame()->getFramePrintArea().Right() );
aPos.setY( rInf.GetTextFrame()->getFrameArea().Top() +
rInf.GetTextFrame()->getFramePrintArea().Bottom() );
- SetWhichPor( POR_ARROW );
+ SetWhichPor( PortionType::Arrow );
}
void SwArrowPortion::Paint( const SwTextPaintInfo &rInf ) const
@@ -487,7 +487,7 @@ void SwControlCharPortion::Paint( const SwTextPaintInfo &rInf ) const
{
if ( Width() ) // is only set during prepaint mode
{
- rInf.DrawViewOpt( *this, POR_CONTROLCHAR );
+ rInf.DrawViewOpt( *this, PortionType::ControlChar );
if ( !rInf.GetOpt().IsPagePreview() &&
!rInf.GetOpt().IsReadonly() &&
diff --git a/sw/source/core/text/porrst.hxx b/sw/source/core/text/porrst.hxx
index f90e7abdf5f6..a7ae25dd4076 100644
--- a/sw/source/core/text/porrst.hxx
+++ b/sw/source/core/text/porrst.hxx
@@ -95,7 +95,7 @@ class SwHangingPortion : public SwTextPortion
public:
explicit SwHangingPortion( SwPosSize aSize ) : nInnerWidth( aSize.Width() )
{
- SetWhichPor( POR_HNG );
+ SetWhichPor( PortionType::Hanging );
SetLen(TextFrameIndex(1));
Height( aSize.Height() );
}
@@ -109,7 +109,7 @@ class SwHiddenTextPortion : public SwLinePortion
public:
explicit SwHiddenTextPortion(TextFrameIndex const nLen)
{
- SetWhichPor( POR_HIDDEN_TXT ); SetLen( nLen );
+ SetWhichPor( PortionType::HiddenText ); SetLen( nLen );
}
virtual void Paint( const SwTextPaintInfo &rInf ) const override;
@@ -129,7 +129,7 @@ public:
explicit SwControlCharPortion( sal_Unicode cChar )
: mnViewWidth( 0 ), mnHalfCharWidth( 0 ), mcChar( cChar )
{
- SetWhichPor( POR_CONTROLCHAR ); SetLen( TextFrameIndex(1) );
+ SetWhichPor( PortionType::ControlChar ); SetLen( TextFrameIndex(1) );
}
virtual void Paint( const SwTextPaintInfo &rInf ) const override;
diff --git a/sw/source/core/text/portab.hxx b/sw/source/core/text/portab.hxx
index e03858f14915..3c6e7a5df137 100644
--- a/sw/source/core/text/portab.hxx
+++ b/sw/source/core/text/portab.hxx
@@ -47,7 +47,7 @@ class SwTabLeftPortion : public SwTabPortion
public:
SwTabLeftPortion( const sal_uInt16 nTabPosVal, const sal_Unicode cFillChar, bool bAutoTab )
: SwTabPortion( nTabPosVal, cFillChar, bAutoTab )
- { SetWhichPor( POR_TABLEFT ); }
+ { SetWhichPor( PortionType::TabLeft ); }
};
class SwTabRightPortion : public SwTabPortion
@@ -55,7 +55,7 @@ class SwTabRightPortion : public SwTabPortion
public:
SwTabRightPortion( const sal_uInt16 nTabPosVal, const sal_Unicode cFillChar )
: SwTabPortion( nTabPosVal, cFillChar )
- { SetWhichPor( POR_TABRIGHT ); }
+ { SetWhichPor( PortionType::TabRight ); }
};
class SwTabCenterPortion : public SwTabPortion
@@ -63,7 +63,7 @@ class SwTabCenterPortion : public SwTabPortion
public:
SwTabCenterPortion( const sal_uInt16 nTabPosVal, const sal_Unicode cFillChar )
: SwTabPortion( nTabPosVal, cFillChar )
- { SetWhichPor( POR_TABCENTER ); }
+ { SetWhichPor( PortionType::TabCenter ); }
};
class SwTabDecimalPortion : public SwTabPortion
@@ -83,7 +83,7 @@ public:
: SwTabPortion( nTabPosVal, cFillChar ),
mcTab(cTab),
mnWidthOfPortionsUpTpDecimalPosition( USHRT_MAX )
- { SetWhichPor( POR_TABDECIMAL ); }
+ { SetWhichPor( PortionType::TabDecimal ); }
sal_Unicode GetTabDecimal() const { return mcTab; }
diff --git a/sw/source/core/text/portox.cxx b/sw/source/core/text/portox.cxx
index ba28c0bc8003..a746058e9b07 100644
--- a/sw/source/core/text/portox.cxx
+++ b/sw/source/core/text/portox.cxx
@@ -27,7 +27,7 @@ void SwToxPortion::Paint( const SwTextPaintInfo &rInf ) const
{
if( Width() )
{
- rInf.DrawViewOpt( *this, POR_TOX );
+ rInf.DrawViewOpt( *this, PortionType::Tox );
SwTextPortion::Paint( rInf );
}
}
@@ -37,7 +37,7 @@ SwLinePortion *SwIsoToxPortion::Compress() { return this; }
SwIsoToxPortion::SwIsoToxPortion() : nViewWidth(0)
{
SetLen(TextFrameIndex(1));
- SetWhichPor( POR_ISOTOX );
+ SetWhichPor( PortionType::IsoTox );
}
sal_uInt16 SwIsoToxPortion::GetViewWidth( const SwTextSizeInfo &rInf ) const
@@ -66,7 +66,7 @@ bool SwIsoToxPortion::Format( SwTextFormatInfo &rInf )
void SwIsoToxPortion::Paint( const SwTextPaintInfo &rInf ) const
{
if( Width() )
- rInf.DrawViewOpt( *this, POR_TOX );
+ rInf.DrawViewOpt( *this, PortionType::Tox );
}
void SwIsoToxPortion::HandlePortion( SwPortionHandler& rPH ) const
diff --git a/sw/source/core/text/portox.hxx b/sw/source/core/text/portox.hxx
index f854b1adc4e1..b2c8f23a76df 100644
--- a/sw/source/core/text/portox.hxx
+++ b/sw/source/core/text/portox.hxx
@@ -25,7 +25,7 @@
class SwToxPortion : public SwTextPortion
{
public:
- SwToxPortion(){ SetWhichPor( POR_TOX ); }
+ SwToxPortion(){ SetWhichPor( PortionType::Tox ); }
virtual void Paint( const SwTextPaintInfo &rInf ) const override;
};
diff --git a/sw/source/core/text/portxt.cxx b/sw/source/core/text/portxt.cxx
index b1b0b317e77d..eb3937d10702 100644
--- a/sw/source/core/text/portxt.cxx
+++ b/sw/source/core/text/portxt.cxx
@@ -217,7 +217,7 @@ SwTextPortion * SwTextPortion::CopyLinePortion(const SwLinePortion &rPortion)
{
SwTextPortion *const pNew(new SwTextPortion);
static_cast<SwLinePortion&>(*pNew) = rPortion;
- pNew->SetWhichPor( POR_TXT ); // overwrite that!
+ pNew->SetWhichPor( PortionType::Text ); // overwrite that!
return pNew;
}
@@ -677,7 +677,7 @@ void SwTextPortion::HandlePortion( SwPortionHandler& rPH ) const
SwTextInputFieldPortion::SwTextInputFieldPortion()
: SwTextPortion()
{
- SetWhichPor( POR_INPUTFLD );
+ SetWhichPor( PortionType::InputField );
}
bool SwTextInputFieldPortion::Format(SwTextFormatInfo &rTextFormatInfo)
@@ -689,7 +689,7 @@ void SwTextInputFieldPortion::Paint( const SwTextPaintInfo &rInf ) const
{
if ( Width() )
{
- rInf.DrawViewOpt( *this, POR_INPUTFLD );
+ rInf.DrawViewOpt( *this, PortionType::InputField );
SwTextSlot aPaintText( &rInf, this, true, true, OUString() );
SwTextPortion::Paint( rInf );
}
@@ -730,7 +730,7 @@ SwHolePortion::SwHolePortion( const SwTextPortion &rPor )
SetLen( TextFrameIndex(1) );
Height( rPor.Height() );
SetAscent( rPor.GetAscent() );
- SetWhichPor( POR_HOLE );
+ SetWhichPor( PortionType::Hole );
}
SwLinePortion *SwHolePortion::Compress() { return this; }
diff --git a/sw/source/core/text/portxt.hxx b/sw/source/core/text/portxt.hxx
index cfa0c190afe9..8bf0a0d46bf7 100644
--- a/sw/source/core/text/portxt.hxx
+++ b/sw/source/core/text/portxt.hxx
@@ -31,7 +31,7 @@ class SwTextPortion : public SwLinePortion
bool Format_( SwTextFormatInfo &rInf );
public:
- SwTextPortion(){ SetWhichPor( POR_TXT ); }
+ SwTextPortion(){ SetWhichPor( PortionType::Text ); }
static SwTextPortion * CopyLinePortion(const SwLinePortion &rPortion);
virtual void Paint( const SwTextPaintInfo &rInf ) const override;
virtual bool Format( SwTextFormatInfo &rInf ) override;
diff --git a/sw/source/core/text/txtdrop.cxx b/sw/source/core/text/txtdrop.cxx
index b6250bee6469..65bdc2dd0e5a 100644
--- a/sw/source/core/text/txtdrop.cxx
+++ b/sw/source/core/text/txtdrop.cxx
@@ -110,7 +110,7 @@ SwDropPortion::SwDropPortion( const sal_uInt16 nLineCnt,
nFix(0),
nY(0)
{
- SetWhichPor( POR_DROP );
+ SetWhichPor( PortionType::Drop );
}
SwDropPortion::~SwDropPortion()
diff --git a/sw/source/core/text/txtftn.cxx b/sw/source/core/text/txtftn.cxx
index 2682ee021493..c9bc349b06d0 100644
--- a/sw/source/core/text/txtftn.cxx
+++ b/sw/source/core/text/txtftn.cxx
@@ -1309,7 +1309,7 @@ SwFootnotePortion::SwFootnotePortion( const OUString &rExpand,
, mnPreferredScriptType( SwFontScript::Latin )
{
SetLen(TextFrameIndex(1));
- SetWhichPor( POR_FTN );
+ SetWhichPor( PortionType::Footnote );
}
bool SwFootnotePortion::GetExpText( const SwTextSizeInfo &, OUString &rText ) const
@@ -1342,7 +1342,7 @@ void SwFootnotePortion::Paint( const SwTextPaintInfo &rInf ) const
// #i98418#
// SwFootnoteSave aFootnoteSave( rInf, pFootnote );
SwFootnoteSave aFootnoteSave( rInf, pFootnote, mbPreferredScriptTypeSet, mnPreferredScriptType );
- rInf.DrawViewOpt( *this, POR_FTN );
+ rInf.DrawViewOpt( *this, PortionType::Footnote );
SwExpandPortion::Paint( rInf );
}
@@ -1370,7 +1370,7 @@ SwQuoVadisPortion::SwQuoVadisPortion( const OUString &rExp, const OUString& rStr
: SwFieldPortion( rExp ), aErgo(rStr)
{
SetLen(TextFrameIndex(0));
- SetWhichPor( POR_QUOVADIS );
+ SetWhichPor( PortionType::QuoVadis );
}
bool SwQuoVadisPortion::Format( SwTextFormatInfo &rInf )
@@ -1421,7 +1421,7 @@ void SwQuoVadisPortion::Paint( const SwTextPaintInfo &rInf ) const
// can quickly switch
if( PrtWidth() )
{
- rInf.DrawViewOpt( *this, POR_QUOVADIS );
+ rInf.DrawViewOpt( *this, PortionType::QuoVadis );
SwTextSlot aDiffText( &rInf, this, true, false );
SwFontSave aSave( rInf, m_pFont.get() );
rInf.DrawText( *this, rInf.GetLen(), true );
@@ -1441,7 +1441,7 @@ SwErgoSumPortion::SwErgoSumPortion(const OUString &rExp, const OUString& rStr)
// One blank distance to the text
m_aExpand += " ";
- SetWhichPor( POR_ERGOSUM );
+ SetWhichPor( PortionType::ErgoSum );
}
TextFrameIndex SwErgoSumPortion::GetCursorOfst(const sal_uInt16) const
diff --git a/sw/source/core/text/txthyph.cxx b/sw/source/core/text/txthyph.cxx
index 887f1e154cca..eb6e4d40b8ef 100644
--- a/sw/source/core/text/txthyph.cxx
+++ b/sw/source/core/text/txthyph.cxx
@@ -92,8 +92,8 @@ bool SwTextFrame::Hyphenate(SwInterHyphInfoTextFrame & rHyphInf)
SwLinePortion *pPor = aLine.GetCurr()->GetFirstPortion();
while( pPor->GetNextPortion() )
pPor = pPor->GetNextPortion();
- if( pPor->GetWhichPor() == POR_SOFTHYPH ||
- pPor->GetWhichPor() == POR_SOFTHYPHSTR )
+ if( pPor->GetWhichPor() == PortionType::SoftHyphen ||
+ pPor->GetWhichPor() == PortionType::SoftHyphenStr )
aLine.Next();
}
@@ -394,7 +394,7 @@ SwSoftHyphPortion::SwSoftHyphPortion() :
bExpand(false), nViewWidth(0)
{
SetLen(TextFrameIndex(1));
- SetWhichPor( POR_SOFTHYPH );
+ SetWhichPor( PortionType::SoftHyphen );
}
sal_uInt16 SwSoftHyphPortion::GetViewWidth( const SwTextSizeInfo &rInf ) const
@@ -426,7 +426,7 @@ void SwSoftHyphPortion::Paint( const SwTextPaintInfo &rInf ) const
{
if( Width() )
{
- rInf.DrawViewOpt( *this, POR_SOFTHYPH );
+ rInf.DrawViewOpt( *this, PortionType::SoftHyphen );
SwExpandPortion::Paint( rInf );
}
}
@@ -550,8 +550,8 @@ bool SwSoftHyphPortion::GetExpText( const SwTextSizeInfo &rInf, OUString &rText
void SwSoftHyphPortion::HandlePortion( SwPortionHandler& rPH ) const
{
- const sal_uInt16 nWhich = ! Width() ?
- POR_SOFTHYPH_COMP :
+ const PortionType nWhich = ! Width() ?
+ PortionType::SoftHyphenComp :
GetWhichPor();
rPH.Special( GetLen(), OUString('-'), nWhich );
}
@@ -560,7 +560,7 @@ void SwSoftHyphStrPortion::Paint( const SwTextPaintInfo &rInf ) const
{
// Bug or feature?:
// {Zu}{k-}{ker}, {k-} will be gray instead of {-}
- rInf.DrawViewOpt( *this, POR_SOFTHYPH );
+ rInf.DrawViewOpt( *this, PortionType::SoftHyphen );
SwHyphStrPortion::Paint( rInf );
}
@@ -568,7 +568,7 @@ SwSoftHyphStrPortion::SwSoftHyphStrPortion( const OUString &rStr )
: SwHyphStrPortion( rStr )
{
SetLen(TextFrameIndex(1));
- SetWhichPor( POR_SOFTHYPHSTR );
+ SetWhichPor( PortionType::SoftHyphenStr );
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/text/txttab.cxx b/sw/source/core/text/txttab.cxx
index 488c60076da7..c2fded221827 100644
--- a/sw/source/core/text/txttab.cxx
+++ b/sw/source/core/text/txttab.cxx
@@ -297,7 +297,7 @@ SwTabPortion::SwTabPortion( const sal_uInt16 nTabPosition, const sal_Unicode cFi
{
nLineLength = TextFrameIndex(1);
OSL_ENSURE(!IsFilled() || ' ' != cFill, "SwTabPortion::CTOR: blanks ?!");
- SetWhichPor( POR_TAB );
+ SetWhichPor( PortionType::Table );
}
bool SwTabPortion::Format( SwTextFormatInfo &rInf )
@@ -363,20 +363,20 @@ bool SwTabPortion::PreFormat( SwTextFormatInfo &rInf )
if( ! bFull && 0 == nDir )
{
- const sal_uInt16 nWhich = GetWhichPor();
+ const PortionType nWhich = GetWhichPor();
switch( nWhich )
{
- case POR_TABRIGHT:
- case POR_TABDECIMAL:
- case POR_TABCENTER:
+ case PortionType::TabRight:
+ case PortionType::TabDecimal:
+ case PortionType::TabCenter:
{
- if( POR_TABDECIMAL == nWhich )
+ if( PortionType::TabDecimal == nWhich )
rInf.SetTabDecimal(
static_cast<SwTabDecimalPortion*>(this)->GetTabDecimal());
rInf.SetLastTab( this );
break;
}
- case POR_TABLEFT:
+ case PortionType::TabLeft:
{
// handle this case in PostFormat
if( bTabOverMargin && !bAutoTabStop && GetTabPos() > rInf.Width() )
@@ -452,16 +452,16 @@ bool SwTabPortion::PostFormat( SwTextFormatInfo &rInf )
pPor = pPor->GetNextPortion();
}
- const sal_uInt16 nWhich = GetWhichPor();
+ const PortionType nWhich = GetWhichPor();
const bool bTabCompat = rInf.GetTextFrame()->GetDoc().getIDocumentSettingAccess().get(DocumentSettingId::TAB_COMPAT);
- if ( bTabOverMargin && POR_TABLEFT == nWhich )
+ if ( bTabOverMargin && PortionType::TabLeft == nWhich )
{
nPorWidth = 0;
}
// #127428# Abandon dec. tab position if line is full
- if ( bTabCompat && POR_TABDECIMAL == nWhich )
+ if ( bTabCompat && PortionType::TabDecimal == nWhich )
{
sal_uInt16 nPrePorWidth = static_cast<const SwTabDecimalPortion*>(this)->GetWidthOfPortionsUpToDecimalPosition();
@@ -477,7 +477,7 @@ bool SwTabPortion::PostFormat( SwTextFormatInfo &rInf )
}
}
- if( POR_TABCENTER == nWhich )
+ if( PortionType::TabCenter == nWhich )
{
// centered tabs are problematic:
// We have to detect how much fits into the line.
@@ -503,7 +503,7 @@ bool SwTabPortion::PostFormat( SwTextFormatInfo &rInf )
SetFixWidth( PrtWidth() );
// reset last values
rInf.SetLastTab(nullptr);
- if( POR_TABDECIMAL == nWhich )
+ if( PortionType::TabDecimal == nWhich )
rInf.SetTabDecimal(0);
return rInf.Width() <= rInf.X();
@@ -546,7 +546,7 @@ void SwTabPortion::Paint( const SwTextPaintInfo &rInf ) const
{
// filled tabs are shaded in gray
if( IsFilled() )
- rInf.DrawViewOpt( *this, POR_TAB );
+ rInf.DrawViewOpt( *this, PortionType::Table );
else
rInf.DrawTab( *this );
}
diff --git a/sw/source/core/text/xmldump.cxx b/sw/source/core/text/xmldump.cxx
index b17078e195d7..9a916c87f583 100644
--- a/sw/source/core/text/xmldump.cxx
+++ b/sw/source/core/text/xmldump.cxx
@@ -35,71 +35,71 @@ class XmlPortionDumper:public SwPortionHandler
const OUString& m_rText;
OUString m_aLine;
- static const char* getTypeName( sal_uInt16 nType )
+ static const char* getTypeName( PortionType nType )
{
switch ( nType )
{
- case POR_LIN: return "POR_LIN";
- case POR_FLYCNT: return "POR_FLYCNT";
-
- case POR_HOLE: return "POR_HOLE";
- case POR_TMPEND: return "POR_TMPEND";
- case POR_BRK: return "POR_BRK";
- case POR_KERN: return "POR_KERN";
- case POR_ARROW: return "POR_ARROW";
- case POR_MULTI: return "POR_MULTI";
- case POR_HIDDEN_TXT: return "POR_HIDDEN_TXT";
- case POR_CONTROLCHAR: return "POR_CONTROLCHAR";
-
- case POR_TXT: return "POR_TXT";
- case POR_LAY: return "POR_LAY";
- case POR_PARA: return "POR_PARA";
- case POR_URL: return "POR_URL";
- case POR_HNG: return "POR_HNG";
-
- case POR_DROP: return "POR_DROP";
- case POR_TOX: return "POR_TOX";
- case POR_ISOTOX: return "POR_ISOTOX";
- case POR_REF: return "POR_REF";
- case POR_ISOREF: return "POR_ISOREF";
- case POR_META: return "POR_META";
-
- case POR_EXP: return "POR_EXP";
- case POR_BLANK: return "POR_BLANK";
- case POR_POSTITS: return "POR_POSTITS";
-
- case POR_HYPH: return "POR_HYPH";
- case POR_HYPHSTR: return "POR_HYPHSTR";
- case POR_SOFTHYPH: return "POR_SOFTHYPH";
- case POR_SOFTHYPHSTR: return "POR_SOFTHYPHSTR";
- case POR_SOFTHYPH_COMP: return "POR_SOFTHYPH_COMP";
-
- case POR_FLD: return "POR_FLD";
- case POR_HIDDEN: return "POR_HIDDEN";
- case POR_QUOVADIS: return "POR_QUOVADIS";
- case POR_ERGOSUM: return "POR_ERGOSUM";
- case POR_COMBINED: return "POR_COMBINED";
- case POR_FTN: return "POR_FTN";
-
- case POR_FTNNUM: return "POR_FTNNUM";
- case POR_NUMBER: return "POR_NUMBER";
- case POR_BULLET: return "POR_BULLET";
- case POR_GRFNUM: return "POR_GRFNUM";
-
- case POR_GLUE: return "POR_GLUE";
-
- case POR_MARGIN: return "POR_MARGIN";
-
- case POR_FIX: return "POR_FIX";
- case POR_FLY: return "POR_FLY";
-
- case POR_TAB: return "POR_TAB";
-
- case POR_TABRIGHT: return "POR_TABRIGHT";
- case POR_TABCENTER: return "POR_TABCENTER";
- case POR_TABDECIMAL: return "POR_TABDECIMAL";
-
- case POR_TABLEFT: return "POR_TABLEFT";
+ case PortionType::NONE: return "PortionType::NONE";
+ case PortionType::FlyCnt: return "PortionType::FlyCnt";
+
+ case PortionType::Hole: return "PortionType::Hole";
+ case PortionType::TempEnd: return "PortionType::TempEnd";
+ case PortionType::Break: return "PortionType::Break";
+ case PortionType::Kern: return "PortionType::Kern";
+ case PortionType::Arrow: return "PortionType::Arrow";
+ case PortionType::Multi: return "PortionType::Multi";
+ case PortionType::HiddenText: return "PortionType::HiddenText";
+ case PortionType::ControlChar: return "PortionType::ControlChar";
+
+ case PortionType::Text: return "PortionType::Text";
+ case PortionType::Lay: return "PortionType::Lay";
+ case PortionType::Para: return "PortionType::Para";
+ case PortionType::Url: return "PortionType::Url";
+ case PortionType::Hanging: return "PortionType::Hanging";
+
+ case PortionType::Drop: return "PortionType::Drop";
+ case PortionType::Tox: return "PortionType::Tox";
+ case PortionType::IsoTox: return "PortionType::IsoTox";
+ case PortionType::Ref: return "PortionType::Ref";
+ case PortionType::IsoRef: return "PortionType::IsoRef";
+ case PortionType::Meta: return "PortionType::Meta";
+
+ case PortionType::Expand: return "PortionType::Expand";
+ case PortionType::Blank: return "PortionType::Blank";
+ case PortionType::PostIts: return "PortionType::PostIts";
+
+ case PortionType::Hyphen: return "PortionType::Hyphen";
+ case PortionType::HyphenStr: return "PortionType::HyphenStr";
+ case PortionType::SoftHyphen: return "PortionType::SoftHyphen";
+ case PortionType::SoftHyphenStr: return "PortionType::SoftHyphenStr";
+ case PortionType::SoftHyphenComp: return "PortionType::SoftHyphenComp";
+
+ case PortionType::Field: return "PortionType::Field";
+ case PortionType::Hidden: return "PortionType::Hidden";
+ case PortionType::QuoVadis: return "PortionType::QuoVadis";
+ case PortionType::ErgoSum: return "PortionType::ErgoSum";
+ case PortionType::Combined: return "PortionType::Combined";
+ case PortionType::Footnote: return "PortionType::Footnote";
+
+ case PortionType::FootnoteNum: return "PortionType::FootnoteNum";
+ case PortionType::Number: return "PortionType::Number";
+ case PortionType::Bullet: return "PortionType::Bullet";
+ case PortionType::GrfNum: return "PortionType::GrfNum";
+
+ case PortionType::Glue: return "PortionType::Glue";
+
+ case PortionType::Margin: return "PortionType::Margin";
+
+ case PortionType::Fix: return "PortionType::Fix";
+ case PortionType::Fly: return "PortionType::Fly";
+
+ case PortionType::Table: return "PortionType::Table";
+
+ case PortionType::TabRight: return "PortionType::TabRight";
+ case PortionType::TabCenter: return "PortionType::TabCenter";
+ case PortionType::TabDecimal: return "PortionType::TabDecimal";
+
+ case PortionType::TabLeft: return "PortionType::TabLeft";
default:
return "Unknown";
}
@@ -118,7 +118,7 @@ class XmlPortionDumper:public SwPortionHandler
text which is painted on-screen
*/
virtual void Text( TextFrameIndex nLength,
- sal_uInt16 nType,
+ PortionType nType,
sal_Int32 nHeight,
sal_Int32 nWidth) override
{
@@ -154,7 +154,7 @@ class XmlPortionDumper:public SwPortionHandler
*/
virtual void Special( TextFrameIndex nLength,
const OUString & rText,
- sal_uInt16 nType,
+ PortionType nType,
sal_Int32 nHeight,
sal_Int32 nWidth,
const SwFont* pFont ) override