diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-03-17 14:15:30 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-03-20 06:52:34 +0000 |
commit | d99d143900081dd14e070c7373ba204739d80496 (patch) | |
tree | 72fb5e8523e29399d0aff96d3a6fb37dafeaabd6 /sw/source | |
parent | 8e5437ea859e78f7de2730bfa60ab6d27534f286 (diff) |
convert RndStdIds to scoped enum
Change-Id: I029ad67dfcbc40f3953adf485957efcbd97f23d0
Reviewed-on: https://gerrit.libreoffice.org/35328
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw/source')
119 files changed, 769 insertions, 769 deletions
diff --git a/sw/source/core/access/accdoc.cxx b/sw/source/core/access/accdoc.cxx index 0cd8202d849d..84e7298487f2 100644 --- a/sw/source/core/access/accdoc.cxx +++ b/sw/source/core/access/accdoc.cxx @@ -560,7 +560,7 @@ uno::Any SAL_CALL SwAccessibleDocument::getExtendedAttributes() SwFlyFrame *pFlyFrame = pCurrFrame->FindFlyFrame(); const SwFormatAnchor& rAnchor = pFlyFrame->GetFormat()->GetAnchor(); RndStdIds eAnchorId = rAnchor.GetAnchorId(); - if(eAnchorId == FLY_AS_CHAR) + if(eAnchorId == RndStdIds::FLY_AS_CHAR) { const SwFrame *pSwFrame = pFlyFrame->GetAnchorFrame(); if(pSwFrame->IsTextFrame()) @@ -584,7 +584,7 @@ uno::Any SAL_CALL SwAccessibleDocument::getExtendedAttributes() SdrObject *pObj = rMrkList.GetMark(i)->GetMarkedSdrObj(); SwFrameFormat* pFormat = static_cast<SwDrawContact*>(pObj->GetUserCall())->GetFormat(); const SwFormatAnchor& rAnchor = pFormat->GetAnchor(); - if( FLY_AS_CHAR != rAnchor.GetAnchorId() ) + if( RndStdIds::FLY_AS_CHAR != rAnchor.GetAnchorId() ) pCurrTextFrame = nullptr; } } diff --git a/sw/source/core/access/accframebase.cxx b/sw/source/core/access/accframebase.cxx index e4021791935b..396cbb0571cf 100644 --- a/sw/source/core/access/accframebase.cxx +++ b/sw/source/core/access/accframebase.cxx @@ -336,13 +336,13 @@ bool SwAccessibleFrameBase::GetSelectedState( ) sal_uLong nEndIndex = pEnd->nNode.GetIndex(); if( ( nHere >= nStartIndex ) && (nHere <= nEndIndex) ) { - if( rAnchor.GetAnchorId() == FLY_AS_CHAR ) + if( rAnchor.GetAnchorId() == RndStdIds::FLY_AS_CHAR ) { if( ((nHere == nStartIndex) && (nIndex >= pStart->nContent.GetIndex())) || (nHere > nStartIndex) ) if( ((nHere == nEndIndex) && (nIndex < pEnd->nContent.GetIndex())) || (nHere < nEndIndex) ) return true; } - else if( rAnchor.GetAnchorId() == FLY_AT_PARA ) + else if( rAnchor.GetAnchorId() == RndStdIds::FLY_AT_PARA ) { if( ((nHere > nStartIndex) || pStart->nContent.GetIndex() ==0 ) && (nHere < nEndIndex ) ) diff --git a/sw/source/core/access/accfrmobj.cxx b/sw/source/core/access/accfrmobj.cxx index 9c8d51520160..b2471797b673 100644 --- a/sw/source/core/access/accfrmobj.cxx +++ b/sw/source/core/access/accfrmobj.cxx @@ -157,7 +157,7 @@ bool SwAccessibleChild::IsBoundAsChar() const { const SwFrameFormat* pFrameFormat = ::FindFrameFormat( mpDrawObj ); bRet = pFrameFormat - && (FLY_AS_CHAR == pFrameFormat->GetAnchor().GetAnchorId()); + && (RndStdIds::FLY_AS_CHAR == pFrameFormat->GetAnchor().GetAnchorId()); } else if ( mpWindow ) { @@ -334,7 +334,7 @@ const SwFrame* SwAccessibleChild::GetParent( const bool bInPagePreview ) const const SwFlyFrame* pFly = static_cast< const SwFlyFrame *>( mpFrame ); if( pFly->IsFlyInContentFrame() ) { - // For FLY_AS_CHAR the parent is the anchor + // For RndStdIds::FLY_AS_CHAR the parent is the anchor pParent = pFly->GetAnchorFrame(); OSL_ENSURE( SwAccessibleChild( pParent ).IsAccessible( bInPagePreview ), "parent is not accessible" ); @@ -368,9 +368,9 @@ const SwFrame* SwAccessibleChild::GetParent( const bool bInPagePreview ) const { const SwFrameFormat *pFrameFormat = pContact->GetFormat(); OSL_ENSURE( pFrameFormat, "frame format is missing" ); - if( pFrameFormat && FLY_AS_CHAR == pFrameFormat->GetAnchor().GetAnchorId() ) + if( pFrameFormat && RndStdIds::FLY_AS_CHAR == pFrameFormat->GetAnchor().GetAnchorId() ) { - // For FLY_AS_CHAR the parent is the anchor + // For RndStdIds::FLY_AS_CHAR the parent is the anchor pParent = pContact->GetAnchorFrame(); OSL_ENSURE( SwAccessibleChild( pParent ).IsAccessible( bInPagePreview ), "parent is not accessible" ); diff --git a/sw/source/core/access/accmap.cxx b/sw/source/core/access/accmap.cxx index c925bac2c6fb..959652ef7484 100644 --- a/sw/source/core/access/accmap.cxx +++ b/sw/source/core/access/accmap.cxx @@ -1152,7 +1152,7 @@ void SwAccessibleMap::InvalidateShapeInParaSelection() const SwFormatAnchor& rAnchor = pFrameFormat->GetAnchor(); const SwPosition *pPos = rAnchor.GetContentAnchor(); - if(rAnchor.GetAnchorId() == FLY_AT_PAGE) + if(rAnchor.GetAnchorId() == RndStdIds::FLY_AT_PAGE) { uno::Reference < XAccessible > xAcc( (*aIter).second ); if(xAcc.is()) @@ -1189,7 +1189,7 @@ void SwAccessibleMap::InvalidateShapeInParaSelection() sal_uLong nEndIndex = pEnd->nNode.GetIndex(); if( ( nHere >= nStartIndex ) && (nHere <= nEndIndex) ) { - if( rAnchor.GetAnchorId() == FLY_AS_CHAR ) + if( rAnchor.GetAnchorId() == RndStdIds::FLY_AS_CHAR ) { if( ( ((nHere == nStartIndex) && (nIndex >= pStart->nContent.GetIndex())) || (nHere > nStartIndex) ) &&( ((nHere == nEndIndex) && (nIndex < pEnd->nContent.GetIndex())) || (nHere < nEndIndex) ) ) @@ -1205,7 +1205,7 @@ void SwAccessibleMap::InvalidateShapeInParaSelection() static_cast < ::accessibility::AccessibleShape* >(xAcc.get())->ResetState( AccessibleStateType::SELECTED ); } } - else if( rAnchor.GetAnchorId() == FLY_AT_PARA ) + else if( rAnchor.GetAnchorId() == RndStdIds::FLY_AT_PARA ) { if( ((nHere > nStartIndex) || pStart->nContent.GetIndex() ==0 ) && (nHere < nEndIndex ) ) @@ -1272,7 +1272,7 @@ void SwAccessibleMap::InvalidateShapeInParaSelection() if (pFrameFormat) { const SwFormatAnchor& rAnchor = pFrameFormat->GetAnchor(); - if( rAnchor.GetAnchorId() == FLY_AS_CHAR ) + if( rAnchor.GetAnchorId() == RndStdIds::FLY_AS_CHAR ) { uno::Reference< XAccessible > xAccParent = pAccFrame->getAccessibleParent(); if (xAccParent.is()) @@ -1543,7 +1543,7 @@ void SwAccessibleMap::DoInvalidateShapeSelection(bool bInvalidateFocusMode /*=fa if (pFrameFormat) { const SwFormatAnchor& rAnchor = pFrameFormat->GetAnchor(); - if( rAnchor.GetAnchorId() == FLY_AS_CHAR ) + if( rAnchor.GetAnchorId() == RndStdIds::FLY_AS_CHAR ) { uno::Reference< XAccessible > xPara = pAccShape->getAccessibleParent(); if (xPara.is()) diff --git a/sw/source/core/access/accselectionhelper.cxx b/sw/source/core/access/accselectionhelper.cxx index 61b25e1a7022..0781b7b04ed2 100644 --- a/sw/source/core/access/accselectionhelper.cxx +++ b/sw/source/core/access/accselectionhelper.cxx @@ -292,7 +292,7 @@ Reference<XAccessible> SwAccessibleSelectionHelper::getSelectedAccessibleChild( if (pFrameFormat) { const SwFormatAnchor& rAnchor = pFrameFormat->GetAnchor(); - if( rAnchor.GetAnchorId() == FLY_AS_CHAR ) + if( rAnchor.GetAnchorId() == RndStdIds::FLY_AS_CHAR ) { const SwFrame *pParaFrame = SwAccessibleFrame::GetParent( SwAccessibleChild(pFlyFrame), m_rContext.IsInPagePreview() ); aChild = pParaFrame; diff --git a/sw/source/core/doc/CntntIdxStore.cxx b/sw/source/core/doc/CntntIdxStore.cxx index 102d4873f202..14775d1e050a 100644 --- a/sw/source/core/doc/CntntIdxStore.cxx +++ b/sw/source/core/doc/CntntIdxStore.cxx @@ -326,13 +326,13 @@ void ContentIdxStoreImpl::SaveFlys(SwDoc* pDoc, sal_uLong nNode, sal_Int32 nCont const SwFormatAnchor& rAnchor = pFrameFormat->GetAnchor(); SwPosition const*const pAPos = rAnchor.GetContentAnchor(); if ( pAPos && ( nNode == pAPos->nNode.GetIndex() ) && - ( FLY_AT_PARA == rAnchor.GetAnchorId() || - FLY_AT_CHAR == rAnchor.GetAnchorId() ) ) + ( RndStdIds::FLY_AT_PARA == rAnchor.GetAnchorId() || + RndStdIds::FLY_AT_CHAR == rAnchor.GetAnchorId() ) ) { bool bSkip = false; aSave.m_bOther = false; aSave.m_nContent = pAPos->nContent.GetIndex(); - if ( FLY_AT_CHAR == rAnchor.GetAnchorId() ) + if ( RndStdIds::FLY_AT_CHAR == rAnchor.GetAnchorId() ) { if( nContent <= aSave.m_nContent ) { @@ -364,7 +364,7 @@ void ContentIdxStoreImpl::RestoreFlys(SwDoc* pDoc, updater_t& rUpdater, bool bAu SwFormatAnchor aNew( rFlyAnchor ); SwPosition aNewPos( *rFlyAnchor.GetContentAnchor() ); rUpdater(aNewPos, aEntry.m_nContent); - if ( FLY_AT_CHAR != rFlyAnchor.GetAnchorId() ) + if ( RndStdIds::FLY_AT_CHAR != rFlyAnchor.GetAnchorId() ) { aNewPos.nContent.Assign( nullptr, 0 ); } diff --git a/sw/source/core/doc/DocumentContentOperationsManager.cxx b/sw/source/core/doc/DocumentContentOperationsManager.cxx index a842102340cc..2e4fe3c54cac 100644 --- a/sw/source/core/doc/DocumentContentOperationsManager.cxx +++ b/sw/source/core/doc/DocumentContentOperationsManager.cxx @@ -94,10 +94,10 @@ namespace SwFormatAnchor const*const pAnchor = &pFormat->GetAnchor(); SwPosition const*const pAPos = pAnchor->GetContentAnchor(); if (pAPos && - ((FLY_AS_CHAR == pAnchor->GetAnchorId()) || - (FLY_AT_CHAR == pAnchor->GetAnchorId()) || - (FLY_AT_FLY == pAnchor->GetAnchorId()) || - (FLY_AT_PARA == pAnchor->GetAnchorId())) && + ((RndStdIds::FLY_AS_CHAR == pAnchor->GetAnchorId()) || + (RndStdIds::FLY_AT_CHAR == pAnchor->GetAnchorId()) || + (RndStdIds::FLY_AT_FLY == pAnchor->GetAnchorId()) || + (RndStdIds::FLY_AT_PARA == pAnchor->GetAnchorId())) && nSttNd <= pAPos->nNode.GetIndex() && pAPos->nNode.GetIndex() < nEndNd ) { @@ -1889,8 +1889,8 @@ bool DocumentContentOperationsManager::DelFullPara( SwPaM& rPam ) const SwFormatAnchor* pAnchor = &pFly->GetAnchor(); SwPosition const*const pAPos = pAnchor->GetContentAnchor(); if (pAPos && - ((FLY_AT_PARA == pAnchor->GetAnchorId()) || - (FLY_AT_CHAR == pAnchor->GetAnchorId())) && + ((RndStdIds::FLY_AT_PARA == pAnchor->GetAnchorId()) || + (RndStdIds::FLY_AT_CHAR == pAnchor->GetAnchorId())) && aRg.aStart <= pAPos->nNode && pAPos->nNode <= aRg.aEnd ) { m_rDoc.getIDocumentLayoutAccess().DelLayoutFormat( pFly ); @@ -2734,7 +2734,7 @@ SwDrawFrameFormat* DocumentContentOperationsManager::InsertDrawObj( // Didn't set the Anchor yet? // DrawObjecte must never end up in the Header/Footer! RndStdIds eAnchorId = pAnchor != nullptr ? pAnchor->GetAnchorId() : pFormat->GetAnchor().GetAnchorId(); - const bool bIsAtContent = (FLY_AT_PAGE != eAnchorId); + const bool bIsAtContent = (RndStdIds::FLY_AT_PAGE != eAnchorId); const SwNodeIndex* pChkIdx = nullptr; if ( pAnchor == nullptr ) @@ -2753,7 +2753,7 @@ SwDrawFrameFormat* DocumentContentOperationsManager::InsertDrawObj( && m_rDoc.IsInHeaderFooter( *pChkIdx ) ) { // apply at-page anchor format - eAnchorId = FLY_AT_PAGE; + eAnchorId = RndStdIds::FLY_AT_PAGE; pFormat->SetFormatAttr( SwFormatAnchor( eAnchorId ) ); } else if( pAnchor == nullptr @@ -2763,7 +2763,7 @@ SwDrawFrameFormat* DocumentContentOperationsManager::InsertDrawObj( // apply anchor format SwFormatAnchor aAnch( pAnchor != nullptr ? *pAnchor : pFormat->GetAnchor() ); eAnchorId = aAnch.GetAnchorId(); - if ( eAnchorId == FLY_AT_FLY ) + if ( eAnchorId == RndStdIds::FLY_AT_FLY ) { SwPosition aPos( *rRg.GetNode().FindFlyStartNode() ); aAnch.SetAnchor( &aPos ); @@ -2771,9 +2771,9 @@ SwDrawFrameFormat* DocumentContentOperationsManager::InsertDrawObj( else { aAnch.SetAnchor( rRg.GetPoint() ); - if ( eAnchorId == FLY_AT_PAGE ) + if ( eAnchorId == RndStdIds::FLY_AT_PAGE ) { - eAnchorId = dynamic_cast<const SdrUnoObj*>( &rDrawObj) != nullptr ? FLY_AS_CHAR : FLY_AT_PARA; + eAnchorId = dynamic_cast<const SdrUnoObj*>( &rDrawObj) != nullptr ? RndStdIds::FLY_AS_CHAR : RndStdIds::FLY_AT_PARA; aAnch.SetType( eAnchorId ); } } @@ -2781,7 +2781,7 @@ SwDrawFrameFormat* DocumentContentOperationsManager::InsertDrawObj( } // insert text attribute for as-character anchored drawing object - if ( eAnchorId == FLY_AS_CHAR ) + if ( eAnchorId == RndStdIds::FLY_AS_CHAR ) { bool bAnchorAtPageAsFallback = true; const SwFormatAnchor& rDrawObjAnchorFormat = pFormat->GetAnchor(); @@ -2801,7 +2801,7 @@ SwDrawFrameFormat* DocumentContentOperationsManager::InsertDrawObj( if ( bAnchorAtPageAsFallback ) { OSL_ENSURE( false, "DocumentContentOperationsManager::InsertDrawObj(..) - missing content anchor for as-character anchored drawing object --> anchor at-page" ); - pFormat->SetFormatAttr( SwFormatAnchor( FLY_AT_PAGE ) ); + pFormat->SetFormatAttr( SwFormatAnchor( RndStdIds::FLY_AT_PAGE ) ); } } @@ -3267,21 +3267,21 @@ void DocumentContentOperationsManager::CopyFlyInFlyImpl( SwFrameFormat* pFormat = (*m_rDoc.GetSpzFrameFormats())[n]; SwFormatAnchor const*const pAnchor = &pFormat->GetAnchor(); SwPosition const*const pAPos = pAnchor->GetContentAnchor(); - bool bAtContent = (pAnchor->GetAnchorId() == FLY_AT_PARA); + bool bAtContent = (pAnchor->GetAnchorId() == RndStdIds::FLY_AT_PARA); if ( !pAPos ) continue; sal_uLong nSkipAfter = pAPos->nNode.GetIndex(); sal_uLong nStart = rRg.aStart.GetIndex(); switch ( pAnchor->GetAnchorId() ) { - case FLY_AT_FLY: + case RndStdIds::FLY_AT_FLY: if(bCopyFlyAtFly) ++nSkipAfter; else if(m_rDoc.getIDocumentRedlineAccess().IsRedlineMove()) ++nStart; break; - case FLY_AT_CHAR: - case FLY_AT_PARA: + case RndStdIds::FLY_AT_CHAR: + case RndStdIds::FLY_AT_PARA: if(m_rDoc.getIDocumentRedlineAccess().IsRedlineMove()) ++nStart; break; @@ -3364,8 +3364,8 @@ void DocumentContentOperationsManager::CopyFlyInFlyImpl( // method <SwNodes::CopyNodes(..)>. // Thus, the new anchor position in the destination document is found // by counting the text nodes. - if ((aAnchor.GetAnchorId() == FLY_AT_PARA) || - (aAnchor.GetAnchorId() == FLY_AT_CHAR) ) + if ((aAnchor.GetAnchorId() == RndStdIds::FLY_AT_PARA) || + (aAnchor.GetAnchorId() == RndStdIds::FLY_AT_CHAR) ) { // First, determine number of anchor text node in the copied range. // Note: The anchor text node *have* to be inside the copied range. @@ -3429,7 +3429,7 @@ void DocumentContentOperationsManager::CopyFlyInFlyImpl( newPos.nNode = aIdx; } // Set the character bound Flys back at the original character - if ((FLY_AT_CHAR == aAnchor.GetAnchorId()) && + if ((RndStdIds::FLY_AT_CHAR == aAnchor.GetAnchorId()) && newPos.nNode.GetNode().IsTextNode() ) { newPos.nContent.Assign( newPos.nNode.GetNode().GetTextNode(), newPos.nContent.GetIndex() ); @@ -4068,7 +4068,7 @@ SwFlyFrameFormat* DocumentContentOperationsManager::InsNoTextNode( const SwPosit SwFlyFrameFormat *pFormat = nullptr; if( pNode ) { - pFormat = m_rDoc.MakeFlySection_( rPos, *pNode, FLY_AT_PARA, + pFormat = m_rDoc.MakeFlySection_( rPos, *pNode, RndStdIds::FLY_AT_PARA, pFlyAttrSet, pFrameFormat ); if( pGrfAttrSet ) pNode->SetAttr( *pGrfAttrSet ); diff --git a/sw/source/core/doc/DocumentDrawModelManager.cxx b/sw/source/core/doc/DocumentDrawModelManager.cxx index b97143d3fbe4..ec8fd87235cc 100644 --- a/sw/source/core/doc/DocumentDrawModelManager.cxx +++ b/sw/source/core/doc/DocumentDrawModelManager.cxx @@ -307,7 +307,7 @@ bool DocumentDrawModelManager::Search(const SwPaM& rPaM, const SvxSearchItem& rS // Filter for at-paragraph anchored draw frames. const SwFrameFormat& rFrameFormat = pPosFlyFrame->GetFormat(); const SwFormatAnchor& rAnchor = rFrameFormat.GetAnchor(); - if (rAnchor.GetAnchorId() != FLY_AT_PARA || rFrameFormat.Which() != RES_DRAWFRMFMT) + if (rAnchor.GetAnchorId() != RndStdIds::FLY_AT_PARA || rFrameFormat.Which() != RES_DRAWFRMFMT) continue; // Does the shape have matching text? diff --git a/sw/source/core/doc/DocumentLayoutManager.cxx b/sw/source/core/doc/DocumentLayoutManager.cxx index 08e1cff435a7..55d0192c9775 100644 --- a/sw/source/core/doc/DocumentLayoutManager.cxx +++ b/sw/source/core/doc/DocumentLayoutManager.cxx @@ -115,16 +115,16 @@ SwFrameFormat *DocumentLayoutManager::MakeLayoutFormat( RndStdIds eRequest, cons switch ( eRequest ) { - case RND_STD_HEADER: - case RND_STD_HEADERL: - case RND_STD_HEADERR: + case RndStdIds::HEADER: + case RndStdIds::HEADERL: + case RndStdIds::HEADERR: { bHeader = true; SAL_FALLTHROUGH; } - case RND_STD_FOOTER: - case RND_STD_FOOTERL: - case RND_STD_FOOTERR: + case RndStdIds::FOOTER: + case RndStdIds::FOOTERL: + case RndStdIds::FOOTERR: { pFormat = new SwFrameFormat( m_rDoc.GetAttrPool(), (bHeader ? "Right header" : "Right footer"), @@ -136,14 +136,14 @@ SwFrameFormat *DocumentLayoutManager::MakeLayoutFormat( RndStdIds eRequest, cons ( aTmpIdx, bHeader ? SwHeaderStartNode : SwFooterStartNode, m_rDoc.getIDocumentStylePoolAccess().GetTextCollFromPool(static_cast<sal_uInt16>( bHeader - ? ( eRequest == RND_STD_HEADERL + ? ( eRequest == RndStdIds::HEADERL ? RES_POOLCOLL_HEADERL - : eRequest == RND_STD_HEADERR + : eRequest == RndStdIds::HEADERR ? RES_POOLCOLL_HEADERR : RES_POOLCOLL_HEADER ) - : ( eRequest == RND_STD_FOOTERL + : ( eRequest == RndStdIds::FOOTERL ? RES_POOLCOLL_FOOTERL - : eRequest == RND_STD_FOOTERR + : eRequest == RndStdIds::FOOTERR ? RES_POOLCOLL_FOOTERR : RES_POOLCOLL_FOOTER ) ) ) ); @@ -159,7 +159,7 @@ SwFrameFormat *DocumentLayoutManager::MakeLayoutFormat( RndStdIds eRequest, cons } break; - case RND_DRAW_OBJECT: + case RndStdIds::DRAW_OBJECT: { pFormat = m_rDoc.MakeDrawFrameFormat( OUString(), m_rDoc.GetDfltFrameFormat() ); if( pSet ) // Set a few more attributes @@ -174,11 +174,11 @@ SwFrameFormat *DocumentLayoutManager::MakeLayoutFormat( RndStdIds eRequest, cons break; #if OSL_DEBUG_LEVEL > 0 - case FLY_AT_PAGE: - case FLY_AT_CHAR: - case FLY_AT_FLY: - case FLY_AT_PARA: - case FLY_AS_CHAR: + case RndStdIds::FLY_AT_PAGE: + case RndStdIds::FLY_AT_CHAR: + case RndStdIds::FLY_AT_FLY: + case RndStdIds::FLY_AT_PARA: + case RndStdIds::FLY_AS_CHAR: OSL_FAIL( "use new interface instead: SwDoc::MakeFlySection!" ); break; #endif @@ -269,7 +269,7 @@ void DocumentLayoutManager::DelLayoutFormat( SwFrameFormat *pFormat ) { SwFrameFormat* pTmpFormat = (*pTable)[i]; const SwFormatAnchor &rAnch = pTmpFormat->GetAnchor(); - if ( rAnch.GetAnchorId() == FLY_AT_FLY && + if ( rAnch.GetAnchorId() == RndStdIds::FLY_AT_FLY && rAnch.GetContentAnchor()->nNode.GetIndex() == nNodeIdxOfFlyFormat ) { aToDeleteFrameFormats.push_back( pTmpFormat ); @@ -298,7 +298,7 @@ void DocumentLayoutManager::DelLayoutFormat( SwFrameFormat *pFormat ) // Delete the character for FlyFrames anchored as char (if necessary) const SwFormatAnchor& rAnchor = pFormat->GetAnchor(); - if ((FLY_AS_CHAR == rAnchor.GetAnchorId()) && rAnchor.GetContentAnchor()) + if ((RndStdIds::FLY_AS_CHAR == rAnchor.GetAnchorId()) && rAnchor.GetContentAnchor()) { const SwPosition* pPos = rAnchor.GetContentAnchor(); SwTextNode *pTextNd = pPos->nNode.GetNode().GetTextNode(); @@ -354,7 +354,7 @@ SwFrameFormat *DocumentLayoutManager::CopyLayoutFormat( rSource.CallSwClientNotify(sw::CheckDrawFrameFormatLayerHint(&bCheckControlLayer)); bMayNotCopy = bCheckControlLayer && - ((FLY_AT_PARA == rNewAnchor.GetAnchorId()) || (FLY_AT_FLY == rNewAnchor.GetAnchorId()) || (FLY_AT_CHAR == rNewAnchor.GetAnchorId())) && + ((RndStdIds::FLY_AT_PARA == rNewAnchor.GetAnchorId()) || (RndStdIds::FLY_AT_FLY == rNewAnchor.GetAnchorId()) || (RndStdIds::FLY_AT_CHAR == rNewAnchor.GetAnchorId())) && pCAnchor && m_rDoc.IsInHeaderFooter(pCAnchor->nNode); } @@ -463,7 +463,7 @@ SwFrameFormat *DocumentLayoutManager::CopyLayoutFormat( } } - if (bSetTextFlyAtt && (FLY_AS_CHAR == rNewAnchor.GetAnchorId())) + if (bSetTextFlyAtt && (RndStdIds::FLY_AS_CHAR == rNewAnchor.GetAnchorId())) { const SwPosition* pPos = rNewAnchor.GetContentAnchor(); SwFormatFlyCnt aFormat( pDest ); @@ -478,13 +478,13 @@ SwFrameFormat *DocumentLayoutManager::CopyLayoutFormat( if (SwFrameFormat* pSourceTextBox = SwTextBoxHelper::getOtherTextBoxFormat(&rSource, RES_DRAWFRMFMT)) { SwFormatAnchor boxAnchor(rNewAnchor); - if (FLY_AS_CHAR == boxAnchor.GetAnchorId()) + if (RndStdIds::FLY_AS_CHAR == boxAnchor.GetAnchorId()) { // AS_CHAR *must not* be set on textbox fly-frame - boxAnchor.SetType(FLY_AT_CHAR); + boxAnchor.SetType(RndStdIds::FLY_AT_CHAR); } // presumably these anchors are supported though not sure - assert(FLY_AT_CHAR == boxAnchor.GetAnchorId() || FLY_AT_PARA == boxAnchor.GetAnchorId()); + assert(RndStdIds::FLY_AT_CHAR == boxAnchor.GetAnchorId() || RndStdIds::FLY_AT_PARA == boxAnchor.GetAnchorId()); SwFrameFormat* pDestTextBox = CopyLayoutFormat(*pSourceTextBox, boxAnchor, bSetTextFlyAtt, bMakeFrames); SwAttrSet aSet(pDest->GetAttrSet()); diff --git a/sw/source/core/doc/DocumentStylePoolManager.cxx b/sw/source/core/doc/DocumentStylePoolManager.cxx index 9ee0154171b0..c911c72b09b4 100644 --- a/sw/source/core/doc/DocumentStylePoolManager.cxx +++ b/sw/source/core/doc/DocumentStylePoolManager.cxx @@ -1271,13 +1271,13 @@ SwFormat* DocumentStylePoolManager::GetFormatFromPool( sal_uInt16 nId ) { if ( m_rDoc.GetDocumentSettingManager().get(DocumentSettingId::HTML_MODE) ) { - aSet.Put( SwFormatAnchor( FLY_AS_CHAR )); + aSet.Put( SwFormatAnchor( RndStdIds::FLY_AS_CHAR )); aSet.Put( SwFormatVertOrient( 0, text::VertOrientation::LINE_CENTER, text::RelOrientation::PRINT_AREA ) ); aSet.Put( SwFormatSurround( css::text::WrapTextMode_NONE ) ); } else { - aSet.Put( SwFormatAnchor( FLY_AT_PARA )); + aSet.Put( SwFormatAnchor( RndStdIds::FLY_AT_PARA )); aSet.Put( SwFormatSurround( css::text::WrapTextMode_PARALLEL ) ); aSet.Put( SwFormatHoriOrient( 0, text::HoriOrientation::CENTER, text::RelOrientation::PRINT_AREA ) ); aSet.Put( SwFormatVertOrient( 0, text::VertOrientation::TOP, text::RelOrientation::PRINT_AREA ) ); @@ -1301,7 +1301,7 @@ SwFormat* DocumentStylePoolManager::GetFormatFromPool( sal_uInt16 nId ) case RES_POOLFRM_GRAPHIC: case RES_POOLFRM_OLE: { - aSet.Put( SwFormatAnchor( FLY_AT_PARA )); + aSet.Put( SwFormatAnchor( RndStdIds::FLY_AT_PARA )); aSet.Put( SwFormatHoriOrient( 0, text::HoriOrientation::CENTER, text::RelOrientation::FRAME )); aSet.Put( SwFormatVertOrient( 0, text::VertOrientation::TOP, text::RelOrientation::FRAME )); aSet.Put( SwFormatSurround( css::text::WrapTextMode_DYNAMIC )); @@ -1309,14 +1309,14 @@ SwFormat* DocumentStylePoolManager::GetFormatFromPool( sal_uInt16 nId ) break; case RES_POOLFRM_FORMEL: { - aSet.Put( SwFormatAnchor( FLY_AS_CHAR ) ); + aSet.Put( SwFormatAnchor( RndStdIds::FLY_AS_CHAR ) ); aSet.Put( SwFormatVertOrient( 0, text::VertOrientation::CHAR_CENTER, text::RelOrientation::FRAME ) ); aSet.Put( SvxLRSpaceItem( 114, 114, 0, 0, RES_LR_SPACE ) ); } break; case RES_POOLFRM_MARGINAL: { - aSet.Put( SwFormatAnchor( FLY_AT_PARA )); + aSet.Put( SwFormatAnchor( RndStdIds::FLY_AT_PARA )); aSet.Put( SwFormatHoriOrient( 0, text::HoriOrientation::LEFT, text::RelOrientation::FRAME )); aSet.Put( SwFormatVertOrient( 0, text::VertOrientation::TOP, text::RelOrientation::FRAME )); aSet.Put( SwFormatSurround( css::text::WrapTextMode_PARALLEL )); @@ -1328,7 +1328,7 @@ SwFormat* DocumentStylePoolManager::GetFormatFromPool( sal_uInt16 nId ) break; case RES_POOLFRM_WATERSIGN: { - aSet.Put( SwFormatAnchor( FLY_AT_PAGE )); + aSet.Put( SwFormatAnchor( RndStdIds::FLY_AT_PAGE )); aSet.Put( SwFormatHoriOrient( 0, text::HoriOrientation::CENTER, text::RelOrientation::FRAME )); aSet.Put( SwFormatVertOrient( 0, text::VertOrientation::CENTER, text::RelOrientation::FRAME )); aSet.Put( SvxOpaqueItem( RES_OPAQUE, false )); @@ -1337,7 +1337,7 @@ SwFormat* DocumentStylePoolManager::GetFormatFromPool( sal_uInt16 nId ) break; case RES_POOLFRM_LABEL: { - aSet.Put( SwFormatAnchor( FLY_AS_CHAR ) ); + aSet.Put( SwFormatAnchor( RndStdIds::FLY_AS_CHAR ) ); aSet.Put( SwFormatVertOrient( 0, text::VertOrientation::TOP, text::RelOrientation::FRAME ) ); aSet.Put( SvxLRSpaceItem( 114, 114, 0, 0, RES_LR_SPACE ) ); diff --git a/sw/source/core/doc/docdesc.cxx b/sw/source/core/doc/docdesc.cxx index bbc3897392c6..52e5600fa6b7 100644 --- a/sw/source/core/doc/docdesc.cxx +++ b/sw/source/core/doc/docdesc.cxx @@ -257,7 +257,7 @@ void SwDoc::CopyMasterHeader(const SwPageDesc &rChged, const SwFormatHeader &rHe const SwFormatHeader &rFormatHead = rDescFrameFormat.GetHeader(); if ( !rFormatHead.IsActive() ) { - SwFormatHeader aHead( getIDocumentLayoutAccess().MakeLayoutFormat( RND_STD_HEADERL, nullptr ) ); + SwFormatHeader aHead( getIDocumentLayoutAccess().MakeLayoutFormat( RndStdIds::HEADERL, nullptr ) ); rDescFrameFormat.SetFormatAttr( aHead ); // take over additional attributes (margins, borders ...) ::lcl_DescSetAttr( *rHead.GetHeaderFormat(), *aHead.GetHeaderFormat(), false); @@ -330,7 +330,7 @@ void SwDoc::CopyMasterFooter(const SwPageDesc &rChged, const SwFormatFooter &rFo const SwFormatFooter &rFormatFoot = rDescFrameFormat.GetFooter(); if ( !rFormatFoot.IsActive() ) { - SwFormatFooter aFoot( getIDocumentLayoutAccess().MakeLayoutFormat( RND_STD_FOOTER, nullptr ) ); + SwFormatFooter aFoot( getIDocumentLayoutAccess().MakeLayoutFormat( RndStdIds::FOOTER, nullptr ) ); rDescFrameFormat.SetFormatAttr( aFoot ); // Take over additional attributes (margins, borders ...). ::lcl_DescSetAttr( *rFoot.GetFooterFormat(), *aFoot.GetFooterFormat(), false); diff --git a/sw/source/core/doc/docdraw.cxx b/sw/source/core/doc/docdraw.cxx index a6c66c2b232a..28be9b0d92d1 100644 --- a/sw/source/core/doc/docdraw.cxx +++ b/sw/source/core/doc/docdraw.cxx @@ -420,7 +420,7 @@ bool SwDoc::DeleteSelection( SwDrawView& rDrawView ) SwDrawContact *pC = static_cast<SwDrawContact*>(GetUserCall(pObj)); SwDrawFrameFormat *pFrameFormat = static_cast<SwDrawFrameFormat*>(pC->GetFormat()); if( pFrameFormat && - FLY_AS_CHAR == pFrameFormat->GetAnchor().GetAnchorId() ) + RndStdIds::FLY_AS_CHAR == pFrameFormat->GetAnchor().GetAnchorId() ) { rDrawView.MarkObj( pObj, rDrawView.Imp().GetPageView(), true ); --i; diff --git a/sw/source/core/doc/docedt.cxx b/sw/source/core/doc/docedt.cxx index 5f2c8d0d1d27..4782b010d8ed 100644 --- a/sw/source/core/doc/docedt.cxx +++ b/sw/source/core/doc/docedt.cxx @@ -94,8 +94,8 @@ void SaveFlyInRange( const SwNodeRange& rRg, SaveFlyArr& rArr ) SwFormatAnchor const*const pAnchor = &pFormat->GetAnchor(); SwPosition const*const pAPos = pAnchor->GetContentAnchor(); if (pAPos && - ((FLY_AT_PARA == pAnchor->GetAnchorId()) || - (FLY_AT_CHAR == pAnchor->GetAnchorId())) && + ((RndStdIds::FLY_AT_PARA == pAnchor->GetAnchorId()) || + (RndStdIds::FLY_AT_CHAR == pAnchor->GetAnchorId())) && rRg.aStart <= pAPos->nNode && pAPos->nNode < rRg.aEnd ) { SaveFly aSave( pAPos->nNode.GetIndex() - rRg.aStart.GetIndex(), @@ -137,8 +137,8 @@ void SaveFlyInRange( const SwPaM& rPam, const SwNodeIndex& rInsPos, const SwPosition* pAPos = pAnchor->GetContentAnchor(); const SwNodeIndex* pContentIdx; if (pAPos && - ((FLY_AT_PARA == pAnchor->GetAnchorId()) || - (FLY_AT_CHAR == pAnchor->GetAnchorId())) && + ((RndStdIds::FLY_AT_PARA == pAnchor->GetAnchorId()) || + (RndStdIds::FLY_AT_CHAR == pAnchor->GetAnchorId())) && // do not move if the InsPos is in the ContentArea of the Fly ( nullptr == ( pContentIdx = pFormat->GetContent().GetContentIdx() ) || !( *pContentIdx < rInsPos && @@ -194,8 +194,8 @@ void DelFlyInRange( const SwNodeIndex& rMkNdIdx, const SwFormatAnchor &rAnch = pFormat->GetAnchor(); SwPosition const*const pAPos = rAnch.GetContentAnchor(); if (pAPos && - ((rAnch.GetAnchorId() == FLY_AT_PARA) || - (rAnch.GetAnchorId() == FLY_AT_CHAR)) && + ((rAnch.GetAnchorId() == RndStdIds::FLY_AT_PARA) || + (rAnch.GetAnchorId() == RndStdIds::FLY_AT_CHAR)) && ( bDelFwrd ? rMkNdIdx < pAPos->nNode && pAPos->nNode <= rPtNdIdx : rPtNdIdx <= pAPos->nNode && pAPos->nNode < rMkNdIdx )) diff --git a/sw/source/core/doc/docfly.cxx b/sw/source/core/doc/docfly.cxx index 231c1785d518..7bf6cba8e05e 100644 --- a/sw/source/core/doc/docfly.cxx +++ b/sw/source/core/doc/docfly.cxx @@ -218,7 +218,7 @@ static Point lcl_FindAnchorLayPos( SwDoc& rDoc, const SwFormatAnchor& rAnch, if( rDoc.getIDocumentLayoutAccess().GetCurrentViewShell() ) switch( rAnch.GetAnchorId() ) { - case FLY_AS_CHAR: + case RndStdIds::FLY_AS_CHAR: if( pFlyFormat && rAnch.GetContentAnchor() ) { const SwFrame* pOld = static_cast<const SwFlyFrameFormat*>(pFlyFormat)->GetFrame( &aRet ); @@ -227,8 +227,8 @@ static Point lcl_FindAnchorLayPos( SwDoc& rDoc, const SwFormatAnchor& rAnch, } break; - case FLY_AT_PARA: - case FLY_AT_CHAR: // LAYER_IMPL + case RndStdIds::FLY_AT_PARA: + case RndStdIds::FLY_AT_CHAR: // LAYER_IMPL if( rAnch.GetContentAnchor() ) { const SwPosition *pPos = rAnch.GetContentAnchor(); @@ -239,7 +239,7 @@ static Point lcl_FindAnchorLayPos( SwDoc& rDoc, const SwFormatAnchor& rAnch, } break; - case FLY_AT_FLY: // LAYER_IMPL + case RndStdIds::FLY_AT_FLY: // LAYER_IMPL if( rAnch.GetContentAnchor() ) { const SwFlyFrameFormat* pFormat = static_cast<SwFlyFrameFormat*>(rAnch.GetContentAnchor()-> @@ -250,7 +250,7 @@ static Point lcl_FindAnchorLayPos( SwDoc& rDoc, const SwFormatAnchor& rAnch, } break; - case FLY_AT_PAGE: + case RndStdIds::FLY_AT_PAGE: { sal_uInt16 nPgNum = rAnch.GetPageNum(); const SwPageFrame *pPage = static_cast<SwPageFrame*>(rDoc.getIDocumentLayoutAccess().GetCurrentLayout()->Lower()); @@ -285,9 +285,9 @@ sal_Int8 SwDoc::SetFlyFrameAnchor( SwFrameFormat& rFormat, SfxItemSet& rSet, boo RndStdIds nNew = aNewAnch.GetAnchorId(); // Is the new anchor valid? - if( !aNewAnch.GetContentAnchor() && (FLY_AT_FLY == nNew || - (FLY_AT_PARA == nNew) || (FLY_AS_CHAR == nNew) || - (FLY_AT_CHAR == nNew) )) + if( !aNewAnch.GetContentAnchor() && (RndStdIds::FLY_AT_FLY == nNew || + (RndStdIds::FLY_AT_PARA == nNew) || (RndStdIds::FLY_AS_CHAR == nNew) || + (RndStdIds::FLY_AT_CHAR == nNew) )) { return IGNOREANCHOR; } @@ -303,7 +303,7 @@ sal_Int8 SwDoc::SetFlyFrameAnchor( SwFrameFormat& rFormat, SfxItemSet& rSet, boo // kind of a show! rFormat.DelFrames(); - if ( FLY_AS_CHAR == nOld ) + if ( RndStdIds::FLY_AS_CHAR == nOld ) { // We need to handle InContents in a special way: // The TextAttribut needs to be destroyed which, unfortunately, also @@ -334,7 +334,7 @@ sal_Int8 SwDoc::SetFlyFrameAnchor( SwFrameFormat& rFormat, SfxItemSet& rSet, boo const SfxPoolItem* pItem; switch( nNew ) { - case FLY_AS_CHAR: + case RndStdIds::FLY_AS_CHAR: // If no position attributes are received, we have to make sure // that no forbidden automatic alignment is left. { @@ -364,10 +364,10 @@ sal_Int8 SwDoc::SetFlyFrameAnchor( SwFrameFormat& rFormat, SfxItemSet& rSet, boo } break; - case FLY_AT_PARA: - case FLY_AT_CHAR: // LAYER_IMPL - case FLY_AT_FLY: // LAYER_IMPL - case FLY_AT_PAGE: + case RndStdIds::FLY_AT_PARA: + case RndStdIds::FLY_AT_CHAR: // LAYER_IMPL + case RndStdIds::FLY_AT_FLY: // LAYER_IMPL + case RndStdIds::FLY_AT_PAGE: { // If no position attributes are coming in, we correct the position in a way // such that the fly's document coordinates are preserved. @@ -381,7 +381,7 @@ sal_Int8 SwDoc::SetFlyFrameAnchor( SwFrameFormat& rFormat, SfxItemSet& rSet, boo if( text::HoriOrientation::NONE == aOldH.GetHoriOrient() && ( !pItem || aOldH.GetPos() == static_cast<const SwFormatHoriOrient*>(pItem)->GetPos() )) { - SwTwips nPos = (FLY_AS_CHAR == nOld) ? 0 : aOldH.GetPos(); + SwTwips nPos = (RndStdIds::FLY_AS_CHAR == nOld) ? 0 : aOldH.GetPos(); nPos += aOldAnchorPos.getX() - aNewAnchorPos.getX(); if( pItem ) @@ -403,7 +403,7 @@ sal_Int8 SwDoc::SetFlyFrameAnchor( SwFrameFormat& rFormat, SfxItemSet& rSet, boo if( text::VertOrientation::NONE == aOldV.GetVertOrient() && (!pItem || aOldV.GetPos() == static_cast<const SwFormatVertOrient*>(pItem)->GetPos() ) ) { - SwTwips nPos = (FLY_AS_CHAR == nOld) ? 0 : aOldV.GetPos(); + SwTwips nPos = (RndStdIds::FLY_AS_CHAR == nOld) ? 0 : aOldV.GetPos(); nPos += aOldAnchorPos.getY() - aNewAnchorPos.getY(); if( pItem ) { @@ -766,7 +766,7 @@ bool SwDoc::ChgAnchor( const SdrMarkList& _rMrkList, // anchored as character. std::unique_ptr<const SwPosition> xOldAsCharAnchorPos; const RndStdIds eOldAnchorType = pContact->GetAnchorId(); - if ( !_bSameOnly && eOldAnchorType == FLY_AS_CHAR ) + if ( !_bSameOnly && eOldAnchorType == RndStdIds::FLY_AS_CHAR ) { xOldAsCharAnchorPos.reset(new SwPosition(pContact->GetContentAnchor())); } @@ -781,8 +781,8 @@ bool SwDoc::ChgAnchor( const SdrMarkList& _rMrkList, switch ( _eAnchorType ) { - case FLY_AT_PARA: - case FLY_AT_CHAR: + case RndStdIds::FLY_AT_PARA: + case RndStdIds::FLY_AT_CHAR: { const Point aNewPoint = ( pOldAnchorFrame->IsVertical() || pOldAnchorFrame->IsRightToLeft() ) @@ -808,7 +808,7 @@ bool SwDoc::ChgAnchor( const SdrMarkList& _rMrkList, } break; - case FLY_AT_FLY: // LAYER_IMPL + case RndStdIds::FLY_AT_FLY: // LAYER_IMPL { // Search the closest SwFlyFrame starting from the upper left corner. SwFrame *pTextFrame; @@ -834,10 +834,10 @@ bool SwDoc::ChgAnchor( const SdrMarkList& _rMrkList, break; } - aNewAnch.SetType( FLY_AT_PAGE ); + aNewAnch.SetType( RndStdIds::FLY_AT_PAGE ); SAL_FALLTHROUGH; } - case FLY_AT_PAGE: + case RndStdIds::FLY_AT_PAGE: { pNewAnchorFrame = getIDocumentLayoutAccess().GetCurrentLayout()->Lower(); while ( pNewAnchorFrame && !pNewAnchorFrame->Frame().IsInside( aPt ) ) @@ -848,7 +848,7 @@ bool SwDoc::ChgAnchor( const SdrMarkList& _rMrkList, aNewAnch.SetPageNum( static_cast<const SwPageFrame*>(pNewAnchorFrame)->GetPhyPageNum()); } break; - case FLY_AS_CHAR: + case RndStdIds::FLY_AS_CHAR: if( _bSameOnly ) // Change of position/size { if( !pOldAnchorFrame ) @@ -871,7 +871,7 @@ bool SwDoc::ChgAnchor( const SdrMarkList& _rMrkList, bUnmark = ( 0 != i ); Point aPoint( aPt ); aPoint.setX(aPoint.getX() - 1); // Do not load in the DrawObj! - aNewAnch.SetType( FLY_AS_CHAR ); + aNewAnch.SetType( RndStdIds::FLY_AS_CHAR ); SwPosition aPos( *static_cast<const SwContentFrame*>(pNewAnchorFrame)->GetNode() ); if ( pNewAnchorFrame->Frame().IsInside( aPoint ) ) { @@ -905,7 +905,7 @@ bool SwDoc::ChgAnchor( const SdrMarkList& _rMrkList, OSL_ENSURE( false, "unexpected AnchorId." ); } - if ( (FLY_AS_CHAR != _eAnchorType) && + if ( (RndStdIds::FLY_AS_CHAR != _eAnchorType) && pNewAnchorFrame && ( !_bSameOnly || pNewAnchorFrame != pOldAnchorFrame ) ) { @@ -1013,8 +1013,8 @@ SwChainRet SwDoc::Chainable( const SwFrameFormat &rSource, const SwFrameFormat & const SwFormatAnchor& rAnchor = pSpzFrameFm->GetAnchor(); sal_uLong nTstSttNd; // #i20622# - to-frame anchored objects are allowed. - if ( ((rAnchor.GetAnchorId() == FLY_AT_PARA) || - (rAnchor.GetAnchorId() == FLY_AT_CHAR)) && + if ( ((rAnchor.GetAnchorId() == RndStdIds::FLY_AT_PARA) || + (rAnchor.GetAnchorId() == RndStdIds::FLY_AT_CHAR)) && nullptr != rAnchor.GetContentAnchor() && nFlySttNd <= ( nTstSttNd = rAnchor.GetContentAnchor()->nNode.GetIndex() ) && @@ -1034,9 +1034,9 @@ SwChainRet SwDoc::Chainable( const SwFrameFormat &rSource, const SwFrameFormat & &rDstAnchor = rDest.GetAnchor(); sal_uLong nEndOfExtras = GetNodes().GetEndOfExtras().GetIndex(); bool bAllowed = false; - if ( FLY_AT_PAGE == rSrcAnchor.GetAnchorId() ) + if ( RndStdIds::FLY_AT_PAGE == rSrcAnchor.GetAnchorId() ) { - if ( (FLY_AT_PAGE == rDstAnchor.GetAnchorId()) || + if ( (RndStdIds::FLY_AT_PAGE == rDstAnchor.GetAnchorId()) || ( rDstAnchor.GetContentAnchor() && rDstAnchor.GetContentAnchor()->nNode.GetIndex() > nEndOfExtras )) bAllowed = true; diff --git a/sw/source/core/doc/docglbl.cxx b/sw/source/core/doc/docglbl.cxx index 4facb1feac1f..f4b0afb0d8da 100644 --- a/sw/source/core/doc/docglbl.cxx +++ b/sw/source/core/doc/docglbl.cxx @@ -379,8 +379,8 @@ bool SwDoc::SplitDoc( sal_uInt16 eDocType, const OUString& rPath, bool bOutline, SwPosition const*const pAPos = pAnchor->GetContentAnchor(); if (pAPos && - ((FLY_AT_PARA == pAnchor->GetAnchorId()) || - (FLY_AT_CHAR == pAnchor->GetAnchorId())) && + ((RndStdIds::FLY_AT_PARA == pAnchor->GetAnchorId()) || + (RndStdIds::FLY_AT_CHAR == pAnchor->GetAnchorId())) && aSIdx <= pAPos->nNode && pAPos->nNode < aEIdx ) { diff --git a/sw/source/core/doc/doclay.cxx b/sw/source/core/doc/doclay.cxx index 7a59d8ca5391..0685cf164a9f 100644 --- a/sw/source/core/doc/doclay.cxx +++ b/sw/source/core/doc/doclay.cxx @@ -206,19 +206,19 @@ SwFlyFrameFormat* SwDoc::MakeFlySection_( const SwPosition& rAnchPos, // #i107811# Assure that at-page anchored fly frames have a page num or a // content anchor set. if ( !pAnchor || - ( FLY_AT_PAGE != pAnchor->GetAnchorId() && + ( RndStdIds::FLY_AT_PAGE != pAnchor->GetAnchorId() && !pAnchor->GetContentAnchor() ) || - ( FLY_AT_PAGE == pAnchor->GetAnchorId() && + ( RndStdIds::FLY_AT_PAGE == pAnchor->GetAnchorId() && !pAnchor->GetContentAnchor() && pAnchor->GetPageNum() == 0 ) ) { // set it again, needed for Undo SwFormatAnchor aAnch( pFormat->GetAnchor() ); - if (pAnchor && (FLY_AT_FLY == pAnchor->GetAnchorId())) + if (pAnchor && (RndStdIds::FLY_AT_FLY == pAnchor->GetAnchorId())) { SwPosition aPos( *rAnchPos.nNode.GetNode().FindFlyStartNode() ); aAnch.SetAnchor( &aPos ); - eAnchorId = FLY_AT_FLY; + eAnchorId = RndStdIds::FLY_AT_FLY; } else { @@ -229,7 +229,7 @@ SwFlyFrameFormat* SwDoc::MakeFlySection_( const SwPosition& rAnchPos, } eAnchorId = aAnch.GetAnchorId(); - if ( FLY_AT_PAGE != eAnchorId || !pAnchor || aAnch.GetPageNum() == 0) + if ( RndStdIds::FLY_AT_PAGE != eAnchorId || !pAnchor || aAnch.GetPageNum() == 0) { aAnch.SetAnchor( &rAnchPos ); } @@ -239,7 +239,7 @@ SwFlyFrameFormat* SwDoc::MakeFlySection_( const SwPosition& rAnchPos, else eAnchorId = pFormat->GetAnchor().GetAnchorId(); - if ( FLY_AS_CHAR == eAnchorId ) + if ( RndStdIds::FLY_AS_CHAR == eAnchorId ) { const sal_Int32 nStt = rAnchPos.nContent.GetIndex(); SwTextNode * pTextNode = rAnchPos.nNode.GetNode().GetTextNode(); @@ -299,7 +299,7 @@ SwFlyFrameFormat* SwDoc::MakeFlySection( RndStdIds eAnchorType, SwFrameFormat* pFrameFormat, bool bCalledFromShell ) { SwFlyFrameFormat* pFormat = nullptr; - if ( !pAnchorPos && (FLY_AT_PAGE != eAnchorType) ) + if ( !pAnchorPos && (RndStdIds::FLY_AT_PAGE != eAnchorType) ) { const SwFormatAnchor* pAnch; if( (pFlySet && SfxItemState::SET == pFlySet->GetItemState( @@ -307,7 +307,7 @@ SwFlyFrameFormat* SwDoc::MakeFlySection( RndStdIds eAnchorType, ( pFrameFormat && SfxItemState::SET == pFrameFormat->GetItemState( RES_ANCHOR, true, reinterpret_cast<const SfxPoolItem**>(&pAnch) )) ) { - if ( (FLY_AT_PAGE != pAnch->GetAnchorId()) ) + if ( (RndStdIds::FLY_AT_PAGE != pAnch->GetAnchorId()) ) { pAnchorPos = pAnch->GetContentAnchor(); } @@ -481,7 +481,7 @@ static bool lcl_TstFlyRange( const SwPaM* pPam, const SwPosition* pFlyPos, const SwPosition* pPaMEnd = pTmp->End(); const sal_uInt32 nPamStartIndex = pPaMStart->nNode.GetIndex(); const sal_uInt32 nPamEndIndex = pPaMEnd->nNode.GetIndex(); - if (FLY_AT_PARA == nAnchorId) + if (RndStdIds::FLY_AT_PARA == nAnchorId) bOk = (nPamStartIndex < nFlyIndex && nPamEndIndex > nFlyIndex) || (((nPamStartIndex == nFlyIndex) && (pPaMStart->nContent.GetIndex() == 0)) && (nPamEndIndex > nFlyIndex)); @@ -519,10 +519,10 @@ SwPosFlyFrames SwDoc::GetAllFlyFormats( const SwPaM* pCmpRange, bool bDrawAlso, const SwFormatAnchor& rAnchor = pFly->GetAnchor(); SwPosition const*const pAPos = rAnchor.GetContentAnchor(); if (pAPos && - ((FLY_AT_PARA == rAnchor.GetAnchorId()) || - (FLY_AT_FLY == rAnchor.GetAnchorId()) || - (FLY_AT_CHAR == rAnchor.GetAnchorId()) || - ((FLY_AS_CHAR == rAnchor.GetAnchorId()) && bAsCharAlso))) + ((RndStdIds::FLY_AT_PARA == rAnchor.GetAnchorId()) || + (RndStdIds::FLY_AT_FLY == rAnchor.GetAnchorId()) || + (RndStdIds::FLY_AT_CHAR == rAnchor.GetAnchorId()) || + ((RndStdIds::FLY_AS_CHAR == rAnchor.GetAnchorId()) && bAsCharAlso))) { if( pCmpRange && !lcl_TstFlyRange( pCmpRange, pAPos, rAnchor.GetAnchorId() )) @@ -556,9 +556,9 @@ SwPosFlyFrames SwDoc::GetAllFlyFormats( const SwPaM* pCmpRange, bool bDrawAlso, continue; const SwFormatAnchor& rAnchor = pFly->GetAnchor(); - if ((FLY_AT_PARA != rAnchor.GetAnchorId()) && - (FLY_AT_FLY != rAnchor.GetAnchorId()) && - (FLY_AT_CHAR != rAnchor.GetAnchorId())) + if ((RndStdIds::FLY_AT_PARA != rAnchor.GetAnchorId()) && + (RndStdIds::FLY_AT_FLY != rAnchor.GetAnchorId()) && + (RndStdIds::FLY_AT_CHAR != rAnchor.GetAnchorId())) { const SwContentFrame * pContentFrame = pPage->FindFirstBodyContent(); if ( !pContentFrame ) @@ -791,7 +791,7 @@ lcl_InsertLabel(SwDoc & rDoc, SwTextFormatColls *const pTextFormatCollTable, // To avoid this, we disconnect the attribute from the Format. const SwFormatAnchor& rAnchor = pNewFormat->GetAnchor(); - if ( FLY_AS_CHAR == rAnchor.GetAnchorId() ) + if ( RndStdIds::FLY_AS_CHAR == rAnchor.GetAnchorId() ) { const SwPosition *pPos = rAnchor.GetContentAnchor(); SwTextNode *pTextNode = pPos->nNode.GetNode().GetTextNode(); @@ -849,7 +849,7 @@ lcl_InsertLabel(SwDoc & rDoc, SwTextFormatColls *const pTextFormatCollTable, pNewSet->Put( SvxULSpaceItem(RES_UL_SPACE) ); // The old one is paragraph-bound to the paragraph in the new one. - SwFormatAnchor aAnch( FLY_AT_PARA ); + SwFormatAnchor aAnch( RndStdIds::FLY_AT_PARA ); SwNodeIndex aAnchIdx( *pNewFormat->GetContent().GetContentIdx(), 1 ); pNew = aAnchIdx.GetNode().GetTextNode(); SwPosition aPos( aAnchIdx ); @@ -1108,7 +1108,7 @@ lcl_InsertDrawLabel( SwDoc & rDoc, SwTextFormatColls *const pTextFormatCollTable pNewFormat->SetFormatAttr( *pNewSet ); const SwFormatAnchor& rAnchor = pNewFormat->GetAnchor(); - if ( FLY_AS_CHAR == rAnchor.GetAnchorId() ) + if ( RndStdIds::FLY_AS_CHAR == rAnchor.GetAnchorId() ) { const SwPosition *pPos = rAnchor.GetContentAnchor(); SwTextNode *pTextNode = pPos->nNode.GetNode().GetTextNode(); @@ -1149,7 +1149,7 @@ lcl_InsertDrawLabel( SwDoc & rDoc, SwTextFormatColls *const pTextFormatCollTable pNewSet->Put( SwFormatHoriOrient( 0, text::HoriOrientation::CENTER, text::RelOrientation::FRAME ) ); // The old one is paragraph-bound to the new one's paragraph. - SwFormatAnchor aAnch( FLY_AT_PARA ); + SwFormatAnchor aAnch( RndStdIds::FLY_AT_PARA ); SwNodeIndex aAnchIdx( *pNewFormat->GetContent().GetContentIdx(), 1 ); pNew = aAnchIdx.GetNode().GetTextNode(); SwPosition aPos( aAnchIdx ); @@ -1467,7 +1467,7 @@ void SwDoc::SetAllUniqueFlyNames() if ( !bContainsAtPageObjWithContentAnchor ) { const SwFormatAnchor& rAnchor = pFlyFormat->GetAnchor(); - if ( (FLY_AT_PAGE == rAnchor.GetAnchorId()) && + if ( (RndStdIds::FLY_AT_PAGE == rAnchor.GetAnchorId()) && rAnchor.GetContentAnchor() ) { bContainsAtPageObjWithContentAnchor = true; @@ -1553,7 +1553,7 @@ bool SwDoc::IsInHeaderFooter( const SwNodeIndex& rIdx ) const checkFormats.erase( checkPos ); #endif const SwFormatAnchor& rAnchor = pFormat->GetAnchor(); - if ((FLY_AT_PAGE == rAnchor.GetAnchorId()) || + if ((RndStdIds::FLY_AT_PAGE == rAnchor.GetAnchorId()) || !rAnchor.GetContentAnchor() ) { return false; @@ -1602,7 +1602,7 @@ SvxFrameDirection SwDoc::GetTextDirection( const SwPosition& rPos, { pItem = nullptr; const SwFormatAnchor* pAnchor = &pFlyFormat->GetAnchor(); - if ((FLY_AT_PAGE != pAnchor->GetAnchorId()) && + if ((RndStdIds::FLY_AT_PAGE != pAnchor->GetAnchorId()) && pAnchor->GetContentAnchor()) { pFlyFormat = pAnchor->GetContentAnchor()->nNode. diff --git a/sw/source/core/doc/docnew.cxx b/sw/source/core/doc/docnew.cxx index 2679bd708879..d579215bcfee 100644 --- a/sw/source/core/doc/docnew.cxx +++ b/sw/source/core/doc/docnew.cxx @@ -1225,7 +1225,7 @@ else { const SwFrameFormat& rCpyFormat = *pCpyFormat; SwFormatAnchor aAnchor( rCpyFormat.GetAnchor() ); - if (FLY_AT_PAGE != aAnchor.GetAnchorId()) + if (RndStdIds::FLY_AT_PAGE != aAnchor.GetAnchorId()) continue; SAL_INFO( "sw.docappend", "PaAn: " << aAnchor.GetPageNum() << " => " << aAnchor.GetPageNum() + pageOffset ); diff --git a/sw/source/core/doc/docsort.cxx b/sw/source/core/doc/docsort.cxx index c1e47b041d59..f3e1095f8333 100644 --- a/sw/source/core/doc/docsort.cxx +++ b/sw/source/core/doc/docsort.cxx @@ -304,7 +304,7 @@ bool SwDoc::SortText(const SwPaM& rPaM, const SwSortOptions& rOpt) SwFormatAnchor const*const pAnchor = &pFormat->GetAnchor(); SwPosition const*const pAPos = pAnchor->GetContentAnchor(); - if (pAPos && (FLY_AT_PARA == pAnchor->GetAnchorId()) && + if (pAPos && (RndStdIds::FLY_AT_PARA == pAnchor->GetAnchorId()) && pStart->nNode <= pAPos->nNode && pAPos->nNode <= pEnd->nNode ) return false; } diff --git a/sw/source/core/doc/tblcpy.cxx b/sw/source/core/doc/tblcpy.cxx index 1addcf3c5ca3..fb1eb20955f8 100644 --- a/sw/source/core/doc/tblcpy.cxx +++ b/sw/source/core/doc/tblcpy.cxx @@ -561,8 +561,8 @@ static void lcl_CpyBox( const SwTable& rCpyTable, const SwTableBox* pCpyBox, SwFormatAnchor const*const pAnchor = &pFly->GetAnchor(); SwPosition const*const pAPos = pAnchor->GetContentAnchor(); if (pAPos && - ((FLY_AT_PARA == pAnchor->GetAnchorId()) || - (FLY_AT_CHAR == pAnchor->GetAnchorId())) && + ((RndStdIds::FLY_AT_PARA == pAnchor->GetAnchorId()) || + (RndStdIds::FLY_AT_CHAR == pAnchor->GetAnchorId())) && aInsIdx <= pAPos->nNode && pAPos->nNode <= aEndNdIdx ) { pDoc->getIDocumentLayoutAccess().DelLayoutFormat( pFly ); diff --git a/sw/source/core/docnode/ndtbl.cxx b/sw/source/core/docnode/ndtbl.cxx index 5a3abcb11420..e81e481cacba 100644 --- a/sw/source/core/docnode/ndtbl.cxx +++ b/sw/source/core/docnode/ndtbl.cxx @@ -1689,8 +1689,8 @@ bool SwNodes::TableToText( const SwNodeRange& rRange, sal_Unicode cCh, const SwFormatAnchor& rAnchor = pFormat->GetAnchor(); SwPosition const*const pAPos = rAnchor.GetContentAnchor(); if (pAPos && - ((FLY_AT_PARA == rAnchor.GetAnchorId()) || - (FLY_AT_CHAR == rAnchor.GetAnchorId())) && + ((RndStdIds::FLY_AT_PARA == rAnchor.GetAnchorId()) || + (RndStdIds::FLY_AT_CHAR == rAnchor.GetAnchorId())) && nStt <= pAPos->nNode.GetIndex() && pAPos->nNode.GetIndex() < nEnd ) { diff --git a/sw/source/core/docnode/node.cxx b/sw/source/core/docnode/node.cxx index 4962f734223c..96ec1e018fcd 100644 --- a/sw/source/core/docnode/node.cxx +++ b/sw/source/core/docnode/node.cxx @@ -528,7 +528,7 @@ const SwPageDesc* SwNode::FindPageDesc( size_t* pPgDescNdIdx ) const if( pFormat ) { const SwFormatAnchor* pAnchor = &pFormat->GetAnchor(); - if ((FLY_AT_PAGE != pAnchor->GetAnchorId()) && + if ((RndStdIds::FLY_AT_PAGE != pAnchor->GetAnchorId()) && pAnchor->GetContentAnchor() ) { pNd = &pAnchor->GetContentAnchor()->nNode.GetNode(); @@ -551,7 +551,7 @@ const SwPageDesc* SwNode::FindPageDesc( size_t* pPgDescNdIdx ) const break; } pAnchor = &pFrameFormat->GetAnchor(); - if ((FLY_AT_PAGE == pAnchor->GetAnchorId()) || + if ((RndStdIds::FLY_AT_PAGE == pAnchor->GetAnchorId()) || !pAnchor->GetContentAnchor() ) { pFlyNd = nullptr; diff --git a/sw/source/core/docnode/nodes.cxx b/sw/source/core/docnode/nodes.cxx index ccc50ee39f72..fd5edbf0bfaa 100644 --- a/sw/source/core/docnode/nodes.cxx +++ b/sw/source/core/docnode/nodes.cxx @@ -2227,7 +2227,7 @@ void SwNodes::RemoveNode( sal_uLong nDelPos, sal_uLong nSz, bool bDel ) if (pTextNd) { pTextNd->RemoveFromList(); - // remove FLY_AS_CHAR *before* adjusting SwNodeIndex + // remove RndStdIds::FLY_AS_CHAR *before* adjusting SwNodeIndex // so their anchor still points to correct node when deleted! // NOTE: this will call RemoveNode() recursively! // so adjust our indexes to account for removed nodes diff --git a/sw/source/core/docnode/swbaslnk.cxx b/sw/source/core/docnode/swbaslnk.cxx index 4fbd3b7a5137..cc86094b1808 100644 --- a/sw/source/core/docnode/swbaslnk.cxx +++ b/sw/source/core/docnode/swbaslnk.cxx @@ -439,10 +439,10 @@ const SwNode* SwBaseLink::GetAnchor() const const SwFormatAnchor& rAnchor = pFormat->GetAnchor(); SwPosition const*const pAPos = rAnchor.GetContentAnchor(); if (pAPos && - ((FLY_AS_CHAR == rAnchor.GetAnchorId()) || - (FLY_AT_CHAR == rAnchor.GetAnchorId()) || - (FLY_AT_FLY == rAnchor.GetAnchorId()) || - (FLY_AT_PARA == rAnchor.GetAnchorId()))) + ((RndStdIds::FLY_AS_CHAR == rAnchor.GetAnchorId()) || + (RndStdIds::FLY_AT_CHAR == rAnchor.GetAnchorId()) || + (RndStdIds::FLY_AT_FLY == rAnchor.GetAnchorId()) || + (RndStdIds::FLY_AT_PARA == rAnchor.GetAnchorId()))) { return &pAPos->nNode.GetNode(); } diff --git a/sw/source/core/draw/dcontact.cxx b/sw/source/core/draw/dcontact.cxx index e2e67a0de425..291ae1a58e5e 100644 --- a/sw/source/core/draw/dcontact.cxx +++ b/sw/source/core/draw/dcontact.cxx @@ -1751,7 +1751,7 @@ void SwDrawContact::ConnectToLayout( const SwFormatAnchor* pAnch ) switch ( pAnch->GetAnchorId() ) { - case FLY_AT_PAGE: + case RndStdIds::FLY_AT_PAGE: { sal_uInt16 nPgNum = pAnch->GetPageNum(); SwViewShell *pShell = pDrawFrameFormat->getIDocumentLayoutAccess().GetCurrentViewShell(); @@ -1775,12 +1775,12 @@ void SwDrawContact::ConnectToLayout( const SwFormatAnchor* pAnch ) } break; - case FLY_AT_CHAR: - case FLY_AT_PARA: - case FLY_AT_FLY: - case FLY_AS_CHAR: + case RndStdIds::FLY_AT_CHAR: + case RndStdIds::FLY_AT_PARA: + case RndStdIds::FLY_AT_FLY: + case RndStdIds::FLY_AS_CHAR: { - if ( pAnch->GetAnchorId() == FLY_AS_CHAR ) + if ( pAnch->GetAnchorId() == RndStdIds::FLY_AS_CHAR ) { ClrContourCache( GetMaster() ); } @@ -1792,7 +1792,7 @@ void SwDrawContact::ConnectToLayout( const SwFormatAnchor* pAnch ) SwModify *pModify = nullptr; if( pAnch->GetContentAnchor() ) { - if ( pAnch->GetAnchorId() == FLY_AT_FLY ) + if ( pAnch->GetAnchorId() == RndStdIds::FLY_AT_FLY ) { SwNodeIndex aIdx( pAnch->GetContentAnchor()->nNode ); SwContentNode* pCNd = pDrawFrameFormat->GetDoc()->GetNodes().GoNext( &aIdx ); @@ -1844,14 +1844,14 @@ void SwDrawContact::ConnectToLayout( const SwFormatAnchor* pAnch ) if( bAdd ) { - if ( FLY_AT_FLY == pAnch->GetAnchorId() && !pFrame->IsFlyFrame() ) + if ( RndStdIds::FLY_AT_FLY == pAnch->GetAnchorId() && !pFrame->IsFlyFrame() ) { pFrame = pFrame->FindFlyFrame(); assert(pFrame); } // find correct follow for as character anchored objects - if ((pAnch->GetAnchorId() == FLY_AS_CHAR) && + if ((pAnch->GetAnchorId() == RndStdIds::FLY_AS_CHAR) && pFrame->IsTextFrame() ) { pFrame = lcl_GetFlyInContentAnchor( @@ -1869,7 +1869,7 @@ void SwDrawContact::ConnectToLayout( const SwFormatAnchor* pAnch ) { // append 'virtual' drawing object SwDrawVirtObj* pDrawVirtObj = AddVirtObj(); - if ( pAnch->GetAnchorId() == FLY_AS_CHAR ) + if ( pAnch->GetAnchorId() == RndStdIds::FLY_AS_CHAR ) { ClrContourCache( pDrawVirtObj ); } @@ -1878,7 +1878,7 @@ void SwDrawContact::ConnectToLayout( const SwFormatAnchor* pAnch ) pDrawVirtObj->ActionChanged(); } - if ( pAnch->GetAnchorId() == FLY_AS_CHAR ) + if ( pAnch->GetAnchorId() == RndStdIds::FLY_AS_CHAR ) { pFrame->InvalidatePrt(); } diff --git a/sw/source/core/draw/dview.cxx b/sw/source/core/draw/dview.cxx index 9e95c18c6464..7ef966ca04b3 100644 --- a/sw/source/core/draw/dview.cxx +++ b/sw/source/core/draw/dview.cxx @@ -218,7 +218,7 @@ void SwDrawView::AddCustomHdl() } const SwFormatAnchor &rAnchor = pFrameFormat->GetAnchor(); - if (FLY_AS_CHAR == rAnchor.GetAnchorId()) + if (RndStdIds::FLY_AS_CHAR == rAnchor.GetAnchorId()) return; const SwFrame* pAnch; @@ -227,7 +227,7 @@ void SwDrawView::AddCustomHdl() Point aPos(aAnchorPoint); - if ( FLY_AT_CHAR == rAnchor.GetAnchorId() ) + if ( RndStdIds::FLY_AT_CHAR == rAnchor.GetAnchorId() ) { // #i28701# - use last character rectangle saved at object // in order to avoid a format of the anchor frame @@ -843,7 +843,7 @@ void SwDrawView::CheckPossibilities() // #i972: protect position if it is a Math object anchored 'as char' and baseline alignment is activated SwDoc* pDoc = Imp().GetShell()->GetDoc(); const bool bProtectMathPos = SotExchange::IsMath( xObj->getClassID() ) - && FLY_AS_CHAR == pFly->GetFormat()->GetAnchor().GetAnchorId() + && RndStdIds::FLY_AS_CHAR == pFly->GetFormat()->GetAnchor().GetAnchorId() && pDoc->GetDocumentSettingManager().get( DocumentSettingId::MATH_BASELINE_ALIGNMENT ); if (bProtectMathPos) bMoveProtect = true; @@ -867,7 +867,7 @@ void SwDrawView::CheckPossibilities() OSL_FAIL( "<SwDrawView::CheckPossibilities()> - missing frame format" ); bProtect = true; } - else if ((FLY_AS_CHAR == pFrameFormat->GetAnchor().GetAnchorId()) && + else if ((RndStdIds::FLY_AS_CHAR == pFrameFormat->GetAnchor().GetAnchorId()) && rMrkList.GetMarkCount() > 1 ) { bProtect = true; diff --git a/sw/source/core/edit/autofmt.cxx b/sw/source/core/edit/autofmt.cxx index 9a094f7dacce..cfc87bffeec7 100644 --- a/sw/source/core/edit/autofmt.cxx +++ b/sw/source/core/edit/autofmt.cxx @@ -353,7 +353,7 @@ bool SwAutoFormat::HasObjects( const SwNode& rNd ) for( auto pFrameFormat : rFormats ) { const SwFormatAnchor& rAnchor = pFrameFormat->GetAnchor(); - if ((FLY_AT_PAGE != rAnchor.GetAnchorId()) && + if ((RndStdIds::FLY_AT_PAGE != rAnchor.GetAnchorId()) && rAnchor.GetContentAnchor() && &rAnchor.GetContentAnchor()->nNode.GetNode() == &rNd ) { diff --git a/sw/source/core/fields/expfld.cxx b/sw/source/core/fields/expfld.cxx index 2e10443c0aa9..8bdac6feb728 100644 --- a/sw/source/core/fields/expfld.cxx +++ b/sw/source/core/fields/expfld.cxx @@ -179,20 +179,20 @@ const SwTextNode* GetBodyTextNode( const SwDoc& rDoc, SwPosition& rPos, const SwFormatAnchor &rAnchor = pFlyFormat->GetAnchor(); - if( FLY_AT_FLY == rAnchor.GetAnchorId() ) + if( RndStdIds::FLY_AT_FLY == rAnchor.GetAnchorId() ) { // the fly needs to be attached somewhere, so ask it pLayout = static_cast<const SwLayoutFrame*>(static_cast<const SwFlyFrame*>(pLayout)->GetAnchorFrame()); continue; } - else if ((FLY_AT_PARA == rAnchor.GetAnchorId()) || - (FLY_AT_CHAR == rAnchor.GetAnchorId()) || - (FLY_AS_CHAR == rAnchor.GetAnchorId())) + else if ((RndStdIds::FLY_AT_PARA == rAnchor.GetAnchorId()) || + (RndStdIds::FLY_AT_CHAR == rAnchor.GetAnchorId()) || + (RndStdIds::FLY_AS_CHAR == rAnchor.GetAnchorId())) { OSL_ENSURE( rAnchor.GetContentAnchor(), "no valid position" ); rPos = *rAnchor.GetContentAnchor(); pTextNode = rPos.nNode.GetNode().GetTextNode(); - if ( FLY_AT_PARA == rAnchor.GetAnchorId() ) + if ( RndStdIds::FLY_AT_PARA == rAnchor.GetAnchorId() ) { const_cast<SwTextNode*>(pTextNode)->MakeStartIndex( &rPos.nContent ); diff --git a/sw/source/core/frmedt/fecopy.cxx b/sw/source/core/frmedt/fecopy.cxx index d62e5cea4300..bd4f5e6b1ee0 100644 --- a/sw/source/core/frmedt/fecopy.cxx +++ b/sw/source/core/frmedt/fecopy.cxx @@ -108,8 +108,8 @@ bool SwFEShell::Copy( SwDoc* pClpDoc, const OUString* pNewClpText ) SwFormatAnchor const*const pAnchor = &pFly->GetAnchor(); SwPosition const*const pAPos = pAnchor->GetContentAnchor(); if (pAPos && - ((FLY_AT_PARA == pAnchor->GetAnchorId()) || - (FLY_AT_CHAR == pAnchor->GetAnchorId())) && + ((RndStdIds::FLY_AT_PARA == pAnchor->GetAnchorId()) || + (RndStdIds::FLY_AT_CHAR == pAnchor->GetAnchorId())) && aSttIdx <= pAPos->nNode && pAPos->nNode <= aEndNdIdx ) { pClpDoc->getIDocumentLayoutAccess().DelLayoutFormat( pFly ); @@ -139,13 +139,13 @@ bool SwFEShell::Copy( SwDoc* pClpDoc, const OUString* pNewClpText ) SwFrameFormat* pFlyFormat = pFly->GetFormat(); SwFormatAnchor aAnchor( pFlyFormat->GetAnchor() ); - if ((FLY_AT_PARA == aAnchor.GetAnchorId()) || - (FLY_AT_CHAR == aAnchor.GetAnchorId()) || - (FLY_AT_FLY == aAnchor.GetAnchorId()) || - (FLY_AS_CHAR == aAnchor.GetAnchorId())) + if ((RndStdIds::FLY_AT_PARA == aAnchor.GetAnchorId()) || + (RndStdIds::FLY_AT_CHAR == aAnchor.GetAnchorId()) || + (RndStdIds::FLY_AT_FLY == aAnchor.GetAnchorId()) || + (RndStdIds::FLY_AS_CHAR == aAnchor.GetAnchorId())) { SwPosition aPos( aSttIdx ); - if ( FLY_AS_CHAR == aAnchor.GetAnchorId() ) + if ( RndStdIds::FLY_AS_CHAR == aAnchor.GetAnchorId() ) { aPos.nContent.Assign( pTextNd, 0 ); } @@ -165,7 +165,7 @@ bool SwFEShell::Copy( SwDoc* pClpDoc, const OUString* pNewClpText ) assert( !inserted && "Fly not contained in Spz-Array" ); } - if ( FLY_AS_CHAR == aAnchor.GetAnchorId() ) + if ( RndStdIds::FLY_AS_CHAR == aAnchor.GetAnchorId() ) { // JP 13.02.99 Bug 61863: if a frameselection is passed to the // clipboard, it should be found at pasting. Therefore @@ -196,7 +196,7 @@ bool SwFEShell::Copy( SwDoc* pClpDoc, const OUString* pNewClpText ) { SfxItemSet aSet( pClpDoc->GetAttrPool(), aFrameFormatSetRange ); - SwFormatAnchor aAnchor( FLY_AT_PARA ); + SwFormatAnchor aAnchor( RndStdIds::FLY_AT_PARA ); aAnchor.SetAnchor( &aPos ); aSet.Put( aAnchor ); @@ -211,10 +211,10 @@ bool SwFEShell::Copy( SwDoc* pClpDoc, const OUString* pNewClpText ) SwDrawContact *pContact = static_cast<SwDrawContact*>(GetUserCall( pObj )); SwFrameFormat *pFormat = pContact->GetFormat(); SwFormatAnchor aAnchor( pFormat->GetAnchor() ); - if ((FLY_AT_PARA == aAnchor.GetAnchorId()) || - (FLY_AT_CHAR == aAnchor.GetAnchorId()) || - (FLY_AT_FLY == aAnchor.GetAnchorId()) || - (FLY_AS_CHAR == aAnchor.GetAnchorId())) + if ((RndStdIds::FLY_AT_PARA == aAnchor.GetAnchorId()) || + (RndStdIds::FLY_AT_CHAR == aAnchor.GetAnchorId()) || + (RndStdIds::FLY_AT_FLY == aAnchor.GetAnchorId()) || + (RndStdIds::FLY_AS_CHAR == aAnchor.GetAnchorId())) { aAnchor.SetAnchor( &aPos ); } @@ -263,7 +263,7 @@ static bool lcl_SetAnchor( const SwPosition& rPos, const SwNode& rNd, SwFlyFrame { bRet = false; } - else if ( FLY_AT_FLY == rAnchor.GetAnchorId() ) + else if ( RndStdIds::FLY_AT_FLY == rAnchor.GetAnchorId() ) { if( pTmpFly ) { @@ -274,7 +274,7 @@ static bool lcl_SetAnchor( const SwPosition& rPos, const SwNode& rNd, SwFlyFrame } else { - rAnchor.SetType( FLY_AT_PAGE ); + rAnchor.SetType( RndStdIds::FLY_AT_PAGE ); rAnchor.SetPageNum( rDestShell.GetPageNumber( rInsPt ) ); const SwFrame *pPg = pTmpFrame->FindPageFrame(); rNewPos = pPg->Frame().Pos(); @@ -321,7 +321,7 @@ bool SwFEShell::CopyDrawSel( SwFEShell* pDestShell, const Point& rSttPt, // insert into the group, when it belongs to an entered group // or when the object is not anchored as a character if( pSrcDrwView->IsGroupEntered() || - (FLY_AS_CHAR != rAnchor.GetAnchorId()) ) + (RndStdIds::FLY_AS_CHAR != rAnchor.GetAnchorId()) ) { SdrObject* pNew = pDestDoc->CloneSdrObj( *pObj, bIsMove && @@ -337,10 +337,10 @@ bool SwFEShell::CopyDrawSel( SwFEShell* pDestShell, const Point& rSttPt, SwFormatAnchor aAnchor( rAnchor ); Point aNewAnch; - if ((FLY_AT_PARA == aAnchor.GetAnchorId()) || - (FLY_AT_CHAR == aAnchor.GetAnchorId()) || - (FLY_AT_FLY == aAnchor.GetAnchorId()) || - (FLY_AS_CHAR == aAnchor.GetAnchorId())) + if ((RndStdIds::FLY_AT_PARA == aAnchor.GetAnchorId()) || + (RndStdIds::FLY_AT_CHAR == aAnchor.GetAnchorId()) || + (RndStdIds::FLY_AT_FLY == aAnchor.GetAnchorId()) || + (RndStdIds::FLY_AS_CHAR == aAnchor.GetAnchorId())) { if ( this == pDestShell ) { @@ -370,7 +370,7 @@ bool SwFEShell::CopyDrawSel( SwFEShell* pDestShell, const Point& rSttPt, aNewAnch, false ); } } - else if ( FLY_AT_PAGE == aAnchor.GetAnchorId() ) + else if ( RndStdIds::FLY_AT_PAGE == aAnchor.GetAnchorId() ) { aAnchor.SetPageNum( pDestShell->GetPageNumber( rInsPt ) ); const SwRootFrame* pTmpRoot = pDestShell->GetLayout(); @@ -397,7 +397,7 @@ bool SwFEShell::CopyDrawSel( SwFEShell* pDestShell, const Point& rSttPt, if ( pFormat ) { SdrObject* pNew = pFormat->FindSdrObject(); - if ( FLY_AS_CHAR != aAnchor.GetAnchorId() ) + if ( RndStdIds::FLY_AS_CHAR != aAnchor.GetAnchorId() ) { Point aPos( rInsPt ); aPos -= aNewAnch; @@ -482,10 +482,10 @@ bool SwFEShell::Copy( SwFEShell* pDestShell, const Point& rSttPt, bRet = true; Point aNewAnch; - if ((FLY_AT_PARA == aAnchor.GetAnchorId()) || - (FLY_AT_CHAR == aAnchor.GetAnchorId()) || - (FLY_AT_FLY == aAnchor.GetAnchorId()) || - (FLY_AS_CHAR == aAnchor.GetAnchorId())) + if ((RndStdIds::FLY_AT_PARA == aAnchor.GetAnchorId()) || + (RndStdIds::FLY_AT_CHAR == aAnchor.GetAnchorId()) || + (RndStdIds::FLY_AT_FLY == aAnchor.GetAnchorId()) || + (RndStdIds::FLY_AS_CHAR == aAnchor.GetAnchorId())) { if ( this == pDestShell ) { @@ -524,7 +524,7 @@ bool SwFEShell::Copy( SwFEShell* pDestShell, const Point& rSttPt, aNewAnch, GetDoc() == pDestShell->GetDoc()); } } - else if ( FLY_AT_PAGE == aAnchor.GetAnchorId() ) + else if ( RndStdIds::FLY_AT_PAGE == aAnchor.GetAnchorId() ) { aAnchor.SetPageNum( pDestShell->GetPageNumber( rInsPt ) ); const SwRootFrame* pTmpRoot = pDestShell->GetLayout(); @@ -541,7 +541,7 @@ bool SwFEShell::Copy( SwFEShell* pDestShell, const Point& rSttPt, SwFrameFormat *pOldFormat = pFlyFormat; pFlyFormat = pDestShell->GetDoc()->getIDocumentLayoutAccess().CopyLayoutFormat( *pFlyFormat, aAnchor, true, true ); - if ( FLY_AS_CHAR != aAnchor.GetAnchorId() ) + if ( RndStdIds::FLY_AS_CHAR != aAnchor.GetAnchorId() ) { Point aPos( rInsPt ); aPos -= aNewAnch; @@ -908,7 +908,7 @@ bool SwFEShell::Paste( SwDoc* pClpDoc ) if( Imp()->GetDrawView()->IsGroupEntered() && RES_DRAWFRMFMT == pCpyFormat->Which() && - (FLY_AS_CHAR != pCpyFormat->GetAnchor().GetAnchorId()) ) + (RndStdIds::FLY_AS_CHAR != pCpyFormat->GetAnchor().GetAnchorId()) ) { const SdrObject* pSdrObj = pCpyFormat->FindSdrObject(); if( pSdrObj ) @@ -956,9 +956,9 @@ bool SwFEShell::Paste( SwDoc* pClpDoc ) if( bInsWithFormat ) { SwFormatAnchor aAnchor( pCpyFormat->GetAnchor() ); - if ((FLY_AT_PARA == aAnchor.GetAnchorId()) || - (FLY_AT_CHAR == aAnchor.GetAnchorId()) || - (FLY_AS_CHAR == aAnchor.GetAnchorId())) + if ((RndStdIds::FLY_AT_PARA == aAnchor.GetAnchorId()) || + (RndStdIds::FLY_AT_CHAR == aAnchor.GetAnchorId()) || + (RndStdIds::FLY_AS_CHAR == aAnchor.GetAnchorId())) { SwPosition* pPos = rPaM.GetPoint(); // allow shapes (no controls) in header/footer @@ -976,11 +976,11 @@ bool SwFEShell::Paste( SwDoc* pClpDoc ) aAnchor.SetAnchor( pPos ); } - else if ( FLY_AT_PAGE == aAnchor.GetAnchorId() ) + else if ( RndStdIds::FLY_AT_PAGE == aAnchor.GetAnchorId() ) { aAnchor.SetPageNum( GetPhyPageNum() ); } - else if( FLY_AT_FLY == aAnchor.GetAnchorId() ) + else if( RndStdIds::FLY_AT_FLY == aAnchor.GetAnchorId() ) { Point aPt; (void)lcl_SetAnchor( *rPaM.GetPoint(), rPaM.GetNode(), @@ -1171,7 +1171,7 @@ bool SwFEShell::PastePages( SwFEShell& rToFill, sal_uInt16 nStartPage, sal_uInt1 for ( auto pCpyFormat : *GetDoc()->GetSpzFrameFormats() ) { SwFormatAnchor aAnchor( pCpyFormat->GetAnchor() ); - if ((FLY_AT_PAGE == aAnchor.GetAnchorId()) && + if ((RndStdIds::FLY_AT_PAGE == aAnchor.GetAnchorId()) && aAnchor.GetPageNum() >= nStartPage && aAnchor.GetPageNum() <= nEndPage) { aAnchor.SetPageNum( aAnchor.GetPageNum() - nStartPage + 1); diff --git a/sw/source/core/frmedt/fefly1.cxx b/sw/source/core/frmedt/fefly1.cxx index 394454cc7ba9..c495a35abf73 100644 --- a/sw/source/core/frmedt/fefly1.cxx +++ b/sw/source/core/frmedt/fefly1.cxx @@ -97,7 +97,7 @@ static bool lcl_SetNewFlyPos( const SwNode& rNode, SwFormatAnchor& rAnchor, const SwPageFrame *pPg = pCFrame ? pCFrame->FindPageFrame() : nullptr; rAnchor.SetPageNum( pPg ? pPg->GetPhyPageNum() : 1 ); - rAnchor.SetType( FLY_AT_PAGE ); + rAnchor.SetType( RndStdIds::FLY_AT_PAGE ); } return bRet; } @@ -117,9 +117,9 @@ static bool lcl_FindAnchorPos( Point aTmpPnt( rPt ); switch( nNew ) { - case FLY_AS_CHAR: // also include this? - case FLY_AT_PARA: - case FLY_AT_CHAR: // LAYER_IMPL + case RndStdIds::FLY_AS_CHAR: // also include this? + case RndStdIds::FLY_AT_PARA: + case RndStdIds::FLY_AT_CHAR: // LAYER_IMPL { // starting from the upper-left corner of the Fly, // search nearest ContentFrame @@ -133,7 +133,7 @@ static bool lcl_FindAnchorPos( } SwPosition aPos( *static_cast<const SwContentFrame*>(pNewAnch)->GetNode() ); - if ((FLY_AT_CHAR == nNew) || (FLY_AS_CHAR == nNew)) + if ((RndStdIds::FLY_AT_CHAR == nNew) || (RndStdIds::FLY_AS_CHAR == nNew)) { // textnode should be found, as only in those // a content bound frame can be anchored @@ -159,7 +159,7 @@ static bool lcl_FindAnchorPos( } break; - case FLY_AT_FLY: // LAYER_IMPL + case RndStdIds::FLY_AT_FLY: // LAYER_IMPL { // starting from the upper-left corner of the Fly // search nearest SwFlyFrame @@ -180,10 +180,10 @@ static bool lcl_FindAnchorPos( } } - aNewAnch.SetType( nNew = FLY_AT_PAGE ); + aNewAnch.SetType( nNew = RndStdIds::FLY_AT_PAGE ); SAL_FALLTHROUGH; - case FLY_AT_PAGE: + case RndStdIds::FLY_AT_PAGE: pNewAnch = rFrame.FindPageFrame(); aNewAnch.SetPageNum( pNewAnch->GetPhyPageNum() ); break; @@ -214,8 +214,8 @@ bool sw_ChkAndSetNewAnchor( SwDoc* pDoc = const_cast<SwDoc*>(rFormat.GetDoc()); #if OSL_DEBUG_LEVEL > 0 - OSL_ENSURE( !(nNew == FLY_AT_PAGE && - (FLY_AT_PARA==nOld || FLY_AT_CHAR==nOld || FLY_AS_CHAR==nOld ) && + OSL_ENSURE( !(nNew == RndStdIds::FLY_AT_PAGE && + (RndStdIds::FLY_AT_PARA==nOld || RndStdIds::FLY_AT_CHAR==nOld || RndStdIds::FLY_AS_CHAR==nOld ) && pDoc->IsInHeaderFooter( rOldAnch.GetContentAnchor()->nNode )), "forbidden anchor change in Head/Foot." ); #endif @@ -316,7 +316,7 @@ const SwFrameFormat* SwFEShell::IsFlyInFly() SdrObject *pObj = rMrkList.GetMark( 0 )->GetMarkedSdrObj(); SwFrameFormat *pFormat = FindFrameFormat( pObj ); - if( pFormat && FLY_AT_FLY == pFormat->GetAnchor().GetAnchorId() ) + if( pFormat && RndStdIds::FLY_AT_FLY == pFormat->GetAnchor().GetAnchorId() ) { const SwFrame* pFly; if (SwVirtFlyDrawObj* pFlyObj = dynamic_cast<SwVirtFlyDrawObj *>(pObj)) @@ -405,7 +405,7 @@ Point SwFEShell::FindAnchorPos( const Point& rAbsPos, bool bMoveIt ) SwFrameFormat& rFormat = pAnchoredObj->GetFrameFormat(); const RndStdIds nAnchorId = rFormat.GetAnchor().GetAnchorId(); - if ( FLY_AS_CHAR == nAnchorId ) + if ( RndStdIds::FLY_AS_CHAR == nAnchorId ) return aRet; bool bFlyFrame = dynamic_cast<SwVirtFlyDrawObj *>(pObj) != nullptr; @@ -425,7 +425,7 @@ Point SwFEShell::FindAnchorPos( const Point& rAbsPos, bool bMoveIt ) const SwFrame* pOldAnch = pFly->GetAnchorFrame(); if( !pOldAnch ) return aRet; - if ( FLY_AT_PAGE != nAnchorId ) + if ( RndStdIds::FLY_AT_PAGE != nAnchorId ) { pFooterOrHeader = pContent->FindFooterOrHeader(); } @@ -450,7 +450,7 @@ Point SwFEShell::FindAnchorPos( const Point& rAbsPos, bool bMoveIt ) Point aTmpPnt( rAbsPos ); GetLayout()->GetCursorOfst( &aPos, aTmpPnt, &aState ); if (aPos.nNode != GetDoc()->GetNodes().GetEndOfExtras().GetIndex() - && (nAnchorId != FLY_AT_CHAR || !PosInsideInputField(aPos))) + && (nAnchorId != RndStdIds::FLY_AT_CHAR || !PosInsideInputField(aPos))) { SwContentNode* pCNode = aPos.nNode.GetNode().GetContentNode(); assert(pCNode); @@ -460,7 +460,7 @@ Point SwFEShell::FindAnchorPos( const Point& rAbsPos, bool bMoveIt ) const SwFrame *pNewAnch = nullptr; if( pTextFrame != nullptr ) { - if ( FLY_AT_PAGE == nAnchorId ) + if ( RndStdIds::FLY_AT_PAGE == nAnchorId ) { pNewAnch = pTextFrame->FindPageFrame(); } @@ -468,7 +468,7 @@ Point SwFEShell::FindAnchorPos( const Point& rAbsPos, bool bMoveIt ) { pNewAnch = ::FindAnchor( pTextFrame, rAbsPos ); - if( FLY_AT_FLY == nAnchorId ) // LAYER_IMPL + if( RndStdIds::FLY_AT_FLY == nAnchorId ) // LAYER_IMPL { pNewAnch = pNewAnch->FindFlyFrame(); } @@ -495,12 +495,12 @@ Point SwFEShell::FindAnchorPos( const Point& rAbsPos, bool bMoveIt ) { aRet = pNewAnch->GetFrameAnchorPos( ::HasWrap( pObj ) ); - if ( bMoveIt || (nAnchorId == FLY_AT_CHAR) ) + if ( bMoveIt || (nAnchorId == RndStdIds::FLY_AT_CHAR) ) { SwFormatAnchor aAnch( rFormat.GetAnchor() ); switch ( nAnchorId ) { - case FLY_AT_PARA: + case RndStdIds::FLY_AT_PARA: { SwPosition pos = *aAnch.GetContentAnchor(); pos.nNode = *pTextFrame->GetNode(); @@ -508,14 +508,14 @@ Point SwFEShell::FindAnchorPos( const Point& rAbsPos, bool bMoveIt ) aAnch.SetAnchor( &pos ); break; } - case FLY_AT_PAGE: + case RndStdIds::FLY_AT_PAGE: { aAnch.SetPageNum( static_cast<const SwPageFrame*>(pNewAnch)-> GetPhyPageNum() ); break; } - case FLY_AT_FLY: + case RndStdIds::FLY_AT_FLY: { SwPosition aPos( *static_cast<const SwFlyFrame*>(pNewAnch)->GetFormat()-> GetContent().GetContentIdx() ); @@ -523,7 +523,7 @@ Point SwFEShell::FindAnchorPos( const Point& rAbsPos, bool bMoveIt ) break; } - case FLY_AT_CHAR: + case RndStdIds::FLY_AT_CHAR: { SwPosition pos = *aAnch.GetContentAnchor(); Point aTmpPnt( rAbsPos ); @@ -631,24 +631,24 @@ const SwFrameFormat *SwFEShell::NewFlyFrame( const SfxItemSet& rSet, bool bAnchV RndStdIds eRndId = rAnch.GetAnchorId(); switch( eRndId ) { - case FLY_AT_PAGE: + case RndStdIds::FLY_AT_PAGE: if( !rAnch.GetPageNum() ) //HotFix: Bug in UpdateByExample rAnch.SetPageNum( 1 ); break; - case FLY_AT_FLY: - case FLY_AT_PARA: - case FLY_AT_CHAR: - case FLY_AS_CHAR: + case RndStdIds::FLY_AT_FLY: + case RndStdIds::FLY_AT_PARA: + case RndStdIds::FLY_AT_CHAR: + case RndStdIds::FLY_AS_CHAR: if( !bAnchValid ) { - if( FLY_AT_FLY != eRndId ) + if( RndStdIds::FLY_AT_FLY != eRndId ) { rAnch.SetAnchor( &rPos ); } else if( lcl_SetNewFlyPos( rPos.nNode.GetNode(), rAnch, aPt ) ) { - eRndId = FLY_AT_PAGE; + eRndId = RndStdIds::FLY_AT_PAGE; } } break; @@ -667,14 +667,14 @@ const SwFrameFormat *SwFEShell::NewFlyFrame( const SfxItemSet& rSet, bool bAnchV SwFormatVertOrient aOldV; SwFormatHoriOrient aOldH; - if ( FLY_AT_PAGE != eRndId ) + if ( RndStdIds::FLY_AT_PAGE != eRndId ) { // First as with page link. Paragraph/character link on if // everything was shifted. Then the position is valid! // JP 13.05.98: if necessary also convert the horizontal/vertical // orientation, to prevent correction during re-anchoring pOldAnchor = new SwFormatAnchor( rAnch ); - const_cast<SfxItemSet&>(rSet).Put( SwFormatAnchor( FLY_AT_PAGE, 1 ) ); + const_cast<SfxItemSet&>(rSet).Put( SwFormatAnchor( RndStdIds::FLY_AT_PAGE, 1 ) ); const SfxPoolItem* pItem; if( SfxItemState::SET == rSet.GetItemState( RES_HORI_ORIENT, false, &pItem ) @@ -708,7 +708,7 @@ const SwFrameFormat *SwFEShell::NewFlyFrame( const SfxItemSet& rSet, bool bAnchV const SwFrame* pAnch = ::FindAnchor( GetLayout(), aPt ); SwPosition aPos( *static_cast<const SwContentFrame*>(pAnch)->GetNode() ); - if ( FLY_AS_CHAR == eRndId ) + if ( RndStdIds::FLY_AS_CHAR == eRndId ) { aPos.nContent.Assign( const_cast<SwContentFrame*>(static_cast<const SwContentFrame*>(pAnch))->GetNode(), 0 ); } @@ -789,22 +789,22 @@ void SwFEShell::Insert( const OUString& rGrfName, const OUString& rFltName, SwFormatAnchor* pAnchor = const_cast<SwFormatAnchor*>(static_cast<const SwFormatAnchor*>(pItem)); switch( pAnchor->GetAnchorId()) { - case FLY_AT_PARA: - case FLY_AT_CHAR: // LAYER_IMPL - case FLY_AS_CHAR: + case RndStdIds::FLY_AT_PARA: + case RndStdIds::FLY_AT_CHAR: // LAYER_IMPL + case RndStdIds::FLY_AS_CHAR: if( !pAnchor->GetContentAnchor() ) { pAnchor->SetAnchor( pCursor->GetPoint() ); } break; - case FLY_AT_FLY: + case RndStdIds::FLY_AT_FLY: if( !pAnchor->GetContentAnchor() ) { lcl_SetNewFlyPos( pCursor->GetNode(), *pAnchor, GetCursorDocPos() ); } break; - case FLY_AT_PAGE: + case RndStdIds::FLY_AT_PAGE: if( !pAnchor->GetPageNum() ) { pAnchor->SetPageNum( pCursor->GetPageNum( @@ -882,7 +882,7 @@ void SwFEShell::InsertDrawObj( SdrObject& rDrawObj, SET_CURR_SHELL( this ); SfxItemSet rFlyAttrSet( GetDoc()->GetAttrPool(), aFrameFormatSetRange ); - rFlyAttrSet.Put( SwFormatAnchor( FLY_AT_PARA )); + rFlyAttrSet.Put( SwFormatAnchor( RndStdIds::FLY_AT_PARA )); // #i89920# rFlyAttrSet.Put( SwFormatSurround( css::text::WrapTextMode_THROUGHT ) ); rDrawObj.SetLayer( getIDocumentDrawModelAccess().GetHeavenId() ); @@ -926,7 +926,7 @@ void SwFEShell::GetPageObjs( std::vector<SwFrameFormat*>& rFillArr ) for( auto pFormat : *mpDoc->GetSpzFrameFormats() ) { - if (FLY_AT_PAGE == pFormat->GetAnchor().GetAnchorId()) + if (RndStdIds::FLY_AT_PAGE == pFormat->GetAnchor().GetAnchorId()) { rFillArr.push_back( pFormat ); } @@ -952,7 +952,7 @@ void SwFEShell::SetPageObjsNewPage( std::vector<SwFrameFormat*>& rFillArr ) // FlyFormat is still valid, therefore process SwFormatAnchor aNewAnchor( pFormat->GetAnchor() ); - if ((FLY_AT_PAGE != aNewAnchor.GetAnchorId()) || + if ((RndStdIds::FLY_AT_PAGE != aNewAnchor.GetAnchorId()) || 0 >= ( nNewPage = aNewAnchor.GetPageNum() + 1 ) ) // chaos::Anchor has been changed or invalid page number, // therefore: do not change! @@ -1003,11 +1003,11 @@ bool SwFEShell::GetFlyFrameAttr( SfxItemSet &rSet ) const const SwFormatAnchor* pAnchor = static_cast<const SwFormatAnchor*>(pItem); RndStdIds eType = pAnchor->GetAnchorId(); - if ( FLY_AT_PAGE != eType ) + if ( RndStdIds::FLY_AT_PAGE != eType ) { // OD 12.11.2003 #i22341# - content anchor of anchor item is needed. // Thus, don't overwrite anchor item by default contructed anchor item. - if ( FLY_AS_CHAR == eType ) + if ( RndStdIds::FLY_AS_CHAR == eType ) { rSet.ClearItem( RES_OPAQUE ); rSet.ClearItem( RES_SURROUND ); @@ -1664,7 +1664,7 @@ ObjCntType SwFEShell::GetObjCntType( const SdrObject& rObj ) OSL_FAIL( "<SwFEShell::GetObjCntType(..)> - missing frame format" ); eType = OBJCNT_NONE; } - else if ( FLY_AS_CHAR != pFrameFormat->GetAnchor().GetAnchorId() ) + else if ( RndStdIds::FLY_AS_CHAR != pFrameFormat->GetAnchor().GetAnchorId() ) { eType = OBJCNT_GROUPOBJ; } @@ -1998,7 +1998,7 @@ void SwFEShell::AlignFormulaToBaseline( const uno::Reference < embed::XEmbeddedO SwFrameFormat * pFrameFormat = pFly ? pFly->GetFormat() : nullptr; // baseline to baseline alignment should only be applied to formulas anchored as char - if ( pFly && pFrameFormat && FLY_AS_CHAR == pFrameFormat->GetAnchor().GetAnchorId() ) + if ( pFly && pFrameFormat && RndStdIds::FLY_AS_CHAR == pFrameFormat->GetAnchor().GetAnchorId() ) { // get baseline from Math object uno::Any aBaseline; diff --git a/sw/source/core/frmedt/feshview.cxx b/sw/source/core/frmedt/feshview.cxx index 9ff50efd80c9..9df3d900447f 100644 --- a/sw/source/core/frmedt/feshview.cxx +++ b/sw/source/core/frmedt/feshview.cxx @@ -362,7 +362,7 @@ bool SwFEShell::MoveAnchor( SwMove nDir ) SwFrameFormat& rFormat = pAnchoredObj->GetFrameFormat(); SwFormatAnchor aAnch( rFormat.GetAnchor() ); RndStdIds nAnchorId = aAnch.GetAnchorId(); - if ( FLY_AS_CHAR == nAnchorId ) + if ( RndStdIds::FLY_AS_CHAR == nAnchorId ) return false; if( pOld->IsVertical() ) { @@ -384,7 +384,7 @@ bool SwFEShell::MoveAnchor( SwMove nDir ) } } switch ( nAnchorId ) { - case FLY_AT_PAGE: + case RndStdIds::FLY_AT_PAGE: { OSL_ENSURE( pOld->IsPageFrame(), "Wrong anchor, page expected." ); if( SwMove::UP == nDir ) @@ -398,7 +398,7 @@ bool SwFEShell::MoveAnchor( SwMove nDir ) } break; } - case FLY_AT_CHAR: + case RndStdIds::FLY_AT_CHAR: { OSL_ENSURE( pOld->IsContentFrame(), "Wrong anchor, page expected." ); if( SwMove::LEFT == nDir || SwMove::RIGHT == nDir ) @@ -433,7 +433,7 @@ bool SwFEShell::MoveAnchor( SwMove nDir ) } SAL_FALLTHROUGH; } - case FLY_AT_PARA: + case RndStdIds::FLY_AT_PARA: { OSL_ENSURE( pOld->IsContentFrame(), "Wrong anchor, page expected." ); if( SwMove::UP == nDir ) @@ -460,7 +460,7 @@ bool SwFEShell::MoveAnchor( SwMove nDir ) bRet = false; break; } - case FLY_AT_FLY: + case RndStdIds::FLY_AT_FLY: { OSL_ENSURE( pOld->IsFlyFrame(), "Wrong anchor, fly frame expected."); SwPageFrame* pPage = pOld->FindPageFrame(); @@ -753,7 +753,7 @@ void SwFEShell::EndDrag( const Point * ) // DrawUndo on to flyframes are not stored // The flys change the flag. GetDoc()->GetIDocumentUndoRedo().DoDrawUndo(true); - ChgAnchor( 0, true ); + ChgAnchor( RndStdIds::FLY_AT_PARA, true ); EndUndo( SwUndoId::END ); @@ -1798,7 +1798,7 @@ bool SwFEShell::ImpEndCreate() if( bCharBound ) { - aAnch.SetType( FLY_AS_CHAR ); + aAnch.SetType( RndStdIds::FLY_AS_CHAR ); aAnch.SetAnchor( &aPos ); } } @@ -1872,7 +1872,7 @@ bool SwFEShell::ImpEndCreate() bAtPage = true; else { - aAnch.SetType( FLY_AT_PARA ); + aAnch.SetType( RndStdIds::FLY_AT_PARA ); aAnch.SetAnchor( &aPos ); } } @@ -1881,7 +1881,7 @@ bool SwFEShell::ImpEndCreate() { pPage = pAnch ? pAnch->FindPageFrame() : GetLayout()->GetPageAtPos(aPoint); - aAnch.SetType( FLY_AT_PAGE ); + aAnch.SetType( RndStdIds::FLY_AT_PAGE ); aAnch.SetPageNum( pPage->GetPhyPageNum() ); pAnch = pPage; // page becomes an anchor } @@ -2008,7 +2008,7 @@ bool SwFEShell::ImpEndCreate() } SwFormatVertOrient aVert( nYOffset, text::VertOrientation::NONE, text::RelOrientation::FRAME ); aSet.Put( aVert ); - SwDrawFrameFormat* pFormat = static_cast<SwDrawFrameFormat*>(getIDocumentLayoutAccess().MakeLayoutFormat( RND_DRAW_OBJECT, &aSet )); + SwDrawFrameFormat* pFormat = static_cast<SwDrawFrameFormat*>(getIDocumentLayoutAccess().MakeLayoutFormat( RndStdIds::DRAW_OBJECT, &aSet )); // #i36010# - set layout direction of the position pFormat->SetPositionLayoutDir( text::PositionLayoutDir::PositionInLayoutDirOfAnchor ); @@ -2020,7 +2020,7 @@ bool SwFEShell::ImpEndCreate() pContact->MoveObjToVisibleLayer( &rSdrObj ); if( bCharBound ) { - OSL_ENSURE( aAnch.GetAnchorId() == FLY_AS_CHAR, "wrong AnchorType" ); + OSL_ENSURE( aAnch.GetAnchorId() == RndStdIds::FLY_AS_CHAR, "wrong AnchorType" ); SwTextNode *pNd = aAnch.GetContentAnchor()->nNode.GetNode().GetTextNode(); SwFormatFlyCnt aFormat( pFormat ); pNd->InsertItem(aFormat, @@ -2177,37 +2177,37 @@ void SwFEShell::BreakMark() Imp()->GetDrawView()->BrkMarkObj(); } -short SwFEShell::GetAnchorId() const +RndStdIds SwFEShell::GetAnchorId() const { - short nRet = SHRT_MAX; + RndStdIds nRet = (RndStdIds)SHRT_MAX; if ( Imp()->HasDrawView() ) { const SdrMarkList &rMrkList = Imp()->GetDrawView()->GetMarkedObjectList(); for ( size_t i = 0; i < rMrkList.GetMarkCount(); ++i ) { SdrObject *pObj = rMrkList.GetMark( i )->GetMarkedSdrObj(); - if ( dynamic_cast<const SwVirtFlyDrawObj*>( pObj) != nullptr ) + if ( dynamic_cast<const SwVirtFlyDrawObj*>( pObj) != nullptr ) { - nRet = -1; + nRet = RndStdIds::UNKNOWN; break; } SwDrawContact *pContact = static_cast<SwDrawContact*>(GetUserCall(pObj)); - short nId = static_cast<short>(pContact->GetFormat()->GetAnchor().GetAnchorId()); - if ( nRet == SHRT_MAX ) + RndStdIds nId = pContact->GetFormat()->GetAnchor().GetAnchorId(); + if ( nRet == (RndStdIds)SHRT_MAX ) nRet = nId; else if ( nRet != nId ) { - nRet = -1; + nRet = RndStdIds::UNKNOWN; break; } } } - if ( nRet == SHRT_MAX ) - nRet = -1; + if ( nRet == (RndStdIds)SHRT_MAX ) + nRet = RndStdIds::UNKNOWN; return nRet; } -void SwFEShell::ChgAnchor( int eAnchorId, bool bSameOnly, bool bPosCorr ) +void SwFEShell::ChgAnchor( RndStdIds eAnchorId, bool bSameOnly, bool bPosCorr ) { OSL_ENSURE( Imp()->HasDrawView(), "ChgAnchor without DrawView?" ); const SdrMarkList &rMrkList = Imp()->GetDrawView()->GetMarkedObjectList(); @@ -2216,7 +2216,7 @@ void SwFEShell::ChgAnchor( int eAnchorId, bool bSameOnly, bool bPosCorr ) { StartAllAction(); - if( GetDoc()->ChgAnchor( rMrkList, (RndStdIds)eAnchorId, bSameOnly, bPosCorr )) + if( GetDoc()->ChgAnchor( rMrkList, eAnchorId, bSameOnly, bPosCorr )) Imp()->GetDrawView()->UnmarkAll(); EndAllAction(); @@ -2299,7 +2299,7 @@ bool SwFEShell::IsGroupSelected() if ( pObj->IsGroupObject() && // --> #i38505# No ungroup allowed for 3d objects !pObj->Is3DObj() && - FLY_AS_CHAR != static_cast<SwDrawContact*>(GetUserCall(pObj))-> + RndStdIds::FLY_AS_CHAR != static_cast<SwDrawContact*>(GetUserCall(pObj))-> GetFormat()->GetAnchor().GetAnchorId() ) { return true; @@ -2320,7 +2320,7 @@ namespace OSL_FAIL( "<HasSuitableGroupingAnchor> - missing frame format" ); bSuitable = false; } - else if (FLY_AS_CHAR == pFrameFormat->GetAnchor().GetAnchorId()) + else if (RndStdIds::FLY_AS_CHAR == pFrameFormat->GetAnchor().GetAnchorId()) { bSuitable = false; } @@ -2569,7 +2569,7 @@ FlyProtectFlags SwFEShell::IsSelObjProtected( FlyProtectFlags eType ) const // set FlyProtectFlags::Pos if it is a Math object anchored 'as char' and baseline alignment is activated const bool bProtectMathPos = SotExchange::IsMath( xObj->getClassID() ) - && FLY_AS_CHAR == pFly->GetFormat()->GetAnchor().GetAnchorId() + && RndStdIds::FLY_AS_CHAR == pFly->GetFormat()->GetAnchor().GetAnchorId() && mpDoc->GetDocumentSettingManager().get( DocumentSettingId::MATH_BASELINE_ALIGNMENT ); if ((FlyProtectFlags::Pos & eType) && bProtectMathPos) nChk |= FlyProtectFlags::Pos; @@ -2656,7 +2656,7 @@ bool SwFEShell::IsAlignPossible() const SwDrawContact *pC = static_cast<SwDrawContact*>(GetUserCall(pO)); OSL_ENSURE( pC, "No SwDrawContact!"); //only as character bound drawings can be aligned - bRet = pC && pC->GetFormat()->GetAnchor().GetAnchorId() == FLY_AS_CHAR; + bRet = pC && pC->GetFormat()->GetAnchor().GetAnchorId() == RndStdIds::FLY_AS_CHAR; } if ( bRet ) return Imp()->GetDrawView()->IsAlignPossible(); @@ -2699,7 +2699,7 @@ void SwFEShell::CheckUnboundObjects() { const SwFrame *pAnch = ::FindAnchor( pPage, aPt, true ); SwPosition aPos( *static_cast<const SwContentFrame*>(pAnch)->GetNode() ); - aAnch.SetType( FLY_AT_PARA ); + aAnch.SetType( RndStdIds::FLY_AT_PARA ); aAnch.SetAnchor( &aPos ); const_cast<SwRect&>(GetCharRect()).Pos() = aPt; } @@ -2720,7 +2720,7 @@ void SwFEShell::CheckUnboundObjects() aSet.Put( aAnch ); aSet.Put( SwFormatSurround( css::text::WrapTextMode_THROUGHT ) ); - SwFrameFormat* pFormat = getIDocumentLayoutAccess().MakeLayoutFormat( RND_DRAW_OBJECT, &aSet ); + SwFrameFormat* pFormat = getIDocumentLayoutAccess().MakeLayoutFormat( RndStdIds::DRAW_OBJECT, &aSet ); SwDrawContact *pContact = new SwDrawContact( static_cast<SwDrawFrameFormat*>(pFormat), pObj ); diff --git a/sw/source/core/frmedt/fews.cxx b/sw/source/core/frmedt/fews.cxx index 33552c42b699..6cd9d88a398a 100644 --- a/sw/source/core/frmedt/fews.cxx +++ b/sw/source/core/frmedt/fews.cxx @@ -488,7 +488,7 @@ void SwFEShell::InsertLabel( const SwLabelType eType, const OUString &rText, con SwNodeIndex aAnchIdx(*pFlyFormat->GetContent().GetContentIdx(), 1); SwTextNode *pTextNode = aAnchIdx.GetNode().GetTextNode(); - SwFormatAnchor aAnc(FLY_AS_CHAR); + SwFormatAnchor aAnc(RndStdIds::FLY_AS_CHAR); sal_Int32 nInsertPos = bBefore ? pTextNode->Len() : 0; SwPosition aPos(*pTextNode, nInsertPos); @@ -739,12 +739,12 @@ void SwFEShell::CalcBoundRect( SwRect& _orRect, bool bRTL = false; bool bVerticalL2R = false; - if ((FLY_AT_PAGE == _nAnchorId) || (FLY_AT_FLY == _nAnchorId)) // LAYER_IMPL + if ((RndStdIds::FLY_AT_PAGE == _nAnchorId) || (RndStdIds::FLY_AT_FLY == _nAnchorId)) // LAYER_IMPL { const SwFrame* pTmp = pFrame; // #i22305# - if ((FLY_AT_PAGE == _nAnchorId) || - ((FLY_AT_FLY == _nAnchorId) && !_bFollowTextFlow)) + if ((RndStdIds::FLY_AT_PAGE == _nAnchorId) || + ((RndStdIds::FLY_AT_FLY == _nAnchorId) && !_bFollowTextFlow)) { pFrame = pPage; } @@ -889,7 +889,7 @@ void SwFEShell::CalcBoundRect( SwRect& _orRect, aPos = aRectFnSet.GetPos(pFrame->Frame()); // #i17567# - allow negative positions // for fly frames anchor to paragraph/to character. - if ((_nAnchorId == FLY_AT_PARA) || (_nAnchorId == FLY_AT_CHAR)) + if ((_nAnchorId == RndStdIds::FLY_AT_PARA) || (_nAnchorId == RndStdIds::FLY_AT_CHAR)) { // The rectangle, the fly frame can be positioned in, is determined // horizontally by the frame area of the horizontal environment @@ -979,7 +979,7 @@ void SwFEShell::CalcBoundRect( SwRect& _orRect, // fly frame). Thus, assure this. const SwTextFrame* pTextFrame( dynamic_cast<const SwTextFrame*>(pFrame) ); if ( pTextFrame && - (_nAnchorId == FLY_AT_CHAR) && + (_nAnchorId == RndStdIds::FLY_AT_CHAR) && ( _eVertRelOrient == text::RelOrientation::CHAR || _eVertRelOrient == text::RelOrientation::TEXT_LINE ) ) { @@ -1026,7 +1026,7 @@ void SwFEShell::CalcBoundRect( SwRect& _orRect, // position (<aPos.X()> respectively <aPos.Y()>), if object is // anchored to character and horizontal aligned at character. if ( pTextFrame && - (_nAnchorId == FLY_AT_CHAR) && + (_nAnchorId == RndStdIds::FLY_AT_CHAR) && _eHoriRelOrient == text::RelOrientation::CHAR ) { SwTwips nLeft = 0L; diff --git a/sw/source/core/frmedt/tblsel.cxx b/sw/source/core/frmedt/tblsel.cxx index 51a416c96005..36fe7d8829b9 100644 --- a/sw/source/core/frmedt/tblsel.cxx +++ b/sw/source/core/frmedt/tblsel.cxx @@ -884,8 +884,8 @@ bool IsEmptyBox( const SwTableBox& rBox, SwPaM& rPam ) const SwFormatAnchor& rAnchor = pFormat->GetAnchor(); const SwPosition* pAPos = rAnchor.GetContentAnchor(); if (pAPos && - ((FLY_AT_PARA == rAnchor.GetAnchorId()) || - (FLY_AT_CHAR == rAnchor.GetAnchorId())) && + ((RndStdIds::FLY_AT_PARA == rAnchor.GetAnchorId()) || + (RndStdIds::FLY_AT_CHAR == rAnchor.GetAnchorId())) && nSttIdx <= ( nIdx = pAPos->nNode.GetIndex() ) && nIdx < nEndIdx ) { diff --git a/sw/source/core/inc/UndoCore.hxx b/sw/source/core/inc/UndoCore.hxx index 4c73adc8ae7d..ced3e9c754a0 100644 --- a/sw/source/core/inc/UndoCore.hxx +++ b/sw/source/core/inc/UndoCore.hxx @@ -193,7 +193,7 @@ class SwUndoSetFlyFormat : public SwUndo, public SwClient std::unique_ptr<SfxItemSet> pItemSet; // the re-/ set attributes sal_uLong nOldNode, nNewNode; sal_Int32 nOldContent, nNewContent; - sal_uInt16 nOldAnchorTyp, nNewAnchorTyp; + RndStdIds nOldAnchorTyp, nNewAnchorTyp; bool bAnchorChgd; void PutAttr( sal_uInt16 nWhich, const SfxPoolItem* pItem ); diff --git a/sw/source/core/inc/flyfrm.hxx b/sw/source/core/inc/flyfrm.hxx index 2b2b21d1a7ab..fe9faa599388 100644 --- a/sw/source/core/inc/flyfrm.hxx +++ b/sw/source/core/inc/flyfrm.hxx @@ -106,10 +106,10 @@ protected: // but the width will not be re-evaluated based on the attributes. bool m_bFormatHeightOnly :1; - bool m_bInCnt :1; ///< FLY_AS_CHAR, anchored as character - bool m_bAtCnt :1; ///< FLY_AT_PARA, anchored at paragraph - bool m_bLayout :1; ///< FLY_AT_PAGE, FLY_AT_FLY, at page or at frame - bool m_bAutoPosition :1; ///< FLY_AT_CHAR, anchored at character + bool m_bInCnt :1; ///< RndStdIds::FLY_AS_CHAR, anchored as character + bool m_bAtCnt :1; ///< RndStdIds::FLY_AT_PARA, anchored at paragraph + bool m_bLayout :1; ///< RndStdIds::FLY_AT_PAGE, RndStdIds::FLY_AT_FLY, at page or at frame + bool m_bAutoPosition :1; ///< RndStdIds::FLY_AT_CHAR, anchored at character friend class SwNoTextFrame; // is allowed to call NotifyBackground diff --git a/sw/source/core/layout/anchoreddrawobject.cxx b/sw/source/core/layout/anchoreddrawobject.cxx index 53ed59e66e88..5a3ee5cf2ac6 100644 --- a/sw/source/core/layout/anchoreddrawobject.cxx +++ b/sw/source/core/layout/anchoreddrawobject.cxx @@ -302,7 +302,7 @@ void SwAnchoredDrawObject::MakeObjPos() // determine relative position of drawing object and set it switch ( pDrawContact->GetAnchorId() ) { - case FLY_AS_CHAR: + case RndStdIds::FLY_AS_CHAR: { // indicate that position will be valid after positioning is performed mbValidPos = true; @@ -310,16 +310,16 @@ void SwAnchoredDrawObject::MakeObjPos() // during the format of its anchor frame - see <SwFlyCntPortion::SetBase(..)> } break; - case FLY_AT_PARA: - case FLY_AT_CHAR: + case RndStdIds::FLY_AT_PARA: + case RndStdIds::FLY_AT_CHAR: { // --> #i32795# - move intrinsic positioning to // helper method <MakeObjPosAnchoredAtPara()> MakeObjPosAnchoredAtPara(); } break; - case FLY_AT_PAGE: - case FLY_AT_FLY: + case RndStdIds::FLY_AT_PAGE: + case RndStdIds::FLY_AT_FLY: { // --> #i32795# - move intrinsic positioning to // helper method <MakeObjPosAnchoredAtLayout()> @@ -529,7 +529,7 @@ void SwAnchoredDrawObject::InvalidatePage_( SwPageFrame* _pPageFrame ) { // --> #i35007# - correct invalidation for as-character // anchored objects. - if ( GetFrameFormat().GetAnchor().GetAnchorId() == FLY_AS_CHAR ) + if ( GetFrameFormat().GetAnchor().GetAnchorId() == RndStdIds::FLY_AS_CHAR ) { _pPageFrame->InvalidateFlyInCnt(); } @@ -569,7 +569,7 @@ void SwAnchoredDrawObject::InvalidateObjPos() // --> #i44559# - assure, that text hint is already // existing in the text frame if ( dynamic_cast< const SwTextFrame* >(GetAnchorFrame()) != nullptr && - (GetFrameFormat().GetAnchor().GetAnchorId() == FLY_AS_CHAR) ) + (GetFrameFormat().GetAnchor().GetAnchorId() == RndStdIds::FLY_AS_CHAR) ) { SwTextFrame* pAnchorTextFrame( static_cast<SwTextFrame*>(AnchorFrame()) ); if ( pAnchorTextFrame->GetTextNode()->GetpSwpHints() && diff --git a/sw/source/core/layout/anchoredobject.cxx b/sw/source/core/layout/anchoredobject.cxx index d3d51c8db6c3..a1d2080d7856 100644 --- a/sw/source/core/layout/anchoredobject.cxx +++ b/sw/source/core/layout/anchoredobject.cxx @@ -218,7 +218,7 @@ void SwAnchoredObject::CheckCharRectAndTopOfLine( GetAnchorFrame()->IsTextFrame() ) { const SwFormatAnchor& rAnch = GetFrameFormat().GetAnchor(); - if ( (rAnch.GetAnchorId() == FLY_AT_CHAR) && + if ( (rAnch.GetAnchorId() == RndStdIds::FLY_AT_CHAR) && rAnch.GetContentAnchor() ) { // --> if requested, assure that anchor frame, @@ -425,8 +425,8 @@ bool SwAnchoredObject::ConsiderObjWrapInfluenceOnObjPos() const else if ( rObjFormat.getIDocumentSettingAccess().get(DocumentSettingId::CONSIDER_WRAP_ON_OBJECT_POSITION) ) { const SwFormatAnchor& rAnchor = rObjFormat.GetAnchor(); - if ( ((rAnchor.GetAnchorId() == FLY_AT_CHAR) || - (rAnchor.GetAnchorId() == FLY_AT_PARA)) && + if ( ((rAnchor.GetAnchorId() == RndStdIds::FLY_AT_CHAR) || + (rAnchor.GetAnchorId() == RndStdIds::FLY_AT_PARA)) && rObjFormat.GetSurround().GetSurround() != css::text::WrapTextMode_THROUGHT ) { // --> #i34520# - text also wraps around anchored @@ -652,7 +652,7 @@ void SwAnchoredObject::UpdateObjInSortedList() AnchorFrame()->GetDrawObjs()->Update( *this ); // update its position in the sorted object list of its page frame // note: as-character anchored object aren't registered at a page frame - if ( GetFrameFormat().GetAnchor().GetAnchorId() != FLY_AS_CHAR ) + if ( GetFrameFormat().GetAnchor().GetAnchorId() != RndStdIds::FLY_AS_CHAR ) { GetPageFrame()->GetSortedObjs()->Update( *this ); } @@ -711,8 +711,8 @@ SwTextFrame* SwAnchoredObject::FindAnchorCharFrame() if ( mpAnchorFrame ) { const SwFormatAnchor& rAnch = GetFrameFormat().GetAnchor(); - if ((rAnch.GetAnchorId() == FLY_AT_CHAR) || - (rAnch.GetAnchorId() == FLY_AS_CHAR)) + if ((rAnch.GetAnchorId() == RndStdIds::FLY_AT_CHAR) || + (rAnch.GetAnchorId() == RndStdIds::FLY_AS_CHAR)) { pAnchorCharFrame = &(static_cast<SwTextFrame*>(AnchorFrame())-> GetFrameAtOfst( rAnch.GetContentAnchor()->nContent.GetIndex() )); diff --git a/sw/source/core/layout/atrfrm.cxx b/sw/source/core/layout/atrfrm.cxx index dacb82753760..c48c8ca64b22 100644 --- a/sw/source/core/layout/atrfrm.cxx +++ b/sw/source/core/layout/atrfrm.cxx @@ -1503,17 +1503,17 @@ SwFormatAnchor::~SwFormatAnchor() void SwFormatAnchor::SetAnchor( const SwPosition *pPos ) { - // anchor only to paragraphs, or start nodes in case of FLY_AT_FLY + // anchor only to paragraphs, or start nodes in case of RndStdIds::FLY_AT_FLY // also allow table node, this is used when a table is selected and is converted to a frame by the UI assert(!pPos - || ((FLY_AT_FLY == nAnchorId) && + || ((RndStdIds::FLY_AT_FLY == nAnchorId) && dynamic_cast<SwStartNode*>(&pPos->nNode.GetNode())) - || (FLY_AT_PARA == nAnchorId && dynamic_cast<SwTableNode*>(&pPos->nNode.GetNode())) + || (RndStdIds::FLY_AT_PARA == nAnchorId && dynamic_cast<SwTableNode*>(&pPos->nNode.GetNode())) || dynamic_cast<SwTextNode*>(&pPos->nNode.GetNode())); m_pContentAnchor .reset( (pPos) ? new SwPosition( *pPos ) : nullptr ); // Flys anchored AT paragraph should not point into the paragraph content if (m_pContentAnchor && - ((FLY_AT_PARA == nAnchorId) || (FLY_AT_FLY == nAnchorId))) + ((RndStdIds::FLY_AT_PARA == nAnchorId) || (RndStdIds::FLY_AT_FLY == nAnchorId))) { m_pContentAnchor->nContent.Assign( nullptr, 0 ); } @@ -1568,19 +1568,19 @@ bool SwFormatAnchor::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const text::TextContentAnchorType eRet; switch (GetAnchorId()) { - case FLY_AT_CHAR: + case RndStdIds::FLY_AT_CHAR: eRet = text::TextContentAnchorType_AT_CHARACTER; break; - case FLY_AT_PAGE: + case RndStdIds::FLY_AT_PAGE: eRet = text::TextContentAnchorType_AT_PAGE; break; - case FLY_AT_FLY: + case RndStdIds::FLY_AT_FLY: eRet = text::TextContentAnchorType_AT_FRAME; break; - case FLY_AS_CHAR: + case RndStdIds::FLY_AS_CHAR: eRet = text::TextContentAnchorType_AS_CHARACTER; break; - //case FLY_AT_PARA: + //case RndStdIds::FLY_AT_PARA: default: eRet = text::TextContentAnchorType_AT_PARAGRAPH; } @@ -1591,7 +1591,7 @@ bool SwFormatAnchor::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const break; case MID_ANCHOR_ANCHORFRAME: { - if (m_pContentAnchor && FLY_AT_FLY == nAnchorId) + if (m_pContentAnchor && RndStdIds::FLY_AT_FLY == nAnchorId) { SwFrameFormat* pFormat = m_pContentAnchor->nNode.GetNode().GetFlyFormat(); if(pFormat) @@ -1623,10 +1623,10 @@ bool SwFormatAnchor::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId ) switch( SWUnoHelper::GetEnumAsInt32( rVal ) ) { case text::TextContentAnchorType_AS_CHARACTER: - eAnchor = FLY_AS_CHAR; + eAnchor = RndStdIds::FLY_AS_CHAR; break; case text::TextContentAnchorType_AT_PAGE: - eAnchor = FLY_AT_PAGE; + eAnchor = RndStdIds::FLY_AT_PAGE; if( GetPageNum() > 0 ) { // If the anchor type is page and a valid page number @@ -1636,14 +1636,14 @@ bool SwFormatAnchor::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId ) } break; case text::TextContentAnchorType_AT_FRAME: - eAnchor = FLY_AT_FLY; + eAnchor = RndStdIds::FLY_AT_FLY; break; case text::TextContentAnchorType_AT_CHARACTER: - eAnchor = FLY_AT_CHAR; + eAnchor = RndStdIds::FLY_AT_CHAR; break; //case text::TextContentAnchorType_AT_PARAGRAPH: default: - eAnchor = FLY_AT_PARA; + eAnchor = RndStdIds::FLY_AT_PARA; break; } SetType( eAnchor ); @@ -1655,7 +1655,7 @@ bool SwFormatAnchor::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId ) if((rVal >>= nVal) && nVal > 0) { SetPageNum( nVal ); - if (FLY_AT_PAGE == GetAnchorId()) + if (RndStdIds::FLY_AT_PAGE == GetAnchorId()) { // If the anchor type is page and a valid page number // is set, the content position has to be deleted to not @@ -1691,7 +1691,7 @@ void SwFormatAnchor::dumpAsXml(xmlTextWriterPtr pWriter) const } else xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST("pContentAnchor"), "%p", m_pContentAnchor.get()); - xmlTextWriterWriteAttribute(pWriter, BAD_CAST("nAnchorType"), BAD_CAST(OString::number(nAnchorId).getStr())); + xmlTextWriterWriteAttribute(pWriter, BAD_CAST("nAnchorType"), BAD_CAST(OString::number((int)nAnchorId).getStr())); xmlTextWriterWriteAttribute(pWriter, BAD_CAST("nPageNum"), BAD_CAST(OString::number(nPageNum).getStr())); xmlTextWriterWriteAttribute(pWriter, BAD_CAST("nOrder"), BAD_CAST(OString::number(mnOrder).getStr())); xmlTextWriterWriteAttribute(pWriter, BAD_CAST("nOrderCounter"), BAD_CAST(OString::number(mnOrderCounter).getStr())); @@ -2588,13 +2588,13 @@ void SwFrameFormat::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew ) if( pH && pH->IsActive() && !pH->GetHeaderFormat() ) { //If he doesn't have one, I'll add one - SwFrameFormat *pFormat = GetDoc()->getIDocumentLayoutAccess().MakeLayoutFormat( RND_STD_HEADER, nullptr ); + SwFrameFormat *pFormat = GetDoc()->getIDocumentLayoutAccess().MakeLayoutFormat( RndStdIds::HEADER, nullptr ); const_cast<SwFormatHeader *>(pH)->RegisterToFormat( *pFormat ); } if( pF && pF->IsActive() && !pF->GetFooterFormat() ) { //If he doesn't have one, I'll add one - SwFrameFormat *pFormat = GetDoc()->getIDocumentLayoutAccess().MakeLayoutFormat( RND_STD_FOOTER, nullptr ); + SwFrameFormat *pFormat = GetDoc()->getIDocumentLayoutAccess().MakeLayoutFormat( RndStdIds::FOOTER, nullptr ); const_cast<SwFormatFooter *>(pF)->RegisterToFormat( *pFormat ); } @@ -2730,7 +2730,7 @@ bool SwFrameFormat::IsLowerOf( const SwFrameFormat& rFormat ) const // let's try it using the node positions const SwFormatAnchor* pAnchor = &rFormat.GetAnchor(); - if ((FLY_AT_PAGE != pAnchor->GetAnchorId()) && pAnchor->GetContentAnchor()) + if ((RndStdIds::FLY_AT_PAGE != pAnchor->GetAnchorId()) && pAnchor->GetContentAnchor()) { const SwFrameFormats& rFormats = *GetDoc()->GetSpzFrameFormats(); const SwNode* pFlyNd = pAnchor->GetContentAnchor()->nNode.GetNode(). @@ -2749,7 +2749,7 @@ bool SwFrameFormat::IsLowerOf( const SwFrameFormat& rFormat ) const return true; pAnchor = &pFormat->GetAnchor(); - if ((FLY_AT_PAGE == pAnchor->GetAnchorId()) || + if ((RndStdIds::FLY_AT_PAGE == pAnchor->GetAnchorId()) || !pAnchor->GetContentAnchor() ) { return false; @@ -2860,16 +2860,16 @@ void SwFlyFrameFormat::MakeFrames() SwFormatAnchor aAnchorAttr( GetAnchor() ); switch( aAnchorAttr.GetAnchorId() ) { - case FLY_AS_CHAR: - case FLY_AT_PARA: - case FLY_AT_CHAR: + case RndStdIds::FLY_AS_CHAR: + case RndStdIds::FLY_AT_PARA: + case RndStdIds::FLY_AT_CHAR: if( aAnchorAttr.GetContentAnchor() ) { pModify = aAnchorAttr.GetContentAnchor()->nNode.GetNode().GetContentNode(); } break; - case FLY_AT_FLY: + case RndStdIds::FLY_AT_FLY: if( aAnchorAttr.GetContentAnchor() ) { //First search in the content because this is O(1) @@ -2910,7 +2910,7 @@ void SwFlyFrameFormat::MakeFrames() } break; - case FLY_AT_PAGE: + case RndStdIds::FLY_AT_PAGE: { sal_uInt16 nPgNum = aAnchorAttr.GetPageNum(); SwPageFrame *pPage = static_cast<SwPageFrame*>(GetDoc()->getIDocumentLayoutAccess().GetCurrentLayout()->Lower()); @@ -2955,7 +2955,7 @@ void SwFlyFrameFormat::MakeFrames() bool bAdd = !pFrame->IsContentFrame() || !static_cast<SwContentFrame*>(pFrame)->IsFollow(); - if ( FLY_AT_FLY == aAnchorAttr.GetAnchorId() && !pFrame->IsFlyFrame() ) + if ( RndStdIds::FLY_AT_FLY == aAnchorAttr.GetAnchorId() && !pFrame->IsFlyFrame() ) { SwFrame* pFlyFrame = pFrame->FindFlyFrame(); if ( pFlyFrame ) @@ -2964,7 +2964,7 @@ void SwFlyFrameFormat::MakeFrames() } else { - aAnchorAttr.SetType( FLY_AT_PARA ); + aAnchorAttr.SetType( RndStdIds::FLY_AT_PARA ); SetFormatAttr( aAnchorAttr ); MakeFrames(); return; @@ -2993,16 +2993,16 @@ void SwFlyFrameFormat::MakeFrames() SwFlyFrame *pFly = nullptr; // avoid warnings switch( aAnchorAttr.GetAnchorId() ) { - case FLY_AT_FLY: + case RndStdIds::FLY_AT_FLY: pFly = new SwFlyLayFrame( this, pFrame, pFrame ); break; - case FLY_AT_PARA: - case FLY_AT_CHAR: + case RndStdIds::FLY_AT_PARA: + case RndStdIds::FLY_AT_CHAR: pFly = new SwFlyAtContentFrame( this, pFrame, pFrame ); break; - case FLY_AS_CHAR: + case RndStdIds::FLY_AS_CHAR: pFly = new SwFlyInContentFrame( this, pFrame, pFrame ); break; @@ -3209,8 +3209,8 @@ SwHandleAnchorNodeChg::SwHandleAnchorNodeChg( SwFlyFrameFormat& _rFlyFrameFormat mbAnchorNodeChanged( false ) { const RndStdIds nNewAnchorType( _rNewAnchorFormat.GetAnchorId() ); - if ( ((nNewAnchorType == FLY_AT_PARA) || - (nNewAnchorType == FLY_AT_CHAR)) && + if ( ((nNewAnchorType == RndStdIds::FLY_AT_PARA) || + (nNewAnchorType == RndStdIds::FLY_AT_CHAR)) && _rNewAnchorFormat.GetContentAnchor() && _rNewAnchorFormat.GetContentAnchor()->nNode.GetNode().GetContentNode() ) { @@ -3492,7 +3492,7 @@ void CheckAnchoredFlyConsistency(SwDoc const& rDoc) for (auto it = pSpzFrameFormats->begin(); it != pSpzFrameFormats->end(); ++it) { SwFormatAnchor const& rAnchor((**it).GetAnchor(false)); - if (FLY_AT_PAGE == rAnchor.GetAnchorId()) + if (RndStdIds::FLY_AT_PAGE == rAnchor.GetAnchorId()) { assert(!rAnchor.GetContentAnchor() // for invalid documents that lack text:anchor-page-number @@ -3506,14 +3506,14 @@ void CheckAnchoredFlyConsistency(SwDoc const& rDoc) assert(std::find(pFlys->begin(), pFlys->end(), *it) != pFlys->end()); switch (rAnchor.GetAnchorId()) { - case FLY_AT_FLY: + case RndStdIds::FLY_AT_FLY: assert(rNode.IsStartNode()); break; - case FLY_AT_PARA: + case RndStdIds::FLY_AT_PARA: assert(rNode.IsTextNode() || rNode.IsTableNode()); break; - case FLY_AS_CHAR: - case FLY_AT_CHAR: + case RndStdIds::FLY_AS_CHAR: + case RndStdIds::FLY_AT_CHAR: assert(rNode.IsTextNode()); break; default: diff --git a/sw/source/core/layout/calcmove.cxx b/sw/source/core/layout/calcmove.cxx index 7f2a9f06b79a..26eda5e3fef2 100644 --- a/sw/source/core/layout/calcmove.cxx +++ b/sw/source/core/layout/calcmove.cxx @@ -1003,7 +1003,7 @@ bool SwContentFrame::MakePrtArea( const SwBorderAttrs &rAttrs ) continue; } - if ( FLY_AS_CHAR == rFormat.GetAnchor().GetAnchorId() ) + if ( RndStdIds::FLY_AS_CHAR == rFormat.GetAnchor().GetAnchorId() ) { nMinWidth = std::max( nMinWidth, bFly ? rFormat.GetFrameSize().GetWidth() diff --git a/sw/source/core/layout/flowfrm.cxx b/sw/source/core/layout/flowfrm.cxx index d7b65128fdbf..501b16f45c4f 100644 --- a/sw/source/core/layout/flowfrm.cxx +++ b/sw/source/core/layout/flowfrm.cxx @@ -326,7 +326,7 @@ sal_uInt8 SwFlowFrame::BwdMoveNecessary( const SwPageFrame *pPage, const SwRect // flow, because then I wouldn't evade it. if ( ::IsFrameInSameKontext( pAnchor, &m_rThis ) ) { - if ( rFormat.GetAnchor().GetAnchorId() == FLY_AT_PARA ) + if ( rFormat.GetAnchor().GetAnchorId() == RndStdIds::FLY_AT_PARA ) { // The index of the other one can be retrieved using the anchor attribute. sal_uLong nTmpIndex = rFormat.GetAnchor().GetContentAnchor()->nNode.GetIndex(); diff --git a/sw/source/core/layout/fly.cxx b/sw/source/core/layout/fly.cxx index 4f235b2ebe1b..704f28542f7f 100644 --- a/sw/source/core/layout/fly.cxx +++ b/sw/source/core/layout/fly.cxx @@ -714,7 +714,7 @@ void SwFlyFrame::UpdateAttr_( const SfxPoolItem *pOld, const SfxPoolItem *pNew, // By changing the flow of frame-bound Frames, a vertical alignment // can be activated/deactivated => MakeFlyPos - if( FLY_AT_FLY == GetFormat()->GetAnchor().GetAnchorId() ) + if( RndStdIds::FLY_AT_FLY == GetFormat()->GetAnchor().GetAnchorId() ) rInvFlags |= 0x09; // Delete contour in the Node if necessary @@ -1068,12 +1068,12 @@ void SwFlyFrame::ChgRelPos( const Point &rNewPos ) // #i34948# - handle also at-page and at-fly anchored // Writer fly frames const RndStdIds eAnchorType = GetFrameFormat().GetAnchor().GetAnchorId(); - if ( eAnchorType == FLY_AT_PAGE ) + if ( eAnchorType == RndStdIds::FLY_AT_PAGE ) { aVert.SetVertOrient( text::VertOrientation::NONE ); aVert.SetRelationOrient( text::RelOrientation::PAGE_FRAME ); } - else if ( eAnchorType == FLY_AT_FLY ) + else if ( eAnchorType == RndStdIds::FLY_AT_FLY ) { aVert.SetVertOrient( text::VertOrientation::NONE ); aVert.SetRelationOrient( text::RelOrientation::FRAME ); @@ -1120,13 +1120,13 @@ void SwFlyFrame::ChgRelPos( const Point &rNewPos ) SwFormatHoriOrient aHori( pFormat->GetHoriOrient() ); // #i34948# - handle also at-page and at-fly anchored // Writer fly frames - if ( eAnchorType == FLY_AT_PAGE ) + if ( eAnchorType == RndStdIds::FLY_AT_PAGE ) { aHori.SetHoriOrient( text::HoriOrientation::NONE ); aHori.SetRelationOrient( text::RelOrientation::PAGE_FRAME ); aHori.SetPosToggle( false ); } - else if ( eAnchorType == FLY_AT_FLY ) + else if ( eAnchorType == RndStdIds::FLY_AT_FLY ) { aHori.SetHoriOrient( text::HoriOrientation::NONE ); aHori.SetRelationOrient( text::RelOrientation::FRAME ); @@ -1469,7 +1469,7 @@ void CalcContent( SwLayoutFrame *pLay, bool bNoColl ) // When on auto position, we can only set it to // flow through if ((rFormat.GetAnchor().GetAnchorId() == - FLY_AT_CHAR) && + RndStdIds::FLY_AT_CHAR) && (css::text::WrapTextMode_PARALLEL == aAttr.GetSurround())) { @@ -2121,7 +2121,7 @@ void SwFrame::InvalidateObjs( const bool _bNoInvaOfAsCharAnchoredObjs ) { if ( _bNoInvaOfAsCharAnchoredObjs && (pAnchoredObj->GetFrameFormat().GetAnchor().GetAnchorId() - == FLY_AS_CHAR) ) + == RndStdIds::FLY_AS_CHAR) ) { continue; } diff --git a/sw/source/core/layout/flycnt.cxx b/sw/source/core/layout/flycnt.cxx index 8521e3354ddf..5dcead6ab0a3 100644 --- a/sw/source/core/layout/flycnt.cxx +++ b/sw/source/core/layout/flycnt.cxx @@ -70,7 +70,7 @@ SwFlyAtContentFrame::SwFlyAtContentFrame( SwFlyFrameFormat *pFormat, SwFrame* pS SwFlyFreeFrame( pFormat, pSib, pAnch ) { m_bAtCnt = true; - m_bAutoPosition = (FLY_AT_CHAR == pFormat->GetAnchor().GetAnchorId()); + m_bAutoPosition = (RndStdIds::FLY_AT_CHAR == pFormat->GetAnchor().GetAnchorId()); } // #i28701# diff --git a/sw/source/core/layout/flylay.cxx b/sw/source/core/layout/flylay.cxx index 496d6b9b9838..59f9e82fd78f 100644 --- a/sw/source/core/layout/flylay.cxx +++ b/sw/source/core/layout/flylay.cxx @@ -503,7 +503,7 @@ void SwFlyLayFrame::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew ) SwPageFrame *pOldPage = GetPageFrame(); AnchorFrame()->RemoveFly( this ); - if ( FLY_AT_PAGE == pAnch->GetAnchorId() ) + if ( RndStdIds::FLY_AT_PAGE == pAnch->GetAnchorId() ) { sal_uInt16 nPgNum = pAnch->GetPageNum(); SwRootFrame *pRoot = getRootFrame(); @@ -813,7 +813,7 @@ void SwPageFrame::AppendDrawObjToPage( SwAnchoredObject& _rNewObj ) pFlyFrame->GetVirtDrawObj()->SetOrdNum( nNewNum ); } - if ( FLY_AS_CHAR == _rNewObj.GetFrameFormat().GetAnchor().GetAnchorId() ) + if ( RndStdIds::FLY_AS_CHAR == _rNewObj.GetFrameFormat().GetAnchor().GetAnchorId() ) { return; } @@ -853,7 +853,7 @@ void SwPageFrame::RemoveDrawObjFromPage( SwAnchoredObject& _rToRemoveObj ) } if ( GetUpper() ) { - if (FLY_AS_CHAR != + if (RndStdIds::FLY_AS_CHAR != _rToRemoveObj.GetFrameFormat().GetAnchor().GetAnchorId()) { static_cast<SwRootFrame*>(GetUpper())->SetSuperfluous(); @@ -1173,7 +1173,7 @@ bool CalcClipRect( const SdrObject *pSdrObj, SwRect &rRect, bool bMove ) const SwDrawContact *pC = static_cast<const SwDrawContact*>(GetUserCall(pSdrObj)); const SwFrameFormat *pFormat = pC->GetFormat(); const SwFormatAnchor &rAnch = pFormat->GetAnchor(); - if ( FLY_AS_CHAR == rAnch.GetAnchorId() ) + if ( RndStdIds::FLY_AS_CHAR == rAnch.GetAnchorId() ) { const SwFrame* pAnchorFrame = pC->GetAnchorFrame( pSdrObj ); if( !pAnchorFrame ) diff --git a/sw/source/core/layout/flypos.cxx b/sw/source/core/layout/flypos.cxx index 0503f5adf247..ca3a8c07748f 100644 --- a/sw/source/core/layout/flypos.cxx +++ b/sw/source/core/layout/flypos.cxx @@ -40,7 +40,7 @@ SwPosFlyFrame::SwPosFlyFrame(const SwNodeIndex& rIdx, const SwFrameFormat* pForm : m_pFrameFormat(pFormat), m_pNodeIndex(const_cast<SwNodeIndex*>(&rIdx)), m_nOrdNum(SAL_MAX_UINT32) { const SwFormatAnchor& rAnchor = pFormat->GetAnchor(); - if(FLY_AT_PAGE == rAnchor.GetAnchorId()) + if(RndStdIds::FLY_AT_PAGE == rAnchor.GetAnchorId()) m_pNodeIndex = new SwNodeIndex(rIdx); else if(pFormat->GetDoc()->getIDocumentLayoutAccess().GetCurrentViewShell()) pFormat->CallSwClientNotify(sw::GetZOrderHint(m_nOrdNum)); @@ -54,7 +54,7 @@ SwPosFlyFrame::SwPosFlyFrame(const SwNodeIndex& rIdx, const SwFrameFormat* pForm SwPosFlyFrame::~SwPosFlyFrame() { const SwFormatAnchor& rAnchor = m_pFrameFormat->GetAnchor(); - if (FLY_AT_PAGE == rAnchor.GetAnchorId()) + if (RndStdIds::FLY_AT_PAGE == rAnchor.GetAnchorId()) { delete m_pNodeIndex; } diff --git a/sw/source/core/layout/frmtool.cxx b/sw/source/core/layout/frmtool.cxx index e0fa2f08c59e..2a449affe36c 100644 --- a/sw/source/core/layout/frmtool.cxx +++ b/sw/source/core/layout/frmtool.cxx @@ -894,7 +894,7 @@ SwContentNotify::~SwContentNotify() { SwFrameFormat *pFormat = (*pTable)[i]; const SwFormatAnchor &rAnch = pFormat->GetAnchor(); - if ( FLY_AT_PAGE != rAnch.GetAnchorId() || + if ( RndStdIds::FLY_AT_PAGE != rAnch.GetAnchorId() || rAnch.GetContentAnchor() == nullptr ) { continue; @@ -956,7 +956,7 @@ SwContentNotify::~SwContentNotify() for (SwAnchoredObject* pAnchoredObj : *pObjs) { if ( pAnchoredObj->GetFrameFormat().GetAnchor().GetAnchorId() - == FLY_AT_CHAR ) + == RndStdIds::FLY_AT_CHAR ) { pAnchoredObj->CheckCharRectAndTopOfLine( !pMasterFrame->IsEmpty() ); } @@ -998,17 +998,17 @@ void AppendObjs( const SwFrameFormats *pTable, sal_uLong nIndex, assert( checkPos != checkFormats.end()); checkFormats.erase( checkPos ); #endif - const bool bFlyAtFly = rAnch.GetAnchorId() == FLY_AT_FLY; // LAYER_IMPL + const bool bFlyAtFly = rAnch.GetAnchorId() == RndStdIds::FLY_AT_FLY; // LAYER_IMPL //Is a frame or a SdrObject described? const bool bSdrObj = RES_DRAWFRMFMT == pFormat->Which(); // OD 23.06.2003 #108784# - append also drawing objects anchored // as character. const bool bDrawObjInContent = bSdrObj && - (rAnch.GetAnchorId() == FLY_AS_CHAR); + (rAnch.GetAnchorId() == RndStdIds::FLY_AS_CHAR); if( bFlyAtFly || - (rAnch.GetAnchorId() == FLY_AT_PARA) || - (rAnch.GetAnchorId() == FLY_AT_CHAR) || + (rAnch.GetAnchorId() == RndStdIds::FLY_AT_PARA) || + (rAnch.GetAnchorId() == RndStdIds::FLY_AT_CHAR) || bDrawObjInContent ) { SdrObject* pSdrObj = nullptr; @@ -1084,7 +1084,7 @@ static inline bool lcl_ObjConnected(const SwFrameFormat* pFormat, const SwFrame* static inline bool lcl_InHeaderOrFooter(const SwFrameFormat& rFormat) { const SwFormatAnchor& rAnch = rFormat.GetAnchor(); - if (rAnch.GetAnchorId() == FLY_AT_PAGE) + if (rAnch.GetAnchorId() == RndStdIds::FLY_AT_PAGE) return false; return rFormat.GetDoc()->IsInHeaderFooter(rAnch.GetContentAnchor()->nNode); } @@ -1100,7 +1100,7 @@ void AppendAllObjs(const SwFrameFormats* pTable, const SwFrame* pSib) const auto& rAnch = pFormat->GetAnchor(); // Formats can still remain, because we neither use character bound // frames nor objects which are anchored to character bounds. - if ((rAnch.GetAnchorId() != FLY_AT_PAGE) && (rAnch.GetAnchorId() != FLY_AS_CHAR)) + if ((rAnch.GetAnchorId() != RndStdIds::FLY_AT_PAGE) && (rAnch.GetAnchorId() != RndStdIds::FLY_AS_CHAR)) vFormatsToConnect.push_back(pFormat); } const SwFrameFormat* pFirstRequeued(nullptr); @@ -2304,7 +2304,7 @@ static void lcl_RemoveObjsFromPage( SwFrame* _pFrame ) // #115759# - remove also drawing objects from page else if ( dynamic_cast<const SwAnchoredDrawObject*>( pObj) != nullptr ) { - if (pObj->GetFrameFormat().GetAnchor().GetAnchorId() != FLY_AS_CHAR) + if (pObj->GetFrameFormat().GetAnchor().GetAnchorId() != RndStdIds::FLY_AS_CHAR) { pObj->GetPageFrame()->RemoveDrawObjFromPage( *(static_cast<SwAnchoredDrawObject*>(pObj)) ); @@ -2466,7 +2466,7 @@ static void lcl_AddObjsToPage( SwFrame* _pFrame, SwPageFrame* _pPage ) // #115759# - remove also drawing objects from page else if ( dynamic_cast<const SwAnchoredDrawObject*>( pObj) != nullptr ) { - if (pObj->GetFrameFormat().GetAnchor().GetAnchorId() != FLY_AS_CHAR) + if (pObj->GetFrameFormat().GetAnchor().GetAnchorId() != RndStdIds::FLY_AS_CHAR) { pObj->InvalidateObjPos(); _pPage->AppendDrawObjToPage( diff --git a/sw/source/core/layout/objectformattertxtfrm.cxx b/sw/source/core/layout/objectformattertxtfrm.cxx index 4eb5d5009516..032f0cf9a304 100644 --- a/sw/source/core/layout/objectformattertxtfrm.cxx +++ b/sw/source/core/layout/objectformattertxtfrm.cxx @@ -580,8 +580,8 @@ bool SwObjectFormatterTextFrame::CheckMovedFwdCondition( // which will be on the next page. if ( !bAnchorIsMovedForward && _bAnchoredAtMasterBeforeFormatAnchor && - ((_rAnchoredObj.GetFrameFormat().GetAnchor().GetAnchorId() == FLY_AT_CHAR) || - (_rAnchoredObj.GetFrameFormat().GetAnchor().GetAnchorId() == FLY_AT_PARA))) + ((_rAnchoredObj.GetFrameFormat().GetAnchor().GetAnchorId() == RndStdIds::FLY_AT_CHAR) || + (_rAnchoredObj.GetFrameFormat().GetAnchor().GetAnchorId() == RndStdIds::FLY_AT_PARA))) { SwFrame* pAnchorFrame = _rAnchoredObj.GetAnchorFrameContainingAnchPos(); OSL_ENSURE( pAnchorFrame->IsTextFrame(), diff --git a/sw/source/core/layout/pagechg.cxx b/sw/source/core/layout/pagechg.cxx index 44ca0dd07756..356d5df770f2 100644 --- a/sw/source/core/layout/pagechg.cxx +++ b/sw/source/core/layout/pagechg.cxx @@ -373,7 +373,7 @@ static void lcl_MakeObjs( const SwFrameFormats &rTable, SwPageFrame *pPage ) { if( rAnch.GetContentAnchor() ) { - if (FLY_AT_PAGE == rAnch.GetAnchorId()) + if (RndStdIds::FLY_AT_PAGE == rAnch.GetAnchorId()) { SwFormatAnchor aAnch( rAnch ); aAnch.SetAnchor( nullptr ); @@ -1518,7 +1518,7 @@ void SwRootFrame::AssertPageFlys( SwPageFrame *pPage ) SwFrameFormat& rFormat = (*pPage->GetSortedObjs())[i]->GetFrameFormat(); const SwFormatAnchor &rAnch = rFormat.GetAnchor(); const sal_uInt16 nPg = rAnch.GetPageNum(); - if ((rAnch.GetAnchorId() == FLY_AT_PAGE) && + if ((rAnch.GetAnchorId() == RndStdIds::FLY_AT_PAGE) && nPg != pPage->GetPhyPageNum() ) { SAL_INFO( "sw.pageframe", nPg << " " << pPage->GetPhyPageNum() ); @@ -1661,11 +1661,11 @@ void SwRootFrame::ImplCalcBrowseWidth() long nWidth = 0; switch ( rFormat.GetAnchor().GetAnchorId() ) { - case FLY_AS_CHAR: + case RndStdIds::FLY_AS_CHAR: nWidth = bFly ? rFormat.GetFrameSize().GetWidth() : pAnchoredObj->GetObjRect().Width(); break; - case FLY_AT_PARA: + case RndStdIds::FLY_AT_PARA: { // #i33170# // Reactivated old code because @@ -1812,7 +1812,7 @@ static void lcl_MoveAllLowerObjs( SwFrame* pFrame, const Point& rOffset ) // all except from the as character anchored objects are moved // when processing the page frame: - if ( !bPage && (rAnchor.GetAnchorId() != FLY_AS_CHAR) ) + if ( !bPage && (rAnchor.GetAnchorId() != RndStdIds::FLY_AS_CHAR) ) continue; SwObjPositioningInProgress aPosInProgress( *pAnchoredObj ); diff --git a/sw/source/core/layout/sortedobjs.cxx b/sw/source/core/layout/sortedobjs.cxx index 72f9db7256fe..da019d065046 100644 --- a/sw/source/core/layout/sortedobjs.cxx +++ b/sw/source/core/layout/sortedobjs.cxx @@ -64,9 +64,9 @@ namespace { int GetAnchorWeight(RndStdIds eAnchor) { - if (eAnchor == FLY_AT_CHAR) + if (eAnchor == RndStdIds::FLY_AT_CHAR) return 0; - if (eAnchor == FLY_AS_CHAR) + if (eAnchor == RndStdIds::FLY_AS_CHAR) return 1; return 2; } @@ -86,36 +86,36 @@ struct ObjAnchorOrder const SwFormatAnchor* pAnchorNew = &(rFormatNew.GetAnchor()); // check for to-page anchored objects - if ((pAnchorListed->GetAnchorId() == FLY_AT_PAGE) && - (pAnchorNew ->GetAnchorId() != FLY_AT_PAGE)) + if ((pAnchorListed->GetAnchorId() == RndStdIds::FLY_AT_PAGE) && + (pAnchorNew ->GetAnchorId() != RndStdIds::FLY_AT_PAGE)) { return true; } - else if ((pAnchorListed->GetAnchorId() != FLY_AT_PAGE) && - (pAnchorNew ->GetAnchorId() == FLY_AT_PAGE)) + else if ((pAnchorListed->GetAnchorId() != RndStdIds::FLY_AT_PAGE) && + (pAnchorNew ->GetAnchorId() == RndStdIds::FLY_AT_PAGE)) { return false; } - else if ((pAnchorListed->GetAnchorId() == FLY_AT_PAGE) && - (pAnchorNew ->GetAnchorId() == FLY_AT_PAGE)) + else if ((pAnchorListed->GetAnchorId() == RndStdIds::FLY_AT_PAGE) && + (pAnchorNew ->GetAnchorId() == RndStdIds::FLY_AT_PAGE)) { return pAnchorListed->GetOrder() < pAnchorNew->GetOrder(); } // Both objects aren't anchored to page. // Thus, check for to-fly anchored objects - if ((pAnchorListed->GetAnchorId() == FLY_AT_FLY) && - (pAnchorNew ->GetAnchorId() != FLY_AT_FLY)) + if ((pAnchorListed->GetAnchorId() == RndStdIds::FLY_AT_FLY) && + (pAnchorNew ->GetAnchorId() != RndStdIds::FLY_AT_FLY)) { return true; } - else if ((pAnchorListed->GetAnchorId() != FLY_AT_FLY) && - (pAnchorNew ->GetAnchorId() == FLY_AT_FLY)) + else if ((pAnchorListed->GetAnchorId() != RndStdIds::FLY_AT_FLY) && + (pAnchorNew ->GetAnchorId() == RndStdIds::FLY_AT_FLY)) { return false; } - else if ((pAnchorListed->GetAnchorId() == FLY_AT_FLY) && - (pAnchorNew ->GetAnchorId() == FLY_AT_FLY)) + else if ((pAnchorListed->GetAnchorId() == RndStdIds::FLY_AT_FLY) && + (pAnchorNew ->GetAnchorId() == RndStdIds::FLY_AT_FLY)) { return pAnchorListed->GetOrder() < pAnchorNew->GetOrder(); } @@ -136,9 +136,9 @@ struct ObjAnchorOrder // if not anchored at-paragraph if (pContentAnchorListed && pContentAnchorNew) { - sal_Int32 nListedIndex = pAnchorListed->GetAnchorId() != FLY_AT_PARA ? + sal_Int32 nListedIndex = pAnchorListed->GetAnchorId() != RndStdIds::FLY_AT_PARA ? pContentAnchorListed->nContent.GetIndex() : 0; - sal_Int32 nNewIndex = pAnchorNew->GetAnchorId() != FLY_AT_PARA ? + sal_Int32 nNewIndex = pAnchorNew->GetAnchorId() != RndStdIds::FLY_AT_PARA ? pContentAnchorNew->nContent.GetIndex() : 0; if (nListedIndex != nNewIndex) { diff --git a/sw/source/core/layout/tabfrm.cxx b/sw/source/core/layout/tabfrm.cxx index ad276edb57c9..e217725bcbc0 100644 --- a/sw/source/core/layout/tabfrm.cxx +++ b/sw/source/core/layout/tabfrm.cxx @@ -273,7 +273,7 @@ static void lcl_InvalidateLowerObjs( SwLayoutFrame& _rLayoutFrame, pAnchoredObj->ClearCharRectAndTopOfLine(); pAnchoredObj->SetCurrRelPos( Point( 0, 0 ) ); if ( pAnchoredObj->GetFrameFormat().GetAnchor().GetAnchorId() - == FLY_AS_CHAR ) + == RndStdIds::FLY_AS_CHAR ) { pAnchoredObj->AnchorFrame() ->Prepare( PREP_FLY_ATTR_CHG, @@ -3683,7 +3683,7 @@ long CalcHeightWithFlys( const SwFrame *pFrame ) // the text flow have to be considered. const SwFrameFormat& rFrameFormat = pAnchoredObj->GetFrameFormat(); const bool bConsiderObj = - (rFrameFormat.GetAnchor().GetAnchorId() != FLY_AS_CHAR) && + (rFrameFormat.GetAnchor().GetAnchorId() != RndStdIds::FLY_AS_CHAR) && pAnchoredObj->GetObjRect().Top() != FAR_AWAY && rFrameFormat.GetFollowTextFlow().GetValue() && pAnchoredObj->GetPageFrame() == pTmp->FindPageFrame(); @@ -4675,7 +4675,7 @@ static bool lcl_ArrangeLowers( SwLayoutFrame *pLay, long lYStart, bool bInva ) !( pTabFrame->IsFollow() && pTabFrame->FindMaster()->IsRebuildLastLine() ) && (pAnchoredObj->GetFrameFormat().GetAnchor().GetAnchorId() - != FLY_AS_CHAR)) + != RndStdIds::FLY_AS_CHAR)) { SwPageFrame* pPageFrame = pAnchoredObj->GetPageFrame(); SwPageFrame* pPageOfAnchor = pFrame->FindPageFrame(); diff --git a/sw/source/core/layout/wsfrm.cxx b/sw/source/core/layout/wsfrm.cxx index 79ba414c06cf..651a6f12a666 100644 --- a/sw/source/core/layout/wsfrm.cxx +++ b/sw/source/core/layout/wsfrm.cxx @@ -3741,8 +3741,8 @@ void SwRootFrame::InvalidateAllObjPos() for (SwAnchoredObject* pAnchoredObj : rObjs) { const SwFormatAnchor& rAnch = pAnchoredObj->GetFrameFormat().GetAnchor(); - if ((rAnch.GetAnchorId() != FLY_AT_PARA) && - (rAnch.GetAnchorId() != FLY_AT_CHAR)) + if ((rAnch.GetAnchorId() != RndStdIds::FLY_AT_PARA) && + (rAnch.GetAnchorId() != RndStdIds::FLY_AT_CHAR)) { // only to paragraph and to character anchored objects are considered. continue; diff --git a/sw/source/core/objectpositioning/tocntntanchoredobjectposition.cxx b/sw/source/core/objectpositioning/tocntntanchoredobjectposition.cxx index fa16f3741b7e..74967f30b76b 100644 --- a/sw/source/core/objectpositioning/tocntntanchoredobjectposition.cxx +++ b/sw/source/core/objectpositioning/tocntntanchoredobjectposition.cxx @@ -193,7 +193,7 @@ void SwToContentAnchoredObjectPosition::CalcPosition() { // if object is at-character anchored, determine character-rectangle // and frame, position has to be oriented at. - mbAnchorToChar = (FLY_AT_CHAR == rFrameFormat.GetAnchor().GetAnchorId()); + mbAnchorToChar = (RndStdIds::FLY_AT_CHAR == rFrameFormat.GetAnchor().GetAnchorId()); if ( mbAnchorToChar ) { const SwFormatAnchor& rAnch = rFrameFormat.GetAnchor(); diff --git a/sw/source/core/objectpositioning/tolayoutanchoredobjectposition.cxx b/sw/source/core/objectpositioning/tolayoutanchoredobjectposition.cxx index d3ddf25465cb..82f731a55521 100644 --- a/sw/source/core/objectpositioning/tolayoutanchoredobjectposition.cxx +++ b/sw/source/core/objectpositioning/tolayoutanchoredobjectposition.cxx @@ -58,7 +58,7 @@ void SwToLayoutAnchoredObjectPosition::CalcPosition() const SvxLRSpaceItem &rLR = rFrameFormat.GetLRSpace(); const SvxULSpaceItem &rUL = rFrameFormat.GetULSpace(); - const bool bFlyAtFly = FLY_AT_FLY == rFrameFormat.GetAnchor().GetAnchorId(); + const bool bFlyAtFly = RndStdIds::FLY_AT_FLY == rFrameFormat.GetAnchor().GetAnchorId(); // determine position. // 'vertical' and 'horizontal' position are calculated separately diff --git a/sw/source/core/text/EnhancedPDFExportHelper.cxx b/sw/source/core/text/EnhancedPDFExportHelper.cxx index 0d39d8319176..129770957527 100644 --- a/sw/source/core/text/EnhancedPDFExportHelper.cxx +++ b/sw/source/core/text/EnhancedPDFExportHelper.cxx @@ -344,9 +344,9 @@ bool SwTaggedPDFHelper::CheckReopenTag() { const SwFormatAnchor& rAnchor = static_cast<const SwFlyFrame*>(&rFrame)->GetFormat()->GetAnchor(); - if ((FLY_AT_PARA == rAnchor.GetAnchorId()) || - (FLY_AT_CHAR == rAnchor.GetAnchorId()) || - (FLY_AT_PAGE == rAnchor.GetAnchorId())) + if ((RndStdIds::FLY_AT_PARA == rAnchor.GetAnchorId()) || + (RndStdIds::FLY_AT_CHAR == rAnchor.GetAnchorId()) || + (RndStdIds::FLY_AT_PAGE == rAnchor.GetAnchorId())) { pKeyFrame = static_cast<const SwFlyFrame&>(rFrame).GetAnchorFrame(); bContinue = true; @@ -1796,7 +1796,7 @@ void SwEnhancedPDFExportHelper::EnhancedPDFExport() // #i44368# Links in Header/Footer const SwFormatAnchor &rAnch = pFrameFormat->GetAnchor(); - if (FLY_AT_PAGE != rAnch.GetAnchorId()) + if (RndStdIds::FLY_AT_PAGE != rAnch.GetAnchorId()) { const SwPosition* pPosition = rAnch.GetContentAnchor(); if ( pPosition && pDoc->IsInHeaderFooter( pPosition->nNode ) ) diff --git a/sw/source/core/text/frmform.cxx b/sw/source/core/text/frmform.cxx index ee4844c48f4d..8a5efa1c706c 100644 --- a/sw/source/core/text/frmform.cxx +++ b/sw/source/core/text/frmform.cxx @@ -969,7 +969,7 @@ void SwTextFrame::FormatAdjust( SwTextFormatter &rLine, bool bOnlyContainsAsCharAnchoredObj = !IsFollow() && nStrLen == 1 && GetDrawObjs() && GetDrawObjs()->size() == 1 && - (*GetDrawObjs())[0]->GetFrameFormat().GetAnchor().GetAnchorId() == FLY_AS_CHAR; + (*GetDrawObjs())[0]->GetFrameFormat().GetAnchor().GetAnchorId() == RndStdIds::FLY_AS_CHAR; // Still try split text frame if we have columns. if (FindColFrame()) diff --git a/sw/source/core/text/itratr.cxx b/sw/source/core/text/itratr.cxx index 0182fd07747e..f37b593b8d91 100644 --- a/sw/source/core/text/itratr.cxx +++ b/sw/source/core/text/itratr.cxx @@ -432,8 +432,8 @@ static void lcl_MinMaxNode( SwFrameFormat* pNd, SwMinMaxNodeArgs* pIn ) { const SwFormatAnchor& rFormatA = pNd->GetAnchor(); - if ((FLY_AT_PARA != rFormatA.GetAnchorId()) && - (FLY_AT_CHAR != rFormatA.GetAnchorId())) + if ((RndStdIds::FLY_AT_PARA != rFormatA.GetAnchorId()) && + (RndStdIds::FLY_AT_CHAR != rFormatA.GetAnchorId())) { return; } diff --git a/sw/source/core/text/porfly.cxx b/sw/source/core/text/porfly.cxx index 5386a500808d..b24fe59e84a3 100644 --- a/sw/source/core/text/porfly.cxx +++ b/sw/source/core/text/porfly.cxx @@ -157,7 +157,7 @@ void SwTextFrame::MoveFlyInCnt( SwTextFrame *pNew, sal_Int32 nStart, sal_Int32 n // Consider changed type of <SwSortedList> entries SwAnchoredObject* pAnchoredObj = (*pObjs)[i]; const SwFormatAnchor& rAnch = pAnchoredObj->GetFrameFormat().GetAnchor(); - if (rAnch.GetAnchorId() == FLY_AS_CHAR) + if (rAnch.GetAnchorId() == RndStdIds::FLY_AS_CHAR) { const SwPosition* pPos = rAnch.GetContentAnchor(); const sal_Int32 nIdx = pPos->nContent.GetIndex(); @@ -346,7 +346,7 @@ void SwFlyCntPortion::SetBase( const SwTextFrame& rFrame, const Point &rBase, SwFrameFormat* pShape = FindFrameFormat(pSdrObj); const SwFormatAnchor& rAnchor(pShape->GetAnchor()); - if (rAnchor.GetAnchorId() == FLY_AS_CHAR) + if (rAnchor.GetAnchorId() == RndStdIds::FLY_AS_CHAR) { // This is an inline draw shape, see if it has a textbox. SwFrameFormat* pTextBox = SwTextBoxHelper::getOtherTextBoxFormat(pShape, RES_DRAWFRMFMT); diff --git a/sw/source/core/text/txtfly.cxx b/sw/source/core/text/txtfly.cxx index 7c32123aae9e..19e6e18b72d5 100644 --- a/sw/source/core/text/txtfly.cxx +++ b/sw/source/core/text/txtfly.cxx @@ -512,8 +512,8 @@ bool SwTextFly::DrawTextOpaque( SwDrawTextInfo &rInf ) ( !rSur.IsAnchorOnly() || // #i68520# GetMaster() == rFly.GetAnchorFrame() || - ((FLY_AT_PARA != rAnchor.GetAnchorId()) && - (FLY_AT_CHAR != rAnchor.GetAnchorId()) + ((RndStdIds::FLY_AT_PARA != rAnchor.GetAnchorId()) && + (RndStdIds::FLY_AT_CHAR != rAnchor.GetAnchorId()) ) ) && // #i68520# @@ -654,7 +654,7 @@ bool SwTextFly::GetTop( const SwAnchoredObject* _pAnchoredObj, // #i26945# const SwFrameFormat& rFrameFormat = _pAnchoredObj->GetFrameFormat(); const SwFormatAnchor& rNewA = rFrameFormat.GetAnchor(); - if (FLY_AT_PAGE == rNewA.GetAnchorId()) + if (RndStdIds::FLY_AT_PAGE == rNewA.GetAnchorId()) { if ( bInFootnote ) return false; @@ -700,27 +700,27 @@ bool SwTextFly::GetTop( const SwAnchoredObject* _pAnchoredObj, // If <mpCurrAnchoredObj> is anchored as character, its content // does not wrap around pNew - if (FLY_AS_CHAR == rCurrA.GetAnchorId()) + if (RndStdIds::FLY_AS_CHAR == rCurrA.GetAnchorId()) return false; // If pNew is anchored to page and <mpCurrAnchoredObj is not anchored // to page, the content of <mpCurrAnchoredObj> does not wrap around pNew // If both pNew and <mpCurrAnchoredObj> are anchored to page, we can do // some more checks - if (FLY_AT_PAGE == rNewA.GetAnchorId()) + if (RndStdIds::FLY_AT_PAGE == rNewA.GetAnchorId()) { - if (FLY_AT_PAGE == rCurrA.GetAnchorId()) + if (RndStdIds::FLY_AT_PAGE == rCurrA.GetAnchorId()) { bEvade = true; } else return false; } - else if (FLY_AT_PAGE == rCurrA.GetAnchorId()) + else if (RndStdIds::FLY_AT_PAGE == rCurrA.GetAnchorId()) return false; // Page anchored ones only avoid page anchored ones - else if (FLY_AT_FLY == rNewA.GetAnchorId()) + else if (RndStdIds::FLY_AT_FLY == rNewA.GetAnchorId()) bEvade = true; // Non-page anchored ones avoid frame anchored ones - else if( FLY_AT_FLY == rCurrA.GetAnchorId() ) + else if( RndStdIds::FLY_AT_FLY == rCurrA.GetAnchorId() ) return false; // Frame anchored ones do not avoid paragraph anchored ones // #i57062# // In order to avoid loop situation, it's decided to adjust @@ -749,9 +749,9 @@ bool SwTextFly::GetTop( const SwAnchoredObject* _pAnchoredObj, { // #i26945# const SwFormatAnchor& rNewA = _pAnchoredObj->GetFrameFormat().GetAnchor(); - OSL_ENSURE( FLY_AS_CHAR != rNewA.GetAnchorId(), + OSL_ENSURE( RndStdIds::FLY_AS_CHAR != rNewA.GetAnchorId(), "Don't call GetTop with a FlyInContentFrame" ); - if (FLY_AT_PAGE == rNewA.GetAnchorId()) + if (RndStdIds::FLY_AT_PAGE == rNewA.GetAnchorId()) return true; // We always avoid page anchored ones // If Flys anchored at paragraph are caught in a FlyCnt, then @@ -805,7 +805,7 @@ bool SwTextFly::GetTop( const SwAnchoredObject* _pAnchoredObj, !pHeader->IsFooterFrame() && pCurrFrame->IsInDocBody() ) ) ) { - if( pHeader || FLY_AT_FLY == rNewA.GetAnchorId() ) + if( pHeader || RndStdIds::FLY_AT_FLY == rNewA.GetAnchorId() ) return true; // Compare indices: @@ -1030,8 +1030,8 @@ bool SwTextFly::ForEach( const SwRect &rRect, SwRect* pRect, bool bAvoid ) const ( !rSur.IsAnchorOnly() || // #i68520# GetMaster() == pAnchoredObj->GetAnchorFrame() || - ((FLY_AT_PARA != rAnchor.GetAnchorId()) && - (FLY_AT_CHAR != rAnchor.GetAnchorId())) ) ) + ((RndStdIds::FLY_AT_PARA != rAnchor.GetAnchorId()) && + (RndStdIds::FLY_AT_CHAR != rAnchor.GetAnchorId())) ) ) || aRect.Top() == FAR_AWAY ) continue; } @@ -1315,8 +1315,8 @@ css::text::WrapTextMode SwTextFly::GetSurroundForTextWrap( const SwAnchoredObjec if( rFlyFormat.IsAnchorOnly() && pAnchoredObj->GetAnchorFrame() != GetMaster() ) { const SwFormatAnchor& rAnchor = pFormat->GetAnchor(); - if ((FLY_AT_PARA == rAnchor.GetAnchorId()) || - (FLY_AT_CHAR == rAnchor.GetAnchorId())) + if ((RndStdIds::FLY_AT_PARA == rAnchor.GetAnchorId()) || + (RndStdIds::FLY_AT_CHAR == rAnchor.GetAnchorId())) { return css::text::WrapTextMode_NONE; } diff --git a/sw/source/core/text/txtfrm.cxx b/sw/source/core/text/txtfrm.cxx index 25cef9fc8347..d27a21cdadd7 100644 --- a/sw/source/core/text/txtfrm.cxx +++ b/sw/source/core/text/txtfrm.cxx @@ -515,7 +515,7 @@ bool sw_HideObj( const SwTextFrame& _rFrame, { bool bRet( true ); - if (_eAnchorType == FLY_AT_CHAR) + if (_eAnchorType == RndStdIds::FLY_AT_CHAR) { const IDocumentSettingAccess* pIDSA = _rFrame.GetTextNode()->getIDocumentSettingAccess(); if ( !pIDSA->get(DocumentSettingId::USE_FORMER_TEXT_WRAPPING) && @@ -582,7 +582,7 @@ void SwTextFrame::HideAndShowObjects() // under certain conditions const RndStdIds eAnchorType( pContact->GetAnchorId() ); const sal_Int32 nObjAnchorPos = pContact->GetContentAnchorIndex().GetIndex(); - if ((eAnchorType != FLY_AT_CHAR) || + if ((eAnchorType != RndStdIds::FLY_AT_CHAR) || sw_HideObj( *this, eAnchorType, nObjAnchorPos, i )) { @@ -609,12 +609,12 @@ void SwTextFrame::HideAndShowObjects() // Determine anchor type only once const RndStdIds eAnchorType( pContact->GetAnchorId() ); - if (eAnchorType == FLY_AT_PARA) + if (eAnchorType == RndStdIds::FLY_AT_PARA) { pContact->MoveObjToVisibleLayer( pObj ); } - else if ((eAnchorType == FLY_AT_CHAR) || - (eAnchorType == FLY_AS_CHAR)) + else if ((eAnchorType == RndStdIds::FLY_AT_CHAR) || + (eAnchorType == RndStdIds::FLY_AS_CHAR)) { sal_Int32 nHiddenStart; sal_Int32 nHiddenEnd; @@ -1686,7 +1686,7 @@ bool SwTextFrame::Prepare( const PrepareHint ePrep, const void* pVoid, // i#28701 - consider all // to-character anchored objects if ( pAnchoredObj->GetFrameFormat().GetAnchor().GetAnchorId() - == FLY_AT_CHAR ) + == RndStdIds::FLY_AT_CHAR ) { bFormat = true; break; diff --git a/sw/source/core/txtnode/atrflyin.cxx b/sw/source/core/txtnode/atrflyin.cxx index cec358730c63..7efe6df4ad6a 100644 --- a/sw/source/core/txtnode/atrflyin.cxx +++ b/sw/source/core/txtnode/atrflyin.cxx @@ -104,7 +104,7 @@ void SwTextFlyCnt::CopyFlyFormat( SwDoc* pDoc ) // disable undo while copying attribute ::sw::UndoGuard const undoGuard(pDoc->GetIDocumentUndoRedo()); SwFormatAnchor aAnchor( pFormat->GetAnchor() ); - if ((FLY_AT_PAGE != aAnchor.GetAnchorId()) && + if ((RndStdIds::FLY_AT_PAGE != aAnchor.GetAnchorId()) && (pDoc != pFormat->GetDoc())) // different documents? { // JP 03.06.96: dann sorge dafuer, das der koperierte Anker auf @@ -117,7 +117,7 @@ void SwTextFlyCnt::CopyFlyFormat( SwDoc* pDoc ) SwPosition pos = *aAnchor.GetContentAnchor(); pos.nNode = aIdx; - if (FLY_AS_CHAR == aAnchor.GetAnchorId()) + if (RndStdIds::FLY_AS_CHAR == aAnchor.GetAnchorId()) { pos.nContent.Assign( pCNd, 0 ); } @@ -164,7 +164,7 @@ void SwTextFlyCnt::SetAnchor( const SwTextNode *pNode ) aPos.nNode = *pOldNode; } - aAnchor.SetType( FLY_AS_CHAR ); // default! + aAnchor.SetType( RndStdIds::FLY_AS_CHAR ); // default! aAnchor.SetAnchor( &aPos ); // beim Ankerwechsel werden immer alle FlyFrames vom Attribut geloescht diff --git a/sw/source/core/txtnode/ndtxt.cxx b/sw/source/core/txtnode/ndtxt.cxx index 22264c339ccc..4c8a4f77cb0b 100644 --- a/sw/source/core/txtnode/ndtxt.cxx +++ b/sw/source/core/txtnode/ndtxt.cxx @@ -1116,7 +1116,7 @@ void SwTextNode::Update( { const SwFormatAnchor& rAnchor = (*pFormat)->GetAnchor(); const SwPosition* pContentAnchor = rAnchor.GetContentAnchor(); - if (rAnchor.GetAnchorId() == FLY_AT_CHAR && pContentAnchor) + if (rAnchor.GetAnchorId() == RndStdIds::FLY_AT_CHAR && pContentAnchor) { // The fly is at-char anchored and has an anchor position. SwIndex& rEndIdx = const_cast<SwIndex&>(pContentAnchor->nContent); @@ -1137,7 +1137,7 @@ void SwTextNode::Update( SwFrameFormat const*const pFormat = (*pFlys)[i]; const SwFormatAnchor& rAnchor = pFormat->GetAnchor(); const SwPosition* pContentAnchor = rAnchor.GetContentAnchor(); - if (rAnchor.GetAnchorId() == FLY_AT_CHAR && pContentAnchor) + if (rAnchor.GetAnchorId() == RndStdIds::FLY_AT_CHAR && pContentAnchor) { // The fly is at-char anchored and has an anchor position. SwIndex& rEndIdx = const_cast<SwIndex&>(pContentAnchor->nContent); diff --git a/sw/source/core/txtnode/thints.cxx b/sw/source/core/txtnode/thints.cxx index e38856540c09..ad2e39a843bd 100644 --- a/sw/source/core/txtnode/thints.cxx +++ b/sw/source/core/txtnode/thints.cxx @@ -1287,7 +1287,7 @@ bool SwTextNode::InsertHint( SwTextAttr * const pAttr, const SetAttrMode nMode ) nInsMode |= SetAttrMode::NOTXTATRCHR; if (pAnchor && - (FLY_AS_CHAR == pAnchor->GetAnchorId()) && + (RndStdIds::FLY_AS_CHAR == pAnchor->GetAnchorId()) && pAnchor->GetContentAnchor() && pAnchor->GetContentAnchor()->nNode == *this && pAnchor->GetContentAnchor()->nContent == aIdx ) diff --git a/sw/source/core/undo/rolbck.cxx b/sw/source/core/undo/rolbck.cxx index 2a2c8c0eba60..eb19b089cd43 100644 --- a/sw/source/core/undo/rolbck.cxx +++ b/sw/source/core/undo/rolbck.cxx @@ -776,7 +776,7 @@ SwHistoryChangeFlyAnchor::SwHistoryChangeFlyAnchor( SwFrameFormat& rFormat ) : SwHistoryHint( HSTRY_CHGFLYANCHOR ) , m_rFormat( rFormat ) , m_nOldNodeIndex( rFormat.GetAnchor().GetContentAnchor()->nNode.GetIndex() ) - , m_nOldContentIndex( (FLY_AT_CHAR == rFormat.GetAnchor().GetAnchorId()) + , m_nOldContentIndex( (RndStdIds::FLY_AT_CHAR == rFormat.GetAnchor().GetAnchorId()) ? rFormat.GetAnchor().GetContentAnchor()->nContent.GetIndex() : COMPLETE_STRING ) { diff --git a/sw/source/core/undo/unattr.cxx b/sw/source/core/undo/unattr.cxx index 0354d15a0d25..d97b3953ced9 100644 --- a/sw/source/core/undo/unattr.cxx +++ b/sw/source/core/undo/unattr.cxx @@ -373,12 +373,12 @@ void SwUndoFormatAttr::SaveFlyAnchor( bool bSvDrwPt ) sal_Int32 nContent = 0; switch( rAnchor.GetAnchorId() ) { - case FLY_AS_CHAR: - case FLY_AT_CHAR: + case RndStdIds::FLY_AS_CHAR: + case RndStdIds::FLY_AT_CHAR: nContent = rAnchor.GetContentAnchor()->nContent.GetIndex(); SAL_FALLTHROUGH; - case FLY_AT_PARA: - case FLY_AT_FLY: + case RndStdIds::FLY_AT_PARA: + case RndStdIds::FLY_AT_FLY: m_nNodeIndex = rAnchor.GetContentAnchor()->nNode.GetIndex(); break; default: @@ -401,10 +401,10 @@ bool SwUndoFormatAttr::RestoreFlyAnchor(::sw::UndoRedoContext & rContext) static_cast<const SwFormatAnchor&>( m_pOldSet->Get( RES_ANCHOR, false ) ); SwFormatAnchor aNewAnchor( rAnchor.GetAnchorId() ); - if (FLY_AT_PAGE != rAnchor.GetAnchorId()) { + if (RndStdIds::FLY_AT_PAGE != rAnchor.GetAnchorId()) { SwNode* pNd = pDoc->GetNodes()[ m_nNodeIndex ]; - if ( (FLY_AT_FLY == rAnchor.GetAnchorId()) + if ( (RndStdIds::FLY_AT_FLY == rAnchor.GetAnchorId()) ? ( !pNd->IsStartNode() || (SwFlyStartNode != static_cast<SwStartNode*>(pNd)->GetStartNodeType()) ) : !pNd->IsTextNode() ) { @@ -414,8 +414,8 @@ bool SwUndoFormatAttr::RestoreFlyAnchor(::sw::UndoRedoContext & rContext) } SwPosition aPos( *pNd ); - if ((FLY_AS_CHAR == rAnchor.GetAnchorId()) || - (FLY_AT_CHAR == rAnchor.GetAnchorId())) { + if ((RndStdIds::FLY_AS_CHAR == rAnchor.GetAnchorId()) || + (RndStdIds::FLY_AT_CHAR == rAnchor.GetAnchorId())) { aPos.nContent.Assign( static_cast<SwTextNode*>(pNd), rAnchor.GetPageNum() ); if ( aPos.nContent.GetIndex() > pNd->GetTextNode()->GetText().getLength()) { // #i35443# - invalid position. @@ -447,7 +447,7 @@ bool SwUndoFormatAttr::RestoreFlyAnchor(::sw::UndoRedoContext & rContext) const SwFormatAnchor &rOldAnch = pFrameFormat->GetAnchor(); // #i54336# // Consider case, that as-character anchored object has moved its anchor position. - if (FLY_AS_CHAR == rOldAnch.GetAnchorId()) { + if (RndStdIds::FLY_AS_CHAR == rOldAnch.GetAnchorId()) { // With InContents it's tricky: the text attribute needs to be deleted. // Unfortunately, this not only destroys the Frames but also the format. // To prevent that, first detach the connection between attribute and @@ -491,7 +491,7 @@ bool SwUndoFormatAttr::RestoreFlyAnchor(::sw::UndoRedoContext & rContext) m_pOldSet->Put(SwFormatFrameSize(ATT_VAR_SIZE, aDrawOldPt.X(), aDrawOldPt.Y())); } - if (FLY_AS_CHAR == aNewAnchor.GetAnchorId()) { + if (RndStdIds::FLY_AS_CHAR == aNewAnchor.GetAnchorId()) { const SwPosition* pPos = aNewAnchor.GetContentAnchor(); SwTextNode* pTextNd = pPos->nNode.GetNode().GetTextNode(); OSL_ENSURE( pTextNd, "no Text Node at position." ); diff --git a/sw/source/core/undo/undel.cxx b/sw/source/core/undo/undel.cxx index 9ed7449890fa..41f48292d105 100644 --- a/sw/source/core/undo/undel.cxx +++ b/sw/source/core/undo/undel.cxx @@ -58,7 +58,7 @@ static void lcl_MakeAutoFrames( const SwFrameFormats& rSpzArr, sal_uLong nMovedI { SwFrameFormat * pFormat = rSpzArr[n]; const SwFormatAnchor* pAnchor = &pFormat->GetAnchor(); - if (pAnchor->GetAnchorId() == FLY_AT_CHAR) + if (pAnchor->GetAnchorId() == RndStdIds::FLY_AT_CHAR) { const SwPosition* pAPos = pAnchor->GetContentAnchor(); if( pAPos && nMovedIndex == pAPos->nNode.GetIndex() ) @@ -730,7 +730,7 @@ static void lcl_ReAnchorAtContentFlyFrames( const SwFrameFormats& rSpzArr, SwPos { pFormat = static_cast<SwFlyFrameFormat*>(rSpzArr[n]); pAnchor = &pFormat->GetAnchor(); - if (pAnchor->GetAnchorId() == FLY_AT_PARA) + if (pAnchor->GetAnchorId() == RndStdIds::FLY_AT_PARA) { pAPos = pAnchor->GetContentAnchor(); if( pAPos && nOldIdx == pAPos->nNode.GetIndex() ) diff --git a/sw/source/core/undo/undobj.cxx b/sw/source/core/undo/undobj.cxx index 6455257b1cfe..7a67c130ccc5 100644 --- a/sw/source/core/undo/undobj.cxx +++ b/sw/source/core/undo/undobj.cxx @@ -557,7 +557,7 @@ void SwUndoSaveContent::DelContentIndex( const SwPosition& rMark, pAnchor = &pFormat->GetAnchor(); switch( pAnchor->GetAnchorId() ) { - case FLY_AS_CHAR: + case RndStdIds::FLY_AS_CHAR: if( nullptr != (pAPos = pAnchor->GetContentAnchor() ) && (( DelContentType::CheckNoCntnt & nDelContentType ) ? ( pStt->nNode <= pAPos->nNode && @@ -576,7 +576,7 @@ void SwUndoSaveContent::DelContentIndex( const SwPosition& rMark, n = n >= rSpzArr.size() ? rSpzArr.size() : n+1; } break; - case FLY_AT_PARA: + case RndStdIds::FLY_AT_PARA: { pAPos = pAnchor->GetContentAnchor(); if( pAPos ) @@ -624,7 +624,7 @@ void SwUndoSaveContent::DelContentIndex( const SwPosition& rMark, } } break; - case FLY_AT_CHAR: + case RndStdIds::FLY_AT_CHAR: if( nullptr != (pAPos = pAnchor->GetContentAnchor() ) && ( pStt->nNode <= pAPos->nNode && pAPos->nNode <= pEnd->nNode ) ) { @@ -654,7 +654,7 @@ void SwUndoSaveContent::DelContentIndex( const SwPosition& rMark, } } break; - case FLY_AT_FLY: + case RndStdIds::FLY_AT_FLY: if( nullptr != (pAPos = pAnchor->GetContentAnchor() ) && pStt->nNode == pAPos->nNode ) diff --git a/sw/source/core/undo/undobj1.cxx b/sw/source/core/undo/undobj1.cxx index 6e9a9e4d25af..fb6d81acc208 100644 --- a/sw/source/core/undo/undobj1.cxx +++ b/sw/source/core/undo/undobj1.cxx @@ -44,7 +44,7 @@ SwUndoFlyBase::SwUndoFlyBase( SwFrameFormat* pFormat, SwUndoId nUndoId ) , pFrameFormat(pFormat) , nNdPgPos(0) , nCntPos(0) - , nRndId(0) + , nRndId(RndStdIds::FLY_AT_PARA) , bDelFormat(false) { } @@ -69,7 +69,7 @@ void SwUndoFlyBase::InsFly(::sw::UndoRedoContext & rContext, bool bShowSelFrame) SwFormatAnchor aAnchor( (RndStdIds)nRndId ); - if (FLY_AT_PAGE == nRndId) + if (RndStdIds::FLY_AT_PAGE == nRndId) { aAnchor.SetPageNum( (sal_uInt16)nNdPgPos ); } @@ -77,7 +77,7 @@ void SwUndoFlyBase::InsFly(::sw::UndoRedoContext & rContext, bool bShowSelFrame) { SwPosition aNewPos(pDoc->GetNodes().GetEndOfContent()); aNewPos.nNode = nNdPgPos; - if ((FLY_AS_CHAR == nRndId) || (FLY_AT_CHAR == nRndId)) + if ((RndStdIds::FLY_AS_CHAR == nRndId) || (RndStdIds::FLY_AT_CHAR == nRndId)) { aNewPos.nContent.Assign( aNewPos.nNode.GetNode().GetContentNode(), nCntPos ); @@ -98,7 +98,7 @@ void SwUndoFlyBase::InsFly(::sw::UndoRedoContext & rContext, bool bShowSelFrame) // Set InContentAttribute not until there is content! // Otherwise the layout would format the Fly beforehand but would not find // content; this happened with graphics from the internet. - if (FLY_AS_CHAR == nRndId) + if (RndStdIds::FLY_AS_CHAR == nRndId) { // there must be at least the attribute in a TextNode SwContentNode* pCNd = aAnchor.GetContentAnchor()->nNode.GetNode().GetContentNode(); @@ -119,23 +119,24 @@ void SwUndoFlyBase::InsFly(::sw::UndoRedoContext & rContext, bool bShowSelFrame) switch( nRndId ) { - case FLY_AS_CHAR: - case FLY_AT_CHAR: + case RndStdIds::FLY_AS_CHAR: + case RndStdIds::FLY_AT_CHAR: { const SwFormatAnchor& rAnchor = pFrameFormat->GetAnchor(); nNdPgPos = rAnchor.GetContentAnchor()->nNode.GetIndex(); nCntPos = rAnchor.GetContentAnchor()->nContent.GetIndex(); } break; - case FLY_AT_PARA: - case FLY_AT_FLY: + case RndStdIds::FLY_AT_PARA: + case RndStdIds::FLY_AT_FLY: { const SwFormatAnchor& rAnchor = pFrameFormat->GetAnchor(); nNdPgPos = rAnchor.GetContentAnchor()->nNode.GetIndex(); } break; - case FLY_AT_PAGE: + case RndStdIds::FLY_AT_PAGE: break; + default: break; } bDelFormat = false; } @@ -167,8 +168,8 @@ void SwUndoFlyBase::DelFly( SwDoc* pDoc ) const SwFormatAnchor& rAnchor = pFrameFormat->GetAnchor(); const SwPosition* pPos = rAnchor.GetContentAnchor(); // The positions in Nodes array got shifted. - nRndId = static_cast<sal_uInt16>(rAnchor.GetAnchorId()); - if (FLY_AS_CHAR == nRndId) + nRndId = rAnchor.GetAnchorId(); + if (RndStdIds::FLY_AS_CHAR == nRndId) { nNdPgPos = pPos->nNode.GetIndex(); nCntPos = pPos->nContent.GetIndex(); @@ -185,12 +186,12 @@ void SwUndoFlyBase::DelFly( SwDoc* pDoc ) pTextNd->EraseText( aIdx, 1 ); } } - else if (FLY_AT_CHAR == nRndId) + else if (RndStdIds::FLY_AT_CHAR == nRndId) { nNdPgPos = pPos->nNode.GetIndex(); nCntPos = pPos->nContent.GetIndex(); } - else if ((FLY_AT_PARA == nRndId) || (FLY_AT_FLY == nRndId)) + else if ((RndStdIds::FLY_AT_PARA == nRndId) || (RndStdIds::FLY_AT_FLY == nRndId)) { nNdPgPos = pPos->nNode.GetIndex(); } @@ -212,19 +213,19 @@ SwUndoInsLayFormat::SwUndoInsLayFormat( SwFrameFormat* pFormat, sal_uLong nNodeI mnCursorSaveIndexPara( nNodeIdx ), mnCursorSaveIndexPos( nCntIdx ) { const SwFormatAnchor& rAnchor = pFrameFormat->GetAnchor(); - nRndId = static_cast<sal_uInt16>(rAnchor.GetAnchorId()); + nRndId = rAnchor.GetAnchorId(); bDelFormat = false; switch( nRndId ) { - case FLY_AT_PAGE: + case RndStdIds::FLY_AT_PAGE: nNdPgPos = rAnchor.GetPageNum(); break; - case FLY_AT_PARA: - case FLY_AT_FLY: + case RndStdIds::FLY_AT_PARA: + case RndStdIds::FLY_AT_FLY: nNdPgPos = rAnchor.GetContentAnchor()->nNode.GetIndex(); break; - case FLY_AS_CHAR: - case FLY_AT_CHAR: + case RndStdIds::FLY_AS_CHAR: + case RndStdIds::FLY_AT_CHAR: { const SwPosition* pPos = rAnchor.GetContentAnchor(); nCntPos = pPos->nContent.GetIndex(); @@ -281,18 +282,18 @@ void SwUndoInsLayFormat::RepeatImpl(::sw::RepeatContext & rContext) SwDoc *const pDoc = & rContext.GetDoc(); // get anchor and reset it SwFormatAnchor aAnchor( pFrameFormat->GetAnchor() ); - if ((FLY_AT_PARA == aAnchor.GetAnchorId()) || - (FLY_AT_CHAR == aAnchor.GetAnchorId()) || - (FLY_AS_CHAR == aAnchor.GetAnchorId())) + if ((RndStdIds::FLY_AT_PARA == aAnchor.GetAnchorId()) || + (RndStdIds::FLY_AT_CHAR == aAnchor.GetAnchorId()) || + (RndStdIds::FLY_AS_CHAR == aAnchor.GetAnchorId())) { SwPosition aPos( *rContext.GetRepeatPaM().GetPoint() ); - if (FLY_AT_PARA == aAnchor.GetAnchorId()) + if (RndStdIds::FLY_AT_PARA == aAnchor.GetAnchorId()) { aPos.nContent.Assign( nullptr, 0 ); } aAnchor.SetAnchor( &aPos ); } - else if( FLY_AT_FLY == aAnchor.GetAnchorId() ) + else if( RndStdIds::FLY_AT_FLY == aAnchor.GetAnchorId() ) { SwStartNode const*const pSttNd = rContext.GetRepeatPaM().GetNode().FindFlyStartNode(); @@ -306,7 +307,7 @@ void SwUndoInsLayFormat::RepeatImpl(::sw::RepeatContext & rContext) return ; } } - else if (FLY_AT_PAGE == aAnchor.GetAnchorId()) + else if (RndStdIds::FLY_AT_PAGE == aAnchor.GetAnchorId()) { aAnchor.SetPageNum( pDoc->getIDocumentLayoutAccess().GetCurrentLayout()->GetCurrPage( &rContext.GetRepeatPaM() )); } @@ -443,7 +444,7 @@ SwUndoSetFlyFormat::SwUndoSetFlyFormat( SwFrameFormat& rFlyFormat, SwFrameFormat rFlyFormat.GetAttrSet().GetRanges() )), nOldNode( 0 ), nNewNode( 0 ), nOldContent( 0 ), nNewContent( 0 ), - nOldAnchorTyp( 0 ), nNewAnchorTyp( 0 ), bAnchorChgd( false ) + nOldAnchorTyp( RndStdIds::FLY_AT_PARA ), nNewAnchorTyp( RndStdIds::FLY_AT_PARA ), bAnchorChgd( false ) { } @@ -470,11 +471,11 @@ void SwUndoSetFlyFormat::GetAnchor( SwFormatAnchor& rAnchor, sal_uLong nNode, sal_Int32 nContent ) { RndStdIds nAnchorTyp = rAnchor.GetAnchorId(); - if (FLY_AT_PAGE != nAnchorTyp) + if (RndStdIds::FLY_AT_PAGE != nAnchorTyp) { SwNode* pNd = pFrameFormat->GetDoc()->GetNodes()[ nNode ]; - if( FLY_AT_FLY == nAnchorTyp + if( RndStdIds::FLY_AT_FLY == nAnchorTyp ? ( !pNd->IsStartNode() || SwFlyStartNode != static_cast<SwStartNode*>(pNd)->GetStartNodeType() ) : !pNd->IsTextNode() ) @@ -484,8 +485,8 @@ void SwUndoSetFlyFormat::GetAnchor( SwFormatAnchor& rAnchor, else { SwPosition aPos( *pNd ); - if ((FLY_AS_CHAR == nAnchorTyp) || - (FLY_AT_CHAR == nAnchorTyp)) + if ((RndStdIds::FLY_AS_CHAR == nAnchorTyp) || + (RndStdIds::FLY_AT_CHAR == nAnchorTyp)) { if (nContent > pNd->GetTextNode()->GetText().getLength()) { @@ -505,7 +506,7 @@ void SwUndoSetFlyFormat::GetAnchor( SwFormatAnchor& rAnchor, if( !pNd ) { // invalid position - assign first page - rAnchor.SetType( FLY_AT_PAGE ); + rAnchor.SetType( RndStdIds::FLY_AT_PAGE ); rAnchor.SetPageNum( 1 ); } } @@ -544,7 +545,7 @@ void SwUndoSetFlyFormat::UndoImpl(::sw::UndoRedoContext & rContext) if( bAnchorChgd ) { const SwFormatAnchor& rOldAnch = pFrameFormat->GetAnchor(); - if (FLY_AS_CHAR == rOldAnch.GetAnchorId()) + if (RndStdIds::FLY_AS_CHAR == rOldAnch.GetAnchorId()) { // With InContents it's tricky: the text attribute needs to be // deleted. Unfortunately, this not only destroys the Frames but @@ -572,7 +573,7 @@ void SwUndoSetFlyFormat::UndoImpl(::sw::UndoRedoContext & rContext) GetAnchor( aNewAnchor, nOldNode, nOldContent ); pFrameFormat->SetFormatAttr( aNewAnchor ); - if (FLY_AS_CHAR == aNewAnchor.GetAnchorId()) + if (RndStdIds::FLY_AS_CHAR == aNewAnchor.GetAnchorId()) { const SwPosition* pPos = aNewAnchor.GetContentAnchor(); SwFormatFlyCnt aFormat( pFrameFormat ); @@ -622,14 +623,14 @@ void SwUndoSetFlyFormat::PutAttr( sal_uInt16 nWhich, const SfxPoolItem* pItem ) bAnchorChgd = true; const SwFormatAnchor* pAnchor = static_cast<const SwFormatAnchor*>(pItem); - switch( nOldAnchorTyp = static_cast<sal_uInt16>(pAnchor->GetAnchorId()) ) + switch( nOldAnchorTyp = pAnchor->GetAnchorId() ) { - case FLY_AS_CHAR: - case FLY_AT_CHAR: + case RndStdIds::FLY_AS_CHAR: + case RndStdIds::FLY_AT_CHAR: nOldContent = pAnchor->GetContentAnchor()->nContent.GetIndex(); SAL_FALLTHROUGH; - case FLY_AT_PARA: - case FLY_AT_FLY: + case RndStdIds::FLY_AT_PARA: + case RndStdIds::FLY_AT_FLY: nOldNode = pAnchor->GetContentAnchor()->nNode.GetIndex(); break; @@ -638,14 +639,14 @@ void SwUndoSetFlyFormat::PutAttr( sal_uInt16 nWhich, const SfxPoolItem* pItem ) } pAnchor = &pFrameFormat->GetAnchor(); - switch( nNewAnchorTyp = static_cast<sal_uInt16>(pAnchor->GetAnchorId()) ) + switch( nNewAnchorTyp = pAnchor->GetAnchorId() ) { - case FLY_AS_CHAR: - case FLY_AT_CHAR: + case RndStdIds::FLY_AS_CHAR: + case RndStdIds::FLY_AT_CHAR: nNewContent = pAnchor->GetContentAnchor()->nContent.GetIndex(); SAL_FALLTHROUGH; - case FLY_AT_PARA: - case FLY_AT_FLY: + case RndStdIds::FLY_AT_PARA: + case RndStdIds::FLY_AT_FLY: nNewNode = pAnchor->GetContentAnchor()->nNode.GetIndex(); break; diff --git a/sw/source/core/undo/undraw.cxx b/sw/source/core/undo/undraw.cxx index cd2d23ff1aa1..f76e6bfd883b 100644 --- a/sw/source/core/undo/undraw.cxx +++ b/sw/source/core/undo/undraw.cxx @@ -116,15 +116,15 @@ static void lcl_SendRemoveToUno( SwFormat& rFormat ) static void lcl_SaveAnchor( SwFrameFormat* pFormat, sal_uLong& rNodePos ) { const SwFormatAnchor& rAnchor = pFormat->GetAnchor(); - if ((FLY_AT_PARA == rAnchor.GetAnchorId()) || - (FLY_AT_CHAR == rAnchor.GetAnchorId()) || - (FLY_AT_FLY == rAnchor.GetAnchorId()) || - (FLY_AS_CHAR == rAnchor.GetAnchorId())) + if ((RndStdIds::FLY_AT_PARA == rAnchor.GetAnchorId()) || + (RndStdIds::FLY_AT_CHAR == rAnchor.GetAnchorId()) || + (RndStdIds::FLY_AT_FLY == rAnchor.GetAnchorId()) || + (RndStdIds::FLY_AS_CHAR == rAnchor.GetAnchorId())) { rNodePos = rAnchor.GetContentAnchor()->nNode.GetIndex(); sal_Int32 nContentPos = 0; - if (FLY_AS_CHAR == rAnchor.GetAnchorId()) + if (RndStdIds::FLY_AS_CHAR == rAnchor.GetAnchorId()) { nContentPos = rAnchor.GetContentAnchor()->nContent.GetIndex(); @@ -142,7 +142,7 @@ static void lcl_SaveAnchor( SwFrameFormat* pFormat, sal_uLong& rNodePos ) pTextNd->EraseText( aIdx, 1 ); } } - else if (FLY_AT_CHAR == rAnchor.GetAnchorId()) + else if (RndStdIds::FLY_AT_CHAR == rAnchor.GetAnchorId()) { nContentPos = rAnchor.GetContentAnchor()->nContent.GetIndex(); } @@ -154,10 +154,10 @@ static void lcl_SaveAnchor( SwFrameFormat* pFormat, sal_uLong& rNodePos ) static void lcl_RestoreAnchor( SwFrameFormat* pFormat, sal_uLong& rNodePos ) { const SwFormatAnchor& rAnchor = pFormat->GetAnchor(); - if ((FLY_AT_PARA == rAnchor.GetAnchorId()) || - (FLY_AT_CHAR == rAnchor.GetAnchorId()) || - (FLY_AT_FLY == rAnchor.GetAnchorId()) || - (FLY_AS_CHAR == rAnchor.GetAnchorId())) + if ((RndStdIds::FLY_AT_PARA == rAnchor.GetAnchorId()) || + (RndStdIds::FLY_AT_CHAR == rAnchor.GetAnchorId()) || + (RndStdIds::FLY_AT_FLY == rAnchor.GetAnchorId()) || + (RndStdIds::FLY_AS_CHAR == rAnchor.GetAnchorId())) { const sal_Int32 nContentPos = rAnchor.GetPageNum(); SwNodes& rNds = pFormat->GetDoc()->GetNodes(); @@ -166,15 +166,15 @@ static void lcl_RestoreAnchor( SwFrameFormat* pFormat, sal_uLong& rNodePos ) SwPosition aPos( aIdx ); SwFormatAnchor aTmp( rAnchor.GetAnchorId() ); - if ((FLY_AS_CHAR == rAnchor.GetAnchorId()) || - (FLY_AT_CHAR == rAnchor.GetAnchorId())) + if ((RndStdIds::FLY_AS_CHAR == rAnchor.GetAnchorId()) || + (RndStdIds::FLY_AT_CHAR == rAnchor.GetAnchorId())) { aPos.nContent.Assign( aIdx.GetNode().GetContentNode(), nContentPos ); } aTmp.SetAnchor( &aPos ); pFormat->SetFormatAttr( aTmp ); - if (FLY_AS_CHAR == rAnchor.GetAnchorId()) + if (RndStdIds::FLY_AS_CHAR == rAnchor.GetAnchorId()) { SwTextNode *pTextNd = aIdx.GetNode().GetTextNode(); OSL_ENSURE( pTextNd, "no Text Node" ); diff --git a/sw/source/core/undo/untbl.cxx b/sw/source/core/undo/untbl.cxx index ad8561b5cbaa..03de7f8b5de7 100644 --- a/sw/source/core/undo/untbl.cxx +++ b/sw/source/core/undo/untbl.cxx @@ -421,8 +421,8 @@ SwUndoTableToText::SwUndoTableToText( const SwTable& rTable, sal_Unicode cCh ) SwFormatAnchor const*const pAnchor = &pFormat->GetAnchor(); SwPosition const*const pAPos = pAnchor->GetContentAnchor(); if (pAPos && - ((FLY_AT_CHAR == pAnchor->GetAnchorId()) || - (FLY_AT_PARA == pAnchor->GetAnchorId())) && + ((RndStdIds::FLY_AT_CHAR == pAnchor->GetAnchorId()) || + (RndStdIds::FLY_AT_PARA == pAnchor->GetAnchorId())) && nTableStt <= pAPos->nNode.GetIndex() && pAPos->nNode.GetIndex() < nTableEnd ) { diff --git a/sw/source/core/undo/untblk.cxx b/sw/source/core/undo/untblk.cxx index 90452f76592c..3ce8864999e8 100644 --- a/sw/source/core/undo/untblk.cxx +++ b/sw/source/core/undo/untblk.cxx @@ -58,7 +58,7 @@ SwUndoInserts::SwUndoInserts( SwUndoId nUndoId, const SwPaM& rPam ) SwFormatAnchor const*const pAnchor = &pFormat->GetAnchor(); const SwPosition* pAPos = pAnchor->GetContentAnchor(); if (pAPos && - (pAnchor->GetAnchorId() == FLY_AT_PARA) && + (pAnchor->GetAnchorId() == RndStdIds::FLY_AT_PARA) && nSttNode == pAPos->nNode.GetIndex() ) { if( !pFrameFormats ) @@ -111,7 +111,7 @@ void SwUndoInserts::SetInsertRange( const SwPaM& rPam, bool bScanFlys, SwFormatAnchor const*const pAnchor = &pFormat->GetAnchor(); SwPosition const*const pAPos = pAnchor->GetContentAnchor(); if (pAPos && - (pAnchor->GetAnchorId() == FLY_AT_PARA) && + (pAnchor->GetAnchorId() == RndStdIds::FLY_AT_PARA) && nSttNode == pAPos->nNode.GetIndex() ) { std::vector<SwFrameFormat*>::iterator it; diff --git a/sw/source/core/unocore/unodraw.cxx b/sw/source/core/unocore/unodraw.cxx index a15bacd7e745..f262c7bae15e 100644 --- a/sw/source/core/unocore/unodraw.cxx +++ b/sw/source/core/unocore/unodraw.cxx @@ -130,7 +130,7 @@ public: { if(bCreate && !pAnchor) { - pAnchor = new SwFormatAnchor(FLY_AS_CHAR); + pAnchor = new SwFormatAnchor(RndStdIds::FLY_AS_CHAR); } return pAnchor; } @@ -598,7 +598,7 @@ void SwXDrawPage::add(const uno::Reference< drawing::XShape > & xShape) SfxItemSet aSet( pDoc->GetAttrPool(), RES_FRMATR_BEGIN, RES_FRMATR_END-1 ); - SwFormatAnchor aAnchor( FLY_AS_CHAR ); + SwFormatAnchor aAnchor( RndStdIds::FLY_AS_CHAR ); bool bOpaque = false; if( pDesc ) { @@ -675,12 +675,12 @@ void SwXDrawPage::add(const uno::Reference< drawing::XShape > & xShape) pInternalPam = new SwUnoInternalPaM(*pDoc); if (::sw::XTextRangeToSwPaM(*pInternalPam, xRg)) { - if(FLY_AT_FLY == aAnchor.GetAnchorId() && + if(RndStdIds::FLY_AT_FLY == aAnchor.GetAnchorId() && !pInternalPam->GetNode().FindFlyStartNode()) { - aAnchor.SetType(FLY_AS_CHAR); + aAnchor.SetType(RndStdIds::FLY_AS_CHAR); } - else if (FLY_AT_PAGE == aAnchor.GetAnchorId()) + else if (RndStdIds::FLY_AT_PAGE == aAnchor.GetAnchorId()) { aAnchor.SetAnchor(pInternalPam->Start()); } @@ -688,7 +688,7 @@ void SwXDrawPage::add(const uno::Reference< drawing::XShape > & xShape) else throw uno::RuntimeException(); } - else if ((aAnchor.GetAnchorId() != FLY_AT_PAGE) && pDoc->getIDocumentLayoutAccess().GetCurrentLayout()) + else if ((aAnchor.GetAnchorId() != RndStdIds::FLY_AT_PAGE) && pDoc->getIDocumentLayoutAccess().GetCurrentLayout()) { SwCursorMoveState aState( MV_SETONLYTEXT ); Point aTmp(convertMm100ToTwip(aMM100Pos.X), convertMm100ToTwip(aMM100Pos.Y)); @@ -700,7 +700,7 @@ void SwXDrawPage::add(const uno::Reference< drawing::XShape > & xShape) } else { - aAnchor.SetType(FLY_AT_PAGE); + aAnchor.SetType(RndStdIds::FLY_AT_PAGE); // #i32349# - adjustment of vertical positioning // attributes no longer needed, because its already got a default. @@ -749,7 +749,7 @@ uno::Reference< drawing::XShapeGroup > SwXDrawPage::group(const uno::Reference< for ( size_t i = 0; !bFlyInCnt && i < rMarkList.GetMarkCount(); ++i ) { const SdrObject *pObj = rMarkList.GetMark( i )->GetMarkedSdrObj(); - if (FLY_AS_CHAR == ::FindFrameFormat(const_cast<SdrObject*>( + if (RndStdIds::FLY_AS_CHAR == ::FindFrameFormat(const_cast<SdrObject*>( pObj))->GetAnchor().GetAnchorId()) { bFlyInCnt = true; @@ -765,7 +765,7 @@ uno::Reference< drawing::XShapeGroup > SwXDrawPage::group(const uno::Reference< SwDrawContact* pContact = pDoc->GroupSelection( *pPage->GetDrawView() ); pDoc->ChgAnchor( pPage->GetDrawView()->GetMarkedObjectList(), - FLY_AT_PARA, + RndStdIds::FLY_AT_PARA, true, false ); pPage->GetDrawView()->UnmarkAll(); @@ -799,7 +799,7 @@ void SwXDrawPage::ungroup(const uno::Reference< drawing::XShapeGroup > & rShapeG pDoc->UnGroupSelection( *pPage->GetDrawView() ); pDoc->ChgAnchor( pPage->GetDrawView()->GetMarkedObjectList(), - FLY_AT_PARA, + RndStdIds::FLY_AT_PARA, true, false ); pDoc->GetIDocumentUndoRedo().EndUndo( SwUndoId::END, nullptr ); pPage->RemovePageView(); @@ -1080,7 +1080,7 @@ void SwXShape::setPropertyValue(const OUString& rPropertyName, const uno::Any& a SwFormatAnchor aAnchor = static_cast<const SwFormatAnchor&>(aItemSet.Get(pEntry->nWID)); SwPosition aPos(*pFrame->GetFrameFormat()->GetContent().GetContentIdx()); aAnchor.SetAnchor(&aPos); - aAnchor.SetType(FLY_AT_FLY); + aAnchor.SetType(RndStdIds::FLY_AT_FLY); aItemSet.Put(aAnchor); pFormat->SetFormatAttr(aItemSet); bDone = true; @@ -1117,7 +1117,7 @@ void SwXShape::setPropertyValue(const OUString& rPropertyName, const uno::Any& a else if ( FN_TEXT_RANGE == pEntry->nWID ) { SwFormatAnchor aAnchor( static_cast<const SwFormatAnchor&>(aSet.Get( RES_ANCHOR )) ); - if (aAnchor.GetAnchorId() == FLY_AT_PAGE) + if (aAnchor.GetAnchorId() == RndStdIds::FLY_AT_PAGE) { // set property <TextRange> not valid for to-page anchored shapes throw lang::IllegalArgumentException(); @@ -1130,7 +1130,7 @@ void SwXShape::setPropertyValue(const OUString& rPropertyName, const uno::Any& a aValue >>= xRg; if (::sw::XTextRangeToSwPaM(*pInternalPam, xRg) ) { - if (aAnchor.GetAnchorId() == FLY_AS_CHAR) + if (aAnchor.GetAnchorId() == RndStdIds::FLY_AS_CHAR) { //delete old SwFormatFlyCnt //With AnchorAsCharacter the current TextAttribute has to be deleted. @@ -1259,7 +1259,7 @@ void SwXShape::setPropertyValue(const OUString& rPropertyName, const uno::Any& a SwFrameFormat *pFlyFormat = FindFrameFormat( pObj ); pFlyFormat->DelFrames(); if( text::TextContentAnchorType_AS_CHARACTER != eNewAnchor && - (FLY_AS_CHAR == eOldAnchorId)) + (RndStdIds::FLY_AS_CHAR == eOldAnchorId)) { //With AnchorAsCharacter the current TextAttribute has to be deleted. //Tbis removes the frame format too. @@ -1282,7 +1282,7 @@ void SwXShape::setPropertyValue(const OUString& rPropertyName, const uno::Any& a pTextNode->DeleteAttributes(RES_TXTATR_FLYCNT, nIdx); } else if( text::TextContentAnchorType_AT_PAGE != eNewAnchor && - (FLY_AT_PAGE == eOldAnchorId)) + (RndStdIds::FLY_AT_PAGE == eOldAnchorId)) { SwFormatAnchor aNewAnchor( dynamic_cast< const SwFormatAnchor& >( aSet.Get( RES_ANCHOR ) ) ); //if the fly has been anchored at page then it needs to be connected @@ -1306,7 +1306,7 @@ void SwXShape::setPropertyValue(const OUString& rPropertyName, const uno::Any& a bSetAttr = false; } if( text::TextContentAnchorType_AS_CHARACTER == eNewAnchor && - (FLY_AS_CHAR != eOldAnchorId)) + (RndStdIds::FLY_AS_CHAR != eOldAnchorId)) { SwPaM aPam(pDoc->GetNodes().GetEndOfContent()); if( pDoc->getIDocumentLayoutAccess().GetCurrentLayout() ) @@ -1484,7 +1484,7 @@ uno::Any SwXShape::getPropertyValue(const OUString& rPropertyName) else if ( FN_TEXT_RANGE == pEntry->nWID ) { const SwFormatAnchor aAnchor = pFormat->GetAnchor(); - if (aAnchor.GetAnchorId() == FLY_AT_PAGE) + if (aAnchor.GetAnchorId() == RndStdIds::FLY_AT_PAGE) { // return nothing, because property <TextRange> isn't // valid for to-page anchored shapes @@ -2086,7 +2086,7 @@ uno::Reference< text::XTextRange > SwXShape::getAnchor() const SwFormatAnchor& rAnchor = pFormat->GetAnchor(); // return an anchor for non-page bound frames // and for page bound frames that have a page no == NULL and a content position - if ((rAnchor.GetAnchorId() != FLY_AT_PAGE) || + if ((rAnchor.GetAnchorId() != RndStdIds::FLY_AT_PAGE) || (rAnchor.GetContentAnchor() && !rAnchor.GetPageNum())) { const SwPosition &rPos = *(pFormat->GetAnchor().GetContentAnchor()); @@ -2125,7 +2125,7 @@ void SwXShape::dispose() !pObj->GetUpGroup() && pObj->IsInserted() ) { - if (pFormat->GetAnchor().GetAnchorId() == FLY_AS_CHAR) + if (pFormat->GetAnchor().GetAnchorId() == RndStdIds::FLY_AS_CHAR) { const SwPosition &rPos = *(pFormat->GetAnchor().GetContentAnchor()); SwTextNode *pTextNode = rPos.nNode.GetNode().GetTextNode(); diff --git a/sw/source/core/unocore/unoframe.cxx b/sw/source/core/unocore/unoframe.cxx index 7de59808c43c..c1222db074da 100644 --- a/sw/source/core/unocore/unoframe.cxx +++ b/sw/source/core/unocore/unoframe.cxx @@ -1773,7 +1773,7 @@ void SwXFrame::setPropertyValue(const OUString& rPropertyName, const ::uno::Any& SwPosition aPos(*pFrame->GetFrameFormat()->GetContent().GetContentIdx()); aAnchor.SetAnchor(&aPos); - aAnchor.SetType(FLY_AT_FLY); + aAnchor.SetType(RndStdIds::FLY_AT_FLY); aSet.Put(aAnchor); pDoc->SetFlyFrameAttr( *pFormat, aSet ); bDone = true; @@ -1902,7 +1902,7 @@ void SwXFrame::setPropertyValue(const OUString& rPropertyName, const ::uno::Any& if(RES_ANCHOR == pEntry->nWID && MID_ANCHOR_ANCHORTYPE == nMemberId) { SwFormatAnchor aAnchor = static_cast<const SwFormatAnchor&>(aSet.Get(pEntry->nWID)); - if(aAnchor.GetAnchorId() == FLY_AT_FLY) + if(aAnchor.GetAnchorId() == RndStdIds::FLY_AT_FLY) { const ::SwPosition* pPosition = aAnchor.GetContentAnchor(); SwFrameFormat* pFlyFormat = pPosition ? pPosition->nNode.GetNode().GetFlyFormat() : nullptr; @@ -1920,7 +1920,7 @@ void SwXFrame::setPropertyValue(const OUString& rPropertyName, const ::uno::Any& aSet.Put(aAnchor); } } - else if ((aAnchor.GetAnchorId() != FLY_AT_PAGE) && + else if ((aAnchor.GetAnchorId() != RndStdIds::FLY_AT_PAGE) && !aAnchor.GetContentAnchor()) { SwNode& rNode = pDoc->GetNodes().GetEndOfContent(); @@ -2629,7 +2629,7 @@ void SwXFrame::dispose() ( pObj->GetUserCall() && !static_cast<SwContact*>(pObj->GetUserCall())->IsInDTOR() ) ) ) { - if (pFormat->GetAnchor().GetAnchorId() == FLY_AS_CHAR) + if (pFormat->GetAnchor().GetAnchorId() == RndStdIds::FLY_AS_CHAR) { const SwPosition &rPos = *(pFormat->GetAnchor().GetContentAnchor()); SwTextNode *pTextNode = rPos.nNode.GetNode().GetTextNode(); @@ -2653,7 +2653,7 @@ uno::Reference< text::XTextRange > SwXFrame::getAnchor() const SwFormatAnchor& rAnchor = pFormat->GetAnchor(); // return an anchor for non-page bound frames // and for page bound frames that have a page no == NULL and a content position - if ((rAnchor.GetAnchorId() != FLY_AT_PAGE) || + if ((rAnchor.GetAnchorId() != RndStdIds::FLY_AT_PAGE) || (rAnchor.GetContentAnchor() && !rAnchor.GetPageNum())) { const SwPosition &rPos = *(rAnchor.GetContentAnchor()); @@ -2735,18 +2735,18 @@ void SwXFrame::attachToRange(const uno::Reference< text::XTextRange > & xTextRan } const SfxPoolItem* pItem; - RndStdIds eAnchorId = FLY_AT_PARA; + RndStdIds eAnchorId = RndStdIds::FLY_AT_PARA; if(SfxItemState::SET == aFrameSet.GetItemState(RES_ANCHOR, false, &pItem) ) { eAnchorId = static_cast<const SwFormatAnchor*>(pItem)->GetAnchorId(); - if( FLY_AT_FLY == eAnchorId && + if( RndStdIds::FLY_AT_FLY == eAnchorId && !aPam.GetNode().FindFlyStartNode()) { // framebound only where a frame exists - SwFormatAnchor aAnchor(FLY_AT_PARA); + SwFormatAnchor aAnchor(RndStdIds::FLY_AT_PARA); aFrameSet.Put(aAnchor); } - else if ((FLY_AT_PAGE == eAnchorId) && + else if ((RndStdIds::FLY_AT_PAGE == eAnchorId) && 0 == static_cast<const SwFormatAnchor*>(pItem)->GetPageNum() ) { SwFormatAnchor aAnchor( *static_cast<const SwFormatAnchor*>(pItem) ); @@ -2769,10 +2769,10 @@ void SwXFrame::attachToRange(const uno::Reference< text::XTextRange > & xTextRan SwFormatAnchor* pAnchorItem = nullptr; // the frame is inserted bound to page // to prevent conflicts if the to-be-anchored position is part of the to-be-copied text - if (eAnchorId != FLY_AT_PAGE) + if (eAnchorId != RndStdIds::FLY_AT_PAGE) { pAnchorItem = static_cast<SwFormatAnchor*>(aFrameSet.Get(RES_ANCHOR).Clone()); - aFrameSet.Put( SwFormatAnchor( FLY_AT_PAGE, 1 )); + aFrameSet.Put( SwFormatAnchor( RndStdIds::FLY_AT_PAGE, 1 )); } aPam.DeleteMark(); // mark position node will be deleted! @@ -2793,7 +2793,7 @@ void SwXFrame::attachToRange(const uno::Reference< text::XTextRange > & xTextRan } else { - pFormat = pDoc->MakeFlySection( FLY_AT_PARA, aPam.GetPoint(), + pFormat = pDoc->MakeFlySection( RndStdIds::FLY_AT_PARA, aPam.GetPoint(), &aFrameSet, pParentFrameFormat ); } if(pFormat) diff --git a/sw/source/core/unocore/unoobj2.cxx b/sw/source/core/unocore/unoobj2.cxx index 0a202afbf3dd..91a84c2e30f0 100644 --- a/sw/source/core/unocore/unoobj2.cxx +++ b/sw/source/core/unocore/unoobj2.cxx @@ -167,7 +167,7 @@ namespace { void lcl_CollectFrameAtNodeWithLayout(const SwContentFrame* pCFrame, FrameClientSortList_t& rFrames, - const sal_uInt16 nAnchorType) + const RndStdIds nAnchorType) { auto pObjs = pCFrame->GetDrawObjs(); if(!pObjs) @@ -202,8 +202,7 @@ void CollectFrameAtNode( const SwNodeIndex& rIdx, // search all borders, images, and OLEs that are connected to the paragraph SwDoc* pDoc = rIdx.GetNode().GetDoc(); - const auto nChkType = static_cast< sal_uInt16 >((bAtCharAnchoredObjs) - ? FLY_AT_CHAR : FLY_AT_PARA); + const auto nChkType = bAtCharAnchoredObjs ? RndStdIds::FLY_AT_CHAR : RndStdIds::FLY_AT_PARA; const SwContentFrame* pCFrame; const SwContentNode* pCNd; if( pDoc->getIDocumentLayoutAccess().GetCurrentViewShell() && diff --git a/sw/source/core/unocore/unotext.cxx b/sw/source/core/unocore/unotext.cxx index fcde2732ac2d..a22f2e874822 100644 --- a/sw/source/core/unocore/unotext.cxx +++ b/sw/source/core/unocore/unotext.cxx @@ -1627,7 +1627,7 @@ SwXText::convertToTextFrame( { const SwFrameFormat* pFrameFormat = (*m_pImpl->m_pDoc->GetSpzFrameFormats())[i]; const SwFormatAnchor& rAnchor = pFrameFormat->GetAnchor(); - if ((FLY_AT_PARA == rAnchor.GetAnchorId() || FLY_AT_CHAR == rAnchor.GetAnchorId()) && + if ((RndStdIds::FLY_AT_PARA == rAnchor.GetAnchorId() || RndStdIds::FLY_AT_CHAR == rAnchor.GetAnchorId()) && aStartPam.Start()->nNode.GetIndex() <= rAnchor.GetContentAnchor()->nNode.GetIndex() && aStartPam.End()->nNode.GetIndex() >= rAnchor.GetContentAnchor()->nNode.GetIndex()) { diff --git a/sw/source/core/view/vdraw.cxx b/sw/source/core/view/vdraw.cxx index eb4ad0772eca..ddd003c75465 100644 --- a/sw/source/core/view/vdraw.cxx +++ b/sw/source/core/view/vdraw.cxx @@ -229,7 +229,7 @@ void SwViewShellImp::NotifySizeChg( const Size &rNewSz ) const SwFrame *pAnchor = static_cast<const SwDrawContact*>(pCont)->GetAnchorFrame(); if ( !pAnchor || pAnchor->IsInFly() || !pAnchor->IsValid() || !pAnchor->GetUpper() || !pAnchor->FindPageFrame() || - (FLY_AS_CHAR == pCont->GetFormat()->GetAnchor().GetAnchorId()) ) + (RndStdIds::FLY_AS_CHAR == pCont->GetFormat()->GetAnchor().GetAnchorId()) ) { continue; } diff --git a/sw/source/filter/basflt/fltshell.cxx b/sw/source/filter/basflt/fltshell.cxx index c0e8c7283e00..91853f720054 100644 --- a/sw/source/filter/basflt/fltshell.cxx +++ b/sw/source/filter/basflt/fltshell.cxx @@ -552,7 +552,7 @@ void SwFltControlStack::SetAttrInDoc(const SwPosition& rTmpPos, // So the frames will be created when inserting into // existing doc (after setting the anchor!): if(pDoc->getIDocumentLayoutAccess().GetCurrentViewShell() - && (FLY_AT_PARA == pFormat->GetAnchor().GetAnchorId())) + && (RndStdIds::FLY_AT_PARA == pFormat->GetAnchor().GetAnchorId())) { pFormat->MakeFrames(); } diff --git a/sw/source/filter/basflt/shellio.cxx b/sw/source/filter/basflt/shellio.cxx index e1e8694a2586..642c84dca8de 100644 --- a/sw/source/filter/basflt/shellio.cxx +++ b/sw/source/filter/basflt/shellio.cxx @@ -230,9 +230,9 @@ sal_uLong SwReader::Read( const Reader& rOptions ) { SwPosition const*const pFrameAnchor( rAnchor.GetContentAnchor()); - if ( (FLY_AT_PAGE == rAnchor.GetAnchorId()) + if ( (RndStdIds::FLY_AT_PAGE == rAnchor.GetAnchorId()) || ( pFrameAnchor - && ( ( (FLY_AT_PARA == rAnchor.GetAnchorId()) + && ( ( (RndStdIds::FLY_AT_PARA == rAnchor.GetAnchorId()) && ( (pUndoPam->GetPoint()->nNode == pFrameAnchor->nNode) || (pUndoPam->GetMark()->nNode == @@ -240,7 +240,7 @@ sal_uLong SwReader::Read( const Reader& rOptions ) ) ) // #i97570# also check frames anchored AT char - || ( (FLY_AT_CHAR == rAnchor.GetAnchorId()) + || ( (RndStdIds::FLY_AT_CHAR == rAnchor.GetAnchorId()) && !IsDestroyFrameAnchoredAtChar( *pFrameAnchor, *pUndoPam->GetPoint(), @@ -252,7 +252,7 @@ sal_uLong SwReader::Read( const Reader& rOptions ) ) { if( bChkHeaderFooter && - (FLY_AT_PARA == rAnchor.GetAnchorId()) && + (RndStdIds::FLY_AT_PARA == rAnchor.GetAnchorId()) && RES_DRAWFRMFMT == pFrameFormat->Which() ) { // DrawObjects are not allowed in Headers/Footers! @@ -278,7 +278,7 @@ sal_uLong SwReader::Read( const Reader& rOptions ) pFrameFormat->DelFrames(); } - if (FLY_AT_PAGE == rAnchor.GetAnchorId()) + if (RndStdIds::FLY_AT_PAGE == rAnchor.GetAnchorId()) { if( !rAnchor.GetContentAnchor() ) { diff --git a/sw/source/filter/html/css1atr.cxx b/sw/source/filter/html/css1atr.cxx index bfe7e6b74dcc..3a35921e1fe9 100644 --- a/sw/source/filter/html/css1atr.cxx +++ b/sw/source/filter/html/css1atr.cxx @@ -1890,8 +1890,8 @@ void SwHTMLWriter::OutCSS1_FrameFormatOptions( const SwFrameFormat& rFrameFormat const SwFormatAnchor& rAnchor = rFrameFormat.GetAnchor(); switch( rAnchor.GetAnchorId() ) { - case FLY_AT_PARA: - case FLY_AT_CHAR: + case RndStdIds::FLY_AT_PARA: + case RndStdIds::FLY_AT_CHAR: if( text::RelOrientation::FRAME == rHoriOri.GetRelationOrient() || text::RelOrientation::PRINT_AREA == rHoriOri.GetRelationOrient() ) { @@ -1907,8 +1907,8 @@ void SwHTMLWriter::OutCSS1_FrameFormatOptions( const SwFrameFormat& rFrameFormat } SAL_FALLTHROUGH; - case FLY_AT_PAGE: - case FLY_AT_FLY: + case RndStdIds::FLY_AT_PAGE: + case RndStdIds::FLY_AT_FLY: { // position OutCSS1_PropertyAscii( sCSS1_P_position, sCSS1_PV_absolute ); @@ -2149,7 +2149,7 @@ void SwHTMLWriter::OutCSS1_FrameFormatBackground( const SwFrameFormat& rFrameFor const SwFormatAnchor& rAnchor = rFrameFormat.GetAnchor(); RndStdIds eAnchorId = rAnchor.GetAnchorId(); const SwPosition *pAnchorPos = rAnchor.GetContentAnchor(); - if (FLY_AT_PAGE != eAnchorId && pAnchorPos) + if (RndStdIds::FLY_AT_PAGE != eAnchorId && pAnchorPos) { const SwNode& rNode = pAnchorPos->nNode.GetNode(); if( rNode.IsContentNode() ) diff --git a/sw/source/filter/html/htmlcss1.cxx b/sw/source/filter/html/htmlcss1.cxx index fca9779e273a..d3fe586b3d95 100644 --- a/sw/source/filter/html/htmlcss1.cxx +++ b/sw/source/filter/html/htmlcss1.cxx @@ -1960,13 +1960,13 @@ void SwHTMLParser::SetAnchorAndAdjustment( const SfxItemSet & /*rItemSet*/, m_pPam->GetPoint()->nNode.GetNode().FindFlyStartNode(); if( pFlySttNd ) { - aAnchor.SetType( FLY_AT_FLY ); + aAnchor.SetType( RndStdIds::FLY_AT_FLY ); SwPosition aPos( *pFlySttNd ); aAnchor.SetAnchor( &aPos ); } else { - aAnchor.SetType( FLY_AT_PAGE ); + aAnchor.SetType( RndStdIds::FLY_AT_PAGE ); aAnchor.SetPageNum( 1 ); } nHoriPos = rPropInfo.m_nLeft; @@ -1974,7 +1974,7 @@ void SwHTMLParser::SetAnchorAndAdjustment( const SfxItemSet & /*rItemSet*/, } else { - aAnchor.SetType( FLY_AT_PARA ); + aAnchor.SetType( RndStdIds::FLY_AT_PARA ); aAnchor.SetAnchor( m_pPam->GetPoint() ); eVertOri = text::VertOrientation::TOP; eVertRel = text::RelOrientation::CHAR; @@ -2000,14 +2000,14 @@ void SwHTMLParser::SetAnchorAndAdjustment( const SfxItemSet & /*rItemSet*/, const sal_Int32 nContent = m_pPam->GetPoint()->nContent.GetIndex(); if( nContent ) { - aAnchor.SetType( FLY_AT_CHAR ); + aAnchor.SetType( RndStdIds::FLY_AT_CHAR ); m_pPam->Move( fnMoveBackward ); eVertOri = text::VertOrientation::CHAR_BOTTOM; eVertRel = text::RelOrientation::CHAR; } else { - aAnchor.SetType( FLY_AT_PARA ); + aAnchor.SetType( RndStdIds::FLY_AT_PARA ); eVertOri = text::VertOrientation::TOP; eVertRel = text::RelOrientation::PRINT_AREA; } diff --git a/sw/source/filter/html/htmldrawreader.cxx b/sw/source/filter/html/htmldrawreader.cxx index c1391339854e..c383adea2bef 100644 --- a/sw/source/filter/html/htmldrawreader.cxx +++ b/sw/source/filter/html/htmldrawreader.cxx @@ -152,7 +152,7 @@ void SwHTMLParser::InsertDrawObject( SdrObject* pNewDrawObj, aFrameSet.Put( aULItem ); } - SwFormatAnchor aAnchor( FLY_AS_CHAR ); + SwFormatAnchor aAnchor( RndStdIds::FLY_AS_CHAR ); if( SVX_CSS1_POS_ABSOLUTE == rCSS1PropInfo.m_ePosition && SVX_CSS1_LTYPE_TWIP == rCSS1PropInfo.m_eLeftType && SVX_CSS1_LTYPE_TWIP == rCSS1PropInfo.m_eTopType ) @@ -162,13 +162,13 @@ void SwHTMLParser::InsertDrawObject( SdrObject* pNewDrawObj, if( pFlySttNd ) { - aAnchor.SetType( FLY_AT_FLY ); + aAnchor.SetType( RndStdIds::FLY_AT_FLY ); SwPosition aPos( *pFlySttNd ); aAnchor.SetAnchor( &aPos ); } else { - aAnchor.SetType( FLY_AT_PAGE ); + aAnchor.SetType( RndStdIds::FLY_AT_PAGE ); } // #i26791# - direct positioning for <SwDoc::Insert(..)> pNewDrawObj->SetRelativePos( Point(rCSS1PropInfo.m_nLeft + nLeftSpace, @@ -178,7 +178,7 @@ void SwHTMLParser::InsertDrawObject( SdrObject* pNewDrawObj, else if( SvxAdjust::Left == rCSS1PropInfo.m_eFloat || text::HoriOrientation::LEFT == eHoriOri ) { - aAnchor.SetType( FLY_AT_PARA ); + aAnchor.SetType( RndStdIds::FLY_AT_PARA ); aFrameSet.Put( SwFormatSurround(css::text::WrapTextMode_RIGHT) ); // #i26791# - direct positioning for <SwDoc::Insert(..)> pNewDrawObj->SetRelativePos( Point(nLeftSpace, nUpperSpace) ); @@ -188,11 +188,11 @@ void SwHTMLParser::InsertDrawObject( SdrObject* pNewDrawObj, aFrameSet.Put( SwFormatVertOrient( 0, eVertOri ) ); } - if (FLY_AT_PAGE == aAnchor.GetAnchorId()) + if (RndStdIds::FLY_AT_PAGE == aAnchor.GetAnchorId()) { aAnchor.SetPageNum( 1 ); } - else if( FLY_AT_FLY != aAnchor.GetAnchorId() ) + else if( RndStdIds::FLY_AT_FLY != aAnchor.GetAnchorId() ) { aAnchor.SetAnchor( m_pPam->GetPoint() ); } diff --git a/sw/source/filter/html/htmlfly.cxx b/sw/source/filter/html/htmlfly.cxx index 700c7d7bc81f..0613b7c79100 100644 --- a/sw/source/filter/html/htmlfly.cxx +++ b/sw/source/filter/html/htmlfly.cxx @@ -46,7 +46,7 @@ SwHTMLPosFlyFrame::SwHTMLPosFlyFrame( const SwPosFlyFrame& rPosFly, nAllFlags( nFlags ) { const SwFormatAnchor& rAnchor = rPosFly.GetFormat().GetAnchor(); - if ((FLY_AT_CHAR == rAnchor.GetAnchorId()) && + if ((RndStdIds::FLY_AT_CHAR == rAnchor.GetAnchorId()) && HtmlPosition::Inside == GetOutPos() ) { // Auto-gebundene Rahmen werden ein Zeichen weiter hinten diff --git a/sw/source/filter/html/htmlflywriter.cxx b/sw/source/filter/html/htmlflywriter.cxx index 7356d697bf0b..8f32f2591888 100644 --- a/sw/source/filter/html/htmlflywriter.cxx +++ b/sw/source/filter/html/htmlflywriter.cxx @@ -307,12 +307,12 @@ void SwHTMLWriter::CollectFlyFrames() sal_Int16 eHoriRel = rFrameFormat.GetHoriOrient().GetRelationOrient(); switch( rAnchor.GetAnchorId() ) { - case FLY_AT_PAGE: - case FLY_AT_FLY: + case RndStdIds::FLY_AT_PAGE: + case RndStdIds::FLY_AT_FLY: nMode = aHTMLOutFramePageFlyTable[eType][m_nExportMode]; break; - case FLY_AT_PARA: + case RndStdIds::FLY_AT_PARA: // frames that are anchored to a paragraph are only placed // before the paragraph, if the paragraph has a // spacing. @@ -331,7 +331,7 @@ void SwHTMLWriter::CollectFlyFrames() nMode = aHTMLOutFrameParaPrtAreaTable[eType][m_nExportMode]; break; - case FLY_AT_CHAR: + case RndStdIds::FLY_AT_CHAR: if( text::RelOrientation::FRAME == eHoriRel || text::RelOrientation::PRINT_AREA == eHoriRel ) nMode = aHTMLOutFrameParaPrtAreaTable[eType][m_nExportMode]; else @@ -561,7 +561,7 @@ OString SwHTMLWriter::OutFrameFormatOptions( const SwFrameFormat &rFrameFormat, const sal_Char *pStr = nullptr; RndStdIds eAnchorId = rFrameFormat.GetAnchor().GetAnchorId(); if( (nFrameOpts & HtmlFrmOpts::Align) && - ((FLY_AT_PARA == eAnchorId) || (FLY_AT_CHAR == eAnchorId)) ) + ((RndStdIds::FLY_AT_PARA == eAnchorId) || (RndStdIds::FLY_AT_CHAR == eAnchorId)) ) { // MIB 12.3.98: Wouldn't it be more clever to left-align frames that // are anchored to a paragraph if necessary, instead of inserting them @@ -578,7 +578,7 @@ OString SwHTMLWriter::OutFrameFormatOptions( const SwFrameFormat &rFrameFormat, } if( (nFrameOpts & HtmlFrmOpts::Align) && !pStr && ( !(nFrameOpts & HtmlFrmOpts::SAlign) || - (FLY_AS_CHAR == eAnchorId) ) && + (RndStdIds::FLY_AS_CHAR == eAnchorId) ) && SfxItemState::SET == rItemSet.GetItemState( RES_VERT_ORIENT, true, &pItem )) { switch( static_cast<const SwFormatVertOrient*>(pItem)->GetVertOrient() ) @@ -737,8 +737,8 @@ OString SwHTMLWriter::OutFrameFormatOptions( const SwFrameFormat &rFrameFormat, // Insert wrap for graphics that are anchored to a paragraph as // <BR CLEAR=...> in the string if( (nFrameOpts & HtmlFrmOpts::BrClear) && - ((FLY_AT_PARA == rFrameFormat.GetAnchor().GetAnchorId()) || - (FLY_AT_CHAR == rFrameFormat.GetAnchor().GetAnchorId())) && + ((RndStdIds::FLY_AT_PARA == rFrameFormat.GetAnchor().GetAnchorId()) || + (RndStdIds::FLY_AT_CHAR == rFrameFormat.GetAnchor().GetAnchorId())) && SfxItemState::SET == rItemSet.GetItemState( RES_SURROUND, true, &pItem )) { const SwFormatSurround* pSurround = static_cast<const SwFormatSurround*>(pItem); @@ -832,7 +832,7 @@ void SwHTMLWriter::writeFrameFormatOptions(HtmlWriter& aHtml, const SwFrameForma const sal_Char* pAlignString = nullptr; RndStdIds eAnchorId = rFrameFormat.GetAnchor().GetAnchorId(); if( (nFrameOptions & HtmlFrmOpts::Align) && - ((FLY_AT_PARA == eAnchorId) || (FLY_AT_CHAR == eAnchorId)) ) + ((RndStdIds::FLY_AT_PARA == eAnchorId) || (RndStdIds::FLY_AT_CHAR == eAnchorId)) ) { const SwFormatHoriOrient& rHoriOri = rFrameFormat.GetHoriOrient(); if( !(nFrameOptions & HtmlFrmOpts::SAlign) || @@ -846,7 +846,7 @@ void SwHTMLWriter::writeFrameFormatOptions(HtmlWriter& aHtml, const SwFrameForma } if( (nFrameOptions & HtmlFrmOpts::Align) && !pAlignString && ( !(nFrameOptions & HtmlFrmOpts::SAlign) || - (FLY_AS_CHAR == eAnchorId) ) && + (RndStdIds::FLY_AS_CHAR == eAnchorId) ) && SfxItemState::SET == rItemSet.GetItemState( RES_VERT_ORIENT, true, &pItem )) { switch( static_cast<const SwFormatVertOrient*>(pItem)->GetVertOrient() ) @@ -998,8 +998,8 @@ void SwHTMLWriter::writeFrameFormatOptions(HtmlWriter& aHtml, const SwFrameForma // <BR CLEAR=...> in the string if( (nFrameOptions & HtmlFrmOpts::BrClear) && - ((FLY_AT_PARA == rFrameFormat.GetAnchor().GetAnchorId()) || - (FLY_AT_CHAR == rFrameFormat.GetAnchor().GetAnchorId())) && + ((RndStdIds::FLY_AT_PARA == rFrameFormat.GetAnchor().GetAnchorId()) || + (RndStdIds::FLY_AT_CHAR == rFrameFormat.GetAnchor().GetAnchorId())) && SfxItemState::SET == rItemSet.GetItemState( RES_SURROUND, true, &pItem )) { const sal_Char* pSurroundString = nullptr; diff --git a/sw/source/filter/html/htmlforw.cxx b/sw/source/filter/html/htmlforw.cxx index 897ba95f976d..12332ff02e4f 100644 --- a/sw/source/filter/html/htmlforw.cxx +++ b/sw/source/filter/html/htmlforw.cxx @@ -1352,7 +1352,7 @@ void SwHTMLWriter::GetControls() const SwFormatAnchor& rAnchor = pFrameFormat->GetAnchor(); const SwPosition *pPos = rAnchor.GetContentAnchor(); - if ((FLY_AS_CHAR != rAnchor.GetAnchorId()) || !pPos) + if ((RndStdIds::FLY_AS_CHAR != rAnchor.GetAnchorId()) || !pPos) continue; const SdrObject *pSdrObj = diff --git a/sw/source/filter/html/htmlgrin.cxx b/sw/source/filter/html/htmlgrin.cxx index 908cc30ccde7..0e95a29480e6 100644 --- a/sw/source/filter/html/htmlgrin.cxx +++ b/sw/source/filter/html/htmlgrin.cxx @@ -185,7 +185,7 @@ void SwHTMLParser::SetAnchorAndAdjustment( sal_Int16 eVertOri, bool bDontAppend ) { bool bMoveBackward = false; - SwFormatAnchor aAnchor( FLY_AS_CHAR ); + SwFormatAnchor aAnchor( RndStdIds::FLY_AS_CHAR ); sal_Int16 eVertRel = text::RelOrientation::FRAME; if( text::HoriOrientation::NONE != eHoriOri ) @@ -244,14 +244,14 @@ void SwHTMLParser::SetAnchorAndAdjustment( sal_Int16 eVertOri, const sal_Int32 nContent = m_pPam->GetPoint()->nContent.GetIndex(); if( nContent ) { - aAnchor.SetType( FLY_AT_CHAR ); + aAnchor.SetType( RndStdIds::FLY_AT_CHAR ); bMoveBackward = true; eVertOri = text::VertOrientation::CHAR_BOTTOM; eVertRel = text::RelOrientation::CHAR; } else { - aAnchor.SetType( FLY_AT_PARA ); + aAnchor.SetType( RndStdIds::FLY_AT_PARA ); eVertOri = text::VertOrientation::TOP; eVertRel = text::RelOrientation::PRINT_AREA; } @@ -278,7 +278,7 @@ void SwHTMLParser::RegisterFlyFrame( SwFrameFormat *pFlyFormat ) // automatisch verankerte Rahmen muessen noch um eine Position // nach vorne verschoben werden. if( RES_DRAWFRMFMT != pFlyFormat->Which() && - (FLY_AT_PARA == pFlyFormat->GetAnchor().GetAnchorId()) && + (RndStdIds::FLY_AT_PARA == pFlyFormat->GetAnchor().GetAnchorId()) && css::text::WrapTextMode_THROUGHT == pFlyFormat->GetSurround().GetSurround() ) { m_aMoveFlyFrames.push_back( pFlyFormat ); @@ -781,7 +781,7 @@ IMAGE_SETEVENT: } } - if ((FLY_AS_CHAR == pFlyFormat->GetAnchor().GetAnchorId()) && + if ((RndStdIds::FLY_AS_CHAR == pFlyFormat->GetAnchor().GetAnchorId()) && m_aAttrTab.pINetFormat->GetSttPara() == m_pPam->GetPoint()->nNode && m_aAttrTab.pINetFormat->GetSttCnt() == @@ -1352,8 +1352,8 @@ void SwHTMLParser::StripTrailingPara() SwFormatAnchor const*const pAnchor = &pFormat->GetAnchor(); SwPosition const*const pAPos = pAnchor->GetContentAnchor(); if (pAPos && - ((FLY_AT_PARA == pAnchor->GetAnchorId()) || - (FLY_AT_CHAR == pAnchor->GetAnchorId())) && + ((RndStdIds::FLY_AT_PARA == pAnchor->GetAnchorId()) || + (RndStdIds::FLY_AT_CHAR == pAnchor->GetAnchorId())) && pAPos->nNode == nNodeIdx ) return; // den Knoten duerfen wir nicht loeschen diff --git a/sw/source/filter/html/htmlplug.cxx b/sw/source/filter/html/htmlplug.cxx index d5c6cbda7474..4557579fb097 100644 --- a/sw/source/filter/html/htmlplug.cxx +++ b/sw/source/filter/html/htmlplug.cxx @@ -442,7 +442,7 @@ void SwHTMLParser::InsertEmbed() } else { - SwFormatAnchor aAnchor( FLY_AT_PARA ); + SwFormatAnchor aAnchor( RndStdIds::FLY_AT_PARA ); aAnchor.SetAnchor( m_pPam->GetPoint() ); aFrameSet.Put( aAnchor ); aFrameSet.Put( SwFormatHoriOrient( 0, text::HoriOrientation::LEFT, text::RelOrientation::FRAME) ); @@ -1047,7 +1047,7 @@ Writer& OutHTML_FrameFormatOLENode( Writer& rWrt, const SwFrameFormat& rFrameFor sOut.append('\"'); } - if ((FLY_AT_PARA == rFrameFormat.GetAnchor().GetAnchorId()) && + if ((RndStdIds::FLY_AT_PARA == rFrameFormat.GetAnchor().GetAnchorId()) && css::text::WrapTextMode_THROUGHT == rFrameFormat.GetSurround().GetSurround() ) { // Das Plugin ist HIDDEN diff --git a/sw/source/filter/html/swhtml.cxx b/sw/source/filter/html/swhtml.cxx index 49f9e7ee4f05..d1b25df5c7cb 100644 --- a/sw/source/filter/html/swhtml.cxx +++ b/sw/source/filter/html/swhtml.cxx @@ -2898,7 +2898,7 @@ void SwHTMLParser::SetAttr_( bool bChkEnd, bool bBeforeTable, SwFrameFormat *pFrameFormat = m_aMoveFlyFrames[ --n ]; const SwFormatAnchor& rAnchor = pFrameFormat->GetAnchor(); - OSL_ENSURE( FLY_AT_PARA == rAnchor.GetAnchorId(), + OSL_ENSURE( RndStdIds::FLY_AT_PARA == rAnchor.GetAnchorId(), "Nur Auto-Rahmen brauchen eine Spezialbehandlung" ); const SwPosition *pFlyPos = rAnchor.GetContentAnchor(); sal_uLong nFlyParaIdx = pFlyPos->nNode.GetIndex(); @@ -2923,7 +2923,7 @@ void SwHTMLParser::SetAttr_( bool bChkEnd, bool bBeforeTable, pAttrPam->GetPoint()->nContent.Assign( pAttrPam->GetContentNode(), m_aMoveFlyCnts[n] ); SwFormatAnchor aAnchor( rAnchor ); - aAnchor.SetType( FLY_AT_CHAR ); + aAnchor.SetType( RndStdIds::FLY_AT_CHAR ); aAnchor.SetAnchor( pAttrPam->GetPoint() ); pFrameFormat->SetFormatAttr( aAnchor ); @@ -4456,8 +4456,8 @@ bool SwHTMLParser::HasCurrentParaFlys( bool bNoSurroundOnly, // Umlauf besitzt SwPosition const*const pAPos = pAnchor->GetContentAnchor(); if (pAPos && - ((FLY_AT_PARA == pAnchor->GetAnchorId()) || - (FLY_AT_CHAR == pAnchor->GetAnchorId())) && + ((RndStdIds::FLY_AT_PARA == pAnchor->GetAnchorId()) || + (RndStdIds::FLY_AT_CHAR == pAnchor->GetAnchorId())) && pAPos->nNode == rNodeIdx ) { if( !(bNoSurroundOnly || bSurroundOnly) ) @@ -5091,8 +5091,8 @@ void SwHTMLParser::InsertLineBreak() SwFormatAnchor const*const pAnchor = &pFormat->GetAnchor(); SwPosition const*const pAPos = pAnchor->GetContentAnchor(); if (pAPos && - ((FLY_AT_PARA == pAnchor->GetAnchorId()) || - (FLY_AT_CHAR == pAnchor->GetAnchorId())) && + ((RndStdIds::FLY_AT_PARA == pAnchor->GetAnchorId()) || + (RndStdIds::FLY_AT_CHAR == pAnchor->GetAnchorId())) && pAPos->nNode == rNodeIdx && pFormat->GetSurround().GetSurround() != css::text::WrapTextMode_NONE ) { diff --git a/sw/source/filter/ww8/docxsdrexport.cxx b/sw/source/filter/ww8/docxsdrexport.cxx index 291ca1c5bcd4..4426227871b2 100644 --- a/sw/source/filter/ww8/docxsdrexport.cxx +++ b/sw/source/filter/ww8/docxsdrexport.cxx @@ -292,7 +292,7 @@ void DocxSdrExport::startDMLAnchorInline(const SwFrameFormat* pFrameFormat, cons } else { - isAnchor = pFrameFormat->GetAnchor().GetAnchorId() != FLY_AS_CHAR; + isAnchor = pFrameFormat->GetAnchor().GetAnchorId() != RndStdIds::FLY_AS_CHAR; } // Count effectExtent values, their value is needed before dist{T,B,L,R} is written. @@ -745,7 +745,7 @@ void DocxSdrExport::endDMLAnchorInline(const SwFrameFormat* pFrameFormat) } else { - isAnchor = pFrameFormat->GetAnchor().GetAnchorId() != FLY_AS_CHAR; + isAnchor = pFrameFormat->GetAnchor().GetAnchorId() != RndStdIds::FLY_AS_CHAR; } m_pImpl->m_pSerializer->endElementNS(XML_wp, isAnchor ? XML_anchor : XML_inline); diff --git a/sw/source/filter/ww8/rtfattributeoutput.cxx b/sw/source/filter/ww8/rtfattributeoutput.cxx index 1de97d181fd8..0d2e021545a7 100644 --- a/sw/source/filter/ww8/rtfattributeoutput.cxx +++ b/sw/source/filter/ww8/rtfattributeoutput.cxx @@ -3177,12 +3177,12 @@ void RtfAttributeOutput::FormatAnchor(const SwFormatAnchor& rAnchor) m_aRunText->append(static_cast<sal_Int32>(eId)); switch (eId) { - case FLY_AT_PAGE: + case RndStdIds::FLY_AT_PAGE: m_aRunText->append(OOO_STRING_SVTOOLS_RTF_FLYPAGE); m_aRunText->append(static_cast<sal_Int32>(rAnchor.GetPageNum())); break; - case FLY_AT_PARA: - case FLY_AS_CHAR: + case RndStdIds::FLY_AT_PARA: + case RndStdIds::FLY_AS_CHAR: m_aRunText->append(OOO_STRING_SVTOOLS_RTF_FLYCNTNT); break; default: diff --git a/sw/source/filter/ww8/writerhelper.cxx b/sw/source/filter/ww8/writerhelper.cxx index 91c5cb85df82..9aeecca7caf0 100644 --- a/sw/source/filter/ww8/writerhelper.cxx +++ b/sw/source/filter/ww8/writerhelper.cxx @@ -200,7 +200,7 @@ namespace ww8 , meWriterType(eTextBox) , mpStartFrameContent(nullptr) // #i43447# - move to initialization list - , mbIsInline( (rFormat.GetAnchor().GetAnchorId() == FLY_AS_CHAR) ) + , mbIsInline( (rFormat.GetAnchor().GetAnchorId() == RndStdIds::FLY_AS_CHAR) ) // #i120928# - handle graphic of bullet within existing implementation , mbForBullet(false) , maGrf() @@ -543,7 +543,7 @@ namespace sw } else { // these don't need to be corrected, they're not in redlines - assert(FLY_AT_PAGE == rAnchor.GetAnchorId()); + assert(RndStdIds::FLY_AT_PAGE == rAnchor.GetAnchorId()); } } } diff --git a/sw/source/filter/ww8/wrtw8esh.cxx b/sw/source/filter/ww8/wrtw8esh.cxx index ad17d1b31516..c96d61d4961a 100644 --- a/sw/source/filter/ww8/wrtw8esh.cxx +++ b/sw/source/filter/ww8/wrtw8esh.cxx @@ -827,7 +827,7 @@ void PlcDrawObj::WritePlc( WW8Export& rWrt ) const //fHdr/bx/by/wr/wrk/fRcaSimple/fBelowText/fAnchorLock sal_uInt16 nFlags=0; //If nFlags isn't 0x14 its overridden by the escher properties - if (FLY_AT_PAGE == rFormat.GetAnchor().GetAnchorId()) + if (RndStdIds::FLY_AT_PAGE == rFormat.GetAnchor().GetAnchorId()) nFlags = 0x0000; else nFlags = 0x0014; // x-rel to text, y-rel to text @@ -2505,7 +2505,7 @@ bool WinwordAnchoring::ConvertPosition( SwFormatHoriOrient& _iorHoriOri, { const RndStdIds eAnchor = _rFrameFormat.GetAnchor().GetAnchorId(); - if ( (FLY_AS_CHAR == eAnchor) || (FLY_AT_FLY == eAnchor) ) + if ( (RndStdIds::FLY_AS_CHAR == eAnchor) || (RndStdIds::FLY_AT_FLY == eAnchor) ) { // no conversion for as-character or at frame anchored objects return false; @@ -2519,7 +2519,7 @@ bool WinwordAnchoring::ConvertPosition( SwFormatHoriOrient& _iorHoriOri, // the fact, that the object is anchored at a paragraph, which has a "column // break before" attribute bool bConvDueToAnchoredAtColBreakPara( false ); - if ( ( (eAnchor == FLY_AT_PARA) || (eAnchor == FLY_AT_CHAR) ) && + if ( ( (eAnchor == RndStdIds::FLY_AT_PARA) || (eAnchor == RndStdIds::FLY_AT_CHAR) ) && _rFrameFormat.GetAnchor().GetContentAnchor() && _rFrameFormat.GetAnchor().GetContentAnchor()->nNode.GetNode().IsTextNode() ) { @@ -2699,7 +2699,7 @@ bool WinwordAnchoring::ConvertPosition( SwFormatHoriOrient& _iorHoriOri, void WinwordAnchoring::SetAnchoring(const SwFrameFormat& rFormat) { const RndStdIds eAnchor = rFormat.GetAnchor().GetAnchorId(); - mbInline = (eAnchor == FLY_AS_CHAR); + mbInline = (eAnchor == RndStdIds::FLY_AS_CHAR); SwFormatHoriOrient rHoriOri = rFormat.GetHoriOrient(); SwFormatVertOrient rVertOri = rFormat.GetVertOrient(); @@ -2781,13 +2781,13 @@ void WinwordAnchoring::SetAnchoring(const SwFrameFormat& rFormat) case text::RelOrientation::FRAME: case text::RelOrientation::FRAME_LEFT: //:-( case text::RelOrientation::FRAME_RIGHT: //:-( - if (eAnchor == FLY_AT_PAGE) + if (eAnchor == RndStdIds::FLY_AT_PAGE) mnXRelTo = 1; else mnXRelTo = 2; break; case text::RelOrientation::PRINT_AREA: - if (eAnchor == FLY_AT_PAGE) + if (eAnchor == RndStdIds::FLY_AT_PAGE) mnXRelTo = 0; else mnXRelTo = 2; @@ -2809,13 +2809,13 @@ void WinwordAnchoring::SetAnchoring(const SwFrameFormat& rFormat) mnYRelTo = 1; break; case text::RelOrientation::PRINT_AREA: - if (eAnchor == FLY_AT_PAGE) + if (eAnchor == RndStdIds::FLY_AT_PAGE) mnYRelTo = 0; else mnYRelTo = 2; break; case text::RelOrientation::FRAME: - if (eAnchor == FLY_AT_PAGE) + if (eAnchor == RndStdIds::FLY_AT_PAGE) mnYRelTo = 1; else mnYRelTo = 2; diff --git a/sw/source/filter/ww8/wrtw8nds.cxx b/sw/source/filter/ww8/wrtw8nds.cxx index 92a4c358bd16..a7e0247a6ae3 100644 --- a/sw/source/filter/ww8/wrtw8nds.cxx +++ b/sw/source/filter/ww8/wrtw8nds.cxx @@ -355,7 +355,7 @@ sal_Int32 SwWW8AttrIter::SearchNext( sal_Int32 nStartPos ) if (nPos >= nStartPos && nPos <= nMinPos) nMinPos = nPos; - if (maFlyIter->GetFrameFormat().GetAnchor().GetAnchorId() == FLY_AT_CHAR) + if (maFlyIter->GetFrameFormat().GetAnchor().GetAnchorId() == RndStdIds::FLY_AT_CHAR) { ++nPos; if (nPos >= nStartPos && nPos <= nMinPos) @@ -1546,7 +1546,7 @@ SvxFrameDirection MSWordExportBase::TrueFrameDirection( const SwFrameFormat &rFl { pItem = nullptr; const SwFormatAnchor* pAnchor = &pFlyFormat->GetAnchor(); - if ((FLY_AT_PAGE != pAnchor->GetAnchorId()) && + if ((RndStdIds::FLY_AT_PAGE != pAnchor->GetAnchorId()) && pAnchor->GetContentAnchor() ) { pFlyFormat = pAnchor->GetContentAnchor()->nNode.GetNode().GetFlyFormat(); @@ -1604,7 +1604,7 @@ SvxBrushItem WW8Export::TrueFrameBgBrush(const SwFrameFormat &rFlyFormat) const { pRet = nullptr; const SwFormatAnchor* pAnchor = &pFlyFormat->GetAnchor(); - if ((FLY_AT_PAGE != pAnchor->GetAnchorId()) && + if ((RndStdIds::FLY_AT_PAGE != pAnchor->GetAnchorId()) && pAnchor->GetContentAnchor()) { pFlyFormat = @@ -2992,13 +2992,13 @@ void WW8AttributeOutput::OutputFlyFrame_Impl( const ww8::Frame& rFormat, const P aOffset -= aPageRect.Pos(); m_rWW8Export.m_pFlyOffset = &aOffset; - m_rWW8Export.m_eNewAnchorType = FLY_AT_PAGE; + m_rWW8Export.m_eNewAnchorType = RndStdIds::FLY_AT_PAGE; } m_rWW8Export.m_pParentFrame = &rFormat; if ( m_rWW8Export.IsInTable() && - (FLY_AT_PAGE != rAnch.GetAnchorId()) && + (RndStdIds::FLY_AT_PAGE != rAnch.GetAnchorId()) && !m_rWW8Export.m_pDoc->GetNodes()[ nStt ]->IsNoTextNode() ) { @@ -3028,7 +3028,7 @@ void AttributeOutputBase::OutputFlyFrame( const ww8::Frame& rFormat ) Point aLayPos; // get the Layout Node-Position - if (FLY_AT_PAGE == rFormat.GetFrameFormat().GetAnchor().GetAnchorId()) + if (RndStdIds::FLY_AT_PAGE == rFormat.GetFrameFormat().GetAnchor().GetAnchorId()) aLayPos = rNode.FindPageFrameRect().Pos(); else aLayPos = rNode.FindLayoutRect().Pos(); diff --git a/sw/source/filter/ww8/wrtww8.cxx b/sw/source/filter/ww8/wrtww8.cxx index 05a9160df88b..7aee7de8609b 100644 --- a/sw/source/filter/ww8/wrtww8.cxx +++ b/sw/source/filter/ww8/wrtww8.cxx @@ -3084,7 +3084,7 @@ void MSWordExportBase::ExportDocument( bool bWriteAll ) m_pParentFrame = nullptr; m_pFlyOffset = nullptr; - m_eNewAnchorType = FLY_AT_PAGE; + m_eNewAnchorType = RndStdIds::FLY_AT_PAGE; m_nTextTyp = TXT_MAINTEXT; m_nStyleBeforeFly = m_nLastFormatId = 0; m_pStyAttr = nullptr; @@ -3516,7 +3516,7 @@ MSWordExportBase::MSWordExportBase( SwDoc *pDocument, SwPaM *pCurrentPam, SwPaM , m_pHFTextBxs(nullptr) , m_pParentFrame(nullptr) , m_pFlyOffset(nullptr) - , m_eNewAnchorType(FLY_AS_CHAR) + , m_eNewAnchorType(RndStdIds::FLY_AS_CHAR) , m_pFieldMain(nullptr) , m_pFieldHdFt(nullptr) , m_pFieldFootnote(nullptr) diff --git a/sw/source/filter/ww8/wrtww8gr.cxx b/sw/source/filter/ww8/wrtww8gr.cxx index 166a078dcf39..018bfa829d3b 100644 --- a/sw/source/filter/ww8/wrtww8gr.cxx +++ b/sw/source/filter/ww8/wrtww8gr.cxx @@ -400,7 +400,7 @@ void WW8Export::OutGrf(const ww8::Frame &rFrame) const SwFrameFormat &rFlyFormat = rFrame.GetFrameFormat(); const RndStdIds eAn = rFlyFormat.GetAttrSet().GetAnchor(false).GetAnchorId(); - if (eAn == FLY_AS_CHAR) + if (eAn == RndStdIds::FLY_AS_CHAR) { sal_Int16 eVert = rFlyFormat.GetVertOrient().GetVertOrient(); if ((eVert == text::VertOrientation::CHAR_CENTER) || (eVert == text::VertOrientation::LINE_CENTER)) @@ -448,8 +448,8 @@ void WW8Export::OutGrf(const ww8::Frame &rFrame) // Otherwise, an additional paragraph is exported for a graphic, which is // forced to be treated as inline, because it's anchored inside another frame. if ( !rFrame.IsInline() && - ( ((eAn == FLY_AT_PARA)) || - (eAn == FLY_AT_PAGE)) ) + ( ((eAn == RndStdIds::FLY_AT_PARA)) || + (eAn == RndStdIds::FLY_AT_PAGE)) ) { WriteChar( (char)0x0d ); // close the surrounding frame with CR diff --git a/sw/source/filter/ww8/ww8atr.cxx b/sw/source/filter/ww8/ww8atr.cxx index 35dc33ef997f..30127381c460 100644 --- a/sw/source/filter/ww8/ww8atr.cxx +++ b/sw/source/filter/ww8/ww8atr.cxx @@ -3818,15 +3818,15 @@ void WW8AttributeOutput::FormatAnchor( const SwFormatAnchor& rAnchor ) sal_uInt8 nP = 0; switch ( rAnchor.GetAnchorId() ) { - case FLY_AT_PAGE: + case RndStdIds::FLY_AT_PAGE: // Vert: Page | Horz: Page nP |= (1 << 4) | (2 << 6); break; // Im Fall eine Flys als Zeichen: Absatz-gebunden setzen!!! - case FLY_AT_FLY: - case FLY_AT_CHAR: - case FLY_AT_PARA: - case FLY_AS_CHAR: + case RndStdIds::FLY_AT_FLY: + case RndStdIds::FLY_AT_CHAR: + case RndStdIds::FLY_AT_PARA: + case RndStdIds::FLY_AS_CHAR: // Vert: Page | Horz: Page nP |= (2 << 4) | (0 << 6); break; diff --git a/sw/source/filter/ww8/ww8glsy.cxx b/sw/source/filter/ww8/ww8glsy.cxx index b441a0aed8b5..9f34feac6787 100644 --- a/sw/source/filter/ww8/ww8glsy.cxx +++ b/sw/source/filter/ww8/ww8glsy.cxx @@ -65,8 +65,8 @@ bool WW8Glossary::HasBareGraphicEnd(SwDoc *pDoc,SwNodeIndex &rIdx) const SwFormatAnchor& rAnchor = pFrameFormat->GetAnchor(); SwPosition const*const pAPos = rAnchor.GetContentAnchor(); if (pAPos && - ((FLY_AT_PARA == rAnchor.GetAnchorId()) || - (FLY_AT_CHAR == rAnchor.GetAnchorId())) && + ((RndStdIds::FLY_AT_PARA == rAnchor.GetAnchorId()) || + (RndStdIds::FLY_AT_CHAR == rAnchor.GetAnchorId())) && rIdx == pAPos->nNode.GetIndex() ) { bRet=true; diff --git a/sw/source/filter/ww8/ww8graf.cxx b/sw/source/filter/ww8/ww8graf.cxx index edc942f985a2..839bb6471c26 100644 --- a/sw/source/filter/ww8/ww8graf.cxx +++ b/sw/source/filter/ww8/ww8graf.cxx @@ -179,7 +179,7 @@ bool SwWW8ImplReader::ReadGrafStart(void* pData, short nDataSiz, if (!bCouldRead) return false; - SwFormatAnchor aAnchor( FLY_AT_CHAR ); + SwFormatAnchor aAnchor( RndStdIds::FLY_AT_CHAR ); aAnchor.SetAnchor( m_pPaM->GetPoint() ); rSet.Put( aAnchor ); @@ -2168,7 +2168,7 @@ RndStdIds SwWW8ImplReader::ProcessEscherAlign(SvxMSDffImportRec* pRecord, { OSL_ENSURE(pRecord || pFSPA, "give me something! to work with for anchoring"); if (!pRecord && !pFSPA) - return FLY_AT_PAGE; + return RndStdIds::FLY_AT_PAGE; bool bCurSectionVertical = m_aSectionManager.CurrentSectionIsVertical(); SvxMSDffImportRec aRecordFromFSPA; @@ -2220,7 +2220,7 @@ RndStdIds SwWW8ImplReader::ProcessEscherAlign(SvxMSDffImportRec* pRecord, sal_uInt32 nXRelTo = (pRecord->pXRelTo && nCntRelTo > *(pRecord->pXRelTo)) ? *(pRecord->pXRelTo) : 1; sal_uInt32 nYRelTo = (pRecord->pYRelTo && nCntRelTo > *(pRecord->pYRelTo)) ? *(pRecord->pYRelTo) : 1; - RndStdIds eAnchor = IsInlineEscherHack() ? FLY_AS_CHAR : FLY_AT_CHAR; // #i43718# + RndStdIds eAnchor = IsInlineEscherHack() ? RndStdIds::FLY_AS_CHAR : RndStdIds::FLY_AT_CHAR; // #i43718# SwFormatAnchor aAnchor( eAnchor ); aAnchor.SetAnchor( m_pPaM->GetPoint() ); @@ -2759,7 +2759,7 @@ SwFrameFormat *SwWW8ImplReader::AddAutoAnchor(SwFrameFormat *pFormat) * * Leave to later and set the correct location then. */ - if ((pFormat) && (pFormat->GetAnchor().GetAnchorId() != FLY_AS_CHAR)) + if ((pFormat) && (pFormat->GetAnchor().GetAnchorId() != RndStdIds::FLY_AS_CHAR)) { m_pAnchorStck->AddAnchor(*m_pPaM->GetPoint(), pFormat); } @@ -3114,7 +3114,7 @@ void SwWW8ImplReader::GrafikDtor() void SwWW8FltAnchorStack::AddAnchor(const SwPosition& rPos, SwFrameFormat *pFormat) { - OSL_ENSURE(pFormat->GetAnchor().GetAnchorId() != FLY_AS_CHAR, + OSL_ENSURE(pFormat->GetAnchor().GetAnchorId() != RndStdIds::FLY_AS_CHAR, "Don't use fltanchors with inline frames, slap!"); NewAttr(rPos, SwFltAnchor(pFormat)); } diff --git a/sw/source/filter/ww8/ww8graf2.cxx b/sw/source/filter/ww8/ww8graf2.cxx index c4fabfa88735..3f02ec98927d 100644 --- a/sw/source/filter/ww8/ww8graf2.cxx +++ b/sw/source/filter/ww8/ww8graf2.cxx @@ -373,7 +373,7 @@ SwFlyFrameFormat* SwWW8ImplReader::MakeGrafNotInContent(const WW8PicDesc& rPD, // So the frames are generated when inserted in an existing doc: if (m_rDoc.getIDocumentLayoutAccess().GetCurrentViewShell() && - (FLY_AT_PARA == pFlyFormat->GetAnchor().GetAnchorId())) + (RndStdIds::FLY_AT_PARA == pFlyFormat->GetAnchor().GetAnchorId())) { pFlyFormat->MakeFrames(); } @@ -511,7 +511,7 @@ SwFrameFormat* SwWW8ImplReader::ImportGraf(SdrTextObj* pTextObj, // current PaM point is after the position if it is anchored in // content; because this anchor add a character into the textnode. // #i2806# - if (FLY_AS_CHAR == + if (RndStdIds::FLY_AS_CHAR == m_pFlyFormatOfJustInsertedGraphic->GetAnchor().GetAnchorId() ) { aFlySet.ClearItem( RES_ANCHOR ); diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx index 1fb45725c4b4..54a890cb1154 100644 --- a/sw/source/filter/ww8/ww8par.cxx +++ b/sw/source/filter/ww8/ww8par.cxx @@ -2241,10 +2241,10 @@ void SwWW8ImplReader::Read_HdFtTextAsHackedFrame(WW8_CP nStart, WW8_CP nLen, m_pPaM->GetPoint()->nNode = pSttIdx->GetIndex() + 1; m_pPaM->GetPoint()->nContent.Assign(m_pPaM->GetContentNode(), 0); - SwFlyFrameFormat *pFrame = m_rDoc.MakeFlySection(FLY_AT_PARA, m_pPaM->GetPoint()); + SwFlyFrameFormat *pFrame = m_rDoc.MakeFlySection(RndStdIds::FLY_AT_PARA, m_pPaM->GetPoint()); SwFormatAnchor aAnch( pFrame->GetAnchor() ); - aAnch.SetType( FLY_AT_PARA ); + aAnch.SetType( RndStdIds::FLY_AT_PARA ); pFrame->SetFormatAttr( aAnch ); SwFormatFrameSize aSz(ATT_MIN_SIZE, nPageWidth, MINLAY); SwFrameSize eFrameSize = ATT_MIN_SIZE; diff --git a/sw/source/filter/ww8/ww8par2.cxx b/sw/source/filter/ww8/ww8par2.cxx index ec889ea5ce07..669c98c48e64 100644 --- a/sw/source/filter/ww8/ww8par2.cxx +++ b/sw/source/filter/ww8/ww8par2.cxx @@ -3416,7 +3416,7 @@ bool SwWW8ImplReader::StartTable(WW8_CP nStartCp) // #i45301# - anchor nested table inside Writer fly frame // only at-character, if absolute position object attributes are available. // Thus, default anchor type is as-character anchored. - RndStdIds eAnchor( FLY_AS_CHAR ); + RndStdIds eAnchor( RndStdIds::FLY_AS_CHAR ); if ( m_nInTable ) { WW8_TablePos* pNestedTabPos( nullptr ); @@ -3445,7 +3445,7 @@ bool SwWW8ImplReader::StartTable(WW8_CP nStartCp) m_nIniFlyDx, m_nIniFlyDy); // #i45301# - anchor nested table Writer fly frame at-character - eAnchor = FLY_AT_CHAR; + eAnchor = RndStdIds::FLY_AT_CHAR; } } } @@ -3463,7 +3463,7 @@ bool SwWW8ImplReader::StartTable(WW8_CP nStartCp) { int nNewInTable = m_nInTable + 1; - if ((eAnchor == FLY_AT_CHAR) + if ((eAnchor == RndStdIds::FLY_AT_CHAR) && !m_aTableStack.empty() && !InEqualApo(nNewInTable) ) { m_pTableDesc->m_pParentPos = new SwPosition(*m_pPaM->GetPoint()); @@ -3489,7 +3489,7 @@ bool SwWW8ImplReader::StartTable(WW8_CP nStartCp) if ( pTableWFlyPara && pTableSFlyPara ) { WW8FlySet aFlySet( *this, pTableWFlyPara, pTableSFlyPara, false ); - SwFormatAnchor aAnchor( FLY_AT_CHAR ); + SwFormatAnchor aAnchor( RndStdIds::FLY_AT_CHAR ); aAnchor.SetAnchor( m_pTableDesc->m_pParentPos ); aFlySet.Put( aAnchor ); m_pTableDesc->m_pFlyFormat->SetFormatAttr( aFlySet ); diff --git a/sw/source/filter/ww8/ww8par4.cxx b/sw/source/filter/ww8/ww8par4.cxx index c787054081d3..b461ebd2f5d4 100644 --- a/sw/source/filter/ww8/ww8par4.cxx +++ b/sw/source/filter/ww8/ww8par4.cxx @@ -266,7 +266,7 @@ SwFrameFormat* SwWW8ImplReader::ImportOle(const Graphic* pGrf, if (!m_bNewDoc) Reader::ResetFrameFormatAttrs( *pTempSet ); - SwFormatAnchor aAnchor( FLY_AS_CHAR ); + SwFormatAnchor aAnchor( RndStdIds::FLY_AS_CHAR ); aAnchor.SetAnchor( m_pPaM->GetPoint() ); pTempSet->Put( aAnchor ); diff --git a/sw/source/filter/ww8/ww8par5.cxx b/sw/source/filter/ww8/ww8par5.cxx index e384a834e463..eb2f5efba888 100644 --- a/sw/source/filter/ww8/ww8par5.cxx +++ b/sw/source/filter/ww8/ww8par5.cxx @@ -2404,7 +2404,7 @@ eF_ResT SwWW8ImplReader::Read_F_IncludePicture( WW8FieldDesc*, OUString& rStr ) */ SfxItemSet aFlySet( m_rDoc.GetAttrPool(), RES_FRMATR_BEGIN, RES_FRMATR_END-1 ); - aFlySet.Put( SwFormatAnchor( FLY_AS_CHAR ) ); + aFlySet.Put( SwFormatAnchor( RndStdIds::FLY_AS_CHAR ) ); aFlySet.Put( SwFormatVertOrient( 0, text::VertOrientation::TOP, text::RelOrientation::FRAME )); m_pFlyFormatOfJustInsertedGraphic = m_rDoc.getIDocumentContentOperations().Insert( *m_pPaM, aGrfName, diff --git a/sw/source/filter/ww8/ww8par6.cxx b/sw/source/filter/ww8/ww8par6.cxx index 952975d03e43..209ca6771078 100644 --- a/sw/source/filter/ww8/ww8par6.cxx +++ b/sw/source/filter/ww8/ww8par6.cxx @@ -1820,7 +1820,7 @@ WW8SwFlyPara::WW8SwFlyPara( SwPaM& rPaM, nYBind = (( rWW.nSp29 & 0x30 ) >> 4); //#i53725# - absolute positioned objects have to be // anchored at-paragraph to assure its correct anchor position. - eAnchor = FLY_AT_PARA; + eAnchor = RndStdIds::FLY_AT_PARA; rIo.m_pLastAnchorPos.reset( new SwPosition(*rPaM.GetPoint())); switch (nYBind) @@ -2107,7 +2107,7 @@ void WW8FlySet::Init(const SwWW8ImplReader& rReader, const SwPaM* pPaM) Reader::ResetFrameFormatAttrs(*this); // remove distance/borders Put(SvxLRSpaceItem(RES_LR_SPACE)); //inline writer ole2 objects start with 0.2cm l/r - SwFormatAnchor aAnchor(FLY_AS_CHAR); + SwFormatAnchor aAnchor(RndStdIds::FLY_AS_CHAR); aAnchor.SetAnchor(pPaM->GetPoint()); Put(aAnchor); @@ -2360,7 +2360,7 @@ bool SwWW8ImplReader::StartApo(const ApoTestResults &rApo, const WW8_TablePos *p m_pWWZOrder->InsertTextLayerObject(pOurNewObject); } - if (FLY_AS_CHAR != m_pSFlyPara->eAnchor && m_pSFlyPara->pFlyFormat) + if (RndStdIds::FLY_AS_CHAR != m_pSFlyPara->eAnchor && m_pSFlyPara->pFlyFormat) { m_pAnchorStck->AddAnchor(*m_pPaM->GetPoint(),m_pSFlyPara->pFlyFormat); } @@ -3228,7 +3228,7 @@ SwFrameFormat *SwWW8ImplReader::ContainsSingleInlineGraphic(const SwPaM &rRegion subscripting to force the graphic into a centered position on the line, so we must check when applying sub/super to see if it the subscript range contains only a single graphic, and if that graphic is anchored as - FLY_AS_CHAR and then we can change its anchoring to centered in the line. + RndStdIds::FLY_AS_CHAR and then we can change its anchoring to centered in the line. */ SwFrameFormat *pRet=nullptr; SwNodeIndex aBegin(rRegion.Start()->nNode); @@ -3246,7 +3246,7 @@ SwFrameFormat *SwWW8ImplReader::ContainsSingleInlineGraphic(const SwPaM &rRegion const SwFormatFlyCnt& rFly = pTFlyAttr->GetFlyCnt(); SwFrameFormat *pFlyFormat = rFly.GetFrameFormat(); if (pFlyFormat && - (FLY_AS_CHAR == pFlyFormat->GetAnchor().GetAnchorId())) + (RndStdIds::FLY_AS_CHAR == pFlyFormat->GetAnchor().GetAnchorId())) { pRet = pFlyFormat; } @@ -3261,7 +3261,7 @@ bool SwWW8ImplReader::ConvertSubToGraphicPlacement() subscripting to force the graphic into a centered position on the line, so we must check when applying sub/super to see if it the subscript range contains only a single graphic, and if that graphic is anchored as - FLY_AS_CHAR and then we can change its anchoring to centered in the line. + RndStdIds::FLY_AS_CHAR and then we can change its anchoring to centered in the line. */ bool bIsGraphicPlacementHack = false; sal_uInt16 nPos; diff --git a/sw/source/filter/xml/xmltexti.cxx b/sw/source/filter/xml/xmltexti.cxx index 1b20f32bb9c1..75809efb4bba 100644 --- a/sw/source/filter/xml/xmltexti.cxx +++ b/sw/source/filter/xml/xmltexti.cxx @@ -106,7 +106,7 @@ static void lcl_putHeightAndWidth ( SfxItemSet &rItemSet, rItemSet.Put( SwFormatFrameSize( ATT_FIX_SIZE, nWidth, nHeight ) ); } - SwFormatAnchor aAnchor( FLY_AT_CHAR ); + SwFormatAnchor aAnchor( RndStdIds::FLY_AT_CHAR ); rItemSet.Put( aAnchor ); if( pTwipWidth ) diff --git a/sw/source/ui/dbui/mmlayoutpage.cxx b/sw/source/ui/dbui/mmlayoutpage.cxx index ad9eae74e4d0..e84429aef9ed 100644 --- a/sw/source/ui/dbui/mmlayoutpage.cxx +++ b/sw/source/ui/dbui/mmlayoutpage.cxx @@ -290,7 +290,7 @@ SwFrameFormat* SwMailMergeLayoutPage::InsertAddressFrame( RES_FRM_SIZE, RES_FRM_SIZE, RES_SURROUND, RES_SURROUND, 0 ); - aSet.Put(SwFormatAnchor(FLY_AT_PAGE, 1)); + aSet.Put(SwFormatAnchor(RndStdIds::FLY_AT_PAGE, 1)); if(bAlignLeft) aSet.Put(SwFormatHoriOrient( 0, text::HoriOrientation::NONE, text::RelOrientation::PAGE_PRINT_AREA )); else diff --git a/sw/source/ui/frmdlg/column.cxx b/sw/source/ui/frmdlg/column.cxx index 01a3f7fb0ade..c18867b180ca 100644 --- a/sw/source/ui/frmdlg/column.cxx +++ b/sw/source/ui/frmdlg/column.cxx @@ -102,7 +102,7 @@ SwColumnDlg::SwColumnDlg(vcl::Window* pParent, SwWrtShell& rSh) , bFrameChanged(false) { SwRect aRect; - rWrtShell.CalcBoundRect(aRect, FLY_AS_CHAR); + rWrtShell.CalcBoundRect(aRect, RndStdIds::FLY_AS_CHAR); nSelectionWidth = aRect.Width(); diff --git a/sw/source/ui/frmdlg/frmpage.cxx b/sw/source/ui/frmdlg/frmpage.cxx index a5eb7386a6d7..d604a807a006 100644 --- a/sw/source/ui/frmdlg/frmpage.cxx +++ b/sw/source/ui/frmdlg/frmpage.cxx @@ -914,7 +914,7 @@ void SwFramePage::Reset( const SfxItemSet *rSet ) if (SfxItemState::SET == rSet->GetItemState(FN_MATH_BASELINE_ALIGNMENT, false, &pItem)) m_bIsMathBaselineAlignment = static_cast<const SfxBoolItem*>(pItem)->GetValue(); EnableVerticalPositioning( !(m_bIsMathOLE && m_bIsMathBaselineAlignment - && FLY_AS_CHAR == rAnchor.GetAnchorId()) ); + && RndStdIds::FLY_AS_CHAR == rAnchor.GetAnchorId()) ); if (m_bFormat) { @@ -924,7 +924,7 @@ void SwFramePage::Reset( const SfxItemSet *rSet ) } else { - if (rAnchor.GetAnchorId() != FLY_AT_FLY && !pSh->IsFlyInFly()) + if (rAnchor.GetAnchorId() != RndStdIds::FLY_AT_FLY && !pSh->IsFlyInFly()) m_pAnchorAtFrameRB->Hide(); if ( pSh->IsFrameVertical( true, m_bIsInRightToLeft, m_bIsVerticalL2R ) ) { @@ -1002,11 +1002,11 @@ void SwFramePage::Reset( const SfxItemSet *rSet ) // general initialisation part switch(rAnchor.GetAnchorId()) { - case FLY_AT_PAGE: m_pAnchorAtPageRB->Check(); break; - case FLY_AT_PARA: m_pAnchorAtParaRB->Check(); break; - case FLY_AT_CHAR: m_pAnchorAtCharRB->Check(); break; - case FLY_AS_CHAR: m_pAnchorAsCharRB->Check(); break; - case FLY_AT_FLY: m_pAnchorAtFrameRB->Check();break; + case RndStdIds::FLY_AT_PAGE: m_pAnchorAtPageRB->Check(); break; + case RndStdIds::FLY_AT_PARA: m_pAnchorAtParaRB->Check(); break; + case RndStdIds::FLY_AT_CHAR: m_pAnchorAtCharRB->Check(); break; + case RndStdIds::FLY_AS_CHAR: m_pAnchorAsCharRB->Check(); break; + case RndStdIds::FLY_AT_FLY: m_pAnchorAtFrameRB->Check();break; default:; //prevent warning } @@ -1143,7 +1143,7 @@ bool SwFramePage::FillItemSet(SfxItemSet *rSet) // vertical position // recalculate offset for character bound frames SwTwips nY = static_cast< SwTwips >(m_pAtVertPosED->Denormalize(m_pAtVertPosED->GetValue(FUNIT_TWIP))); - if (eAnchorId == FLY_AS_CHAR) + if (eAnchorId == RndStdIds::FLY_AS_CHAR) { nY *= -1; } @@ -1291,19 +1291,19 @@ void SwFramePage::InitPos(RndStdIds eId, } bool bEnable = true; - if ( eId == FLY_AT_PAGE ) + if ( eId == RndStdIds::FLY_AT_PAGE ) { m_pVMap = m_bHtmlMode ? aVPageHtmlMap : aVPageMap; m_pHMap = m_bHtmlMode ? aHPageHtmlMap : aHPageMap; } - else if ( eId == FLY_AT_FLY ) + else if ( eId == RndStdIds::FLY_AT_FLY ) { // own vertical alignment map for to frame // anchored objects. m_pVMap = m_bHtmlMode ? aVFlyHtmlMap : aVFrameMap; m_pHMap = m_bHtmlMode ? aHFlyHtmlMap : aHFrameMap; } - else if ( eId == FLY_AT_PARA ) + else if ( eId == RndStdIds::FLY_AT_PARA ) { if(m_bHtmlMode) { @@ -1316,7 +1316,7 @@ void SwFramePage::InitPos(RndStdIds eId, m_pHMap = aHParaMap; } } - else if ( eId == FLY_AT_CHAR ) + else if ( eId == RndStdIds::FLY_AT_CHAR ) { if(m_bHtmlMode) { @@ -1329,7 +1329,7 @@ void SwFramePage::InitPos(RndStdIds eId, m_pHMap = aHCharMap; } } - else if ( eId == FLY_AS_CHAR ) + else if ( eId == RndStdIds::FLY_AS_CHAR ) { m_pVMap = m_bHtmlMode ? aVAsCharHtmlMap : aVAsCharMap; m_pHMap = nullptr; @@ -1357,7 +1357,7 @@ void SwFramePage::InitPos(RndStdIds eId, nMapPos = FillPosLB(m_pVMap, nV, nVRel, *m_pVerticalDLB); FillRelLB(m_pVMap, nMapPos, nV, nVRel, *m_pVertRelationLB, *m_pVertRelationFT); - bEnable = nH == text::HoriOrientation::NONE && eId != FLY_AS_CHAR; + bEnable = nH == text::HoriOrientation::NONE && eId != RndStdIds::FLY_AS_CHAR; if (!bEnable) { m_pAtHorzPosED->SetValue( 0, FUNIT_TWIP ); @@ -1381,7 +1381,7 @@ void SwFramePage::InitPos(RndStdIds eId, } else { - if ( eId == FLY_AS_CHAR ) + if ( eId == RndStdIds::FLY_AS_CHAR ) { if ( nY == LONG_MAX ) nY = 0; @@ -1708,22 +1708,22 @@ sal_Int32 SwFramePage::GetMapPos( const FrameMap *pMap, ListBox &rAlignLB ) RndStdIds SwFramePage::GetAnchor() { - RndStdIds nRet = FLY_AT_PAGE; + RndStdIds nRet = RndStdIds::FLY_AT_PAGE; if(m_pAnchorAtParaRB->IsChecked()) { - nRet = FLY_AT_PARA; + nRet = RndStdIds::FLY_AT_PARA; } else if(m_pAnchorAtCharRB->IsChecked()) { - nRet = FLY_AT_CHAR; + nRet = RndStdIds::FLY_AT_CHAR; } else if(m_pAnchorAsCharRB->IsChecked()) { - nRet = FLY_AS_CHAR; + nRet = RndStdIds::FLY_AS_CHAR; } else if(m_pAnchorAtFrameRB->IsChecked()) { - nRet = FLY_AT_FLY; + nRet = RndStdIds::FLY_AT_FLY; } return nRet; } @@ -1911,9 +1911,9 @@ void SwFramePage::RangeModifyHdl() if ( aVal.nHPos != nAtHorzPosVal ) m_pAtHorzPosED->SetValue(m_pAtHorzPosED->Normalize(aVal.nHPos), FUNIT_TWIP); - const SwTwips nUpperOffset = (aVal.nAnchorType == FLY_AS_CHAR) + const SwTwips nUpperOffset = (aVal.nAnchorType == (sal_Int16)RndStdIds::FLY_AS_CHAR) ? m_nUpperBorder : 0; - const SwTwips nLowerOffset = (aVal.nAnchorType == FLY_AS_CHAR) + const SwTwips nLowerOffset = (aVal.nAnchorType == (sal_Int16)RndStdIds::FLY_AS_CHAR) ? m_nLowerBorder : 0; m_pAtVertPosED->SetMin(m_pAtVertPosED->Normalize(aVal.nMinVPos + nLowerOffset + nUpperOffset), FUNIT_TWIP); @@ -1946,7 +1946,7 @@ IMPL_LINK_NOARG(SwFramePage, AnchorTypeHdl, Button*, void) } EnableVerticalPositioning( !(m_bIsMathOLE && m_bIsMathBaselineAlignment - && FLY_AS_CHAR == eId) ); + && RndStdIds::FLY_AS_CHAR == eId) ); } IMPL_LINK( SwFramePage, PosHdl, ListBox&, rLB, void ) @@ -1994,7 +1994,7 @@ IMPL_LINK( SwFramePage, PosHdl, ListBox&, rLB, void ) m_bAtVertPosModified = true; // special treatment for HTML-Mode with horizonal-vertical-dependencies - if(m_bHtmlMode && (FLY_AT_CHAR == GetAnchor())) + if(m_bHtmlMode && (RndStdIds::FLY_AT_CHAR == GetAnchor())) { bool bSet = false; if(bHori) @@ -2062,7 +2062,7 @@ IMPL_LINK( SwFramePage, RelHdl, ListBox&, rLB, void ) else m_bAtVertPosModified = true; - if (m_bHtmlMode && (FLY_AT_CHAR == GetAnchor())) + if (m_bHtmlMode && (RndStdIds::FLY_AT_CHAR == GetAnchor())) { if(bHori) { @@ -2282,7 +2282,7 @@ void SwFramePage::Init(const SfxItemSet& rSet, bool bReset) m_nOldV = rVert.GetVertOrient(); m_nOldVRel = rVert.GetRelationOrient(); - if (eAnchorId == FLY_AT_PAGE) + if (eAnchorId == RndStdIds::FLY_AT_PAGE) { if (m_nOldHRel == text::RelOrientation::FRAME) m_nOldHRel = text::RelOrientation::PAGE_FRAME; diff --git a/sw/source/ui/frmdlg/wrap.cxx b/sw/source/ui/frmdlg/wrap.cxx index bb222d8c3612..fad4f66df930 100644 --- a/sw/source/ui/frmdlg/wrap.cxx +++ b/sw/source/ui/frmdlg/wrap.cxx @@ -69,7 +69,7 @@ SwWrapTabPage::SwWrapTabPage(vcl::Window *pParent, const SfxItemSet &rSet) , m_nOldRightMargin(0) , m_nOldUpperMargin(0) , m_nOldLowerMargin(0) - , m_nAnchorId(FLY_AT_PARA) + , m_nAnchorId(RndStdIds::FLY_AT_PARA) , m_nHtmlMode(0) , m_pWrtSh(nullptr) , m_bFormat(false) @@ -206,7 +206,7 @@ void SwWrapTabPage::Reset(const SfxItemSet *rSet) const SwFormatAnchor &rAnch = static_cast<const SwFormatAnchor&>(rSet->Get(RES_ANCHOR)); m_nAnchorId = rAnch.GetAnchorId(); - if (((m_nAnchorId == FLY_AT_PARA) || (m_nAnchorId == FLY_AT_CHAR)) + if (((m_nAnchorId == RndStdIds::FLY_AT_PARA) || (m_nAnchorId == RndStdIds::FLY_AT_CHAR)) && (nSur != css::text::WrapTextMode_NONE)) { m_pWrapAnchorOnlyCB->Check( rSurround.IsAnchorOnly() ); @@ -398,7 +398,7 @@ void SwWrapTabPage::ActivatePage(const SfxItemSet& rSet) // anchor const SwFormatAnchor &rAnch = static_cast<const SwFormatAnchor&>(rSet.Get(RES_ANCHOR)); m_nAnchorId = rAnch.GetAnchorId(); - bool bEnable = (m_nAnchorId != FLY_AS_CHAR); + bool bEnable = (m_nAnchorId != RndStdIds::FLY_AS_CHAR); if (!m_bDrawMode) { @@ -461,7 +461,7 @@ void SwWrapTabPage::ActivatePage(const SfxItemSet& rSet) nBottom = aVal.nMaxHeight - aVal.nHeight; { - if (aVal.nAnchorType == FLY_AS_CHAR) + if (aVal.nAnchorType == (sal_Int16)RndStdIds::FLY_AS_CHAR) { nLeft = nRight; @@ -506,31 +506,31 @@ void SwWrapTabPage::ActivatePage(const SfxItemSet& rSet) sal_Int16 eHRelOrient = rHori.GetRelationOrient(); m_pWrapOutlineCB->Hide(); const bool bAllHtmlModes = - ((m_nAnchorId == FLY_AT_PARA) || (m_nAnchorId == FLY_AT_CHAR)) && + ((m_nAnchorId == RndStdIds::FLY_AT_PARA) || (m_nAnchorId == RndStdIds::FLY_AT_CHAR)) && (eHOrient == text::HoriOrientation::RIGHT || eHOrient == text::HoriOrientation::LEFT); m_pWrapAnchorOnlyCB->Enable( bAllHtmlModes && nSur != css::text::WrapTextMode_NONE ); m_pWrapOutsideCB->Hide(); m_pIdealWrapRB->Enable( false ); m_pWrapTransparentCB->Enable( false ); - m_pNoWrapRB->Enable( FLY_AT_PARA == m_nAnchorId ); + m_pNoWrapRB->Enable( RndStdIds::FLY_AT_PARA == m_nAnchorId ); m_pWrapParallelRB->Enable( false ); m_pWrapLeftRB->Enable - ( (FLY_AT_PARA == m_nAnchorId) - || ( (FLY_AT_CHAR == m_nAnchorId) + ( (RndStdIds::FLY_AT_PARA == m_nAnchorId) + || ( (RndStdIds::FLY_AT_CHAR == m_nAnchorId) && (eHOrient == text::HoriOrientation::RIGHT) && (eHRelOrient == text::RelOrientation::PRINT_AREA))); m_pWrapRightRB->Enable - ( (FLY_AT_PARA == m_nAnchorId) - || ( (FLY_AT_CHAR == m_nAnchorId) + ( (RndStdIds::FLY_AT_PARA == m_nAnchorId) + || ( (RndStdIds::FLY_AT_CHAR == m_nAnchorId) && (eHOrient == text::HoriOrientation::LEFT) && (eHRelOrient == text::RelOrientation::PRINT_AREA))); m_pWrapThroughRB->Enable - ( ( (FLY_AT_PAGE == m_nAnchorId) - || ( (FLY_AT_CHAR == m_nAnchorId) + ( ( (RndStdIds::FLY_AT_PAGE == m_nAnchorId) + || ( (RndStdIds::FLY_AT_CHAR == m_nAnchorId) && (eHRelOrient != text::RelOrientation::PRINT_AREA)) - || (FLY_AT_PARA == m_nAnchorId)) + || (RndStdIds::FLY_AT_PARA == m_nAnchorId)) && (eHOrient != text::HoriOrientation::RIGHT)); if(m_pNoWrapRB->IsChecked() && !m_pNoWrapRB->IsEnabled()) { @@ -572,7 +572,7 @@ void SwWrapTabPage::ActivatePage(const SfxItemSet& rSet) m_pWrapThroughRB->Enable( bEnable ); m_pWrapParallelRB->Enable( bEnable ); m_pWrapAnchorOnlyCB->Enable( - ((m_nAnchorId == FLY_AT_PARA) || (m_nAnchorId == FLY_AT_CHAR)) + ((m_nAnchorId == RndStdIds::FLY_AT_PARA) || (m_nAnchorId == RndStdIds::FLY_AT_CHAR)) && nSur != css::text::WrapTextMode_NONE ); } ContourHdl(nullptr); @@ -620,11 +620,11 @@ IMPL_LINK( SwWrapTabPage, WrapTypeHdl, Button *, pBtn, void ) { bool bWrapThrough = (pBtn == m_pWrapThroughRB); m_pWrapTransparentCB->Enable( bWrapThrough && !m_bHtmlMode ); - bWrapThrough |= ( m_nAnchorId == FLY_AS_CHAR ); + bWrapThrough |= ( m_nAnchorId == RndStdIds::FLY_AS_CHAR ); m_pWrapOutlineCB->Enable( !bWrapThrough && pBtn != m_pNoWrapRB); m_pWrapOutsideCB->Enable( !bWrapThrough && m_pWrapOutlineCB->IsChecked() ); m_pWrapAnchorOnlyCB->Enable( - ((m_nAnchorId == FLY_AT_PARA) || (m_nAnchorId == FLY_AT_CHAR)) && + ((m_nAnchorId == RndStdIds::FLY_AT_PARA) || (m_nAnchorId == RndStdIds::FLY_AT_CHAR)) && (pBtn != m_pNoWrapRB) ); ContourHdl(nullptr); diff --git a/sw/source/uibase/app/appenv.cxx b/sw/source/uibase/app/appenv.cxx index 7296f06c69d1..93366b85d8c3 100644 --- a/sw/source/uibase/app/appenv.cxx +++ b/sw/source/uibase/app/appenv.cxx @@ -429,7 +429,7 @@ void SwModule::InsertEnv( SfxRequest& rReq ) if (rItem.bSend) { pSh->SttEndDoc(true); - aMgr.InsertFlyFrame(FLY_AT_PAGE, + aMgr.InsertFlyFrame(RndStdIds::FLY_AT_PAGE, Point(rItem.lSendFromLeft + lLeft, rItem.lSendFromTop + lUpper), Size (rItem.lAddrFromLeft - rItem.lSendFromLeft, 0)); @@ -445,7 +445,7 @@ void SwModule::InsertEnv( SfxRequest& rReq ) // Addressee pSh->SttEndDoc(true); - aMgr.InsertFlyFrame(FLY_AT_PAGE, + aMgr.InsertFlyFrame(RndStdIds::FLY_AT_PAGE, Point(rItem.lAddrFromLeft + lLeft, rItem.lAddrFromTop + lUpper), Size (nPageW - rItem.lAddrFromLeft - 566, 0)); pSh->EnterSelFrameMode(); diff --git a/sw/source/uibase/app/applab.cxx b/sw/source/uibase/app/applab.cxx index 94973d6fe9bd..208cbeb6cec4 100644 --- a/sw/source/uibase/app/applab.cxx +++ b/sw/source/uibase/app/applab.cxx @@ -90,7 +90,7 @@ static const SwFrameFormat *lcl_InsertBCText( SwWrtShell& rSh, const SwLabItem& rSh.GetPageNum( nPhyPageNum, nVirtPageNum ); //anchor frame to page - aSet.Put( SwFormatAnchor( FLY_AT_PAGE, nPhyPageNum ) ); + aSet.Put( SwFormatAnchor( RndStdIds::FLY_AT_PAGE, nPhyPageNum ) ); aSet.Put( SwFormatHoriOrient( rItem.m_lLeft + static_cast<SwTwips>(nCol) * rItem.m_lHDist, text::HoriOrientation::NONE, text::RelOrientation::PAGE_FRAME ) ); aSet.Put( SwFormatVertOrient( rItem.m_lUpper + static_cast<SwTwips>(nRow) * rItem.m_lVDist, @@ -127,7 +127,7 @@ static const SwFrameFormat *lcl_InsertLabText( SwWrtShell& rSh, const SwLabItem& rSh.GetPageNum( nPhyPageNum, nVirtPageNum ); //anchor frame to page - aSet.Put( SwFormatAnchor( FLY_AT_PAGE, nPhyPageNum ) ); + aSet.Put( SwFormatAnchor( RndStdIds::FLY_AT_PAGE, nPhyPageNum ) ); aSet.Put( SwFormatHoriOrient( rItem.m_lLeft + static_cast<SwTwips>(nCol) * rItem.m_lHDist, text::HoriOrientation::NONE, text::RelOrientation::PAGE_FRAME ) ); aSet.Put( SwFormatVertOrient( rItem.m_lUpper + static_cast<SwTwips>(nRow) * rItem.m_lVDist, diff --git a/sw/source/uibase/dialog/regionsw.cxx b/sw/source/uibase/dialog/regionsw.cxx index 9c0a3de1e61b..ef18d8c2a52f 100644 --- a/sw/source/uibase/dialog/regionsw.cxx +++ b/sw/source/uibase/dialog/regionsw.cxx @@ -74,7 +74,7 @@ void SwBaseShell::InsertRegionDialog(SfxRequest& rReq) if (!pSet || pSet->Count()==0) { SwRect aRect; - rSh.CalcBoundRect(aRect, FLY_AS_CHAR); + rSh.CalcBoundRect(aRect, RndStdIds::FLY_AS_CHAR); long nWidth = aRect.Width(); aSet.Put(SwFormatFrameSize(ATT_VAR_SIZE, nWidth)); @@ -111,7 +111,7 @@ void SwBaseShell::InsertRegionDialog(SfxRequest& rReq) { SwFormatCol aCol; SwRect aRect; - rSh.CalcBoundRect(aRect, FLY_AS_CHAR); + rSh.CalcBoundRect(aRect, RndStdIds::FLY_AS_CHAR); long nWidth = aRect.Width(); sal_uInt16 nCol = static_cast<const SfxUInt16Item *>(pItem)->GetValue(); @@ -187,7 +187,7 @@ IMPL_LINK( SwWrtShell, InsertRegionDialog, void*, p, void ) SID_ATTR_PAGE_SIZE, SID_ATTR_PAGE_SIZE, 0); SwRect aRect; - CalcBoundRect(aRect, FLY_AS_CHAR); + CalcBoundRect(aRect, RndStdIds::FLY_AS_CHAR); long nWidth = aRect.Width(); aSet.Put(SwFormatFrameSize(ATT_VAR_SIZE, nWidth)); // height=width for more consistent preview (analog to edit region) diff --git a/sw/source/uibase/docvw/edtwin.cxx b/sw/source/uibase/docvw/edtwin.cxx index 99c9a9a62f58..44d76b252eda 100644 --- a/sw/source/uibase/docvw/edtwin.cxx +++ b/sw/source/uibase/docvw/edtwin.cxx @@ -1101,7 +1101,7 @@ void SwEditWin::ChangeFly( sal_uInt8 nDir, bool bWeb ) default: OSL_ENSURE(true, "ChangeFly: Unknown direction." ); } bool bSet = false; - if ((FLY_AS_CHAR == eAnchorId) && ( nDir % 2 )) + if ((RndStdIds::FLY_AS_CHAR == eAnchorId) && ( nDir % 2 )) { long aDiff = aTmp.Top() - aRefPoint.Y(); if( aDiff > 0 ) @@ -1146,7 +1146,7 @@ void SwEditWin::ChangeFly( sal_uInt8 nDir, bool bWeb ) aSet.Put( aVert ); bSet = true; } - if (bWeb && (FLY_AT_PARA == eAnchorId) + if (bWeb && (RndStdIds::FLY_AT_PARA == eAnchorId) && ( nDir==MOVE_LEFT_SMALL || nDir==MOVE_RIGHT_BIG )) { SwFormatHoriOrient aHori( static_cast<const SwFormatHoriOrient&>(aSet.Get(RES_HORI_ORIENT)) ); @@ -1174,10 +1174,10 @@ void SwEditWin::ChangeFly( sal_uInt8 nDir, bool bWeb ) rSh.StartAllAction(); if( bSet ) rSh.SetFlyFrameAttr( aSet ); - bool bSetPos = (FLY_AS_CHAR != eAnchorId); + bool bSetPos = (RndStdIds::FLY_AS_CHAR != eAnchorId); if(bSetPos && bWeb) { - if (FLY_AT_PAGE != eAnchorId) + if (RndStdIds::FLY_AT_PAGE != eAnchorId) { bSetPos = false; } @@ -1278,7 +1278,7 @@ void SwEditWin::ChangeDrawing( sal_uInt8 nDir ) const bool bVertAnchor = rSh.IsFrameVertical( true, bDummy1, bDummy2 ); bool bHoriMove = !bVertAnchor == !( nDir % 2 ); bool bMoveAllowed = - !bHoriMove || (rSh.GetAnchorId() != FLY_AS_CHAR); + !bHoriMove || (rSh.GetAnchorId() != RndStdIds::FLY_AS_CHAR); if ( bMoveAllowed ) { pSdrView->MoveAllMarked(Size(nX, nY)); @@ -6271,7 +6271,7 @@ bool SwEditWin::IsOverHeaderFooterFly( const Point& rDocPos, FrameControlType& r rControl = Footer; } else - bPageAnchored = pFlyFormat->GetAnchor( ).GetAnchorId( ) == FLY_AT_PAGE; + bPageAnchored = pFlyFormat->GetAnchor( ).GetAnchorId( ) == RndStdIds::FLY_AT_PAGE; } } else diff --git a/sw/source/uibase/frmdlg/frmmgr.cxx b/sw/source/uibase/frmdlg/frmmgr.cxx index 0f91925b7e9b..7d32a309cf82 100644 --- a/sw/source/uibase/frmdlg/frmmgr.cxx +++ b/sw/source/uibase/frmdlg/frmmgr.cxx @@ -181,11 +181,11 @@ void SwFlyFrameAttrMgr::InsertFlyFrame(RndStdIds eAnchorType, const Point &rPos, const Size &rSize ) { - OSL_ENSURE( eAnchorType == FLY_AT_PAGE || - eAnchorType == FLY_AT_PARA || - eAnchorType == FLY_AT_CHAR || - eAnchorType == FLY_AT_FLY || - eAnchorType == FLY_AS_CHAR, "invalid frame type" ); + OSL_ENSURE( eAnchorType == RndStdIds::FLY_AT_PAGE || + eAnchorType == RndStdIds::FLY_AT_PARA || + eAnchorType == RndStdIds::FLY_AT_CHAR || + eAnchorType == RndStdIds::FLY_AT_FLY || + eAnchorType == RndStdIds::FLY_AS_CHAR, "invalid frame type" ); SetPos( rPos ); @@ -201,8 +201,8 @@ void SwFlyFrameAttrMgr::SetAnchor( RndStdIds eId ) m_pOwnSh->GetPageNum( nPhyPageNum, nVirtPageNum ); m_aSet.Put( SwFormatAnchor( eId, nPhyPageNum ) ); - if ((FLY_AT_PAGE == eId) || (FLY_AT_PARA == eId) || (FLY_AT_CHAR == eId) - || (FLY_AT_FLY == eId)) + if ((RndStdIds::FLY_AT_PAGE == eId) || (RndStdIds::FLY_AT_PARA == eId) || (RndStdIds::FLY_AT_CHAR == eId) + || (RndStdIds::FLY_AT_FLY == eId)) { SwFormatVertOrient aVertOrient( GetVertOrient() ); SwFormatHoriOrient aHoriOrient( GetHoriOrient() ); @@ -277,7 +277,7 @@ void SwFlyFrameAttrMgr::ValidateMetrics( SvxSwFrameValidation& rVal, rVal.nWidth = rVal.nHeight; rVal.nHeight = nTmp; } - if ((eAnchorType == FLY_AT_PAGE) || (eAnchorType == FLY_AT_FLY)) + if ((eAnchorType == RndStdIds::FLY_AT_PAGE) || (eAnchorType == RndStdIds::FLY_AT_FLY)) { // MinimalPosition rVal.nMinHPos = aBoundRect.Left(); @@ -327,8 +327,8 @@ void SwFlyFrameAttrMgr::ValidateMetrics( SvxSwFrameValidation& rVal, } // OD 12.11.2003 #i22341# - handle to character anchored objects vertical // aligned at character or top of line in a special case - else if ((eAnchorType == FLY_AT_PARA) || - ((eAnchorType == FLY_AT_CHAR) && + else if ((eAnchorType == RndStdIds::FLY_AT_PARA) || + ((eAnchorType == RndStdIds::FLY_AT_CHAR) && !(rVal.nVRelOrient == text::RelOrientation::CHAR) && !(rVal.nVRelOrient == text::RelOrientation::TEXT_LINE) ) ) { @@ -395,7 +395,7 @@ void SwFlyFrameAttrMgr::ValidateMetrics( SvxSwFrameValidation& rVal, // vertical aligned at character or top of line. // Note: (1) positive vertical values are positions above the top of line // (2) negative vertical values are positions below the top of line - else if ( (eAnchorType == FLY_AT_CHAR) && + else if ( (eAnchorType == RndStdIds::FLY_AT_CHAR) && ( rVal.nVRelOrient == text::RelOrientation::CHAR || rVal.nVRelOrient == text::RelOrientation::TEXT_LINE ) ) { @@ -442,7 +442,7 @@ void SwFlyFrameAttrMgr::ValidateMetrics( SvxSwFrameValidation& rVal, rVal.nMaxHeight = aBoundRect.Height(); } } - else if ( eAnchorType == FLY_AS_CHAR ) + else if ( eAnchorType == RndStdIds::FLY_AS_CHAR ) { rVal.nMinHPos = 0; rVal.nMaxHPos = 0; diff --git a/sw/source/uibase/ribbar/conrect.cxx b/sw/source/uibase/ribbar/conrect.cxx index 744267924c22..5a8823501cf9 100644 --- a/sw/source/uibase/ribbar/conrect.cxx +++ b/sw/source/uibase/ribbar/conrect.cxx @@ -89,7 +89,7 @@ bool ConstRectangle::MouseButtonUp(const MouseEvent& rMEvt) case OBJ_TEXT: if( bMarquee ) { - m_pSh->ChgAnchor(FLY_AS_CHAR); + m_pSh->ChgAnchor(RndStdIds::FLY_AS_CHAR); if( pObj ) { diff --git a/sw/source/uibase/ribbar/drawbase.cxx b/sw/source/uibase/ribbar/drawbase.cxx index 0d34b801f3aa..2fcdd4f0b9ff 100644 --- a/sw/source/uibase/ribbar/drawbase.cxx +++ b/sw/source/uibase/ribbar/drawbase.cxx @@ -277,7 +277,7 @@ bool SwDrawBase::MouseButtonUp(const MouseEvent& rMEvt) { SfxRequest aReq(m_pSh->GetView().GetViewFrame(),FN_INSERT_FRAME); aReq.AppendItem(SfxUInt16Item( FN_INSERT_FRAME, - static_cast<sal_uInt16>(FLY_AT_PARA) )); + static_cast<sal_uInt16>(RndStdIds::FLY_AT_PARA) )); aReq.AppendItem(SfxPointItem( FN_PARAM_1, m_pSh->GetAnchorObjDiff())); aReq.AppendItem(SvxSizeItem( FN_PARAM_2, m_pSh->GetObjSize())); aReq.Done(); diff --git a/sw/source/uibase/shells/basesh.cxx b/sw/source/uibase/shells/basesh.cxx index fc752de614ed..e55cf191e7fd 100644 --- a/sw/source/uibase/shells/basesh.cxx +++ b/sw/source/uibase/shells/basesh.cxx @@ -1052,14 +1052,14 @@ void SwBaseShell::Execute(SfxRequest &rReq) case FN_TOOL_ANCHOR_FRAME: { RndStdIds eSet = nSlot == FN_TOOL_ANCHOR_PAGE - ? FLY_AT_PAGE + ? RndStdIds::FLY_AT_PAGE : nSlot == FN_TOOL_ANCHOR_PARAGRAPH - ? FLY_AT_PARA + ? RndStdIds::FLY_AT_PARA : nSlot == FN_TOOL_ANCHOR_FRAME - ? FLY_AT_FLY + ? RndStdIds::FLY_AT_FLY : nSlot == FN_TOOL_ANCHOR_CHAR - ? FLY_AS_CHAR - : FLY_AT_CHAR; + ? RndStdIds::FLY_AS_CHAR + : RndStdIds::FLY_AT_CHAR; rSh.StartUndo(); if (rSh.IsObjSelected()) rSh.ChgAnchor(eSet); @@ -1073,7 +1073,7 @@ void SwBaseShell::Execute(SfxRequest &rReq) // pre-conditions are met then align the formula to the baseline of the text const uno::Reference < embed::XEmbeddedObject > xObj( rSh.GetOleRef() ); const bool bDoMathBaselineAlignment = xObj.is() && SotExchange::IsMath( xObj->getClassID() ) - && FLY_AS_CHAR == eSet && rSh.GetDoc()->getIDocumentSettingAccess().get( DocumentSettingId::MATH_BASELINE_ALIGNMENT ); + && RndStdIds::FLY_AS_CHAR == eSet && rSh.GetDoc()->getIDocumentSettingAccess().get( DocumentSettingId::MATH_BASELINE_ALIGNMENT ); if (bDoMathBaselineAlignment) rSh.AlignFormulaToBaseline( xObj ); @@ -1092,8 +1092,8 @@ void SwBaseShell::Execute(SfxRequest &rReq) switch( eSet ) { - case FLY_AT_FLY: - case FLY_AT_PAGE: + case RndStdIds::FLY_AT_FLY: + case RndStdIds::FLY_AT_PAGE: //Wrap through, left or from left, top, from top if(eSurround != css::text::WrapTextMode_THROUGHT) aSet.Put(SwFormatSurround(css::text::WrapTextMode_THROUGHT)); @@ -1105,7 +1105,7 @@ void SwBaseShell::Execute(SfxRequest &rReq) aSet.Put(SwFormatHoriOrient(0, text::HoriOrientation::LEFT)); break; - case FLY_AT_PARA: + case RndStdIds::FLY_AT_PARA: // left, from left, right, top, no wrap, wrap left and right if (eSurround != css::text::WrapTextMode_LEFT && eSurround != css::text::WrapTextMode_RIGHT) aSet.Put(SwFormatSurround(css::text::WrapTextMode_LEFT)); @@ -1117,7 +1117,7 @@ void SwBaseShell::Execute(SfxRequest &rReq) aSet.Put(SwFormatHoriOrient(0, text::HoriOrientation::LEFT)); break; - case FLY_AT_CHAR: + case RndStdIds::FLY_AT_CHAR: // left, from left, right, top, wrap through if(eSurround != css::text::WrapTextMode_THROUGHT) aSet.Put(SwFormatSurround(css::text::WrapTextMode_THROUGHT)); @@ -1625,15 +1625,15 @@ void SwBaseShell::GetState( SfxItemSet &rSet ) RndStdIds eSet = static_cast<const SwFormatAnchor&>(aSet.Get(RES_ANCHOR)).GetAnchorId(); const bool bSet = ((nWhich == FN_TOOL_ANCHOR_PAGE) && - (eSet == FLY_AT_PAGE)) + (eSet == RndStdIds::FLY_AT_PAGE)) || ((nWhich == FN_TOOL_ANCHOR_PARAGRAPH) && - (eSet == FLY_AT_PARA)) + (eSet == RndStdIds::FLY_AT_PARA)) || ((nWhich == FN_TOOL_ANCHOR_FRAME) && - (eSet == FLY_AT_FLY)) + (eSet == RndStdIds::FLY_AT_FLY)) || ((nWhich == FN_TOOL_ANCHOR_AT_CHAR) && - (eSet == FLY_AT_CHAR)) + (eSet == RndStdIds::FLY_AT_CHAR)) || ((nWhich == FN_TOOL_ANCHOR_CHAR) && - (eSet == FLY_AS_CHAR)); + (eSet == RndStdIds::FLY_AS_CHAR)); if(nWhich != FN_TOOL_ANCHOR) { if( nWhich == FN_TOOL_ANCHOR_FRAME && !rSh.IsFlyInFly() ) @@ -1647,19 +1647,19 @@ void SwBaseShell::GetState( SfxItemSet &rSet ) switch (eSet) { - case FLY_AT_PAGE: + case RndStdIds::FLY_AT_PAGE: nSlotId = FN_TOOL_ANCHOR_PAGE; break; - case FLY_AT_PARA: + case RndStdIds::FLY_AT_PARA: nSlotId = FN_TOOL_ANCHOR_PARAGRAPH; break; - case FLY_AS_CHAR: + case RndStdIds::FLY_AS_CHAR: nSlotId = FN_TOOL_ANCHOR_CHAR; break; - case FLY_AT_CHAR: + case RndStdIds::FLY_AT_CHAR: nSlotId = FN_TOOL_ANCHOR_AT_CHAR; break; - case FLY_AT_FLY: + case RndStdIds::FLY_AT_FLY: nSlotId = FN_TOOL_ANCHOR_FRAME; break; default: @@ -1688,7 +1688,7 @@ void SwBaseShell::GetState( SfxItemSet &rSet ) if( !bParentCntProt && (bObj || rSh.IsFrameSelected())) { SfxItemSet aSet(GetPool(), RES_OPAQUE, RES_ANCHOR); - int nAnchorType; + RndStdIds nAnchorType; if(bObj) { rSh.GetObjAttr(aSet); @@ -1707,7 +1707,7 @@ void SwBaseShell::GetState( SfxItemSet &rSet ) bool bSet = false; bool bDisable = - (nAnchorType == - 1) || (nAnchorType == FLY_AS_CHAR); + (nAnchorType == RndStdIds::UNKNOWN) || (nAnchorType == RndStdIds::FLY_AS_CHAR); const bool bHtmlMode = 0 != ::GetHtmlMode(GetView().GetDocShell()); @@ -1715,9 +1715,9 @@ void SwBaseShell::GetState( SfxItemSet &rSet ) { case FN_FRAME_NOWRAP: bDisable |= - ( (nAnchorType != FLY_AT_PARA) - && (nAnchorType != FLY_AT_CHAR) - && (nAnchorType != FLY_AT_PAGE)); + ( (nAnchorType != RndStdIds::FLY_AT_PARA) + && (nAnchorType != RndStdIds::FLY_AT_CHAR) + && (nAnchorType != RndStdIds::FLY_AT_PAGE)); bSet = nSurround == css::text::WrapTextMode_NONE; break; case FN_FRAME_WRAP: @@ -1730,9 +1730,9 @@ void SwBaseShell::GetState( SfxItemSet &rSet ) break; case FN_FRAME_WRAPTHRU: bDisable |= (bHtmlMode || - ( (nAnchorType != FLY_AT_PARA) - && (nAnchorType != FLY_AT_CHAR) - && (nAnchorType != FLY_AT_PAGE))); + ( (nAnchorType != RndStdIds::FLY_AT_PARA) + && (nAnchorType != RndStdIds::FLY_AT_CHAR) + && (nAnchorType != RndStdIds::FLY_AT_PAGE))); if(bObj) bSet = nSurround == css::text::WrapTextMode_THROUGHT && rSh.GetLayerId(); else @@ -1771,7 +1771,7 @@ void SwBaseShell::GetState( SfxItemSet &rSet ) break; case FN_WRAP_ANCHOR_ONLY: bDisable |= (bHtmlMode || - (nAnchorType != FLY_AT_PARA)); + (nAnchorType != RndStdIds::FLY_AT_PARA)); bSet = rWrap.IsAnchorOnly(); break; case FN_FRAME_WRAP_LEFT: diff --git a/sw/source/uibase/shells/drwbassh.cxx b/sw/source/uibase/shells/drwbassh.cxx index 65c12cec1242..ac8bd590d96e 100644 --- a/sw/source/uibase/shells/drwbassh.cxx +++ b/sw/source/uibase/shells/drwbassh.cxx @@ -186,7 +186,7 @@ void SwDrawBaseShell::Execute(SfxRequest &rReq) bool bCaption = false; // Allowed anchorages: - short nAnchor = pSh->GetAnchorId(); + RndStdIds nAnchor = pSh->GetAnchorId(); SvxAnchorIds nAllowedAnchors = SvxAnchorIds::Paragraph | SvxAnchorIds::Character | SvxAnchorIds::Page; sal_uInt16 nHtmlMode = ::GetHtmlMode(pSh->GetView().GetDocShell()); @@ -224,7 +224,7 @@ void SwDrawBaseShell::Execute(SfxRequest &rReq) if (bCaption) pSdrView->GetAttributes( aSet ); - aSet.Put(SfxInt16Item(SID_ATTR_TRANSFORM_ANCHOR, nAnchor)); + aSet.Put(SfxInt16Item(SID_ATTR_TRANSFORM_ANCHOR, (sal_Int16)nAnchor)); bool bRTL; bool bVertL2R; aSet.Put(SfxBoolItem(SID_ATTR_TRANSFORM_IN_VERTICAL_TEXT, pSh->IsFrameVertical(true, bRTL, bVertL2R))); @@ -277,7 +277,7 @@ void SwDrawBaseShell::Execute(SfxRequest &rReq) SID_ATTR_TRANSFORM_ANCHOR, false, &pAnchorItem)) { if(!bSingleSelection) - pSh->ChgAnchor(static_cast<const SfxInt16Item*>(pAnchorItem) + pSh->ChgAnchor((RndStdIds)static_cast<const SfxInt16Item*>(pAnchorItem) ->GetValue(), false, bPosCorr ); else { @@ -433,8 +433,8 @@ void SwDrawBaseShell::Execute(SfxRequest &rReq) const SdrMarkList& rMarkList = pSdrView->GetMarkedObjectList(); if( rMarkList.GetMarkCount() == 1 && bAlignPossible ) { // Do not align objects to each other - sal_uInt16 nAnchor = pSh->GetAnchorId(); - if (nAnchor == FLY_AS_CHAR) + RndStdIds nAnchor = pSh->GetAnchorId(); + if (nAnchor == RndStdIds::FLY_AS_CHAR) { sal_Int16 nVertOrient = -1; @@ -464,7 +464,7 @@ void SwDrawBaseShell::Execute(SfxRequest &rReq) } break; } - if (nAnchor == FLY_AT_PARA) + if (nAnchor == RndStdIds::FLY_AT_PARA) break; // Do not align frames of an anchored paragraph } @@ -797,7 +797,7 @@ IMPL_LINK(SwDrawBaseShell, ValidatePosition, SvxSwFrameValidation&, rValidation, rValidation.nWidth = rValidation.nHeight; rValidation.nHeight = nTmp; } - if ((eAnchorType == FLY_AT_PAGE) || (eAnchorType == FLY_AT_FLY)) + if ((eAnchorType == RndStdIds::FLY_AT_PAGE) || (eAnchorType == RndStdIds::FLY_AT_FLY)) { // MinimalPosition rValidation.nMinHPos = aBoundRect.Left(); @@ -845,7 +845,7 @@ IMPL_LINK(SwDrawBaseShell, ValidatePosition, SvxSwFrameValidation&, rValidation, rValidation.nMaxVPos = aBoundRect.Bottom() - rValidation.nHeight; rValidation.nMaxWidth = aBoundRect.Right() - nH; } - else if ((eAnchorType == FLY_AT_PARA) || (eAnchorType == FLY_AT_CHAR)) + else if ((eAnchorType == RndStdIds::FLY_AT_PARA) || (eAnchorType == RndStdIds::FLY_AT_CHAR)) { if (rValidation.nHPos + rValidation.nWidth > aBoundRect.Right()) { @@ -906,7 +906,7 @@ IMPL_LINK(SwDrawBaseShell, ValidatePosition, SvxSwFrameValidation&, rValidation, rValidation.nMaxHeight = rValidation.nMaxVPos + rValidation.nHeight - nV; rValidation.nMaxWidth = rValidation.nMaxHPos + rValidation.nWidth - nH; } - else if (eAnchorType == FLY_AS_CHAR) + else if (eAnchorType == RndStdIds::FLY_AS_CHAR) { rValidation.nMinHPos = 0; rValidation.nMaxHPos = 0; diff --git a/sw/source/uibase/shells/frmsh.cxx b/sw/source/uibase/shells/frmsh.cxx index 42107d5cba12..9909af838364 100644 --- a/sw/source/uibase/shells/frmsh.cxx +++ b/sw/source/uibase/shells/frmsh.cxx @@ -792,7 +792,7 @@ void SwFrameShell::GetState(SfxItemSet& rSet) if (nWhich != FN_FRAME_ALIGN_VERT_TOP && nWhich != SID_OBJECT_ALIGN_UP ) { - if (aMgr.GetAnchor() == FLY_AT_FLY) + if (aMgr.GetAnchor() == RndStdIds::FLY_AT_FLY) { const SwFrameFormat* pFormat = rSh.IsFlyInFly(); if (pFormat) diff --git a/sw/source/uibase/shells/textidx.cxx b/sw/source/uibase/shells/textidx.cxx index 5d8c2880ddca..259b381e7e14 100644 --- a/sw/source/uibase/shells/textidx.cxx +++ b/sw/source/uibase/shells/textidx.cxx @@ -115,7 +115,7 @@ void SwTextShell::ExecIdx(SfxRequest &rReq) 0 ); SwWrtShell& rSh = GetShell(); SwRect aRect; - rSh.CalcBoundRect(aRect, FLY_AS_CHAR); + rSh.CalcBoundRect(aRect, RndStdIds::FLY_AS_CHAR); long nWidth = aRect.Width(); aSet.Put(SwFormatFrameSize(ATT_VAR_SIZE, nWidth)); diff --git a/sw/source/uibase/shells/textsh.cxx b/sw/source/uibase/shells/textsh.cxx index ef28dbd4871c..6670aeeb6ded 100644 --- a/sw/source/uibase/shells/textsh.cxx +++ b/sw/source/uibase/shells/textsh.cxx @@ -412,7 +412,7 @@ void SwTextShell::ExecInsert(SfxRequest &rReq) aCol.Init( nCols, aCol.GetGutterWidth(), aCol.GetWishWidth() ); aMgr.SetCol( aCol ); } - aMgr.InsertFlyFrame(FLY_AT_PARA, aStartPos, aSize); + aMgr.InsertFlyFrame(RndStdIds::FLY_AT_PARA, aStartPos, aSize); GetShell().EndAllAction(); GetShell().UnlockPaint(); } @@ -442,7 +442,7 @@ void SwTextShell::ExecInsert(SfxRequest &rReq) Size aSize(aMgr.GetSize()); aSize.Width() = GetShell().GetAnyCurRect(CurRectType::PagePrt).Width(); Point aPos = aMgr.GetPos(); - RndStdIds eAnchor = FLY_AT_PARA; + RndStdIds eAnchor = RndStdIds::FLY_AT_PARA; if(pArgs->GetItemState(nSlot, false, &pItem) == SfxItemState::SET) eAnchor = (RndStdIds)static_cast<const SfxUInt16Item *>(pItem)->GetValue(); if(pArgs->GetItemState(FN_PARAM_1, false, &pItem) == SfxItemState::SET) diff --git a/sw/source/uibase/uiview/viewtab.cxx b/sw/source/uibase/uiview/viewtab.cxx index 98bf19dcfca2..c2727e428106 100644 --- a/sw/source/uibase/uiview/viewtab.cxx +++ b/sw/source/uibase/uiview/viewtab.cxx @@ -306,7 +306,7 @@ void SwView::ExecTabWin( SfxRequest& rReq ) if(aSize.GetWidthPercent()) { SwRect aRect; - rSh.CalcBoundRect(aRect, FLY_AS_CHAR); + rSh.CalcBoundRect(aRect, RndStdIds::FLY_AS_CHAR); long nPrtWidth = aRect.Width(); aSize.SetWidthPercent(sal_uInt8((nPageWidth - aLongLR.GetLeft() - aLongLR.GetRight()) * 100 /nPrtWidth)); } @@ -455,7 +455,7 @@ void SwView::ExecTabWin( SfxRequest& rReq ) if(aSize.GetHeightPercent()) { SwRect aRect; - rSh.CalcBoundRect(aRect, FLY_AS_CHAR); + rSh.CalcBoundRect(aRect, RndStdIds::FLY_AS_CHAR); long nPrtHeight = aRect.Height(); aSize.SetHeightPercent(sal_uInt8(nHeight * 100 /nPrtHeight)); } diff --git a/sw/source/uibase/utlui/attrdesc.cxx b/sw/source/uibase/utlui/attrdesc.cxx index d4267a45fd4d..271f442eaf65 100644 --- a/sw/source/uibase/utlui/attrdesc.cxx +++ b/sw/source/uibase/utlui/attrdesc.cxx @@ -441,13 +441,13 @@ bool SwFormatAnchor::GetPresentation sal_uInt16 nId = 0; switch ( GetAnchorId() ) { - case FLY_AT_PARA: + case RndStdIds::FLY_AT_PARA: nId = STR_FLY_AT_PARA; break; - case FLY_AS_CHAR: + case RndStdIds::FLY_AS_CHAR: nId = STR_FLY_AS_CHAR; break; - case FLY_AT_PAGE: + case RndStdIds::FLY_AT_PAGE: nId = STR_FLY_AT_PAGE; break; default:;//prevent warning |