diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-12-10 11:47:26 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-12-11 06:57:45 +0100 |
commit | 544b5bf273b501f9deeed01684ad685e4bac6b55 (patch) | |
tree | 8ed831f581feecff3123fa740ae7f5265166cfe9 | |
parent | f26621d468eb19197d76f10779d5edc7dff6022f (diff) |
convert LinkCreateType to scoped enum
Change-Id: Ia31648d2dbd6eb5d878d7dcc904d1b05b6c1619c
Reviewed-on: https://gerrit.libreoffice.org/84852
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r-- | sw/inc/section.hxx | 8 | ||||
-rw-r--r-- | sw/source/core/doc/docglbl.cxx | 2 | ||||
-rw-r--r-- | sw/source/core/docnode/ndsect.cxx | 8 | ||||
-rw-r--r-- | sw/source/core/docnode/section.cxx | 6 | ||||
-rw-r--r-- | sw/source/core/undo/unsect.cxx | 2 | ||||
-rw-r--r-- | sw/source/core/unocore/unosect.cxx | 4 |
6 files changed, 15 insertions, 15 deletions
diff --git a/sw/inc/section.hxx b/sw/inc/section.hxx index 6cb83b9962db..f911923ab41a 100644 --- a/sw/inc/section.hxx +++ b/sw/inc/section.hxx @@ -50,11 +50,11 @@ enum class SectionType { Content, FileLink = OBJECT_CLIENT_FILE }; -enum LinkCreateType +enum class LinkCreateType { - CREATE_NONE, // Do nothing. - CREATE_CONNECT, // Connect created link. - CREATE_UPDATE // Connect created link and update it. + NONE, // Do nothing. + Connect, // Connect created link. + Update // Connect created link and update it. }; class SW_DLLPUBLIC SwSectionData diff --git a/sw/source/core/doc/docglbl.cxx b/sw/source/core/doc/docglbl.cxx index 48d3854d1598..f3a4eaba8af6 100644 --- a/sw/source/core/doc/docglbl.cxx +++ b/sw/source/core/doc/docglbl.cxx @@ -475,7 +475,7 @@ bool SwDoc::SplitDoc( sal_uInt16 eDocType, const OUString& rPath, bool bOutline, } // <- #i26762# - pSectNd->GetSection().CreateLink( CREATE_CONNECT ); + pSectNd->GetSection().CreateLink( LinkCreateType::Connect ); } break; } diff --git a/sw/source/core/docnode/ndsect.cxx b/sw/source/core/docnode/ndsect.cxx index bcf91b3f1e03..33389bc09b6b 100644 --- a/sw/source/core/docnode/ndsect.cxx +++ b/sw/source/core/docnode/ndsect.cxx @@ -369,7 +369,7 @@ SwDoc::InsertSwSection(SwPaM const& rRange, SwSectionData & rNewData, if (rNewData.IsLinkType()) { - pNewSectNode->GetSection().CreateLink( bUpdate ? CREATE_UPDATE : CREATE_CONNECT ); + pNewSectNode->GetSection().CreateLink( bUpdate ? LinkCreateType::Update : LinkCreateType::Connect ); } if( bUpdateFootnote ) @@ -731,7 +731,7 @@ void SwDoc::UpdateSection( size_t const nPos, SwSectionData & rNewData, } if( bUpdate ) - pSection->CreateLink( bPreventLinkUpdate ? CREATE_CONNECT : CREATE_UPDATE ); + pSection->CreateLink( bPreventLinkUpdate ? LinkCreateType::Connect : LinkCreateType::Update ); else if( !pSection->IsLinkType() && pSection->IsConnected() ) { pSection->Disconnect(); @@ -1248,7 +1248,7 @@ SwSectionNode* SwSectionNode::MakeCopy( SwDoc* pDoc, const SwNodeIndex& rIdx ) c // Copy the Links/Server if( pNewSect->IsLinkType() ) // Add the Link - pNewSect->CreateLink( pDoc->getIDocumentLayoutAccess().GetCurrentViewShell() ? CREATE_CONNECT : CREATE_NONE ); + pNewSect->CreateLink( pDoc->getIDocumentLayoutAccess().GetCurrentViewShell() ? LinkCreateType::Connect : LinkCreateType::NONE ); // If we copy from the Undo as Server, enter it again if (m_pSection->IsServer() @@ -1330,7 +1330,7 @@ void SwSectionNode::NodesArrChgd() OSL_ENSURE( pDoc == GetDoc(), "Moving to different Documents?" ); if( m_pSection->IsLinkType() ) // Remove the Link - m_pSection->CreateLink( pDoc->getIDocumentLayoutAccess().GetCurrentViewShell() ? CREATE_CONNECT : CREATE_NONE ); + m_pSection->CreateLink( pDoc->getIDocumentLayoutAccess().GetCurrentViewShell() ? LinkCreateType::Connect : LinkCreateType::NONE ); if (m_pSection->IsServer()) pDoc->getIDocumentLinksAdministration().GetLinkManager().InsertServer( m_pSection->GetObject() ); diff --git a/sw/source/core/docnode/section.cxx b/sw/source/core/docnode/section.cxx index 56b1ee08cab5..050edf187f36 100644 --- a/sw/source/core/docnode/section.cxx +++ b/sw/source/core/docnode/section.cxx @@ -1538,14 +1538,14 @@ void SwSection::CreateLink( LinkCreateType eCreateType ) switch( eCreateType ) { - case CREATE_CONNECT: // Connect Link right away + case LinkCreateType::Connect: // Connect Link right away pLnk->Connect(); break; - case CREATE_UPDATE: // Connect Link and update + case LinkCreateType::Update: // Connect Link and update pLnk->Update(); break; - case CREATE_NONE: break; + case LinkCreateType::NONE: break; } } diff --git a/sw/source/core/undo/unsect.cxx b/sw/source/core/undo/unsect.cxx index d3c83a217975..80d4a55c4946 100644 --- a/sw/source/core/undo/unsect.cxx +++ b/sw/source/core/undo/unsect.cxx @@ -500,7 +500,7 @@ void SwUndoUpdateSection::UndoImpl(::sw::UndoRedoContext & rContext) m_pSectionData.reset(pOld); if( bUpdate ) - rNdSect.CreateLink( CREATE_UPDATE ); + rNdSect.CreateLink( LinkCreateType::Update ); else if( SectionType::Content == rNdSect.GetType() && rNdSect.IsConnected() ) { rNdSect.Disconnect(); diff --git a/sw/source/core/unocore/unosect.cxx b/sw/source/core/unocore/unosect.cxx index b19ee1462715..831f0bda3e7c 100644 --- a/sw/source/core/unocore/unosect.cxx +++ b/sw/source/core/unocore/unosect.cxx @@ -431,7 +431,7 @@ SwXTextSection::attach(const uno::Reference< text::XTextRange > & xTextRange) { if (! pRet->IsConnected()) { - pRet->CreateLink(CREATE_CONNECT); + pRet->CreateLink(LinkCreateType::Connect); } pRet->SetUpdateType( m_pImpl->m_pProps->m_bUpdateType ? SfxLinkUpdateMode::ALWAYS : SfxLinkUpdateMode::ONCALL ); @@ -510,7 +510,7 @@ lcl_UpdateLinkType(SwSection & rSection, bool const bLinkUpdateAlways) // set update type; needs an established link if (!rSection.IsConnected()) { - rSection.CreateLink(CREATE_CONNECT); + rSection.CreateLink(LinkCreateType::Connect); } rSection.SetUpdateType( bLinkUpdateAlways ? SfxLinkUpdateMode::ALWAYS : SfxLinkUpdateMode::ONCALL ); |