[Libreoffice-commits] core.git: 2 commits - sw/inc sw/qa sw/source
Noel Grandin (via logerrit)
logerrit at kemper.freedesktop.org
Wed Dec 11 05:58:28 UTC 2019
sw/inc/fmtfsize.hxx | 12 ++---
sw/inc/section.hxx | 12 ++---
sw/qa/extras/layout/layout.cxx | 10 ++--
sw/qa/extras/uiwriter/uiwriter.cxx | 2
sw/qa/extras/uiwriter/uiwriter2.cxx | 6 +-
sw/source/core/access/accframe.cxx | 4 -
sw/source/core/crsr/crstrvl.cxx | 4 -
sw/source/core/crsr/swcrsr.cxx | 2
sw/source/core/doc/DocumentStylePoolManager.cxx | 4 -
sw/source/core/doc/doccomp.cxx | 32 +++++++-------
sw/source/core/doc/docdesc.cxx | 2
sw/source/core/doc/docfly.cxx | 4 -
sw/source/core/doc/docglbl.cxx | 2
sw/source/core/doc/doclay.cxx | 8 +--
sw/source/core/doc/docnew.cxx | 2
sw/source/core/doc/doctxm.cxx | 18 ++++----
sw/source/core/doc/htmltbl.cxx | 6 +-
sw/source/core/doc/tblrwcl.cxx | 14 +++---
sw/source/core/docnode/ndsect.cxx | 12 ++---
sw/source/core/docnode/ndtbl.cxx | 28 ++++++------
sw/source/core/docnode/ndtbl1.cxx | 2
sw/source/core/docnode/section.cxx | 32 +++++++-------
sw/source/core/edit/edglbldc.cxx | 4 -
sw/source/core/edit/edsect.cxx | 4 -
sw/source/core/edit/edtox.cxx | 6 +-
sw/source/core/frmedt/fefly1.cxx | 4 -
sw/source/core/frmedt/feshview.cxx | 2
sw/source/core/frmedt/tblsel.cxx | 2
sw/source/core/layout/atrfrm.cxx | 14 +++---
sw/source/core/layout/fly.cxx | 24 +++++------
sw/source/core/layout/flylay.cxx | 2
sw/source/core/layout/frmtool.cxx | 2
sw/source/core/layout/hffrm.cxx | 2
sw/source/core/layout/paintfrm.cxx | 4 -
sw/source/core/layout/ssfrm.cxx | 4 -
sw/source/core/layout/tabfrm.cxx | 16 +++----
sw/source/core/layout/wsfrm.cxx | 10 ++--
sw/source/core/ole/ndole.cxx | 2
sw/source/core/table/swnewtable.cxx | 12 ++---
sw/source/core/table/swtable.cxx | 4 -
sw/source/core/text/EnhancedPDFExportHelper.cxx | 6 +-
sw/source/core/text/pormulti.cxx | 2
sw/source/core/undo/unattr.cxx | 4 -
sw/source/core/undo/unsect.cxx | 2
sw/source/core/unocore/unoidx.cxx | 14 +++---
sw/source/core/unocore/unosect.cxx | 38 ++++++++---------
sw/source/core/unocore/unostyle.cxx | 2
sw/source/core/unocore/unotbl.cxx | 6 +-
sw/source/filter/html/css1atr.cxx | 4 -
sw/source/filter/html/htmlcss1.cxx | 4 -
sw/source/filter/html/htmlflywriter.cxx | 8 +--
sw/source/filter/html/htmlgrin.cxx | 2
sw/source/filter/html/htmlplug.cxx | 4 -
sw/source/filter/html/htmlsect.cxx | 6 +-
sw/source/filter/html/htmltab.cxx | 10 ++--
sw/source/filter/html/wrthtml.cxx | 6 +-
sw/source/filter/ww8/docxattributeoutput.cxx | 10 ++--
sw/source/filter/ww8/docxexport.cxx | 2
sw/source/filter/ww8/docxsdrexport.cxx | 3 -
sw/source/filter/ww8/rtfattributeoutput.cxx | 6 +-
sw/source/filter/ww8/writerwordglue.cxx | 2
sw/source/filter/ww8/wrtw8nds.cxx | 10 ++--
sw/source/filter/ww8/wrtw8sty.cxx | 10 ++--
sw/source/filter/ww8/wrtww8.cxx | 8 +--
sw/source/filter/ww8/ww8atr.cxx | 8 +--
sw/source/filter/ww8/ww8graf.cxx | 10 ++--
sw/source/filter/ww8/ww8graf2.cxx | 4 -
sw/source/filter/ww8/ww8par.cxx | 4 -
sw/source/filter/ww8/ww8par2.cxx | 16 +++----
sw/source/filter/ww8/ww8par4.cxx | 2
sw/source/filter/ww8/ww8par5.cxx | 2
sw/source/filter/ww8/ww8par6.cxx | 24 +++++------
sw/source/filter/xml/xmlexpit.cxx | 4 -
sw/source/filter/xml/xmlimpit.cxx | 10 ++--
sw/source/filter/xml/xmltbli.cxx | 8 +--
sw/source/filter/xml/xmltexti.cxx | 2
sw/source/ui/dbui/mmlayoutpage.cxx | 2
sw/source/ui/dialog/uiregionsw.cxx | 52 ++++++++++++------------
sw/source/ui/frmdlg/column.cxx | 6 +-
sw/source/ui/frmdlg/frmpage.cxx | 16 +++----
sw/source/ui/frmdlg/wrap.cxx | 2
sw/source/ui/table/rowht.cxx | 6 +-
sw/source/uibase/app/appenv.cxx | 4 -
sw/source/uibase/app/applab.cxx | 8 +--
sw/source/uibase/dbui/dbmgr.cxx | 4 -
sw/source/uibase/dialog/regionsw.cxx | 8 +--
sw/source/uibase/dochdl/swdtflvr.cxx | 4 -
sw/source/uibase/frmdlg/frmmgr.cxx | 2
sw/source/uibase/shells/basesh.cxx | 4 -
sw/source/uibase/shells/frmsh.cxx | 6 +-
sw/source/uibase/shells/grfsh.cxx | 2
sw/source/uibase/shells/tabsh.cxx | 8 +--
sw/source/uibase/shells/textidx.cxx | 2
sw/source/uibase/shells/textsh.cxx | 4 -
sw/source/uibase/uiview/view2.cxx | 4 -
sw/source/uibase/uiview/viewtab.cxx | 2
sw/source/uibase/utlui/attrdesc.cxx | 4 -
sw/source/uibase/utlui/content.cxx | 8 +--
sw/source/uibase/utlui/glbltree.cxx | 4 -
sw/source/uibase/utlui/uitool.cxx | 8 +--
sw/source/uibase/wrtsh/wrtsh1.cxx | 4 -
sw/source/uibase/wrtsh/wrtsh2.cxx | 4 -
102 files changed, 389 insertions(+), 388 deletions(-)
New commits:
commit f26621d468eb19197d76f10779d5edc7dff6022f
Author: Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Tue Dec 10 11:20:35 2019 +0200
Commit: Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Wed Dec 11 06:57:26 2019 +0100
convert SectionType to scoped enum
Change-Id: Ib05b88b05c90b835107128f42c70170660788d00
Reviewed-on: https://gerrit.libreoffice.org/84851
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
diff --git a/sw/inc/section.hxx b/sw/inc/section.hxx
index 0776afda4cf9..6cb83b9962db 100644
--- a/sw/inc/section.hxx
+++ b/sw/inc/section.hxx
@@ -43,11 +43,11 @@ class SwServerObject;
typedef std::vector<SwSection*> SwSections;
-enum SectionType { CONTENT_SECTION,
- TOX_HEADER_SECTION,
- TOX_CONTENT_SECTION,
- DDE_LINK_SECTION = OBJECT_CLIENT_DDE,
- FILE_LINK_SECTION = OBJECT_CLIENT_FILE
+enum class SectionType { Content,
+ ToxHeader,
+ ToxContent,
+ DdeLink = OBJECT_CLIENT_DDE,
+ FileLink = OBJECT_CLIENT_FILE
};
enum LinkCreateType
@@ -128,7 +128,7 @@ public:
void SetPassword(css::uno::Sequence<sal_Int8> const& rNew)
{ m_Password = rNew; }
bool IsLinkType() const
- { return (DDE_LINK_SECTION == m_eType) || (FILE_LINK_SECTION == m_eType); }
+ { return (SectionType::DdeLink == m_eType) || (SectionType::FileLink == m_eType); }
bool IsConnectFlag() const { return m_bConnectFlag; }
void SetConnectFlag(bool const bFlag){ m_bConnectFlag = bFlag; }
diff --git a/sw/qa/extras/uiwriter/uiwriter.cxx b/sw/qa/extras/uiwriter/uiwriter.cxx
index f4ceaeb25839..6932e6992e81 100644
--- a/sw/qa/extras/uiwriter/uiwriter.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter.cxx
@@ -1329,7 +1329,7 @@ void SwUiWriterTest::testCp1000071()
// Change the document layout to be 2 columns, and then undo.
pWrtShell->SelAll();
- SwSectionData section(CONTENT_SECTION, pWrtShell->GetUniqueSectionName());
+ SwSectionData section(SectionType::Content, pWrtShell->GetUniqueSectionName());
SfxItemSet set( pDoc->GetDocShell()->GetPool(), svl::Items<RES_COL, RES_COL>{} );
SwFormatCol col;
col.Init( 2, 0, 10000 );
diff --git a/sw/qa/extras/uiwriter/uiwriter2.cxx b/sw/qa/extras/uiwriter/uiwriter2.cxx
index fefd9f3f8df7..e351da8e14f7 100644
--- a/sw/qa/extras/uiwriter/uiwriter2.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter2.cxx
@@ -232,7 +232,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testRedlineInHiddenSection)
pWrtShell->Right(CRSR_SKIP_CHARS, /*bSelect=*/false, 1, /*bBasicCall=*/false);
pWrtShell->EndOfSection(true);
- SwSectionData section(CONTENT_SECTION, pWrtShell->GetUniqueSectionName());
+ SwSectionData section(SectionType::Content, pWrtShell->GetUniqueSectionName());
section.SetHidden(true);
SwSection const* pSection = pWrtShell->InsertSection(section, nullptr);
diff --git a/sw/source/core/access/accframe.cxx b/sw/source/core/access/accframe.cxx
index bca511eb0cfa..a3ece547a8a9 100644
--- a/sw/source/core/access/accframe.cxx
+++ b/sw/source/core/access/accframe.cxx
@@ -389,8 +389,8 @@ bool SwAccessibleFrame::IsOpaque( SwViewShell const *pVSh ) const
if( pFrame->IsSctFrame() )
{
const SwSection* pSection = static_cast<const SwSectionFrame*>(pFrame)->GetSection();
- if( pSection && ( TOX_HEADER_SECTION == pSection->GetType() ||
- TOX_CONTENT_SECTION == pSection->GetType() ) &&
+ if( pSection && ( SectionType::ToxHeader == pSection->GetType() ||
+ SectionType::ToxContent == pSection->GetType() ) &&
!pVOpt->IsReadonly() &&
SwViewOption::IsIndexShadings() )
return true;
diff --git a/sw/source/core/crsr/crstrvl.cxx b/sw/source/core/crsr/crstrvl.cxx
index 9153b8b34e85..ebc9ab4306bd 100644
--- a/sw/source/core/crsr/crstrvl.cxx
+++ b/sw/source/core/crsr/crstrvl.cxx
@@ -269,7 +269,7 @@ bool SwCursorShell::GotoNextTOXBase( const OUString* pName )
for( SwSectionFormats::size_type n = rFormats.size(); n; )
{
const SwSection* pSect = rFormats[ --n ]->GetSection();
- if (TOX_CONTENT_SECTION == pSect->GetType())
+ if (SectionType::ToxContent == pSect->GetType())
{
SwSectionNode const*const pSectNd(
pSect->GetFormat()->GetSectionNode());
@@ -320,7 +320,7 @@ bool SwCursorShell::GotoPrevTOXBase( const OUString* pName )
for( SwSectionFormats::size_type n = rFormats.size(); n; )
{
const SwSection* pSect = rFormats[ --n ]->GetSection();
- if (TOX_CONTENT_SECTION == pSect->GetType())
+ if (SectionType::ToxContent == pSect->GetType())
{
SwSectionNode const*const pSectNd(
pSect->GetFormat()->GetSectionNode());
diff --git a/sw/source/core/crsr/swcrsr.cxx b/sw/source/core/crsr/swcrsr.cxx
index 1075f2fa0fb6..12b71b08d530 100644
--- a/sw/source/core/crsr/swcrsr.cxx
+++ b/sw/source/core/crsr/swcrsr.cxx
@@ -315,7 +315,7 @@ bool SwCursor::IsSelOvr( SwCursorSelOverFlags eFlags )
{
// if it is no linked section then we cannot select it
const SwSection& rSect = *pFormat->GetSection();
- if( CONTENT_SECTION == rSect.GetType() )
+ if( SectionType::Content == rSect.GetType() )
{
RestoreSavePos();
return true;
diff --git a/sw/source/core/doc/doccomp.cxx b/sw/source/core/doc/doccomp.cxx
index e3562414907d..165b3a20298f 100644
--- a/sw/source/core/doc/doccomp.cxx
+++ b/sw/source/core/doc/doccomp.cxx
@@ -1054,7 +1054,7 @@ const SwNode& SwCompareLine::GetEndNode() const
{
const SwSectionNode& rSNd = static_cast<const SwSectionNode&>(rNode);
const SwSection& rSect = rSNd.GetSection();
- if( CONTENT_SECTION != rSect.GetType() || rSect.IsProtect() )
+ if( SectionType::Content != rSect.GetType() || rSect.IsProtect() )
pNd = rNode.EndOfSectionNode();
}
break;
@@ -1131,8 +1131,8 @@ bool SwCompareLine::CompareNode( const SwNode& rDstNd, const SwNode& rSrcNd )
eDstSectType = rDstSect.GetType();
switch( eSrcSectType )
{
- case CONTENT_SECTION:
- bRet = CONTENT_SECTION == eDstSectType &&
+ case SectionType::Content:
+ bRet = SectionType::Content == eDstSectType &&
rSrcSect.IsProtect() == rDstSect.IsProtect();
if( bRet && rSrcSect.IsProtect() )
{
@@ -1142,10 +1142,10 @@ bool SwCompareLine::CompareNode( const SwNode& rDstNd, const SwNode& rSrcNd )
}
break;
- case TOX_HEADER_SECTION:
- case TOX_CONTENT_SECTION:
- if( TOX_HEADER_SECTION == eDstSectType ||
- TOX_CONTENT_SECTION == eDstSectType )
+ case SectionType::ToxHeader:
+ case SectionType::ToxContent:
+ if( SectionType::ToxHeader == eDstSectType ||
+ SectionType::ToxContent == eDstSectType )
{
// the same type of TOX?
const SwTOXBase* pSrcTOX = rSrcSect.GetTOXBase();
@@ -1158,8 +1158,8 @@ bool SwCompareLine::CompareNode( const SwNode& rDstNd, const SwNode& rSrcNd )
}
break;
- case DDE_LINK_SECTION:
- case FILE_LINK_SECTION:
+ case SectionType::DdeLink:
+ case SectionType::FileLink:
bRet = eSrcSectType == eDstSectType &&
rSrcSect.GetLinkFileName() ==
rDstSect.GetLinkFileName();
@@ -1209,14 +1209,14 @@ OUString SwCompareLine::GetText() const
const SwSection& rSect = rSNd.GetSection();
switch( rSect.GetType() )
{
- case CONTENT_SECTION:
+ case SectionType::Content:
if( rSect.IsProtect() )
sRet += OUString::number(
rSNd.EndOfSectionIndex() - rSNd.GetIndex() );
break;
- case TOX_HEADER_SECTION:
- case TOX_CONTENT_SECTION:
+ case SectionType::ToxHeader:
+ case SectionType::ToxContent:
{
const SwTOXBase* pTOX = rSect.GetTOXBase();
if( pTOX )
@@ -1225,8 +1225,8 @@ OUString SwCompareLine::GetText() const
}
break;
- case DDE_LINK_SECTION:
- case FILE_LINK_SECTION:
+ case SectionType::DdeLink:
+ case SectionType::FileLink:
sRet += rSect.GetLinkFileName();
break;
}
@@ -1409,7 +1409,7 @@ sal_uLong CompareData::NextIdx( const SwNode* pNd )
const SwSectionNode* pSNd;
if( pNd->IsTableNode() ||
( nullptr != (pSNd = pNd->GetSectionNode() ) &&
- ( CONTENT_SECTION != pSNd->GetSection().GetType() ||
+ ( SectionType::Content != pSNd->GetSection().GetType() ||
pSNd->GetSection().IsProtect() ) ) )
pNd = pNd->EndOfSectionNode();
}
@@ -1423,7 +1423,7 @@ sal_uLong CompareData::PrevIdx( const SwNode* pNd )
const SwSectionNode* pSNd;
if( pNd->StartOfSectionNode()->IsTableNode() ||
( nullptr != (pSNd = pNd->StartOfSectionNode()->GetSectionNode() ) &&
- ( CONTENT_SECTION != pSNd->GetSection().GetType() ||
+ ( SectionType::Content != pSNd->GetSection().GetType() ||
pSNd->GetSection().IsProtect() ) ) )
pNd = pNd->StartOfSectionNode();
}
diff --git a/sw/source/core/doc/docglbl.cxx b/sw/source/core/doc/docglbl.cxx
index 3a226356bb7b..48d3854d1598 100644
--- a/sw/source/core/doc/docglbl.cxx
+++ b/sw/source/core/doc/docglbl.cxx
@@ -409,7 +409,7 @@ bool SwDoc::SplitDoc( sal_uInt16 eDocType, const OUString& rPath, bool bOutline,
default:
{
const OUString sNm(INetURLObject(sFileName).GetLastName());
- SwSectionData aSectData( FILE_LINK_SECTION,
+ SwSectionData aSectData( SectionType::FileLink,
GetUniqueSectionName( &sNm ));
SwSectionFormat* pFormat = MakeSectionFormat();
aSectData.SetLinkFileName(sFileName);
diff --git a/sw/source/core/doc/doctxm.cxx b/sw/source/core/doc/doctxm.cxx
index c5e9aa42cf8c..01fa812c4a1d 100644
--- a/sw/source/core/doc/doctxm.cxx
+++ b/sw/source/core/doc/doctxm.cxx
@@ -361,7 +361,7 @@ SwTOXBaseSection* SwDoc::InsertTableOf( const SwPaM& aPam,
GetIDocumentUndoRedo().StartUndo( SwUndoId::INSTOX, nullptr );
OUString sSectNm = GetUniqueTOXBaseName( *rTOX.GetTOXType(), rTOX.GetTOXName() );
- SwSectionData aSectionData( TOX_CONTENT_SECTION, sSectNm );
+ SwSectionData aSectionData( SectionType::ToxContent, sSectNm );
std::pair<SwTOXBase const*, sw::RedlineMode> const tmp(&rTOX,
pLayout && pLayout->IsHideRedlines()
@@ -390,7 +390,7 @@ SwTOXBaseSection* SwDoc::InsertTableOf( const SwPaM& aPam,
SwTextNode* pHeadNd = GetNodes().MakeTextNode( aIdx,
getIDocumentStylePoolAccess().GetTextCollFromPool( RES_POOLCOLL_STANDARD ) );
- SwSectionData headerData( TOX_HEADER_SECTION, pNewSection->GetTOXName()+"_Head" );
+ SwSectionData headerData( SectionType::ToxHeader, pNewSection->GetTOXName()+"_Head" );
SwNodeIndex aStt( *pHeadNd ); --aIdx;
SwSectionFormat* pSectFormat = MakeSectionFormat();
@@ -414,14 +414,14 @@ void SwDoc::InsertTableOf( sal_uLong nSttNd, sal_uLong nEndNd,
while( pSectNd )
{
SectionType eT = pSectNd->GetSection().GetType();
- if( TOX_HEADER_SECTION == eT || TOX_CONTENT_SECTION == eT )
+ if( SectionType::ToxHeader == eT || SectionType::ToxContent == eT )
return;
pSectNd = pSectNd->StartOfSectionNode()->FindSectionNode();
}
const OUString sSectNm = GetUniqueTOXBaseName(*rTOX.GetTOXType(), rTOX.GetTOXName());
- SwSectionData aSectionData( TOX_CONTENT_SECTION, sSectNm );
+ SwSectionData aSectionData( SectionType::ToxContent, sSectNm );
SwNodeIndex aStt( GetNodes(), nSttNd ), aEnd( GetNodes(), nEndNd );
SwSectionFormat* pFormat = MakeSectionFormat();
@@ -450,7 +450,7 @@ SwTOXBase* SwDoc::GetCurTOX( const SwPosition& rPos )
while( pSectNd )
{
SectionType eT = pSectNd->GetSection().GetType();
- if( TOX_CONTENT_SECTION == eT )
+ if( SectionType::ToxContent == eT )
{
OSL_ENSURE( dynamic_cast< const SwTOXBaseSection *>( &pSectNd->GetSection()) != nullptr,
"no TOXBaseSection!" );
@@ -589,7 +589,7 @@ bool SwDoc::DeleteTOX( const SwTOXBase& rTOXBase, bool bDelNodes )
pFormat->GetChildSections( aArr, SectionSort::Not, false );
for( const auto pSect : aArr )
{
- if( TOX_HEADER_SECTION == pSect->GetType() )
+ if( SectionType::ToxHeader == pSect->GetType() )
{
DelSectionFormat( pSect->GetFormat(), bDelNodes );
}
@@ -660,7 +660,7 @@ OUString SwDoc::GetUniqueTOXBaseName( const SwTOXType& rType,
continue;
const SwSection& rSect = pSectNd->GetSection();
- if (rSect.GetType()==TOX_CONTENT_SECTION)
+ if (rSect.GetType()==SectionType::ToxContent)
{
const OUString& rNm = rSect.GetSectionName();
if ( rNm.startsWith(aName) )
@@ -740,7 +740,7 @@ static const SwTextNode* lcl_FindChapterNode( const SwNode& rNd,
// Table of contents class
SwTOXBaseSection::SwTOXBaseSection(SwTOXBase const& rBase, SwSectionFormat & rFormat)
: SwTOXBase( rBase )
- , SwSection( TOX_CONTENT_SECTION, OUString(), rFormat )
+ , SwSection( SectionType::ToxContent, OUString(), rFormat )
{
SetProtect( rBase.IsProtected() );
SetSectionName( GetTOXName() );
@@ -970,7 +970,7 @@ void SwTOXBaseSection::Update(const SfxItemSet* pAttr,
GetTextFormatColl( FORM_TITLE ) );
pHeadNd->InsertText( GetTitle(), SwIndex( pHeadNd ) );
- SwSectionData headerData( TOX_HEADER_SECTION, GetTOXName()+"_Head" );
+ SwSectionData headerData( SectionType::ToxHeader, GetTOXName()+"_Head" );
SwNodeIndex aStt( *pHeadNd ); --aIdx;
SwSectionFormat* pSectFormat = pDoc->MakeSectionFormat();
diff --git a/sw/source/core/docnode/ndsect.cxx b/sw/source/core/docnode/ndsect.cxx
index 8655874fe858..bcf91b3f1e03 100644
--- a/sw/source/core/docnode/ndsect.cxx
+++ b/sw/source/core/docnode/ndsect.cxx
@@ -772,8 +772,8 @@ void sw_DeleteFootnote( SwSectionNode *pNd, sal_uLong nStt, sal_uLong nEnd )
static bool lcl_IsTOXSection(SwSectionData const& rSectionData)
{
- return (TOX_CONTENT_SECTION == rSectionData.GetType())
- || (TOX_HEADER_SECTION == rSectionData.GetType());
+ return (SectionType::ToxContent == rSectionData.GetType())
+ || (SectionType::ToxHeader == rSectionData.GetType());
}
SwSectionNode* SwNodes::InsertTextSection(SwNodeIndex const& rNdIdx,
@@ -983,7 +983,7 @@ SwSectionNode::SwSectionNode(SwNodeIndex const& rIdx,
: SwStartNode( rIdx, SwNodeType::Section )
, m_pSection( pTOXBase
? new SwTOXBaseSection(*pTOXBase, lcl_initParent(*this, rFormat))
- : new SwSection( CONTENT_SECTION, rFormat.GetName(),
+ : new SwSection( SectionType::Content, rFormat.GetName(),
lcl_initParent(*this, rFormat) ) )
{
// Set the connection from Format to Node
@@ -1198,7 +1198,7 @@ SwSectionNode* SwSectionNode::MakeCopy( SwDoc* pDoc, const SwNodeIndex& rIdx ) c
pSectFormat->CopyAttrs( *GetSection().GetFormat() );
std::unique_ptr<SwTOXBase> pTOXBase;
- if (TOX_CONTENT_SECTION == GetSection().GetType())
+ if (SectionType::ToxContent == GetSection().GetType())
{
OSL_ENSURE( dynamic_cast< const SwTOXBaseSection* >( &GetSection() ) != nullptr , "no TOXBaseSection!" );
SwTOXBaseSection const& rTBS(
@@ -1214,7 +1214,7 @@ SwSectionNode* SwSectionNode::MakeCopy( SwDoc* pDoc, const SwNodeIndex& rIdx ) c
// Take over values
SwSection *const pNewSect = pSectNd->m_pSection.get();
- if (TOX_CONTENT_SECTION != GetSection().GetType())
+ if (SectionType::ToxContent != GetSection().GetType())
{
// Keep the Name for Move
if( rNds.GetDoc() == pDoc && pDoc->IsCopyIsMove() )
@@ -1337,7 +1337,7 @@ void SwSectionNode::NodesArrChgd()
}
else
{
- if (CONTENT_SECTION != m_pSection->GetType()
+ if (SectionType::Content != m_pSection->GetType()
&& m_pSection->IsConnected())
{
pDoc->getIDocumentLinksAdministration().GetLinkManager().Remove( &m_pSection->GetBaseLink() );
diff --git a/sw/source/core/docnode/section.cxx b/sw/source/core/docnode/section.cxx
index 5ee2c0cda4c1..56b1ee08cab5 100644
--- a/sw/source/core/docnode/section.cxx
+++ b/sw/source/core/docnode/section.cxx
@@ -241,7 +241,7 @@ SwSection::~SwSection()
{
pFormat->Remove( this ); // remove
- if (CONTENT_SECTION != m_Data.GetType())
+ if (SectionType::Content != m_Data.GetType())
{
pDoc->getIDocumentLinksAdministration().GetLinkManager().Remove( m_RefLink.get() );
}
@@ -548,11 +548,11 @@ OUString const & SwSection::GetLinkFileName() const
OUString sTmp;
switch (m_Data.GetType())
{
- case DDE_LINK_SECTION:
+ case SectionType::DdeLink:
sTmp = m_RefLink->GetLinkSourceName();
break;
- case FILE_LINK_SECTION:
+ case SectionType::FileLink:
{
OUString sRange;
OUString sFilter;
@@ -602,7 +602,7 @@ void SwSection::MakeChildLinksVisible( const SwSectionNode& rSectNd )
pNd = pNd->StartOfSectionNode(); // If it's a SectionNode
const SwSectionNode* pParent;
while( nullptr != ( pParent = pNd->FindSectionNode() ) &&
- ( CONTENT_SECTION == pParent->GetSection().GetType()
+ ( SectionType::Content == pParent->GetSection().GetType()
|| pNd == &rSectNd ))
pNd = pParent->StartOfSectionNode();
@@ -616,7 +616,7 @@ void SwSection::MakeChildLinksVisible( const SwSectionNode& rSectNd )
const SwTOXBase* SwSection::GetTOXBase() const
{
const SwTOXBase* pRet = nullptr;
- if( TOX_CONTENT_SECTION == GetType() )
+ if( SectionType::ToxContent == GetType() )
pRet = dynamic_cast<const SwTOXBaseSection*>(this);
return pRet;
}
@@ -1013,8 +1013,8 @@ const SwSection* SwSectionFormat::GetGlobalDocSection() const
{
const SwSectionNode* pNd = GetSectionNode();
if( pNd &&
- ( FILE_LINK_SECTION == pNd->GetSection().GetType() ||
- TOX_CONTENT_SECTION == pNd->GetSection().GetType() ) &&
+ ( SectionType::FileLink == pNd->GetSection().GetType() ||
+ SectionType::ToxContent == pNd->GetSection().GetType() ) &&
pNd->GetIndex() > pNd->GetNodes().GetEndOfExtras().GetIndex() &&
!pNd->StartOfSectionNode()->IsSectionNode() &&
!pNd->StartOfSectionNode()->FindSectionNode() )
@@ -1058,7 +1058,7 @@ SwSectionFormat::MakeUnoObject()
if (pSection)
{
xMeta.set( SwXTextSection::CreateXTextSection(this,
- TOX_HEADER_SECTION == pSection->GetType()),
+ SectionType::ToxHeader == pSection->GetType()),
uno::UNO_QUERY );
}
return xMeta;
@@ -1461,7 +1461,7 @@ void SwIntrnlSectRefLink::Closed()
pSh->StartAction();
SwSectionData aSectionData(*rSectFormat.GetSection());
- aSectionData.SetType( CONTENT_SECTION );
+ aSectionData.SetType( SectionType::Content );
aSectionData.SetLinkFileName( OUString() );
aSectionData.SetProtectFlag( false );
// edit in readonly sections
@@ -1490,7 +1490,7 @@ void SwSection::CreateLink( LinkCreateType eCreateType )
{
SwSectionFormat* pFormat = GetFormat();
OSL_ENSURE(pFormat, "SwSection::CreateLink: no format?");
- if (!pFormat || (CONTENT_SECTION == m_Data.GetType()))
+ if (!pFormat || (SectionType::Content == m_Data.GetType()))
return ;
SfxLinkUpdateMode nUpdateType = SfxLinkUpdateMode::ALWAYS;
@@ -1514,11 +1514,11 @@ void SwSection::CreateLink( LinkCreateType eCreateType )
switch (m_Data.GetType())
{
- case DDE_LINK_SECTION:
+ case SectionType::DdeLink:
pLnk->SetLinkSourceName( sCmd );
pFormat->GetDoc()->getIDocumentLinksAdministration().GetLinkManager().InsertDDELink( pLnk );
break;
- case FILE_LINK_SECTION:
+ case SectionType::FileLink:
{
pLnk->SetContentType( SotClipboardFormatId::SIMPLE_FILE );
sal_Int32 nIndex = 0;
@@ -1552,9 +1552,9 @@ void SwSection::CreateLink( LinkCreateType eCreateType )
void SwSection::BreakLink()
{
const SectionType eCurrentType( GetType() );
- if ( eCurrentType == CONTENT_SECTION ||
- eCurrentType == TOX_HEADER_SECTION ||
- eCurrentType == TOX_CONTENT_SECTION )
+ if ( eCurrentType == SectionType::Content ||
+ eCurrentType == SectionType::ToxHeader ||
+ eCurrentType == SectionType::ToxContent )
{
// nothing to do
return;
@@ -1572,7 +1572,7 @@ void SwSection::BreakLink()
m_RefLink.clear();
}
// change type
- SetType( CONTENT_SECTION );
+ SetType( SectionType::Content );
// reset linked file data
SetLinkFileName( OUString() );
SetLinkFilePassword( OUString() );
diff --git a/sw/source/core/edit/edglbldc.cxx b/sw/source/core/edit/edglbldc.cxx
index bbc10e095f80..add383a8c6dd 100644
--- a/sw/source/core/edit/edglbldc.cxx
+++ b/sw/source/core/edit/edglbldc.cxx
@@ -70,9 +70,9 @@ void SwEditShell::GetGlobalDocContent( SwGlblDocContents& rArr ) const
std::unique_ptr<SwGlblDocContent> pNew;
switch( pSect->GetType() )
{
- case TOX_HEADER_SECTION:
+ case SectionType::ToxHeader:
break; // ignore
- case TOX_CONTENT_SECTION:
+ case SectionType::ToxContent:
OSL_ENSURE( dynamic_cast<const SwTOXBaseSection*>( pSect) != nullptr, "no TOXBaseSection!" );
pNew.reset(new SwGlblDocContent( static_cast<const SwTOXBaseSection*>(pSect) ));
break;
diff --git a/sw/source/core/edit/edsect.cxx b/sw/source/core/edit/edsect.cxx
index 7c26915befe9..662737d2fe2a 100644
--- a/sw/source/core/edit/edsect.cxx
+++ b/sw/source/core/edit/edsect.cxx
@@ -123,8 +123,8 @@ bool SwEditShell::IsAnySectionInDoc() const
{
SectionType eTmpType;
if( pFormat->IsInNodesArr() &&
- ( (eTmpType = pFormat->GetSection()->GetType()) != TOX_CONTENT_SECTION
- && TOX_HEADER_SECTION != eTmpType ) )
+ ( (eTmpType = pFormat->GetSection()->GetType()) != SectionType::ToxContent
+ && SectionType::ToxHeader != eTmpType ) )
{
return true;
}
diff --git a/sw/source/core/edit/edtox.cxx b/sw/source/core/edit/edtox.cxx
index 98ae87d85906..e652551d160b 100644
--- a/sw/source/core/edit/edtox.cxx
+++ b/sw/source/core/edit/edtox.cxx
@@ -100,7 +100,7 @@ void SwEditShell::SetTOXBaseReadonly(const SwTOXBase& rTOXBase, bool bReadonly)
OSL_ENSURE( dynamic_cast<const SwTOXBaseSection*>( &rTOXBase) != nullptr, "no TOXBaseSection!" );
const SwTOXBaseSection& rTOXSect = static_cast<const SwTOXBaseSection&>(rTOXBase);
const_cast<SwTOXBase&>(rTOXBase).SetProtected(bReadonly);
- OSL_ENSURE( rTOXSect.SwSection::GetType() == TOX_CONTENT_SECTION, "not a TOXContentSection" );
+ OSL_ENSURE( rTOXSect.SwSection::GetType() == SectionType::ToxContent, "not a TOXContentSection" );
SwSectionData aSectionData(rTOXSect);
aSectionData.SetProtectFlag(bReadonly);
@@ -215,7 +215,7 @@ sal_uInt16 SwEditShell::GetTOXCount() const
for( auto n = rFormats.size(); n; )
{
const SwSection* pSect = rFormats[ --n ]->GetSection();
- if( TOX_CONTENT_SECTION == pSect->GetType() &&
+ if( SectionType::ToxContent == pSect->GetType() &&
pSect->GetFormat()->GetSectionNode() )
++nRet;
}
@@ -229,7 +229,7 @@ const SwTOXBase* SwEditShell::GetTOX( sal_uInt16 nPos ) const
for( const SwSectionFormat *pFormat : rFormats )
{
const SwSection* pSect = pFormat->GetSection();
- if( TOX_CONTENT_SECTION == pSect->GetType() &&
+ if( SectionType::ToxContent == pSect->GetType() &&
pSect->GetFormat()->GetSectionNode() &&
nCnt++ == nPos )
{
diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx
index 13d0fe04afb4..8c3fe341def1 100644
--- a/sw/source/core/layout/paintfrm.cxx
+++ b/sw/source/core/layout/paintfrm.cxx
@@ -7272,8 +7272,8 @@ bool SwFrame::GetBackgroundBrush(
// option "index shadings" is set and
// the output is not the printer
// then set <rpCol> to the color of the index shading
- if( pSection && ( TOX_HEADER_SECTION == pSection->GetType() ||
- TOX_CONTENT_SECTION == pSection->GetType() ) &&
+ if( pSection && ( SectionType::ToxHeader == pSection->GetType() ||
+ SectionType::ToxContent == pSection->GetType() ) &&
(rBack.GetColor() == COL_TRANSPARENT) &&
rBack.GetGraphicPos() == GPOS_NONE &&
!pOpt->IsPagePreview() &&
diff --git a/sw/source/core/ole/ndole.cxx b/sw/source/core/ole/ndole.cxx
index 7c374297b747..135586eb6493 100644
--- a/sw/source/core/ole/ndole.cxx
+++ b/sw/source/core/ole/ndole.cxx
@@ -493,7 +493,7 @@ bool SwOLENode::IsInGlobalDocSection() const
// pAnchorNd contains the most recently found Section Node, which
// now must fulfill the prerequisites for the GlobalDoc
pSectNd = static_cast<const SwSectionNode*>(pAnchorNd);
- return FILE_LINK_SECTION == pSectNd->GetSection().GetType() &&
+ return SectionType::FileLink == pSectNd->GetSection().GetType() &&
pSectNd->GetIndex() > nEndExtraIdx;
}
diff --git a/sw/source/core/text/EnhancedPDFExportHelper.cxx b/sw/source/core/text/EnhancedPDFExportHelper.cxx
index f47ee6c0ec71..5069edccac17 100644
--- a/sw/source/core/text/EnhancedPDFExportHelper.cxx
+++ b/sw/source/core/text/EnhancedPDFExportHelper.cxx
@@ -1011,7 +1011,7 @@ void SwTaggedPDFHelper::BeginBlockStructureElements()
{
const SwSection* pSection =
static_cast<const SwSectionFrame*>(pFrame)->GetSection();
- if ( TOX_CONTENT_SECTION == pSection->GetType() )
+ if ( SectionType::ToxContent == pSection->GetType() )
{
const SwTOXBase* pTOXBase = pSection->GetTOXBase();
if ( pTOXBase )
@@ -1028,7 +1028,7 @@ void SwTaggedPDFHelper::BeginBlockStructureElements()
}
}
}
- else if ( CONTENT_SECTION == pSection->GetType() )
+ else if ( SectionType::Content == pSection->GetType() )
{
nPDFType = vcl::PDFWriter::Section;
aPDFType = aSectString;
@@ -1133,7 +1133,7 @@ void SwTaggedPDFHelper::BeginBlockStructureElements()
const SwSectionFrame* pSctFrame = pFrame->FindSctFrame();
const SwSection* pSection = pSctFrame->GetSection();
- if ( TOX_CONTENT_SECTION == pSection->GetType() )
+ if ( SectionType::ToxContent == pSection->GetType() )
{
const SwTOXBase* pTOXBase = pSection->GetTOXBase();
if ( pTOXBase && TOX_INDEX != pTOXBase->GetType() )
diff --git a/sw/source/core/undo/unsect.cxx b/sw/source/core/undo/unsect.cxx
index 7e05ae0e9fd7..d3c83a217975 100644
--- a/sw/source/core/undo/unsect.cxx
+++ b/sw/source/core/undo/unsect.cxx
@@ -501,7 +501,7 @@ void SwUndoUpdateSection::UndoImpl(::sw::UndoRedoContext & rContext)
if( bUpdate )
rNdSect.CreateLink( CREATE_UPDATE );
- else if( CONTENT_SECTION == rNdSect.GetType() && rNdSect.IsConnected() )
+ else if( SectionType::Content == rNdSect.GetType() && rNdSect.IsConnected() )
{
rNdSect.Disconnect();
rDoc.getIDocumentLinksAdministration().GetLinkManager().Remove( &rNdSect.GetBaseLink() );
diff --git a/sw/source/core/unocore/unoidx.cxx b/sw/source/core/unocore/unoidx.cxx
index 26cc13a113b9..fbb5373f0235 100644
--- a/sw/source/core/unocore/unoidx.cxx
+++ b/sw/source/core/unocore/unoidx.cxx
@@ -915,7 +915,7 @@ SwXDocumentIndex::getPropertyValue(const OUString& rPropertyName)
SectionSort::Not, false);
for(SwSection* pSect : aSectArr)
{
- if(pSect->GetType() == TOX_HEADER_SECTION)
+ if(pSect->GetType() == SectionType::ToxHeader)
{
const uno::Reference <text::XTextSection> xHeader =
SwXTextSection::CreateXTextSection(
@@ -2361,7 +2361,7 @@ SwXDocumentIndexes::getCount()
for( size_t n = 0; n < rFormats.size(); ++n )
{
const SwSection* pSect = rFormats[ n ]->GetSection();
- if( TOX_CONTENT_SECTION == pSect->GetType() &&
+ if( SectionType::ToxContent == pSect->GetType() &&
pSect->GetFormat()->GetSectionNode() )
{
++nRet;
@@ -2384,7 +2384,7 @@ SwXDocumentIndexes::getByIndex(sal_Int32 nIndex)
for( size_t n = 0; n < rFormats.size(); ++n )
{
SwSection* pSect = rFormats[ n ]->GetSection();
- if( TOX_CONTENT_SECTION == pSect->GetType() &&
+ if( SectionType::ToxContent == pSect->GetType() &&
pSect->GetFormat()->GetSectionNode() &&
nIdx++ == nIndex )
{
@@ -2412,7 +2412,7 @@ SwXDocumentIndexes::getByName(const OUString& rName)
for( size_t n = 0; n < rFormats.size(); ++n )
{
SwSection* pSect = rFormats[ n ]->GetSection();
- if( TOX_CONTENT_SECTION == pSect->GetType() &&
+ if( SectionType::ToxContent == pSect->GetType() &&
pSect->GetFormat()->GetSectionNode() &&
(static_cast<SwTOXBaseSection const*>(pSect)->GetTOXName()
== rName))
@@ -2441,7 +2441,7 @@ SwXDocumentIndexes::getElementNames()
for( size_t n = 0; n < rFormats.size(); ++n )
{
SwSection const*const pSect = rFormats[ n ]->GetSection();
- if( TOX_CONTENT_SECTION == pSect->GetType() &&
+ if( SectionType::ToxContent == pSect->GetType() &&
pSect->GetFormat()->GetSectionNode() )
{
++nCount;
@@ -2454,7 +2454,7 @@ SwXDocumentIndexes::getElementNames()
for( size_t n = 0; n < rFormats.size(); ++n )
{
SwSection const*const pSect = rFormats[ n ]->GetSection();
- if( TOX_CONTENT_SECTION == pSect->GetType() &&
+ if( SectionType::ToxContent == pSect->GetType() &&
pSect->GetFormat()->GetSectionNode())
{
pArray[nCnt++] = static_cast<SwTOXBaseSection const*>(pSect)->GetTOXName();
@@ -2475,7 +2475,7 @@ SwXDocumentIndexes::hasByName(const OUString& rName)
for( size_t n = 0; n < rFormats.size(); ++n )
{
SwSection const*const pSect = rFormats[ n ]->GetSection();
- if( TOX_CONTENT_SECTION == pSect->GetType() &&
+ if( SectionType::ToxContent == pSect->GetType() &&
pSect->GetFormat()->GetSectionNode())
{
if (static_cast<SwTOXBaseSection const*>(pSect)->GetTOXName()
diff --git a/sw/source/core/unocore/unosect.cxx b/sw/source/core/unocore/unosect.cxx
index f39a038a0dd7..b19ee1462715 100644
--- a/sw/source/core/unocore/unosect.cxx
+++ b/sw/source/core/unocore/unosect.cxx
@@ -312,11 +312,11 @@ SwXTextSection::attach(const uno::Reference< text::XTextRange > & xTextRange)
{
m_pImpl->m_sName = "TextSection";
}
- SectionType eType(FILE_LINK_SECTION);
+ SectionType eType(SectionType::FileLink);
if( m_pImpl->m_pProps->m_bDDE )
- eType = DDE_LINK_SECTION;
+ eType = SectionType::DdeLink;
else if( m_pImpl->m_pProps->m_sLinkFileName.isEmpty() && m_pImpl->m_pProps->m_sSectionRegion.isEmpty() )
- eType = CONTENT_SECTION;
+ eType = SectionType::Content;
// index header section?
if (m_pImpl->m_bIndexHeader)
{
@@ -338,12 +338,12 @@ SwXTextSection::attach(const uno::Reference< text::XTextRange > & xTextRange)
bool bHeaderPresent = false;
for(size_t i = 0; i < nCount; ++i)
{
- if (aSectionsArr[i]->GetType() == TOX_HEADER_SECTION)
+ if (aSectionsArr[i]->GetType() == SectionType::ToxHeader)
bHeaderPresent = true;
}
if (! bHeaderPresent)
{
- eType = TOX_HEADER_SECTION;
+ eType = SectionType::ToxHeader;
}
}
}
@@ -505,7 +505,7 @@ SwXTextSection::getPropertySetInfo()
static void
lcl_UpdateLinkType(SwSection & rSection, bool const bLinkUpdateAlways)
{
- if (rSection.GetType() == DDE_LINK_SECTION)
+ if (rSection.GetType() == SectionType::DdeLink)
{
// set update type; needs an established link
if (!rSection.IsConnected())
@@ -630,10 +630,10 @@ void SwXTextSection::Impl::SetPropertyValues_Impl(
else
{
OUString sLinkFileName(pSectionData->GetLinkFileName());
- if (pSectionData->GetType() != DDE_LINK_SECTION)
+ if (pSectionData->GetType() != SectionType::DdeLink)
{
sLinkFileName = OUStringChar(sfx2::cTokenSeparator) + OUStringChar(sfx2::cTokenSeparator);
- pSectionData->SetType(DDE_LINK_SECTION);
+ pSectionData->SetType(SectionType::DdeLink);
}
sLinkFileName = comphelper::string::setToken(sLinkFileName,
pEntry->nWID - WID_SECT_DDE_TYPE,
@@ -675,10 +675,10 @@ void SwXTextSection::Impl::SetPropertyValues_Impl(
}
else
{
- if (pSectionData->GetType() != FILE_LINK_SECTION &&
+ if (pSectionData->GetType() != SectionType::FileLink &&
!aLink.FileURL.isEmpty())
{
- pSectionData->SetType(FILE_LINK_SECTION);
+ pSectionData->SetType(SectionType::FileLink);
}
const OUString sTmp(!aLink.FileURL.isEmpty()
? URIHelper::SmartRel2Abs(
@@ -692,7 +692,7 @@ void SwXTextSection::Impl::SetPropertyValues_Impl(
pSectionData->SetLinkFileName(sFileName);
if (sFileName.getLength() < 3)
{
- pSectionData->SetType(CONTENT_SECTION);
+ pSectionData->SetType(SectionType::Content);
}
}
}
@@ -708,10 +708,10 @@ void SwXTextSection::Impl::SetPropertyValues_Impl(
}
else
{
- if (pSectionData->GetType() != FILE_LINK_SECTION &&
+ if (pSectionData->GetType() != SectionType::FileLink &&
!sLink.isEmpty())
{
- pSectionData->SetType(FILE_LINK_SECTION);
+ pSectionData->SetType(SectionType::FileLink);
}
OUString sSectLink(pSectionData->GetLinkFileName());
for (sal_Int32 i = comphelper::string::getTokenCount(sSectLink, sfx2::cTokenSeparator);
@@ -723,7 +723,7 @@ void SwXTextSection::Impl::SetPropertyValues_Impl(
pSectionData->SetLinkFileName(sSectLink);
if (sSectLink.getLength() < 3)
{
- pSectionData->SetType(CONTENT_SECTION);
+ pSectionData->SetType(SectionType::Content);
}
}
}
@@ -992,7 +992,7 @@ SwXTextSection::Impl::GetPropertyValues_Impl(
sRet = m_pProps->m_sLinkFileName;
}
}
- else if (DDE_LINK_SECTION == pSect->GetType())
+ else if (SectionType::DdeLink == pSect->GetType())
{
sRet = pSect->GetLinkFileName();
}
@@ -1022,7 +1022,7 @@ SwXTextSection::Impl::GetPropertyValues_Impl(
aLink.FilterName = m_pProps->m_sSectionFilter;
}
}
- else if (FILE_LINK_SECTION == pSect->GetType())
+ else if (SectionType::FileLink == pSect->GetType())
{
const OUString& sRet( pSect->GetLinkFileName() );
sal_Int32 nIndex(0);
@@ -1041,7 +1041,7 @@ SwXTextSection::Impl::GetPropertyValues_Impl(
{
sRet = m_pProps->m_sSectionRegion;
}
- else if (FILE_LINK_SECTION == pSect->GetType())
+ else if (SectionType::FileLink == pSect->GetType())
{
sRet = pSect->GetLinkFileName().getToken(2,
sfx2::cTokenSeparator);
@@ -1090,7 +1090,7 @@ SwXTextSection::Impl::GetPropertyValues_Impl(
// search enclosing index
SwSection* pEnclosingSection = pSect;
while ((pEnclosingSection != nullptr) &&
- (TOX_CONTENT_SECTION != pEnclosingSection->GetType()))
+ (SectionType::ToxContent != pEnclosingSection->GetType()))
{
pEnclosingSection = pEnclosingSection->GetParent();
}
@@ -1489,7 +1489,7 @@ SwXTextSection::setPropertyToDefault(const OUString& rPropertyName)
}
else
{
- pSectionData->SetType(CONTENT_SECTION);
+ pSectionData->SetType(SectionType::Content);
}
break;
case WID_SECT_DDE_AUTOUPDATE:
diff --git a/sw/source/filter/html/htmlsect.cxx b/sw/source/filter/html/htmlsect.cxx
index 54bab22c49f4..4370f81bc152 100644
--- a/sw/source/filter/html/htmlsect.cxx
+++ b/sw/source/filter/html/htmlsect.cxx
@@ -307,8 +307,8 @@ void SwHTMLParser::NewDivision( HtmlTokenId nToken )
aHRef = aURL;
}
- SwSectionData aSection( (!aHRef.isEmpty()) ? FILE_LINK_SECTION
- : CONTENT_SECTION, aName );
+ SwSectionData aSection( (!aHRef.isEmpty()) ? SectionType::FileLink
+ : SectionType::Content, aName );
if( !aHRef.isEmpty() )
{
aSection.SetLinkFileName( aHRef );
@@ -688,7 +688,7 @@ void SwHTMLParser::NewMultiCol( sal_uInt16 columnsFromCss )
// Make section name unique.
OUString aName( m_xDoc->GetUniqueSectionName( !aId.isEmpty() ? &aId : nullptr ) );
- SwSectionData aSection( CONTENT_SECTION, aName );
+ SwSectionData aSection( SectionType::Content, aName );
SfxItemSet aFrameItemSet( m_xDoc->GetAttrPool(),
svl::Items<RES_FRMATR_BEGIN, RES_FRMATR_END-1>{} );
diff --git a/sw/source/filter/html/wrthtml.cxx b/sw/source/filter/html/wrthtml.cxx
index 76ce6fb781a6..d1e213f5ad71 100644
--- a/sw/source/filter/html/wrthtml.cxx
+++ b/sw/source/filter/html/wrthtml.cxx
@@ -401,7 +401,7 @@ ErrCode SwHTMLWriter::WriteStream()
}
else
{
- OSL_ENSURE( FILE_LINK_SECTION != pSNd->GetSection().GetType(),
+ OSL_ENSURE( SectionType::FileLink != pSNd->GetSection().GetType(),
"Export linked areas at document beginning is not implemented" );
// save only the tag of section
@@ -552,7 +552,7 @@ static const SwFormatCol *lcl_html_GetFormatCol( const SwSection& rSection,
const SwFormatCol *pCol = nullptr;
const SfxPoolItem* pItem;
- if( FILE_LINK_SECTION != rSection.GetType() &&
+ if( SectionType::FileLink != rSection.GetType() &&
SfxItemState::SET == rFormat.GetAttrSet().GetItemState(RES_COL,false,&pItem) &&
static_cast<const SwFormatCol *>(pItem)->GetNumCols() > 1 )
{
@@ -616,7 +616,7 @@ static void lcl_html_OutSectionStartTag( SwHTMLWriter& rHTMLWrt,
rHTMLWrt.Strm().WriteOString( sOut.makeStringAndClear() );
rHTMLWrt.OutDirection( nDir );
- if( FILE_LINK_SECTION == rSection.GetType() )
+ if( SectionType::FileLink == rSection.GetType() )
{
sOut.append(" " OOO_STRING_SVTOOLS_HTML_O_href "=\"");
rHTMLWrt.Strm().WriteOString( sOut.makeStringAndClear() );
diff --git a/sw/source/filter/ww8/docxexport.cxx b/sw/source/filter/ww8/docxexport.cxx
index 40121e26721d..d71d16c00fc6 100644
--- a/sw/source/filter/ww8/docxexport.cxx
+++ b/sw/source/filter/ww8/docxexport.cxx
@@ -562,7 +562,7 @@ void DocxExport::OutputEndNode( const SwEndNode& rEndNode )
// could have some code common with SectionNode()...
const SwSection& rSect = rEndNode.StartOfSectionNode()->GetSectionNode()->GetSection();
- if ( m_bStartTOX && TOX_CONTENT_SECTION == rSect.GetType() )
+ if ( m_bStartTOX && SectionType::ToxContent == rSect.GetType() )
m_bStartTOX = false;
SwNodeIndex aIdx( rEndNode, 1 );
diff --git a/sw/source/filter/ww8/wrtw8nds.cxx b/sw/source/filter/ww8/wrtw8nds.cxx
index 13732268af52..83563e42aa0f 100644
--- a/sw/source/filter/ww8/wrtw8nds.cxx
+++ b/sw/source/filter/ww8/wrtw8nds.cxx
@@ -2151,7 +2151,7 @@ void MSWordExportBase::OutputTextNode( SwTextNode& rNode )
{
// ignore TOX header section
const SwSectionNode* pSectNd = rNode.FindSectionNode();
- if ( pSectNd && TOX_CONTENT_SECTION == pSectNd->GetSection().GetType() )
+ if ( pSectNd && SectionType::ToxContent == pSectNd->GetSection().GetType() )
{
AttrOutput().StartTOX( pSectNd->GetSection() );
m_aCurrentCharPropStarts.push( 0 );
@@ -3117,7 +3117,7 @@ void MSWordExportBase::OutputSectionNode( const SwSectionNode& rSectionNode )
else
AttrOutput().SectionBreaks( rSectionNode );
- const bool bInTOX = rSection.GetType() == TOX_CONTENT_SECTION || rSection.GetType() == TOX_HEADER_SECTION;
+ const bool bInTOX = rSection.GetType() == SectionType::ToxContent || rSection.GetType() == SectionType::ToxHeader;
if ( !pSet && !bInTOX )
{
// new Section with no own PageDesc/-Break
@@ -3133,7 +3133,7 @@ void MSWordExportBase::OutputSectionNode( const SwSectionNode& rSectionNode )
AppendSection( pCurrent, pFormat, nRstLnNum );
}
}
- if ( TOX_CONTENT_SECTION == rSection.GetType() )
+ if ( SectionType::ToxContent == rSection.GetType() )
{
m_bStartTOX = true;
UpdateTocSectionNodeProperties(rSectionNode);
@@ -3149,7 +3149,7 @@ void MSWordExportBase::UpdateTocSectionNodeProperties(const SwSectionNode& rSect
// check section type
{
const SwSection& rSection = rSectionNode.GetSection();
- if (TOX_CONTENT_SECTION != rSection.GetType())
+ if (SectionType::ToxContent != rSection.GetType())
return;
const SwTOXBase* pTOX = rSection.GetTOXBase();
@@ -3170,7 +3170,7 @@ void MSWordExportBase::UpdateTocSectionNodeProperties(const SwSectionNode& rSect
if (rNdNext.IsSectionNode())
{
const SwSectionNode* pSectNdNext = static_cast<const SwSectionNode*>(&rNdNext);
- if (TOX_HEADER_SECTION == pSectNdNext->GetSection().GetType() &&
+ if (SectionType::ToxHeader == pSectNdNext->GetSection().GetType() &&
pSectNdNext->StartOfSectionNode()->IsSectionNode())
{
pSectNd = pSectNdNext;
diff --git a/sw/source/filter/ww8/wrtw8sty.cxx b/sw/source/filter/ww8/wrtw8sty.cxx
index 62262700e885..8373b5c2f40d 100644
--- a/sw/source/filter/ww8/wrtw8sty.cxx
+++ b/sw/source/filter/ww8/wrtw8sty.cxx
@@ -1000,26 +1000,26 @@ MSWordSections::MSWordSections( MSWordExportBase& rExport )
}
else if (pNd && nullptr != ( pSectNd = pNd->FindSectionNode() ))
{
- if ( TOX_HEADER_SECTION == pSectNd->GetSection().GetType() &&
+ if ( SectionType::ToxHeader == pSectNd->GetSection().GetType() &&
pSectNd->StartOfSectionNode()->IsSectionNode() )
{
pSectNd = pSectNd->StartOfSectionNode()->GetSectionNode();
}
- if ( TOX_CONTENT_SECTION == pSectNd->GetSection().GetType() )
+ if ( SectionType::ToxContent == pSectNd->GetSection().GetType() )
{
pNd = pSectNd;
rExport.m_pCurPam->GetPoint()->nNode = *pNd;
}
- if ( CONTENT_SECTION == pSectNd->GetSection().GetType() )
+ if ( SectionType::Content == pSectNd->GetSection().GetType() )
pFormat = pSectNd->GetSection().GetFormat();
}
// tdf#118393: FILESAVE: DOCX Export loses header/footer
rExport.m_bFirstTOCNodeWithSection = pSectNd &&
- ( TOX_HEADER_SECTION == pSectNd->GetSection().GetType() ||
- TOX_CONTENT_SECTION == pSectNd->GetSection().GetType() );
+ ( SectionType::ToxHeader == pSectNd->GetSection().GetType() ||
+ SectionType::ToxContent == pSectNd->GetSection().GetType() );
// Try to get page descriptor of the first node
if ( pSet &&
diff --git a/sw/source/filter/ww8/wrtww8.cxx b/sw/source/filter/ww8/wrtww8.cxx
index 18698337808b..06d347d30fe8 100644
--- a/sw/source/filter/ww8/wrtww8.cxx
+++ b/sw/source/filter/ww8/wrtww8.cxx
@@ -2752,7 +2752,7 @@ void MSWordExportBase::WriteText()
{
const SwSection& rSect = rNd.StartOfSectionNode()->GetSectionNode()
->GetSection();
- if ( m_bStartTOX && TOX_CONTENT_SECTION == rSect.GetType() )
+ if ( m_bStartTOX && SectionType::ToxContent == rSect.GetType() )
m_bStartTOX = false;
SwNodeIndex aIdx( rNd, 1 );
@@ -2764,7 +2764,7 @@ void MSWordExportBase::WriteText()
{
//#120140# Do not need to insert a page/section break after a section end. Check this case first
bool bNeedExportBreakHere = true;
- if ( rSect.GetType() == TOX_CONTENT_SECTION || rSect.GetType() == TOX_HEADER_SECTION )
+ if ( rSect.GetType() == SectionType::ToxContent || rSect.GetType() == SectionType::ToxHeader )
bNeedExportBreakHere = false;
else if ( aIdx.GetNode().IsTextNode() )
{
diff --git a/sw/source/filter/ww8/ww8atr.cxx b/sw/source/filter/ww8/ww8atr.cxx
index d7d30eb99773..8f4e051d2c5d 100644
--- a/sw/source/filter/ww8/ww8atr.cxx
+++ b/sw/source/filter/ww8/ww8atr.cxx
@@ -628,7 +628,7 @@ const SwSectionFormat* MSWordExportBase::GetSectionFormat( const SwNode& rNd )
const SwSectionFormat* pFormat = nullptr;
const SwSectionNode* pSect = rNd.FindSectionNode();
if ( pSect &&
- CONTENT_SECTION == pSect->GetSection().GetType() )
+ SectionType::Content == pSect->GetSection().GetType() )
{
pFormat = pSect->GetSection().GetFormat();
}
diff --git a/sw/source/filter/ww8/ww8par5.cxx b/sw/source/filter/ww8/ww8par5.cxx
index ea0a435371a3..a7fa401c393b 100644
--- a/sw/source/filter/ww8/ww8par5.cxx
+++ b/sw/source/filter/ww8/ww8par5.cxx
@@ -2524,7 +2524,7 @@ eF_ResT SwWW8ImplReader::Read_F_IncludeText( WW8FieldDesc* /*pF*/, OUString& rSt
*/
SwPosition aTmpPos(*m_pPaM->GetPoint());
- SwSectionData aSection(FILE_LINK_SECTION,
+ SwSectionData aSection(SectionType::FileLink,
m_aSectionNameGenerator.UniqueName());
aSection.SetLinkFileName( aPara );
aSection.SetProtectFlag(true);
diff --git a/sw/source/filter/ww8/ww8par6.cxx b/sw/source/filter/ww8/ww8par6.cxx
index 912b099ed233..a27b27749c0a 100644
--- a/sw/source/filter/ww8/ww8par6.cxx
+++ b/sw/source/filter/ww8/ww8par6.cxx
@@ -702,7 +702,7 @@ void wwSectionManager::SetPageULSpaceItems(SwFrameFormat &rFormat,
SwSectionFormat *wwSectionManager::InsertSection(
SwPaM const & rMyPaM, wwSection &rSection)
{
- SwSectionData aSection( CONTENT_SECTION,
+ SwSectionData aSection( SectionType::Content,
mrReader.m_rDoc.GetUniqueSectionName() );
SfxItemSet aSet( mrReader.m_rDoc.GetAttrPool(), aFrameFormatSetRange );
@@ -878,7 +878,7 @@ void wwSectionManager::CreateSep(const long nTextPos)
return;
OUString sSectionName = mrReader.m_aLinkStringMap[SVBT16ToUInt16( static_cast<WW8_WKB*>(pData)->nLinkId) ];
sSectionName = mrReader.ConvertFFileName(sSectionName);
- SwSectionData aSection(FILE_LINK_SECTION, sSectionName);
+ SwSectionData aSection(SectionType::FileLink, sSectionName);
aSection.SetLinkFileName( sSectionName );
aSection.SetProtectFlag(true);
// #i19922# - improvement: return value of method <Insert> not used.
diff --git a/sw/source/ui/dialog/uiregionsw.cxx b/sw/source/ui/dialog/uiregionsw.cxx
index a95e184de1a1..840cdf7c7904 100644
--- a/sw/source/ui/dialog/uiregionsw.cxx
+++ b/sw/source/ui/dialog/uiregionsw.cxx
@@ -92,8 +92,8 @@ static void lcl_FillList( SwWrtShell& rSh, weld::ComboBox& rSubRegions, weld::Co
const SwSectionFormat* pFormat = &rSh.GetSectionFormat(i);
if( !pFormat->GetParent() &&
pFormat->IsInNodesArr() &&
- (eTmpType = pFormat->GetSection()->GetType()) != TOX_CONTENT_SECTION
- && TOX_HEADER_SECTION != eTmpType )
+ (eTmpType = pFormat->GetSection()->GetType()) != SectionType::ToxContent
+ && SectionType::ToxHeader != eTmpType )
{
const OUString sString(pFormat->GetSection()->GetSectionName());
if (pAvailNames)
@@ -114,8 +114,8 @@ static void lcl_FillList( SwWrtShell& rSh, weld::ComboBox& rSubRegions, weld::Co
{
const SwSectionFormat* pFormat = pSect->GetFormat();
if( pFormat->IsInNodesArr()&&
- (eTmpType = pFormat->GetSection()->GetType()) != TOX_CONTENT_SECTION
- && TOX_HEADER_SECTION != eTmpType )
+ (eTmpType = pFormat->GetSection()->GetType()) != SectionType::ToxContent
+ && SectionType::ToxHeader != eTmpType )
{
const OUString sString(pFormat->GetSection()->GetSectionName());
if (pAvailNames)
@@ -234,11 +234,11 @@ void SectRepr::SetFile( const OUString& rFile )
if( !rFile.isEmpty() || !sSub.isEmpty() )
{
- m_SectionData.SetType( FILE_LINK_SECTION );
+ m_SectionData.SetType( SectionType::FileLink );
}
else
{
- m_SectionData.SetType( CONTENT_SECTION );
+ m_SectionData.SetType( SectionType::Content );
}
}
@@ -260,7 +260,7 @@ void SectRepr::SetFilter( const OUString& rFilter )
if( !sNewFile.isEmpty() )
{
- m_SectionData.SetType( FILE_LINK_SECTION );
+ m_SectionData.SetType( SectionType::FileLink );
}
}
@@ -280,11 +280,11 @@ void SectRepr::SetSubRegion(const OUString& rSubRegion)
if( !rSubRegion.isEmpty() || !sOldFileName.isEmpty() )
{
- m_SectionData.SetType( FILE_LINK_SECTION );
+ m_SectionData.SetType( SectionType::FileLink );
}
else
{
- m_SectionData.SetType( CONTENT_SECTION );
+ m_SectionData.SetType( SectionType::Content );
}
}
@@ -296,7 +296,7 @@ OUString SectRepr::GetFile() const
{
return sLinkFile;
}
- if (DDE_LINK_SECTION == m_SectionData.GetType())
+ if (SectionType::DdeLink == m_SectionData.GetType())
{
sal_Int32 n = 0;
return sLinkFile.replaceFirst( OUStringChar(sfx2::cTokenSeparator), " ", &n )
@@ -460,8 +460,8 @@ void SwEditRegionDlg::RecurseList(const SwSectionFormat* pFormat, const weld::Tr
SectionType eTmpType;
if( !( pFormat = &rSh.GetSectionFormat(n))->GetParent() &&
pFormat->IsInNodesArr() &&
- (eTmpType = pFormat->GetSection()->GetType()) != TOX_CONTENT_SECTION
- && TOX_HEADER_SECTION != eTmpType )
+ (eTmpType = pFormat->GetSection()->GetType()) != SectionType::ToxContent
+ && SectionType::ToxHeader != eTmpType )
{
SwSection *pSect = pFormat->GetSection();
SectRepr* pSectRepr = new SectRepr( n, *pSect );
@@ -492,8 +492,8 @@ void SwEditRegionDlg::RecurseList(const SwSectionFormat* pFormat, const weld::Tr
SectionType eTmpType;
pFormat = pSect->GetFormat();
if( pFormat->IsInNodesArr() &&
- (eTmpType = pFormat->GetSection()->GetType()) != TOX_CONTENT_SECTION
- && TOX_HEADER_SECTION != eTmpType )
+ (eTmpType = pFormat->GetSection()->GetType()) != SectionType::ToxContent
+ && SectionType::ToxHeader != eTmpType )
{
SectRepr* pSectRepr=new SectRepr(
FindArrPos( pSect->GetFormat() ), *pSect );
@@ -608,7 +608,7 @@ IMPL_LINK(SwEditRegionDlg, GetFirstEntryHdl, weld::TreeView&, rBox, void)
// edit in readonly sections
bEditInReadonly = rData.IsEditInReadonlyFlag();
- bFile = (rData.GetType() != CONTENT_SECTION);
+ bFile = (rData.GetType() != SectionType::Content);
aCurPasswd = rData.GetPassword();
}
else
@@ -622,7 +622,7 @@ IMPL_LINK(SwEditRegionDlg, GetFirstEntryHdl, weld::TreeView&, rBox, void)
(bEditInReadonly == rData.IsEditInReadonlyFlag());
bFileValid = (bFile ==
- (rData.GetType() != CONTENT_SECTION));
+ (rData.GetType() != SectionType::Content));
bPasswdValid = (aCurPasswd == rData.GetPassword());
}
bFirst = false;
@@ -695,7 +695,7 @@ IMPL_LINK(SwEditRegionDlg, GetFirstEntryHdl, weld::TreeView&, rBox, void)
m_xFileCB->set_active(true);
m_xFileNameED->set_text(aFile);
m_xSubRegionED->set_entry_text(sSub);
- m_xDDECB->set_active(rData.GetType() == DDE_LINK_SECTION);
+ m_xDDECB->set_active(rData.GetType() == SectionType::DdeLink);
}
else
{
@@ -1140,7 +1140,7 @@ IMPL_LINK(SwEditRegionDlg, FileNameEntryHdl, weld::Entry&, rEdit, void)
}
pSectRepr->GetSectionData().SetLinkFileName( sLink );
- pSectRepr->GetSectionData().SetType( DDE_LINK_SECTION );
+ pSectRepr->GetSectionData().SetType( SectionType::DdeLink );
}
else
{
@@ -1176,13 +1176,13 @@ IMPL_LINK(SwEditRegionDlg, DDEHdl, weld::ToggleButton&, rButton, void)
m_xDDECommandFT->show();
m_xSubRegionFT->hide();
m_xSubRegionED->hide();
- if (FILE_LINK_SECTION == rData.GetType())
+ if (SectionType::FileLink == rData.GetType())
{
pSectRepr->SetFile(OUString());
m_xFileNameED->set_text(OUString());
rData.SetLinkFilePassword(OUString());
}
- rData.SetType(DDE_LINK_SECTION);
+ rData.SetType(SectionType::DdeLink);
}
else
{
@@ -1194,9 +1194,9 @@ IMPL_LINK(SwEditRegionDlg, DDEHdl, weld::ToggleButton&, rButton, void)
m_xSubRegionED->set_sensitive(bFile);
m_xSubRegionFT->set_sensitive(bFile);
m_xSubRegionED->set_sensitive(bFile);
- if (DDE_LINK_SECTION == rData.GetType())
+ if (SectionType::DdeLink == rData.GetType())
{
- rData.SetType(FILE_LINK_SECTION);
+ rData.SetType(SectionType::FileLink);
pSectRepr->SetFile(OUString());
rData.SetLinkFilePassword(OUString());
m_xFileNameED->set_text(OUString());
@@ -1554,7 +1554,7 @@ void SwInsertSectionTabPage::SetWrtShell(SwWrtShell& rSh)
bool SwInsertSectionTabPage::FillItemSet( SfxItemSet* )
{
- SwSectionData aSection(CONTENT_SECTION, m_xCurName->get_active_text());
+ SwSectionData aSection(SectionType::Content, m_xCurName->get_active_text());
aSection.SetCondition(m_xConditionED->get_text());
bool bProtected = m_xProtectCB->get_active();
aSection.SetProtectFlag(bProtected);
@@ -1603,8 +1603,8 @@ bool SwInsertSectionTabPage::FillItemSet( SfxItemSet* )
if (!aLinkFile.isEmpty())
{
aSection.SetType( m_xDDECB->get_active() ?
- DDE_LINK_SECTION :
- FILE_LINK_SECTION);
+ SectionType::DdeLink :
+ SectionType::FileLink);
}
}
static_cast<SwInsertSectionTabDialog*>(GetDialogController())->SetSectionData(aSection);
diff --git a/sw/source/uibase/app/applab.cxx b/sw/source/uibase/app/applab.cxx
index a72d7a591cba..d8bae1facda4 100644
--- a/sw/source/uibase/app/applab.cxx
+++ b/sw/source/uibase/app/applab.cxx
@@ -331,13 +331,13 @@ void SwModule::InsertLab(SfxRequest& rReq, bool bLabel)
else
pSh->SetMark(); // set only the mark
- SwSectionData aSect(CONTENT_SECTION, MASTER_LABEL);
+ SwSectionData aSect(SectionType::Content, MASTER_LABEL);
pSh->InsertSection(aSect);
}
}
else if (rItem.m_bSynchron)
{
- SwSectionData aSect(FILE_LINK_SECTION,
+ SwSectionData aSect(SectionType::FileLink,
pSh->GetUniqueSectionName());
OUString sLinkName =
OUStringChar(sfx2::cTokenSeparator) +
diff --git a/sw/source/uibase/dbui/dbmgr.cxx b/sw/source/uibase/dbui/dbmgr.cxx
index 32eaa13fb153..c3b4ef6e7297 100644
--- a/sw/source/uibase/dbui/dbmgr.cxx
+++ b/sw/source/uibase/dbui/dbmgr.cxx
@@ -843,9 +843,9 @@ static void lcl_RemoveSectionLinks( SwWrtShell& rWorkShell )
for (size_t nSection = 0; nSection < nSections; ++nSection)
{
SwSectionData aSectionData( *rWorkShell.GetSectionFormat( nSection ).GetSection() );
- if( aSectionData.GetType() == FILE_LINK_SECTION )
+ if( aSectionData.GetType() == SectionType::FileLink )
{
- aSectionData.SetType( CONTENT_SECTION );
+ aSectionData.SetType( SectionType::Content );
aSectionData.SetLinkFileName( OUString() );
rWorkShell.UpdateSection( nSection, aSectionData );
}
diff --git a/sw/source/uibase/dialog/regionsw.cxx b/sw/source/uibase/dialog/regionsw.cxx
index 2aa3c5a93b22..32d9e6e5f3c1 100644
--- a/sw/source/uibase/dialog/regionsw.cxx
+++ b/sw/source/uibase/dialog/regionsw.cxx
@@ -101,7 +101,7 @@ void SwBaseShell::InsertRegionDialog(SfxRequest& rReq)
else
aTmpStr = rSh.GetUniqueSectionName();
- SwSectionData aSection(CONTENT_SECTION, aTmpStr);
+ SwSectionData aSection(SectionType::Content, aTmpStr);
rReq.SetReturnValue(SfxStringItem(FN_INSERT_REGION, aTmpStr));
aSet.Put( *pSet );
@@ -165,7 +165,7 @@ void SwBaseShell::InsertRegionDialog(SfxRequest& rReq)
}
sLinkFileName += aSub;
- aSection.SetType( FILE_LINK_SECTION );
+ aSection.SetType( SectionType::FileLink );
aSection.SetLinkFileName(sLinkFileName);
}
rSh.InsertSection(aSection, aSet.Count() ? &aSet : nullptr);
diff --git a/sw/source/uibase/dochdl/swdtflvr.cxx b/sw/source/uibase/dochdl/swdtflvr.cxx
index ffdbd98b4538..bb140e9742af 100644
--- a/sw/source/uibase/dochdl/swdtflvr.cxx
+++ b/sw/source/uibase/dochdl/swdtflvr.cxx
@@ -2562,7 +2562,7 @@ bool SwTransferable::PasteDDE( TransferableDataHelper& rData,
if( rWrtShell.HasSelection() )
rWrtShell.DelRight();
- SwSectionData aSect( DDE_LINK_SECTION, aName );
+ SwSectionData aSect( SectionType::DdeLink, aName );
aSect.SetLinkFileName( aCmd );
aSect.SetProtectFlag(true);
rWrtShell.InsertSection( aSect );
@@ -2974,7 +2974,7 @@ bool SwTransferable::PasteFileName( TransferableDataHelper& rData,
{
// and then pull up the insert-region-dialog
SwSectionData aSect(
- FILE_LINK_SECTION,
+ SectionType::FileLink,
rSh.GetDoc()->GetUniqueSectionName() );
aSect.SetLinkFileName( sFileURL );
aSect.SetProtectFlag( true );
diff --git a/sw/source/uibase/shells/basesh.cxx b/sw/source/uibase/shells/basesh.cxx
index e65149b15995..e346600c0549 100644
--- a/sw/source/uibase/shells/basesh.cxx
+++ b/sw/source/uibase/shells/basesh.cxx
@@ -1437,8 +1437,8 @@ void SwBaseShell::GetState( SfxItemSet &rSet )
case FN_EDIT_CURRENT_REGION:
//tdf#112808 if cursor is in an index, don't show the edit section.
if( !rSh.GetCurrSection() ||
- (rSh.GetCurrSection()->GetType() != CONTENT_SECTION &&
- rSh.GetCurrSection()->GetType() != FILE_LINK_SECTION ))
+ (rSh.GetCurrSection()->GetType() != SectionType::Content &&
+ rSh.GetCurrSection()->GetType() != SectionType::FileLink ))
{
rSet.DisableItem(nWhich);
}
diff --git a/sw/source/uibase/uiview/view2.cxx b/sw/source/uibase/uiview/view2.cxx
index 117d90931dd9..54b96e4b5e36 100644
--- a/sw/source/uibase/uiview/view2.cxx
+++ b/sw/source/uibase/uiview/view2.cxx
@@ -1586,8 +1586,8 @@ void SwView::StateStatusLine(SfxItemSet &rSet)
{
switch( pCurrSect->GetType() )
{
- case TOX_HEADER_SECTION:
- case TOX_CONTENT_SECTION:
+ case SectionType::ToxHeader:
+ case SectionType::ToxContent:
{
const SwTOXBase* pTOX = m_pWrtShell->GetCurTOX();
if( pTOX )
diff --git a/sw/source/uibase/utlui/content.cxx b/sw/source/uibase/utlui/content.cxx
index 95091161e3fd..eaaf40f8963a 100644
--- a/sw/source/uibase/utlui/content.cxx
+++ b/sw/source/uibase/utlui/content.cxx
@@ -366,8 +366,8 @@ void SwContentType::Init(bool* pbInvalidateWindow)
const SwSectionFormat* pFormat;
SectionType eTmpType;
if( (pFormat = &m_pWrtShell->GetSectionFormat(i))->IsInNodesArr() &&
- (eTmpType = pFormat->GetSection()->GetType()) != TOX_CONTENT_SECTION
- && TOX_HEADER_SECTION != eTmpType )
+ (eTmpType = pFormat->GetSection()->GetType()) != SectionType::ToxContent
+ && SectionType::ToxHeader != eTmpType )
{
const OUString& rSectionName =
pFormat->GetSection()->GetSectionName();
@@ -671,8 +671,8 @@ void SwContentType::FillMemberList(bool* pbLevelOrVisibilityChanged)
const SwSectionFormat* pFormat;
SectionType eTmpType;
if( (pFormat = &m_pWrtShell->GetSectionFormat(i))->IsInNodesArr() &&
- (eTmpType = pFormat->GetSection()->GetType()) != TOX_CONTENT_SECTION
- && TOX_HEADER_SECTION != eTmpType )
+ (eTmpType = pFormat->GetSection()->GetType()) != SectionType::ToxContent
+ && SectionType::ToxHeader != eTmpType )
{
OUString sSectionName = pFormat->GetSection()->GetSectionName();
diff --git a/sw/source/uibase/utlui/glbltree.cxx b/sw/source/uibase/utlui/glbltree.cxx
index 788d999f21f6..507725e2b24e 100644
--- a/sw/source/uibase/utlui/glbltree.cxx
+++ b/sw/source/uibase/utlui/glbltree.cxx
@@ -1339,12 +1339,12 @@ void SwGlobalTree::InsertRegion( const SwGlblDocContent* _pContent, const Sequen
if ( nAddNumber )
sSectionName = sTempSectionName;
- SwSectionData aSectionData(CONTENT_SECTION, sSectionName);
+ SwSectionData aSectionData(SectionType::Content, sSectionName);
aSectionData.SetProtectFlag(true);
aSectionData.SetHidden(false);
aSectionData.SetLinkFileName(sFileName);
- aSectionData.SetType(FILE_LINK_SECTION);
+ aSectionData.SetType(SectionType::FileLink);
aSectionData.SetLinkFilePassword( OUString() );
rSh.InsertGlobalDocContent( *pAnchorContent, aSectionData );
diff --git a/sw/source/uibase/wrtsh/wrtsh2.cxx b/sw/source/uibase/wrtsh/wrtsh2.cxx
index a3e4d08b3e03..92169d03d0eb 100644
--- a/sw/source/uibase/wrtsh/wrtsh2.cxx
+++ b/sw/source/uibase/wrtsh/wrtsh2.cxx
@@ -586,7 +586,7 @@ void SwWrtShell::NavigatorPaste( const NaviContentBookmark& rBkmk,
}
else
{
- SwSectionData aSection( FILE_LINK_SECTION, GetUniqueSectionName() );
+ SwSectionData aSection( SectionType::FileLink, GetUniqueSectionName() );
OUString aLinkFile = rBkmk.GetURL().getToken(0, '#')
+ OUStringChar(sfx2::cTokenSeparator)
+ OUStringChar(sfx2::cTokenSeparator)
@@ -598,7 +598,7 @@ void SwWrtShell::NavigatorPaste( const NaviContentBookmark& rBkmk,
{
aSection = SwSectionData(*pIns);
aSection.SetLinkFileName( OUString() );
- aSection.SetType( CONTENT_SECTION );
+ aSection.SetType( SectionType::Content );
aSection.SetProtectFlag( false );
// the update of content from linked section at time delete
commit 412ca1ff72d2031d327df658a94e63bdcb8583b0
Author: Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Tue Dec 10 10:46:19 2019 +0200
Commit: Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Wed Dec 11 06:57:12 2019 +0100
convert SwFrameSize to scoped enum
Change-Id: I7e1e641ff180035c7dcefdcfdd185eadbae32142
Reviewed-on: https://gerrit.libreoffice.org/84850
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
diff --git a/sw/inc/fmtfsize.hxx b/sw/inc/fmtfsize.hxx
index e393d3a44ca3..e2c1e999468e 100644
--- a/sw/inc/fmtfsize.hxx
+++ b/sw/inc/fmtfsize.hxx
@@ -32,12 +32,12 @@ class IntlWrapper;
//Frame size.
-enum SwFrameSize
+enum class SwFrameSize
{
- ATT_VAR_SIZE, ///< Frame is variable in Var-direction.
- ATT_FIX_SIZE, ///< Frame cannot be moved in Var-direction.
- ATT_MIN_SIZE /**< Value in Var-direction gives minimum
- (can be exceeded but not be less). */
+ Variable, ///< Frame is variable in Var-direction.
+ Fixed, ///< Frame cannot be moved in Var-direction.
+ Minimum /**< Value in Var-direction gives minimum
+ (can be exceeded but not be less). */
};
class SW_DLLPUBLIC SwFormatFrameSize: public SvxSizeItem
@@ -64,7 +64,7 @@ class SW_DLLPUBLIC SwFormatFrameSize: public SvxSizeItem
bool HasMetrics() const override;
public:
- SwFormatFrameSize( SwFrameSize eSize = ATT_VAR_SIZE,
+ SwFormatFrameSize( SwFrameSize eSize = SwFrameSize::Variable,
SwTwips nWidth = 0, SwTwips nHeight = 0 );
virtual bool operator==( const SfxPoolItem& ) const override;
diff --git a/sw/qa/extras/layout/layout.cxx b/sw/qa/extras/layout/layout.cxx
index 6b4ab938f94c..eac0b40ddcd0 100644
--- a/sw/qa/extras/layout/layout.cxx
+++ b/sw/qa/extras/layout/layout.cxx
@@ -225,7 +225,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testRedlineFlysInBody)
pWrtShell->Right(CRSR_SKIP_CHARS, /*bSelect=*/false, 1, /*bBasicCall=*/false);
anchor.SetAnchor(pWrtShell->GetCursor()->GetPoint());
flySet.Put(anchor);
- SwFormatFrameSize size(ATT_MIN_SIZE, 1000, 1000);
+ SwFormatFrameSize size(SwFrameSize::Minimum, 1000, 1000);
flySet.Put(size); // set a size, else we get 1 char per line...
SwFrameFormat const* pFly = pWrtShell->NewFlyFrame(flySet, /*bAnchValid=*/true);
CPPUNIT_ASSERT(pFly != nullptr);
@@ -495,7 +495,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testRedlineFlysInHeader)
pWrtShell->Right(CRSR_SKIP_CHARS, /*bSelect=*/false, 1, /*bBasicCall=*/false);
anchor.SetAnchor(pWrtShell->GetCursor()->GetPoint());
flySet.Put(anchor);
- SwFormatFrameSize size(ATT_MIN_SIZE, 1000, 1000);
+ SwFormatFrameSize size(SwFrameSize::Minimum, 1000, 1000);
flySet.Put(size); // set a size, else we get 1 char per line...
SwFrameFormat const* pFly = pWrtShell->NewFlyFrame(flySet, /*bAnchValid=*/true);
CPPUNIT_ASSERT(pFly != nullptr);
@@ -767,7 +767,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testRedlineFlysInFootnote)
SfxItemSet flySet(pDoc->GetAttrPool(),
svl::Items<RES_FRM_SIZE, RES_FRM_SIZE, RES_ANCHOR, RES_ANCHOR>{});
- SwFormatFrameSize size(ATT_MIN_SIZE, 1000, 1000);
+ SwFormatFrameSize size(SwFrameSize::Minimum, 1000, 1000);
flySet.Put(size); // set a size, else we get 1 char per line...
SwFormatAnchor anchor(RndStdIds::FLY_AT_CHAR);
anchor.SetAnchor(pWrtShell->GetCursor()->GetPoint());
@@ -1147,7 +1147,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testRedlineFlysInFlys)
pWrtShell->Insert("baz");
SfxItemSet flySet(pDoc->GetAttrPool(),
svl::Items<RES_FRM_SIZE, RES_FRM_SIZE, RES_ANCHOR, RES_ANCHOR>{});
- SwFormatFrameSize size(ATT_MIN_SIZE, 1000, 1000);
+ SwFormatFrameSize size(SwFrameSize::Minimum, 1000, 1000);
flySet.Put(size); // set a size, else we get 1 char per line...
pWrtShell->StartOfSection(false);
pWrtShell->Right(CRSR_SKIP_CHARS, /*bSelect=*/false, 1, /*bBasicCall=*/false);
@@ -1611,7 +1611,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testRedlineFlysAtFlys)
pWrtShell->Insert("baz");
SfxItemSet flySet(pDoc->GetAttrPool(),
svl::Items<RES_FRM_SIZE, RES_FRM_SIZE, RES_ANCHOR, RES_ANCHOR>{});
- SwFormatFrameSize size(ATT_MIN_SIZE, 1000, 1000);
+ SwFormatFrameSize size(SwFrameSize::Minimum, 1000, 1000);
flySet.Put(size); // set a size, else we get 1 char per line...
pWrtShell->StartOfSection(false);
pWrtShell->Right(CRSR_SKIP_CHARS, /*bSelect=*/false, 1, /*bBasicCall=*/false);
diff --git a/sw/qa/extras/uiwriter/uiwriter2.cxx b/sw/qa/extras/uiwriter/uiwriter2.cxx
index 79601dfddcd5..fefd9f3f8df7 100644
--- a/sw/qa/extras/uiwriter/uiwriter2.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter2.cxx
@@ -602,7 +602,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf109376_redline)
SfxItemSet flySet(pDoc->GetAttrPool(),
svl::Items<RES_FRM_SIZE, RES_FRM_SIZE, RES_ANCHOR, RES_ANCHOR>{});
flySet.Put(anchor);
- SwFormatFrameSize size(ATT_MIN_SIZE, 1000, 1000);
+ SwFormatFrameSize size(SwFrameSize::Minimum, 1000, 1000);
flySet.Put(size); // set a size, else we get 1 char per line...
SwFrameFormat const* pFly = pWrtShell->NewFlyFrame(flySet, /*bAnchValid=*/true);
CPPUNIT_ASSERT(pFly != nullptr);
@@ -653,7 +653,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testTdf109376)
SfxItemSet flySet(pDoc->GetAttrPool(),
svl::Items<RES_FRM_SIZE, RES_FRM_SIZE, RES_ANCHOR, RES_ANCHOR>{});
flySet.Put(anchor);
- SwFormatFrameSize size(ATT_MIN_SIZE, 1000, 1000);
+ SwFormatFrameSize size(SwFrameSize::Minimum, 1000, 1000);
flySet.Put(size); // set a size, else we get 1 char per line...
SwFrameFormat const* pFly = pWrtShell->NewFlyFrame(flySet, /*bAnchValid=*/true);
CPPUNIT_ASSERT(pFly != nullptr);
diff --git a/sw/source/core/doc/DocumentStylePoolManager.cxx b/sw/source/core/doc/DocumentStylePoolManager.cxx
index 767af3a22010..d3b0761128dd 100644
--- a/sw/source/core/doc/DocumentStylePoolManager.cxx
+++ b/sw/source/core/doc/DocumentStylePoolManager.cxx
@@ -1627,7 +1627,7 @@ SwFormat* DocumentStylePoolManager::GetFormatFromPool( sal_uInt16 nId )
aSet.Put( SwFormatVertOrient( 0, text::VertOrientation::TOP, text::RelOrientation::FRAME ));
aSet.Put( SwFormatSurround( css::text::WrapTextMode_PARALLEL ));
// Set the default width to 3.5 cm, use the minimum value for the height
- aSet.Put( SwFormatFrameSize( ATT_MIN_SIZE,
+ aSet.Put( SwFormatFrameSize( SwFrameSize::Minimum,
GetMetricVal( CM_1 ) * 3 + GetMetricVal( CM_05 ),
MM50 ));
}
@@ -1774,7 +1774,7 @@ SwPageDesc* DocumentStylePoolManager::GetPageDescFromPool( sal_uInt16 nId, bool
{
Size aPSize( SvxPaperInfo::GetPaperSize( PAPER_ENV_C65 ) );
LandscapeSwap( aPSize );
- aSet.Put( SwFormatFrameSize( ATT_FIX_SIZE, aPSize.Width(), aPSize.Height() ));
+ aSet.Put( SwFormatFrameSize( SwFrameSize::Fixed, aPSize.Width(), aPSize.Height() ));
aLR.SetLeft( 0 ); aLR.SetRight( 0 );
aUL.SetUpper( 0 ); aUL.SetLower( 0 );
aSet.Put( aLR );
diff --git a/sw/source/core/doc/docdesc.cxx b/sw/source/core/doc/docdesc.cxx
index d1cc84f8d8e3..eccbe3cc1b3a 100644
--- a/sw/source/core/doc/docdesc.cxx
+++ b/sw/source/core/doc/docdesc.cxx
@@ -73,7 +73,7 @@ static void lcl_DefaultPageFormat( sal_uInt16 nPoolFormatId,
// The default page size is obtained from the application
//locale
- SwFormatFrameSize aFrameSize( ATT_FIX_SIZE );
+ SwFormatFrameSize aFrameSize( SwFrameSize::Fixed );
const Size aPhysSize = SvxPaperInfo::GetDefaultPaperSize();
aFrameSize.SetSize( aPhysSize );
diff --git a/sw/source/core/doc/docfly.cxx b/sw/source/core/doc/docfly.cxx
index 4451115905a8..0735144328d0 100644
--- a/sw/source/core/doc/docfly.cxx
+++ b/sw/source/core/doc/docfly.cxx
@@ -1094,12 +1094,12 @@ SwChainRet SwDoc::Chain( SwFrameFormat &rSource, const SwFrameFormat &rDest )
aSet.Put( aChain );
SwFormatFrameSize aSize( rSource.GetFrameSize() );
- if ( aSize.GetHeightSizeType() != ATT_FIX_SIZE )
+ if ( aSize.GetHeightSizeType() != SwFrameSize::Fixed )
{
SwFlyFrame *pFly = SwIterator<SwFlyFrame,SwFormat>( rSource ).First();
if ( pFly )
aSize.SetHeight( pFly->getFrameArea().Height() );
- aSize.SetHeightSizeType( ATT_FIX_SIZE );
+ aSize.SetHeightSizeType( SwFrameSize::Fixed );
aSet.Put( aSize );
}
SetAttr( aSet, rSource );
diff --git a/sw/source/core/doc/doclay.cxx b/sw/source/core/doc/doclay.cxx
index de177655f7dd..1b0ac762b6a2 100644
--- a/sw/source/core/doc/doclay.cxx
+++ b/sw/source/core/doc/doclay.cxx
@@ -247,7 +247,7 @@ SwFlyFrameFormat* SwDoc::MakeFlySection_( const SwPosition& rAnchPos,
if( SfxItemState::SET != pFormat->GetAttrSet().GetItemState( RES_FRM_SIZE ))
{
- SwFormatFrameSize aFormatSize( ATT_VAR_SIZE, 0, DEF_FLY_WIDTH );
+ SwFormatFrameSize aFormatSize( SwFrameSize::Variable, 0, DEF_FLY_WIDTH );
const SwNoTextNode* pNoTextNode = rNode.GetNoTextNode();
if( pNoTextNode )
{
@@ -259,7 +259,7 @@ SwFlyFrameFormat* SwDoc::MakeFlySection_( const SwPosition& rAnchPos,
if( aSize.Height() )
{
aFormatSize.SetHeight( aSize.Height() );
- aFormatSize.SetHeightSizeType( ATT_FIX_SIZE );
+ aFormatSize.SetHeightSizeType( SwFrameSize::Fixed );
}
}
pFormat->SetFormatAttr( aFormatSize );
@@ -768,7 +768,7 @@ lcl_InsertLabel(SwDoc & rDoc, SwTextFormatColls *const pTextFormatCollTable,
// The new one should be changeable in its height.
std::unique_ptr<SwFormatFrameSize> aFrameSize(static_cast<SwFormatFrameSize*>(pOldFormat->GetFrameSize().Clone()));
- aFrameSize->SetHeightSizeType( ATT_MIN_SIZE );
+ aFrameSize->SetHeightSizeType( SwFrameSize::Minimum );
pNewSet->Put( std::move(aFrameSize) );
SwStartNode* pSttNd = rDoc.GetNodes().MakeTextSection(
@@ -1076,7 +1076,7 @@ lcl_InsertDrawLabel( SwDoc & rDoc, SwTextFormatColls *const pTextFormatCollTable
// The new one should be variable in its height!
Size aSz( rSdrObj.GetCurrentBoundRect().GetSize() );
- SwFormatFrameSize aFrameSize( ATT_MIN_SIZE, aSz.Width(), aSz.Height() );
+ SwFormatFrameSize aFrameSize( SwFrameSize::Minimum, aSz.Width(), aSz.Height() );
pNewSet->Put( aFrameSize );
// Apply the margin to the new Frame.
diff --git a/sw/source/core/doc/docnew.cxx b/sw/source/core/doc/docnew.cxx
index 73a39fd9f1f9..db14a1d2b681 100644
--- a/sw/source/core/doc/docnew.cxx
+++ b/sw/source/core/doc/docnew.cxx
@@ -296,7 +296,7 @@ SwDoc::SwDoc()
getIDocumentStylePoolAccess().GetPageDescFromPool( RES_POOLPAGE_STANDARD );
// Set to "Empty Page"
- mpEmptyPageFormat->SetFormatAttr( SwFormatFrameSize( ATT_FIX_SIZE ) );
+ mpEmptyPageFormat->SetFormatAttr( SwFormatFrameSize( SwFrameSize::Fixed ) );
// Set BodyFormat for columns
mpColumnContFormat->SetFormatAttr( SwFormatFillOrder( ATT_LEFT_TO_RIGHT ) );
diff --git a/sw/source/core/doc/htmltbl.cxx b/sw/source/core/doc/htmltbl.cxx
index 8e6f8ac1d446..9b5defa3b695 100644
--- a/sw/source/core/doc/htmltbl.cxx
+++ b/sw/source/core/doc/htmltbl.cxx
@@ -289,7 +289,7 @@ void SwHTMLTableLayout::SetBoxWidth( SwTableBox *pBox, sal_uInt16 nCol,
nFrameWidth += GetColumn( nCol++ )->GetRelColWidth();
// and reset
- pFrameFormat->SetFormatAttr( SwFormatFrameSize( ATT_VAR_SIZE, nFrameWidth, 0 ));
+ pFrameFormat->SetFormatAttr( SwFormatFrameSize( SwFrameSize::Variable, nFrameWidth, 0 ));
}
void SwHTMLTableLayout::GetAvail( sal_uInt16 nCol, sal_uInt16 nColSpan,
@@ -1527,7 +1527,7 @@ static void lcl_ResizeBox( const SwTableBox* pBox, SwTwips* pWidth )
SwTwips nWidth = 0;
for( const SwTableLine *pLine : pBox->GetTabLines() )
lcl_ResizeLine( pLine, &nWidth );
- pBox->GetFrameFormat()->SetFormatAttr( SwFormatFrameSize( ATT_VAR_SIZE, nWidth, 0 ));
+ pBox->GetFrameFormat()->SetFormatAttr( SwFormatFrameSize( SwFrameSize::Variable, nWidth, 0 ));
*pWidth = *pWidth + nWidth;
}
else
@@ -1636,7 +1636,7 @@ void SwHTMLTableLayout::SetWidths( bool bCallPass2, sal_uInt16 nAbsAvail,
SwFrameFormat *pFlyFrameFormat = FindFlyFrameFormat();
if( pFlyFrameFormat )
{
- SwFormatFrameSize aFlyFrameSize( ATT_VAR_SIZE, m_nRelTabWidth, MINLAY );
+ SwFormatFrameSize aFlyFrameSize( SwFrameSize::Variable, m_nRelTabWidth, MINLAY );
if( m_bUseRelWidth )
{
diff --git a/sw/source/core/doc/tblrwcl.cxx b/sw/source/core/doc/tblrwcl.cxx
index dd150db18b2a..3c701ffc52cb 100644
--- a/sw/source/core/doc/tblrwcl.cxx
+++ b/sw/source/core/doc/tblrwcl.cxx
@@ -1053,8 +1053,8 @@ bool SwTable::OldSplitRow( SwDoc* pDoc, const SwSelBoxes& rBoxes, sal_uInt16 nCn
// Respect the Line's height, reset if needed
SwFormatFrameSize aFSz( pInsLine->GetFrameFormat()->GetFrameSize() );
- if ( bSameHeight && ATT_VAR_SIZE == aFSz.GetHeightSizeType() )
- aFSz.SetHeightSizeType( ATT_MIN_SIZE );
+ if ( bSameHeight && SwFrameSize::Variable == aFSz.GetHeightSizeType() )
+ aFSz.SetHeightSizeType( SwFrameSize::Minimum );
bool bChgLineSz = 0 != aFSz.GetHeight() || bSameHeight;
if ( bChgLineSz )
@@ -1196,7 +1196,7 @@ bool SwTable::SplitCol( SwDoc* pDoc, const SwSelBoxes& rBoxes, sal_uInt16 nCnt )
aFindFrame.pNewFrameFormat = static_cast<SwTableBoxFormat*>(pSelBox->ClaimFrameFormat());
SwTwips nBoxSz = aFindFrame.pNewFrameFormat->GetFrameSize().GetWidth();
SwTwips nNewBoxSz = nBoxSz / ( nCnt + 1 );
- aFindFrame.pNewFrameFormat->SetFormatAttr( SwFormatFrameSize( ATT_VAR_SIZE,
+ aFindFrame.pNewFrameFormat->SetFormatAttr( SwFormatFrameSize( SwFrameSize::Variable,
nNewBoxSz, 0 ) );
aFrameArr.insert( aFindFrame );
@@ -1206,7 +1206,7 @@ bool SwTable::SplitCol( SwDoc* pDoc, const SwSelBoxes& rBoxes, sal_uInt16 nCnt )
// We have a remainder, so we need to define an own Format
// for the last Box.
pLastBoxFormat = new SwTableBoxFormat( *aFindFrame.pNewFrameFormat );
- pLastBoxFormat->SetFormatAttr( SwFormatFrameSize( ATT_VAR_SIZE,
+ pLastBoxFormat->SetFormatAttr( SwFormatFrameSize( SwFrameSize::Variable,
nBoxSz - ( nNewBoxSz * nCnt ), 0 ) );
}
aLastBoxArr.insert( aLastBoxArr.begin() + nFndPos, pLastBoxFormat );
@@ -1311,7 +1311,7 @@ static void lcl_CalcWidth( SwTableBox* pBox )
for( auto pTabBox : pLine->GetTabBoxes() )
nWidth += pTabBox->GetFrameFormat()->GetFrameSize().GetWidth();
- pFormat->SetFormatAttr( SwFormatFrameSize( ATT_VAR_SIZE, nWidth, 0 ));
+ pFormat->SetFormatAttr( SwFormatFrameSize( SwFrameSize::Variable, nWidth, 0 ));
// Boxes with Lines can only have Size/Fillorder
pFormat->ResetFormatAttr( RES_LR_SPACE, RES_FRMATR_END - 1 );
@@ -2931,10 +2931,10 @@ static void SetLineHeight( SwTableLine& rLine, SwTwips nOldHeight, SwTwips nNewH
nMyNewH = long(aTmp);
}
- SwFrameSize eSize = ATT_MIN_SIZE;
+ SwFrameSize eSize = SwFrameSize::Minimum;
if( !bMinSize &&
( nMyOldH - nMyNewH ) > ( CalcRowRstHeight( pLineFrame ) + ROWFUZZY ))
- eSize = ATT_FIX_SIZE;
+ eSize = SwFrameSize::Fixed;
pFormat->SetFormatAttr( SwFormatFrameSize( eSize, 0, nMyNewH ) );
diff --git a/sw/source/core/docnode/ndtbl.cxx b/sw/source/core/docnode/ndtbl.cxx
index c35ca9731936..43528cb67bcc 100644
--- a/sw/source/core/docnode/ndtbl.cxx
+++ b/sw/source/core/docnode/ndtbl.cxx
@@ -181,7 +181,7 @@ static SwTableBoxFormat *lcl_CreateDfltBoxFormat( SwDoc &rDoc, std::vector<SwTab
{
SwTableBoxFormat* pBoxFormat = rDoc.MakeTableBoxFormat();
if( USHRT_MAX != nCols )
- pBoxFormat->SetFormatAttr( SwFormatFrameSize( ATT_VAR_SIZE,
+ pBoxFormat->SetFormatAttr( SwFormatFrameSize( SwFrameSize::Variable,
USHRT_MAX / nCols, 0 ));
::lcl_SetDfltBoxAttr( *pBoxFormat, nId );
rBoxFormatArr[ nId ] = pBoxFormat;
@@ -201,7 +201,7 @@ static SwTableBoxFormat *lcl_CreateAFormatBoxFormat( SwDoc &rDoc, std::vector<Sw
SwTableAutoFormatUpdateFlags::Box,
rDoc.GetNumberFormatter( ) );
if( USHRT_MAX != nCols )
- pBoxFormat->SetFormatAttr( SwFormatFrameSize( ATT_VAR_SIZE,
+ pBoxFormat->SetFormatAttr( SwFormatFrameSize( SwFrameSize::Variable,
USHRT_MAX / nCols, 0 ));
rBoxFormatArr[ nId ] = pBoxFormat;
}
@@ -430,7 +430,7 @@ const SwTable* SwDoc::InsertTable( const SwInsertTableOptions& rInsTableOpts,
nWidth /= nCols;
nWidth *= nCols; // to avoid rounding problems
}
- pTableFormat->SetFormatAttr( SwFormatFrameSize( ATT_VAR_SIZE, nWidth ));
+ pTableFormat->SetFormatAttr( SwFormatFrameSize( SwFrameSize::Variable, nWidth ));
if( !(rInsTableOpts.mnInsMode & SwInsertTableFlags::SplitLayout) )
pTableFormat->SetFormatAttr( SwFormatLayoutSplit( false ));
@@ -467,7 +467,7 @@ const SwTable* SwDoc::InsertTable( const SwInsertTableOptions& rInsTableOpts,
if( !bDfltBorders && !pTAFormat )
{
pBoxFormat = MakeTableBoxFormat();
- pBoxFormat->SetFormatAttr( SwFormatFrameSize( ATT_VAR_SIZE, USHRT_MAX / nCols, 0 ));
+ pBoxFormat->SetFormatAttr( SwFormatFrameSize( SwFrameSize::Variable, USHRT_MAX / nCols, 0 ));
}
else
{
@@ -524,7 +524,7 @@ const SwTable* SwDoc::InsertTable( const SwInsertTableOptions& rInsTableOpts,
*pNewFormat = *pBoxF;
pBoxF = pNewFormat;
}
- pBoxF->SetFormatAttr( SwFormatFrameSize( ATT_VAR_SIZE, nWidth ));
+ pBoxF->SetFormatAttr( SwFormatFrameSize( SwFrameSize::Variable, nWidth ));
}
}
@@ -695,7 +695,7 @@ const SwTable* SwDoc::TextToTable( const SwInsertTableOptions& rInsTableOpts,
// All Lines have a left-to-right Fill Order
pLineFormat->SetFormatAttr( SwFormatFillOrder( ATT_LEFT_TO_RIGHT ));
// The Table's SSize is USHRT_MAX
- pTableFormat->SetFormatAttr( SwFormatFrameSize( ATT_VAR_SIZE, USHRT_MAX ));
+ pTableFormat->SetFormatAttr( SwFormatFrameSize( SwFrameSize::Variable, USHRT_MAX ));
if( !(rInsTableOpts.mnInsMode & SwInsertTableFlags::SplitLayout) )
pTableFormat->SetFormatAttr( SwFormatLayoutSplit( false ));
@@ -966,7 +966,7 @@ lcl_SetTableBoxWidths(SwTable & rTable, size_t const nMaxBoxes,
{
SwTableBoxFormat *pNewFormat = rDoc.MakeTableBoxFormat();
pNewFormat->SetFormatAttr(
- SwFormatFrameSize(ATT_VAR_SIZE, (*pPositions)[n] - nLastPos));
+ SwFormatFrameSize(SwFrameSize::Variable, (*pPositions)[n] - nLastPos));
for (size_t nTmpLine = 0; nTmpLine < rLns.size(); ++nTmpLine)
{
// Have to do an Add here, because the BoxFormat
@@ -980,12 +980,12 @@ lcl_SetTableBoxWidths(SwTable & rTable, size_t const nMaxBoxes,
// propagate size upwards from format, so the table gets the right size
SAL_WARN_IF(rBoxFormat.HasWriterListeners(), "sw.core",
"who is still registered in the format?");
- rBoxFormat.SetFormatAttr( SwFormatFrameSize( ATT_VAR_SIZE, nLastPos ));
+ rBoxFormat.SetFormatAttr( SwFormatFrameSize( SwFrameSize::Variable, nLastPos ));
}
else
{
size_t nWidth = nMaxBoxes ? USHRT_MAX / nMaxBoxes : USHRT_MAX;
- rBoxFormat.SetFormatAttr(SwFormatFrameSize(ATT_VAR_SIZE, nWidth));
+ rBoxFormat.SetFormatAttr(SwFormatFrameSize(SwFrameSize::Variable, nWidth));
}
}
@@ -1228,7 +1228,7 @@ const SwTable* SwDoc::TextToTable( const std::vector< std::vector<SwNodeRange> >
// All Lines have a left-to-right Fill Order
pLineFormat->SetFormatAttr( SwFormatFillOrder( ATT_LEFT_TO_RIGHT ));
// The Table's SSize is USHRT_MAX
- pTableFormat->SetFormatAttr( SwFormatFrameSize( ATT_VAR_SIZE, USHRT_MAX ));
+ pTableFormat->SetFormatAttr( SwFormatFrameSize( SwFrameSize::Variable, USHRT_MAX ));
/* If the first node in the selection is a context node and if it
has an item FRAMEDIR set (no default) propagate the item to the
@@ -1350,14 +1350,14 @@ lcl_SetTableBoxWidths2(SwTable & rTable, size_t const nMaxBoxes,
// default width for box at the end of an incomplete line
SwTableBoxFormat *const pNewFormat = rDoc.MakeTableBoxFormat();
size_t nWidth = nMaxBoxes ? USHRT_MAX / nMaxBoxes : USHRT_MAX;
- pNewFormat->SetFormatAttr( SwFormatFrameSize(ATT_VAR_SIZE,
+ pNewFormat->SetFormatAttr( SwFormatFrameSize(SwFrameSize::Variable,
nWidth * (nMissing + 1)) );
pNewFormat->Add(rBoxes.back());
}
}
size_t nWidth = nMaxBoxes ? USHRT_MAX / nMaxBoxes : USHRT_MAX;
// default width for all boxes not at the end of an incomplete line
- rBoxFormat.SetFormatAttr(SwFormatFrameSize(ATT_VAR_SIZE, nWidth));
+ rBoxFormat.SetFormatAttr(SwFormatFrameSize(SwFrameSize::Variable, nWidth));
}
SwTableNode* SwNodes::TextToTable( const SwNodes::TableRanges_t & rTableNodes,
@@ -2823,8 +2823,8 @@ void SwDoc::SetTabRows( const SwTabCols &rNew, bool bCurColOnly,
if( nNewSize != aNew.GetHeight() )
{
aNew.SetHeight( nNewSize );
- if ( ATT_VAR_SIZE == aNew.GetHeightSizeType() )
- aNew.SetHeightSizeType( ATT_MIN_SIZE );
+ if ( SwFrameSize::Variable == aNew.GetHeightSizeType() )
+ aNew.SetHeightSizeType( SwFrameSize::Minimum );
// This position must not be in an overlapped box
const SwPosition aPos(*static_cast<const SwTextFrame*>(pContent)->GetTextNodeFirst());
const SwCursor aTmpCursor( aPos, nullptr );
diff --git a/sw/source/core/docnode/ndtbl1.cxx b/sw/source/core/docnode/ndtbl1.cxx
index c8e9db3c41a8..8fe8c6d0f5c6 100644
--- a/sw/source/core/docnode/ndtbl1.cxx
+++ b/sw/source/core/docnode/ndtbl1.cxx
@@ -456,7 +456,7 @@ bool SwDoc::BalanceRowHeight( const SwCursor& rCursor, bool bTstOnly, const bool
if ( bOptimize )
nHeight = nTotalHeight / aRowArr.size();
- SwFormatFrameSize aNew( ATT_MIN_SIZE, 0, nHeight );
+ SwFormatFrameSize aNew( SwFrameSize::Minimum, 0, nHeight );
if (GetIDocumentUndoRedo().DoesUndo())
{
diff --git a/sw/source/core/frmedt/fefly1.cxx b/sw/source/core/frmedt/fefly1.cxx
index ce770a70bb4f..8137013ab109 100644
--- a/sw/source/core/frmedt/fefly1.cxx
+++ b/sw/source/core/frmedt/fefly1.cxx
@@ -1326,7 +1326,7 @@ Size SwFEShell::RequestObjectResize( const SwRect &rRect, const uno::Reference <
SwFrameFormat *pFormat = pChgFly->GetFormat();
SwFormatFrameSize aFrameSz( pFormat->GetFrameSize() );
aFrameSz.SetWidth( aNewSz.Width() );
- if( ATT_MIN_SIZE != aFrameSz.GetHeightSizeType() )
+ if( SwFrameSize::Minimum != aFrameSz.GetHeightSizeType() )
{
aNewSz.AdjustHeight(pChgFly->getFrameArea().Height() -
pFly->getFramePrintArea().Height() );
@@ -1774,7 +1774,7 @@ void SwFEShell::ReplaceSdrObj( const OUString& rGrfName, const Graphic* pGrf )
const long nWidth = rBound.Right() - rBound.Left();
const long nHeight= rBound.Bottom() - rBound.Top();
- aFrameSet.Put( SwFormatFrameSize( ATT_MIN_SIZE,
+ aFrameSet.Put( SwFormatFrameSize( SwFrameSize::Minimum,
std::max( nWidth, long(MINFLY) ),
std::max( nHeight, long(MINFLY) )));
diff --git a/sw/source/core/frmedt/feshview.cxx b/sw/source/core/frmedt/feshview.cxx
index 8f9d2af42df5..1e2e08a78c5b 100644
--- a/sw/source/core/frmedt/feshview.cxx
+++ b/sw/source/core/frmedt/feshview.cxx
@@ -1981,7 +1981,7 @@ bool SwFEShell::ImpEndCreate()
// For OBJ_NONE a fly is inserted.
const long nWidth = rBound.Right() - rBound.Left();
const long nHeight= rBound.Bottom() - rBound.Top();
- aSet.Put( SwFormatFrameSize( ATT_MIN_SIZE, std::max( nWidth, long(MINFLY) ),
+ aSet.Put( SwFormatFrameSize( SwFrameSize::Minimum, std::max( nWidth, long(MINFLY) ),
std::max( nHeight, long(MINFLY) )));
SwFormatHoriOrient aHori( nXOffset, text::HoriOrientation::NONE, text::RelOrientation::FRAME );
diff --git a/sw/source/core/frmedt/tblsel.cxx b/sw/source/core/frmedt/tblsel.cxx
index a020bb44170c..cc88ed1d8578 100644
--- a/sw/source/core/frmedt/tblsel.cxx
+++ b/sw/source/core/frmedt/tblsel.cxx
@@ -1402,7 +1402,7 @@ void GetMergeSel( const SwPaM& rPam, SwSelBoxes& rBoxes,
}
// set width of the box
- (*ppMergeBox)->GetFrameFormat()->SetFormatAttr( SwFormatFrameSize( ATT_VAR_SIZE, nWidth, 0 ));
+ (*ppMergeBox)->GetFrameFormat()->SetFormatAttr( SwFormatFrameSize( SwFrameSize::Variable, nWidth, 0 ));
if( pUndo )
pUndo->AddNewBox( (*ppMergeBox)->GetSttIdx() );
}
diff --git a/sw/source/core/layout/atrfrm.cxx b/sw/source/core/layout/atrfrm.cxx
index e214f9752a73..3ee1be7590e3 100644
--- a/sw/source/core/layout/atrfrm.cxx
+++ b/sw/source/core/layout/atrfrm.cxx
@@ -193,7 +193,7 @@ bool SwFormatFrameSize::HasMetrics() const {
SwFormatFrameSize::SwFormatFrameSize( SwFrameSize eSize, SwTwips nWidth, SwTwips nHeight )
: SvxSizeItem( RES_FRM_SIZE, {nWidth, nHeight} ),
m_eFrameHeightType( eSize ),
- m_eFrameWidthType( ATT_FIX_SIZE )
+ m_eFrameWidthType( SwFrameSize::Fixed )
{
m_nWidthPercent = m_eWidthPercentRelation = m_nHeightPercent = m_eHeightPercentRelation = 0;
}
@@ -261,7 +261,7 @@ bool SwFormatFrameSize::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
rVal <<= static_cast<sal_Int16>(GetHeightSizeType());
break;
case MID_FRMSIZE_IS_AUTO_HEIGHT:
- rVal <<= ATT_FIX_SIZE != GetHeightSizeType();
+ rVal <<= SwFrameSize::Fixed != GetHeightSizeType();
break;
case MID_FRMSIZE_WIDTH_TYPE:
rVal <<= static_cast<sal_Int16>(GetWidthSizeType());
@@ -379,7 +379,7 @@ bool SwFormatFrameSize::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
case MID_FRMSIZE_SIZE_TYPE:
{
sal_Int16 nType = 0;
- if((rVal >>= nType) && nType >= 0 && nType <= ATT_MIN_SIZE )
+ if((rVal >>= nType) && nType >= 0 && nType <= static_cast<int>(SwFrameSize::Minimum) )
{
SetHeightSizeType(static_cast<SwFrameSize>(nType));
}
@@ -390,13 +390,13 @@ bool SwFormatFrameSize::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
case MID_FRMSIZE_IS_AUTO_HEIGHT:
{
bool bSet = *o3tl::doAccess<bool>(rVal);
- SetHeightSizeType(bSet ? ATT_VAR_SIZE : ATT_FIX_SIZE);
+ SetHeightSizeType(bSet ? SwFrameSize::Variable : SwFrameSize::Fixed);
}
break;
case MID_FRMSIZE_WIDTH_TYPE:
{
sal_Int16 nType = 0;
- if((rVal >>= nType) && nType >= 0 && nType <= ATT_MIN_SIZE )
+ if((rVal >>= nType) && nType >= 0 && nType <= static_cast<int>(SwFrameSize::Minimum) )
{
SetWidthSizeType(static_cast<SwFrameSize>(nType));
}
@@ -419,8 +419,8 @@ void SwFormatFrameSize::dumpAsXml(xmlTextWriterPtr pWriter) const
aSize << GetSize();
xmlTextWriterWriteAttribute(pWriter, BAD_CAST("size"), BAD_CAST(aSize.str().c_str()));
- xmlTextWriterWriteAttribute(pWriter, BAD_CAST("eFrameHeightType"), BAD_CAST(OString::number(m_eFrameHeightType).getStr()));
- xmlTextWriterWriteAttribute(pWriter, BAD_CAST("eFrameWidthType"), BAD_CAST(OString::number(m_eFrameWidthType).getStr()));
+ xmlTextWriterWriteAttribute(pWriter, BAD_CAST("eFrameHeightType"), BAD_CAST(OString::number(static_cast<int>(m_eFrameHeightType)).getStr()));
+ xmlTextWriterWriteAttribute(pWriter, BAD_CAST("eFrameWidthType"), BAD_CAST(OString::number(static_cast<int>(m_eFrameWidthType)).getStr()));
xmlTextWriterWriteAttribute(pWriter, BAD_CAST("nWidthPercent"), BAD_CAST(OString::number(m_nWidthPercent).getStr()));
xmlTextWriterWriteAttribute(pWriter, BAD_CAST("eWidthPercentRelation"), BAD_CAST(OString::number(m_eWidthPercentRelation).getStr()));
xmlTextWriterWriteAttribute(pWriter, BAD_CAST("nHeightPercent"), BAD_CAST(OString::number(m_nHeightPercent).getStr()));
diff --git a/sw/source/core/layout/fly.cxx b/sw/source/core/layout/fly.cxx
index ee4cf8f8587a..76ef0c3f7465 100644
--- a/sw/source/core/layout/fly.cxx
+++ b/sw/source/core/layout/fly.cxx
@@ -146,13 +146,13 @@ SwFlyFrame::SwFlyFrame( SwFlyFrameFormat *pFormat, SwFrame* pSib, SwFrame *pAnch
{
SwFrameAreaDefinition::FrameAreaWriteAccess aFrm(*this);
aFrm.Width( rFrameSize.GetWidth() );
- aFrm.Height( rFrameSize.GetHeightSizeType() == ATT_VAR_SIZE ? MINFLY : rFrameSize.GetHeight() );
+ aFrm.Height( rFrameSize.GetHeightSizeType() == SwFrameSize::Variable ? MINFLY : rFrameSize.GetHeight() );
}
// Fixed or variable Height?
- if ( rFrameSize.GetHeightSizeType() == ATT_MIN_SIZE )
+ if ( rFrameSize.GetHeightSizeType() == SwFrameSize::Minimum )
m_bMinHeight = true;
- else if ( rFrameSize.GetHeightSizeType() == ATT_FIX_SIZE )
+ else if ( rFrameSize.GetHeightSizeType() == SwFrameSize::Fixed )
mbFixSize = true;
// insert columns, if necessary
@@ -559,16 +559,16 @@ bool SwFlyFrame::FrameSizeChg( const SwFormatFrameSize &rFrameSize )
{
bool bRet = false;
SwTwips nDiffHeight = getFrameArea().Height();
- if ( rFrameSize.GetHeightSizeType() == ATT_VAR_SIZE )
+ if ( rFrameSize.GetHeightSizeType() == SwFrameSize::Variable )
mbFixSize = m_bMinHeight = false;
else
{
- if ( rFrameSize.GetHeightSizeType() == ATT_FIX_SIZE )
+ if ( rFrameSize.GetHeightSizeType() == SwFrameSize::Fixed )
{
mbFixSize = true;
m_bMinHeight = false;
}
- else if ( rFrameSize.GetHeightSizeType() == ATT_MIN_SIZE )
+ else if ( rFrameSize.GetHeightSizeType() == SwFrameSize::Minimum )
{
mbFixSize = false;
m_bMinHeight = true;
@@ -1309,13 +1309,13 @@ void SwFlyFrame::Format( vcl::RenderContext* /*pRenderContext*/, const SwBorderA
OSL_ENSURE( aRelSize == CalcRel( rFrameSz ), "SwFlyFrame::Format CalcRel problem" );
SwTwips nNewSize = aRectFnSet.IsVert() ? aRelSize.Height() : aRelSize.Width();
- if ( rFrameSz.GetWidthSizeType() != ATT_FIX_SIZE )
+ if ( rFrameSz.GetWidthSizeType() != SwFrameSize::Fixed )
{
// #i9046# Autowidth for fly frames
... etc. - the rest is truncated
More information about the Libreoffice-commits
mailing list