summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sw/inc/tgrditem.hxx2
-rw-r--r--sw/source/core/layout/atrfrm.cxx20
-rw-r--r--sw/source/core/layout/pagechg.cxx4
-rw-r--r--sw/source/core/layout/paintfrm.cxx2
-rw-r--r--sw/source/core/text/guess.cxx2
-rw-r--r--sw/source/core/text/inftxt.cxx2
-rw-r--r--sw/source/core/text/itrform2.cxx2
-rw-r--r--sw/source/core/text/pormulti.cxx2
-rw-r--r--sw/source/core/text/portxt.cxx4
-rw-r--r--sw/source/core/txtnode/fntcache.cxx8
-rw-r--r--sw/source/filter/ww8/docxattributeoutput.cxx6
-rw-r--r--sw/source/filter/ww8/ww8atr.cxx6
-rw-r--r--sw/source/filter/ww8/ww8par6.cxx10
-rw-r--r--sw/source/ui/misc/pggrid.cxx14
-rw-r--r--sw/source/uibase/frmdlg/colex.cxx4
-rw-r--r--sw/source/uibase/utlui/attrdesc.cxx6
16 files changed, 47 insertions, 47 deletions
diff --git a/sw/inc/tgrditem.hxx b/sw/inc/tgrditem.hxx
index 0836fb731d8b..c787b165c7f8 100644
--- a/sw/inc/tgrditem.hxx
+++ b/sw/inc/tgrditem.hxx
@@ -27,7 +27,7 @@
class IntlWrapper;
-enum SwTextGrid { GRID_NONE, GRID_LINES_ONLY, GRID_LINES_CHARS };
+enum class SwTextGrid { NONE, LinesOnly, LinesAndChars };
class SW_DLLPUBLIC SwTextGridItem final : public SfxPoolItem
{
diff --git a/sw/source/core/layout/atrfrm.cxx b/sw/source/core/layout/atrfrm.cxx
index bd5d65a9e9b1..6b438735c810 100644
--- a/sw/source/core/layout/atrfrm.cxx
+++ b/sw/source/core/layout/atrfrm.cxx
@@ -2381,7 +2381,7 @@ bool SwFormatLineNumber::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
SwTextGridItem::SwTextGridItem()
: SfxPoolItem( RES_TEXTGRID )
, m_aColor( COL_LIGHTGRAY ), m_nLines( 20 )
- , m_nBaseHeight( 400 ), m_nRubyHeight( 200 ), m_eGridType( GRID_NONE )
+ , m_nBaseHeight( 400 ), m_nRubyHeight( 200 ), m_eGridType( SwTextGrid::NONE )
, m_bRubyTextBelow( false ), m_bPrintGrid( true ), m_bDisplayGrid( true )
, m_nBaseWidth(400), m_bSnapToChars( true ), m_bSquaredMode(true)
{
@@ -2452,13 +2452,13 @@ bool SwTextGridItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
case MID_GRID_TYPE:
switch( GetGridType() )
{
- case GRID_NONE:
+ case SwTextGrid::NONE:
rVal <<= text::TextGridMode::NONE;
break;
- case GRID_LINES_ONLY:
+ case SwTextGrid::LinesOnly:
rVal <<= text::TextGridMode::LINES;
break;
- case GRID_LINES_CHARS:
+ case SwTextGrid::LinesAndChars:
rVal <<= text::TextGridMode::LINES_AND_CHARS;
break;
default:
@@ -2555,13 +2555,13 @@ bool SwTextGridItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
switch( nTmp )
{
case text::TextGridMode::NONE:
- SetGridType( GRID_NONE );
+ SetGridType( SwTextGrid::NONE );
break;
case text::TextGridMode::LINES:
- SetGridType( GRID_LINES_ONLY );
+ SetGridType( SwTextGrid::LinesOnly );
break;
case text::TextGridMode::LINES_AND_CHARS:
- SetGridType( GRID_LINES_CHARS );
+ SetGridType( SwTextGrid::LinesAndChars );
break;
default:
bRet = false;
@@ -2596,7 +2596,7 @@ void SwTextGridItem::SwitchPaperMode(bool bNew)
}
// use default value when grid is disable
- if (m_eGridType == GRID_NONE)
+ if (m_eGridType == SwTextGrid::NONE)
{
m_bSquaredMode = bNew;
Init();
@@ -2627,7 +2627,7 @@ void SwTextGridItem::Init()
m_nLines = 20;
m_nBaseHeight = 400;
m_nRubyHeight = 200;
- m_eGridType = GRID_NONE;
+ m_eGridType = SwTextGrid::NONE;
m_bRubyTextBelow = false;
m_bPrintGrid = true;
m_bDisplayGrid = true;
@@ -2639,7 +2639,7 @@ void SwTextGridItem::Init()
m_nLines = 44;
m_nBaseHeight = 312;
m_nRubyHeight = 0;
- m_eGridType = GRID_NONE;
+ m_eGridType = SwTextGrid::NONE;
m_bRubyTextBelow = false;
m_bPrintGrid = true;
m_bDisplayGrid = true;
diff --git a/sw/source/core/layout/pagechg.cxx b/sw/source/core/layout/pagechg.cxx
index cc7fac4b1bba..2d61df056784 100644
--- a/sw/source/core/layout/pagechg.cxx
+++ b/sw/source/core/layout/pagechg.cxx
@@ -128,7 +128,7 @@ void SwBodyFrame::Format( vcl::RenderContext* /*pRenderContext*/, const SwBorder
SwRectFnSet aRectFnSet(this);
tools::Long nSize = aRectFnSet.GetWidth(getFrameArea());
tools::Long nBorder = 0;
- if( GRID_LINES_CHARS == pGrid->GetGridType() )
+ if( SwTextGrid::LinesAndChars == pGrid->GetGridType() )
{
//for textgrid refactor
SwDoc *pDoc = GetFormat()->GetDoc();
@@ -2740,7 +2740,7 @@ SwTextGridItem const* GetGridItem(SwPageFrame const*const pPage)
{
SwTextGridItem const& rGridItem(
pPage->GetPageDesc()->GetMaster().GetTextGrid());
- if (GRID_NONE != rGridItem.GetGridType())
+ if (SwTextGrid::NONE != rGridItem.GetGridType())
{
return &rGridItem;
}
diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx
index d8b2a541dbf7..39d43341148e 100644
--- a/sw/source/core/layout/paintfrm.cxx
+++ b/sw/source/core/layout/paintfrm.cxx
@@ -5900,7 +5900,7 @@ void SwPageFrame::PaintGrid( OutputDevice const * pOut, SwRect const &rRect ) co
return;
bool bGrid = pGrid->GetRubyTextBelow();
- bool bCell = GRID_LINES_CHARS == pGrid->GetGridType();
+ bool bCell = SwTextGrid::LinesAndChars == pGrid->GetGridType();
tools::Long nGrid = pGrid->GetBaseHeight();
const SwDoc* pDoc = GetFormat()->GetDoc();
tools::Long nGridWidth = GetGridWidth(*pGrid, *pDoc);
diff --git a/sw/source/core/text/guess.cxx b/sw/source/core/text/guess.cxx
index 81ca87b15113..680411147a35 100644
--- a/sw/source/core/text/guess.cxx
+++ b/sw/source/core/text/guess.cxx
@@ -215,7 +215,7 @@ bool SwTextGuess::Guess( const SwTextPortion& rPor, SwTextFormatInfo &rInf,
{
SwTextGridItem const*const pGrid(
GetGridItem(rInf.GetTextFrame()->FindPageFrame()));
- bAddItalic = !pGrid || GRID_LINES_CHARS != pGrid->GetGridType();
+ bAddItalic = !pGrid || SwTextGrid::LinesAndChars != pGrid->GetGridType();
}
// do not add extra italic value for an isolated blank:
diff --git a/sw/source/core/text/inftxt.cxx b/sw/source/core/text/inftxt.cxx
index df6c455a74eb..ddb68fd8ef4e 100644
--- a/sw/source/core/text/inftxt.cxx
+++ b/sw/source/core/text/inftxt.cxx
@@ -328,7 +328,7 @@ void SwTextSizeInfo::CtorInitTextSizeInfo( OutputDevice* pRenderContext, SwTextF
bool bGridEnabled = false;
if (SwTextGridItem const* pGrid = GetGridItem(m_pFrame->FindPageFrame()); pGrid)
{
- bGridEnabled = (pGrid->GetGridType() != GRID_NONE);
+ bGridEnabled = (pGrid->GetGridType() != SwTextGrid::NONE);
}
SetSnapToGrid(m_pFrame->GetTextNodeForParaProps()->GetSwAttrSet().GetParaGrid().GetValue()
diff --git a/sw/source/core/text/itrform2.cxx b/sw/source/core/text/itrform2.cxx
index 9c9604873471..8427ceec8757 100644
--- a/sw/source/core/text/itrform2.cxx
+++ b/sw/source/core/text/itrform2.cxx
@@ -442,7 +442,7 @@ void SwTextFormatter::BuildPortions( SwTextFormatInfo &rInf )
// Asian grid stuff
SwTextGridItem const*const pGrid(GetGridItem(m_pFrame->FindPageFrame()));
const bool bHasGrid = pGrid && rInf.SnapToGrid() &&
- GRID_LINES_CHARS == pGrid->GetGridType();
+ SwTextGrid::LinesAndChars == pGrid->GetGridType();
const SwDoc & rDoc = rInf.GetTextFrame()->GetDoc();
diff --git a/sw/source/core/text/pormulti.cxx b/sw/source/core/text/pormulti.cxx
index cdd52ee951fa..50e9a13ebd4a 100644
--- a/sw/source/core/text/pormulti.cxx
+++ b/sw/source/core/text/pormulti.cxx
@@ -2143,7 +2143,7 @@ bool SwTextFormatter::BuildMultiPortion( SwTextFormatInfo &rInf,
bool bRet = false;
SwTextGridItem const*const pGrid(GetGridItem(m_pFrame->FindPageFrame()));
- const bool bHasGrid = pGrid && GRID_LINES_CHARS == pGrid->GetGridType();
+ const bool bHasGrid = pGrid && SwTextGrid::LinesAndChars == pGrid->GetGridType();
bool bRubyTop = false;
diff --git a/sw/source/core/text/portxt.cxx b/sw/source/core/text/portxt.cxx
index 8fd5f1c07623..ff8f05e28197 100644
--- a/sw/source/core/text/portxt.cxx
+++ b/sw/source/core/text/portxt.cxx
@@ -656,7 +656,7 @@ TextFrameIndex SwTextPortion::GetSpaceCnt(const SwTextSizeInfo &rInf,
if ( rInf.SnapToGrid() )
{
SwTextGridItem const*const pGrid(GetGridItem(rInf.GetTextFrame()->FindPageFrame()));
- if (pGrid && GRID_LINES_CHARS == pGrid->GetGridType() && pGrid->IsSnapToChars())
+ if (pGrid && SwTextGrid::LinesAndChars == pGrid->GetGridType() && pGrid->IsSnapToChars())
return TextFrameIndex(0);
}
@@ -696,7 +696,7 @@ SwTwips SwTextPortion::CalcSpacing( tools::Long nSpaceAdd, const SwTextSizeInfo
if ( rInf.SnapToGrid() )
{
SwTextGridItem const*const pGrid(GetGridItem(rInf.GetTextFrame()->FindPageFrame()));
- if (pGrid && GRID_LINES_CHARS == pGrid->GetGridType() && pGrid->IsSnapToChars())
+ if (pGrid && SwTextGrid::LinesAndChars == pGrid->GetGridType() && pGrid->IsSnapToChars())
return 0;
}
diff --git a/sw/source/core/txtnode/fntcache.cxx b/sw/source/core/txtnode/fntcache.cxx
index 740c419a7d25..cab1e6102a3f 100644
--- a/sw/source/core/txtnode/fntcache.cxx
+++ b/sw/source/core/txtnode/fntcache.cxx
@@ -1021,7 +1021,7 @@ void SwFntObj::DrawText( SwDrawTextInfo &rInf )
SwTextGridItem const*const pGrid(GetGridItem(rInf.GetFrame()->FindPageFrame()));
// ASIAN LINE AND CHARACTER GRID MODE
- if ( pGrid && GRID_LINES_CHARS == pGrid->GetGridType() )
+ if ( pGrid && SwTextGrid::LinesAndChars == pGrid->GetGridType() )
{
//for textgrid refactor
const SwDoc* pDoc = rInf.GetShell()->GetDoc();
@@ -1663,7 +1663,7 @@ Size SwFntObj::GetTextSize( SwDrawTextInfo& rInf )
SwFontScript::CJK == rInf.GetFont()->GetActual() )
{
SwTextGridItem const*const pGrid(GetGridItem(rInf.GetFrame()->FindPageFrame()));
- if ( pGrid && GRID_LINES_CHARS == pGrid->GetGridType() )
+ if ( pGrid && SwTextGrid::LinesAndChars == pGrid->GetGridType() )
{
const SwDoc* pDoc = rInf.GetShell()->GetDoc();
const sal_uInt16 nGridWidth = GetGridWidth(*pGrid, *pDoc);
@@ -1810,7 +1810,7 @@ TextFrameIndex SwFntObj::GetModelPositionForViewPoint(SwDrawTextInfo &rInf)
rInf.GetFont() && SwFontScript::CJK == rInf.GetFont()->GetActual() )
{
SwTextGridItem const*const pGrid(GetGridItem(rInf.GetFrame()->FindPageFrame()));
- if ( pGrid && GRID_LINES_CHARS == pGrid->GetGridType() )
+ if ( pGrid && SwTextGrid::LinesAndChars == pGrid->GetGridType() )
{
const SwDoc* pDoc = rInf.GetShell()->GetDoc();
const sal_uInt16 nGridWidth = GetGridWidth(*pGrid, *pDoc);
@@ -2086,7 +2086,7 @@ TextFrameIndex SwFont::GetTextBreak(SwDrawTextInfo const & rInf, tools::Long nTe
rInf.GetFont() && SwFontScript::CJK == rInf.GetFont()->GetActual() )
{
SwTextGridItem const*const pGrid(GetGridItem(rInf.GetFrame()->FindPageFrame()));
- if ( pGrid && GRID_LINES_CHARS == pGrid->GetGridType() )
+ if ( pGrid && SwTextGrid::LinesAndChars == pGrid->GetGridType() )
{
const SwDoc* pDoc = rInf.GetShell()->GetDoc();
const sal_uInt16 nGridWidth = GetGridWidth(*pGrid, *pDoc);
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx
index 5fc619f3ecb2..2f162eabca9c 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -10087,13 +10087,13 @@ void DocxAttributeOutput::FormatTextGrid( const SwTextGridItem& rGrid )
switch ( rGrid.GetGridType( ) )
{
default:
- case GRID_NONE:
+ case SwTextGrid::NONE:
sGridType = "default";
break;
- case GRID_LINES_ONLY:
+ case SwTextGrid::LinesOnly:
sGridType = "lines";
break;
- case GRID_LINES_CHARS:
+ case SwTextGrid::LinesAndChars:
if ( rGrid.IsSnapToChars( ) )
sGridType = "snapToChars";
else
diff --git a/sw/source/filter/ww8/ww8atr.cxx b/sw/source/filter/ww8/ww8atr.cxx
index 3fbd6d4f4bbd..53a043616d34 100644
--- a/sw/source/filter/ww8/ww8atr.cxx
+++ b/sw/source/filter/ww8/ww8atr.cxx
@@ -4301,13 +4301,13 @@ void WW8AttributeOutput::FormatTextGrid( const SwTextGridItem& rGrid )
default:
OSL_FAIL("Unknown grid type");
[[fallthrough]];
- case GRID_NONE:
+ case SwTextGrid::NONE:
nGridType = 0;
break;
- case GRID_LINES_ONLY:
+ case SwTextGrid::LinesOnly:
nGridType = 2;
break;
- case GRID_LINES_CHARS:
+ case SwTextGrid::LinesAndChars:
if ( rGrid.IsSnapToChars() )
nGridType = 3;
else
diff --git a/sw/source/filter/ww8/ww8par6.cxx b/sw/source/filter/ww8/ww8par6.cxx
index 4ba3fb42a401..5423a52f4043 100644
--- a/sw/source/filter/ww8/ww8par6.cxx
+++ b/sw/source/filter/ww8/ww8par6.cxx
@@ -236,26 +236,26 @@ void SwWW8ImplReader::SetDocumentGrid(SwFrameFormat &rFormat, const wwSection &r
SwTextGridItem aGrid;
aGrid.SetDisplayGrid(false);
aGrid.SetPrintGrid(false);
- SwTextGrid eType=GRID_NONE;
+ SwTextGrid eType=SwTextGrid::NONE;
switch (rSection.maSep.clm)
{
case 0:
- eType = GRID_NONE;
+ eType = SwTextGrid::NONE;
break;
default:
OSL_ENSURE(false, "Unknown grid type");
[[fallthrough]];
case 3:
- eType = GRID_LINES_CHARS;
+ eType = SwTextGrid::LinesAndChars;
aGrid.SetSnapToChars(true);
break;
case 1:
- eType = GRID_LINES_CHARS;
+ eType = SwTextGrid::LinesAndChars;
aGrid.SetSnapToChars(false);
break;
case 2:
- eType = GRID_LINES_ONLY;
+ eType = SwTextGrid::LinesOnly;
break;
}
diff --git a/sw/source/ui/misc/pggrid.cxx b/sw/source/ui/misc/pggrid.cxx
index d4a97633feb7..743a108e1d73 100644
--- a/sw/source/ui/misc/pggrid.cxx
+++ b/sw/source/ui/misc/pggrid.cxx
@@ -169,9 +169,9 @@ void SwTextGridPage::Reset(const SfxItemSet *rSet)
weld::RadioButton* pButton = nullptr;
switch(rGridItem.GetGridType())
{
- case GRID_NONE : pButton = m_xNoGridRB.get(); break;
- case GRID_LINES_ONLY : pButton = m_xLinesGridRB.get(); break;
- default: pButton = m_xCharsGridRB.get();
+ case SwTextGrid::NONE : pButton = m_xNoGridRB.get(); break;
+ case SwTextGrid::LinesOnly: pButton = m_xLinesGridRB.get(); break;
+ default: pButton = m_xCharsGridRB.get();
}
pButton->set_active(true);
m_xDisplayCB->set_active(rGridItem.IsDisplayGrid());
@@ -225,8 +225,8 @@ DeactivateRC SwTextGridPage::DeactivatePage( SfxItemSet* )
void SwTextGridPage::PutGridItem(SfxItemSet& rSet)
{
SwTextGridItem aGridItem;
- aGridItem.SetGridType(m_xNoGridRB->get_active() ? GRID_NONE :
- m_xLinesGridRB->get_active() ? GRID_LINES_ONLY : GRID_LINES_CHARS );
+ aGridItem.SetGridType(m_xNoGridRB->get_active() ? SwTextGrid::NONE :
+ m_xLinesGridRB->get_active() ? SwTextGrid::LinesOnly : SwTextGrid::LinesAndChars );
aGridItem.SetSnapToChars(m_xSnapToCharsCB->get_active());
aGridItem.SetLines( static_cast< sal_Int32 >(m_xLinesPerPageNF->get_value()) );
aGridItem.SetBaseHeight( static_cast< sal_uInt16 >(
@@ -247,9 +247,9 @@ void SwTextGridPage::PutGridItem(SfxItemSet& rSet)
rSet.Put(aGridItem);
SwView * pView = ::GetActiveView();
- if (pView && aGridItem.GetGridType() != GRID_NONE)
+ if (pView && aGridItem.GetGridType() != SwTextGrid::NONE)
{
- if ( aGridItem.GetGridType() == GRID_LINES_CHARS )
+ if ( aGridItem.GetGridType() == SwTextGrid::LinesAndChars )
{
m_bHRulerChanged = true;
}
diff --git a/sw/source/uibase/frmdlg/colex.cxx b/sw/source/uibase/frmdlg/colex.cxx
index d8843596d87b..e0aaed8904f1 100644
--- a/sw/source/uibase/frmdlg/colex.cxx
+++ b/sw/source/uibase/frmdlg/colex.cxx
@@ -495,7 +495,7 @@ void SwPageGridExample::DrawPage(vcl::RenderContext& rRenderContext, const Point
{
SwPageExample::DrawPage(rRenderContext, rOrg, bSecond, bEnabled);
- if (!m_pGridItem || !m_pGridItem->GetGridType())
+ if (!m_pGridItem || m_pGridItem->GetGridType() == SwTextGrid::NONE)
return;
//paint the grid now
@@ -563,7 +563,7 @@ void SwPageGridExample::DrawPage(vcl::RenderContext& rRenderContext, const Point
m_bVertical ? aCharRect.Move(nRubyHeight, 0) : aCharRect.Move(0, nRubyHeight);
//vertical lines
- bool bBothLines = m_pGridItem->GetGridType() == GRID_LINES_CHARS;
+ bool bBothLines = m_pGridItem->GetGridType() == SwTextGrid::LinesAndChars;
rRenderContext.SetFillColor(COL_TRANSPARENT);
sal_Int32 nXMove = m_bVertical ? nLineHeight : 0;
sal_Int32 nYMove = m_bVertical ? 0 : nLineHeight;
diff --git a/sw/source/uibase/utlui/attrdesc.cxx b/sw/source/uibase/utlui/attrdesc.cxx
index 71fdd4ab5436..f134ca7f2707 100644
--- a/sw/source/uibase/utlui/attrdesc.cxx
+++ b/sw/source/uibase/utlui/attrdesc.cxx
@@ -645,13 +645,13 @@ bool SwTextGridItem::GetPresentation
switch ( GetGridType() )
{
- case GRID_NONE :
+ case SwTextGrid::NONE :
pId = STR_GRID_NONE;
break;
- case GRID_LINES_ONLY :
+ case SwTextGrid::LinesOnly :
pId = STR_GRID_LINES_ONLY;
break;
- case GRID_LINES_CHARS :
+ case SwTextGrid::LinesAndChars :
pId = STR_GRID_LINES_CHARS;
break;
}