diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-12-10 10:46:19 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-12-11 06:57:12 +0100 |
commit | 412ca1ff72d2031d327df658a94e63bdcb8583b0 (patch) | |
tree | 7f6b173d04d94967d6ac114c216a72e0e44a4940 /sw/source/core | |
parent | d5d8fa63282a433da9c49d811f04390b8d6ab9cc (diff) |
convert SwFrameSize to scoped enum
Change-Id: I7e1e641ff180035c7dcefdcfdd185eadbae32142
Reviewed-on: https://gerrit.libreoffice.org/84850
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw/source/core')
26 files changed, 91 insertions, 91 deletions
diff --git a/sw/source/core/doc/DocumentStylePoolManager.cxx b/sw/source/core/doc/DocumentStylePoolManager.cxx index 767af3a22010..d3b0761128dd 100644 --- a/sw/source/core/doc/DocumentStylePoolManager.cxx +++ b/sw/source/core/doc/DocumentStylePoolManager.cxx @@ -1627,7 +1627,7 @@ SwFormat* DocumentStylePoolManager::GetFormatFromPool( sal_uInt16 nId ) aSet.Put( SwFormatVertOrient( 0, text::VertOrientation::TOP, text::RelOrientation::FRAME )); aSet.Put( SwFormatSurround( css::text::WrapTextMode_PARALLEL )); // Set the default width to 3.5 cm, use the minimum value for the height - aSet.Put( SwFormatFrameSize( ATT_MIN_SIZE, + aSet.Put( SwFormatFrameSize( SwFrameSize::Minimum, GetMetricVal( CM_1 ) * 3 + GetMetricVal( CM_05 ), MM50 )); } @@ -1774,7 +1774,7 @@ SwPageDesc* DocumentStylePoolManager::GetPageDescFromPool( sal_uInt16 nId, bool { Size aPSize( SvxPaperInfo::GetPaperSize( PAPER_ENV_C65 ) ); LandscapeSwap( aPSize ); - aSet.Put( SwFormatFrameSize( ATT_FIX_SIZE, aPSize.Width(), aPSize.Height() )); + aSet.Put( SwFormatFrameSize( SwFrameSize::Fixed, aPSize.Width(), aPSize.Height() )); aLR.SetLeft( 0 ); aLR.SetRight( 0 ); aUL.SetUpper( 0 ); aUL.SetLower( 0 ); aSet.Put( aLR ); diff --git a/sw/source/core/doc/docdesc.cxx b/sw/source/core/doc/docdesc.cxx index d1cc84f8d8e3..eccbe3cc1b3a 100644 --- a/sw/source/core/doc/docdesc.cxx +++ b/sw/source/core/doc/docdesc.cxx @@ -73,7 +73,7 @@ static void lcl_DefaultPageFormat( sal_uInt16 nPoolFormatId, // The default page size is obtained from the application //locale - SwFormatFrameSize aFrameSize( ATT_FIX_SIZE ); + SwFormatFrameSize aFrameSize( SwFrameSize::Fixed ); const Size aPhysSize = SvxPaperInfo::GetDefaultPaperSize(); aFrameSize.SetSize( aPhysSize ); diff --git a/sw/source/core/doc/docfly.cxx b/sw/source/core/doc/docfly.cxx index 4451115905a8..0735144328d0 100644 --- a/sw/source/core/doc/docfly.cxx +++ b/sw/source/core/doc/docfly.cxx @@ -1094,12 +1094,12 @@ SwChainRet SwDoc::Chain( SwFrameFormat &rSource, const SwFrameFormat &rDest ) aSet.Put( aChain ); SwFormatFrameSize aSize( rSource.GetFrameSize() ); - if ( aSize.GetHeightSizeType() != ATT_FIX_SIZE ) + if ( aSize.GetHeightSizeType() != SwFrameSize::Fixed ) { SwFlyFrame *pFly = SwIterator<SwFlyFrame,SwFormat>( rSource ).First(); if ( pFly ) aSize.SetHeight( pFly->getFrameArea().Height() ); - aSize.SetHeightSizeType( ATT_FIX_SIZE ); + aSize.SetHeightSizeType( SwFrameSize::Fixed ); aSet.Put( aSize ); } SetAttr( aSet, rSource ); diff --git a/sw/source/core/doc/doclay.cxx b/sw/source/core/doc/doclay.cxx index de177655f7dd..1b0ac762b6a2 100644 --- a/sw/source/core/doc/doclay.cxx +++ b/sw/source/core/doc/doclay.cxx @@ -247,7 +247,7 @@ SwFlyFrameFormat* SwDoc::MakeFlySection_( const SwPosition& rAnchPos, if( SfxItemState::SET != pFormat->GetAttrSet().GetItemState( RES_FRM_SIZE )) { - SwFormatFrameSize aFormatSize( ATT_VAR_SIZE, 0, DEF_FLY_WIDTH ); + SwFormatFrameSize aFormatSize( SwFrameSize::Variable, 0, DEF_FLY_WIDTH ); const SwNoTextNode* pNoTextNode = rNode.GetNoTextNode(); if( pNoTextNode ) { @@ -259,7 +259,7 @@ SwFlyFrameFormat* SwDoc::MakeFlySection_( const SwPosition& rAnchPos, if( aSize.Height() ) { aFormatSize.SetHeight( aSize.Height() ); - aFormatSize.SetHeightSizeType( ATT_FIX_SIZE ); + aFormatSize.SetHeightSizeType( SwFrameSize::Fixed ); } } pFormat->SetFormatAttr( aFormatSize ); @@ -768,7 +768,7 @@ lcl_InsertLabel(SwDoc & rDoc, SwTextFormatColls *const pTextFormatCollTable, // The new one should be changeable in its height. std::unique_ptr<SwFormatFrameSize> aFrameSize(static_cast<SwFormatFrameSize*>(pOldFormat->GetFrameSize().Clone())); - aFrameSize->SetHeightSizeType( ATT_MIN_SIZE ); + aFrameSize->SetHeightSizeType( SwFrameSize::Minimum ); pNewSet->Put( std::move(aFrameSize) ); SwStartNode* pSttNd = rDoc.GetNodes().MakeTextSection( @@ -1076,7 +1076,7 @@ lcl_InsertDrawLabel( SwDoc & rDoc, SwTextFormatColls *const pTextFormatCollTable // The new one should be variable in its height! Size aSz( rSdrObj.GetCurrentBoundRect().GetSize() ); - SwFormatFrameSize aFrameSize( ATT_MIN_SIZE, aSz.Width(), aSz.Height() ); + SwFormatFrameSize aFrameSize( SwFrameSize::Minimum, aSz.Width(), aSz.Height() ); pNewSet->Put( aFrameSize ); // Apply the margin to the new Frame. diff --git a/sw/source/core/doc/docnew.cxx b/sw/source/core/doc/docnew.cxx index 73a39fd9f1f9..db14a1d2b681 100644 --- a/sw/source/core/doc/docnew.cxx +++ b/sw/source/core/doc/docnew.cxx @@ -296,7 +296,7 @@ SwDoc::SwDoc() getIDocumentStylePoolAccess().GetPageDescFromPool( RES_POOLPAGE_STANDARD ); // Set to "Empty Page" - mpEmptyPageFormat->SetFormatAttr( SwFormatFrameSize( ATT_FIX_SIZE ) ); + mpEmptyPageFormat->SetFormatAttr( SwFormatFrameSize( SwFrameSize::Fixed ) ); // Set BodyFormat for columns mpColumnContFormat->SetFormatAttr( SwFormatFillOrder( ATT_LEFT_TO_RIGHT ) ); diff --git a/sw/source/core/doc/htmltbl.cxx b/sw/source/core/doc/htmltbl.cxx index 8e6f8ac1d446..9b5defa3b695 100644 --- a/sw/source/core/doc/htmltbl.cxx +++ b/sw/source/core/doc/htmltbl.cxx @@ -289,7 +289,7 @@ void SwHTMLTableLayout::SetBoxWidth( SwTableBox *pBox, sal_uInt16 nCol, nFrameWidth += GetColumn( nCol++ )->GetRelColWidth(); // and reset - pFrameFormat->SetFormatAttr( SwFormatFrameSize( ATT_VAR_SIZE, nFrameWidth, 0 )); + pFrameFormat->SetFormatAttr( SwFormatFrameSize( SwFrameSize::Variable, nFrameWidth, 0 )); } void SwHTMLTableLayout::GetAvail( sal_uInt16 nCol, sal_uInt16 nColSpan, @@ -1527,7 +1527,7 @@ static void lcl_ResizeBox( const SwTableBox* pBox, SwTwips* pWidth ) SwTwips nWidth = 0; for( const SwTableLine *pLine : pBox->GetTabLines() ) lcl_ResizeLine( pLine, &nWidth ); - pBox->GetFrameFormat()->SetFormatAttr( SwFormatFrameSize( ATT_VAR_SIZE, nWidth, 0 )); + pBox->GetFrameFormat()->SetFormatAttr( SwFormatFrameSize( SwFrameSize::Variable, nWidth, 0 )); *pWidth = *pWidth + nWidth; } else @@ -1636,7 +1636,7 @@ void SwHTMLTableLayout::SetWidths( bool bCallPass2, sal_uInt16 nAbsAvail, SwFrameFormat *pFlyFrameFormat = FindFlyFrameFormat(); if( pFlyFrameFormat ) { - SwFormatFrameSize aFlyFrameSize( ATT_VAR_SIZE, m_nRelTabWidth, MINLAY ); + SwFormatFrameSize aFlyFrameSize( SwFrameSize::Variable, m_nRelTabWidth, MINLAY ); if( m_bUseRelWidth ) { diff --git a/sw/source/core/doc/tblrwcl.cxx b/sw/source/core/doc/tblrwcl.cxx index dd150db18b2a..3c701ffc52cb 100644 --- a/sw/source/core/doc/tblrwcl.cxx +++ b/sw/source/core/doc/tblrwcl.cxx @@ -1053,8 +1053,8 @@ bool SwTable::OldSplitRow( SwDoc* pDoc, const SwSelBoxes& rBoxes, sal_uInt16 nCn // Respect the Line's height, reset if needed SwFormatFrameSize aFSz( pInsLine->GetFrameFormat()->GetFrameSize() ); - if ( bSameHeight && ATT_VAR_SIZE == aFSz.GetHeightSizeType() ) - aFSz.SetHeightSizeType( ATT_MIN_SIZE ); + if ( bSameHeight && SwFrameSize::Variable == aFSz.GetHeightSizeType() ) + aFSz.SetHeightSizeType( SwFrameSize::Minimum ); bool bChgLineSz = 0 != aFSz.GetHeight() || bSameHeight; if ( bChgLineSz ) @@ -1196,7 +1196,7 @@ bool SwTable::SplitCol( SwDoc* pDoc, const SwSelBoxes& rBoxes, sal_uInt16 nCnt ) aFindFrame.pNewFrameFormat = static_cast<SwTableBoxFormat*>(pSelBox->ClaimFrameFormat()); SwTwips nBoxSz = aFindFrame.pNewFrameFormat->GetFrameSize().GetWidth(); SwTwips nNewBoxSz = nBoxSz / ( nCnt + 1 ); - aFindFrame.pNewFrameFormat->SetFormatAttr( SwFormatFrameSize( ATT_VAR_SIZE, + aFindFrame.pNewFrameFormat->SetFormatAttr( SwFormatFrameSize( SwFrameSize::Variable, nNewBoxSz, 0 ) ); aFrameArr.insert( aFindFrame ); @@ -1206,7 +1206,7 @@ bool SwTable::SplitCol( SwDoc* pDoc, const SwSelBoxes& rBoxes, sal_uInt16 nCnt ) // We have a remainder, so we need to define an own Format // for the last Box. pLastBoxFormat = new SwTableBoxFormat( *aFindFrame.pNewFrameFormat ); - pLastBoxFormat->SetFormatAttr( SwFormatFrameSize( ATT_VAR_SIZE, + pLastBoxFormat->SetFormatAttr( SwFormatFrameSize( SwFrameSize::Variable, nBoxSz - ( nNewBoxSz * nCnt ), 0 ) ); } aLastBoxArr.insert( aLastBoxArr.begin() + nFndPos, pLastBoxFormat ); @@ -1311,7 +1311,7 @@ static void lcl_CalcWidth( SwTableBox* pBox ) for( auto pTabBox : pLine->GetTabBoxes() ) nWidth += pTabBox->GetFrameFormat()->GetFrameSize().GetWidth(); - pFormat->SetFormatAttr( SwFormatFrameSize( ATT_VAR_SIZE, nWidth, 0 )); + pFormat->SetFormatAttr( SwFormatFrameSize( SwFrameSize::Variable, nWidth, 0 )); // Boxes with Lines can only have Size/Fillorder pFormat->ResetFormatAttr( RES_LR_SPACE, RES_FRMATR_END - 1 ); @@ -2931,10 +2931,10 @@ static void SetLineHeight( SwTableLine& rLine, SwTwips nOldHeight, SwTwips nNewH nMyNewH = long(aTmp); } - SwFrameSize eSize = ATT_MIN_SIZE; + SwFrameSize eSize = SwFrameSize::Minimum; if( !bMinSize && ( nMyOldH - nMyNewH ) > ( CalcRowRstHeight( pLineFrame ) + ROWFUZZY )) - eSize = ATT_FIX_SIZE; + eSize = SwFrameSize::Fixed; pFormat->SetFormatAttr( SwFormatFrameSize( eSize, 0, nMyNewH ) ); diff --git a/sw/source/core/docnode/ndtbl.cxx b/sw/source/core/docnode/ndtbl.cxx index c35ca9731936..43528cb67bcc 100644 --- a/sw/source/core/docnode/ndtbl.cxx +++ b/sw/source/core/docnode/ndtbl.cxx @@ -181,7 +181,7 @@ static SwTableBoxFormat *lcl_CreateDfltBoxFormat( SwDoc &rDoc, std::vector<SwTab { SwTableBoxFormat* pBoxFormat = rDoc.MakeTableBoxFormat(); if( USHRT_MAX != nCols ) - pBoxFormat->SetFormatAttr( SwFormatFrameSize( ATT_VAR_SIZE, + pBoxFormat->SetFormatAttr( SwFormatFrameSize( SwFrameSize::Variable, USHRT_MAX / nCols, 0 )); ::lcl_SetDfltBoxAttr( *pBoxFormat, nId ); rBoxFormatArr[ nId ] = pBoxFormat; @@ -201,7 +201,7 @@ static SwTableBoxFormat *lcl_CreateAFormatBoxFormat( SwDoc &rDoc, std::vector<Sw SwTableAutoFormatUpdateFlags::Box, rDoc.GetNumberFormatter( ) ); if( USHRT_MAX != nCols ) - pBoxFormat->SetFormatAttr( SwFormatFrameSize( ATT_VAR_SIZE, + pBoxFormat->SetFormatAttr( SwFormatFrameSize( SwFrameSize::Variable, USHRT_MAX / nCols, 0 )); rBoxFormatArr[ nId ] = pBoxFormat; } @@ -430,7 +430,7 @@ const SwTable* SwDoc::InsertTable( const SwInsertTableOptions& rInsTableOpts, nWidth /= nCols; nWidth *= nCols; // to avoid rounding problems } - pTableFormat->SetFormatAttr( SwFormatFrameSize( ATT_VAR_SIZE, nWidth )); + pTableFormat->SetFormatAttr( SwFormatFrameSize( SwFrameSize::Variable, nWidth )); if( !(rInsTableOpts.mnInsMode & SwInsertTableFlags::SplitLayout) ) pTableFormat->SetFormatAttr( SwFormatLayoutSplit( false )); @@ -467,7 +467,7 @@ const SwTable* SwDoc::InsertTable( const SwInsertTableOptions& rInsTableOpts, if( !bDfltBorders && !pTAFormat ) { pBoxFormat = MakeTableBoxFormat(); - pBoxFormat->SetFormatAttr( SwFormatFrameSize( ATT_VAR_SIZE, USHRT_MAX / nCols, 0 )); + pBoxFormat->SetFormatAttr( SwFormatFrameSize( SwFrameSize::Variable, USHRT_MAX / nCols, 0 )); } else { @@ -524,7 +524,7 @@ const SwTable* SwDoc::InsertTable( const SwInsertTableOptions& rInsTableOpts, *pNewFormat = *pBoxF; pBoxF = pNewFormat; } - pBoxF->SetFormatAttr( SwFormatFrameSize( ATT_VAR_SIZE, nWidth )); + pBoxF->SetFormatAttr( SwFormatFrameSize( SwFrameSize::Variable, nWidth )); } } @@ -695,7 +695,7 @@ const SwTable* SwDoc::TextToTable( const SwInsertTableOptions& rInsTableOpts, // All Lines have a left-to-right Fill Order pLineFormat->SetFormatAttr( SwFormatFillOrder( ATT_LEFT_TO_RIGHT )); // The Table's SSize is USHRT_MAX - pTableFormat->SetFormatAttr( SwFormatFrameSize( ATT_VAR_SIZE, USHRT_MAX )); + pTableFormat->SetFormatAttr( SwFormatFrameSize( SwFrameSize::Variable, USHRT_MAX )); if( !(rInsTableOpts.mnInsMode & SwInsertTableFlags::SplitLayout) ) pTableFormat->SetFormatAttr( SwFormatLayoutSplit( false )); @@ -966,7 +966,7 @@ lcl_SetTableBoxWidths(SwTable & rTable, size_t const nMaxBoxes, { SwTableBoxFormat *pNewFormat = rDoc.MakeTableBoxFormat(); pNewFormat->SetFormatAttr( - SwFormatFrameSize(ATT_VAR_SIZE, (*pPositions)[n] - nLastPos)); + SwFormatFrameSize(SwFrameSize::Variable, (*pPositions)[n] - nLastPos)); for (size_t nTmpLine = 0; nTmpLine < rLns.size(); ++nTmpLine) { // Have to do an Add here, because the BoxFormat @@ -980,12 +980,12 @@ lcl_SetTableBoxWidths(SwTable & rTable, size_t const nMaxBoxes, // propagate size upwards from format, so the table gets the right size SAL_WARN_IF(rBoxFormat.HasWriterListeners(), "sw.core", "who is still registered in the format?"); - rBoxFormat.SetFormatAttr( SwFormatFrameSize( ATT_VAR_SIZE, nLastPos )); + rBoxFormat.SetFormatAttr( SwFormatFrameSize( SwFrameSize::Variable, nLastPos )); } else { size_t nWidth = nMaxBoxes ? USHRT_MAX / nMaxBoxes : USHRT_MAX; - rBoxFormat.SetFormatAttr(SwFormatFrameSize(ATT_VAR_SIZE, nWidth)); + rBoxFormat.SetFormatAttr(SwFormatFrameSize(SwFrameSize::Variable, nWidth)); } } @@ -1228,7 +1228,7 @@ const SwTable* SwDoc::TextToTable( const std::vector< std::vector<SwNodeRange> > // All Lines have a left-to-right Fill Order pLineFormat->SetFormatAttr( SwFormatFillOrder( ATT_LEFT_TO_RIGHT )); // The Table's SSize is USHRT_MAX - pTableFormat->SetFormatAttr( SwFormatFrameSize( ATT_VAR_SIZE, USHRT_MAX )); + pTableFormat->SetFormatAttr( SwFormatFrameSize( SwFrameSize::Variable, USHRT_MAX )); /* If the first node in the selection is a context node and if it has an item FRAMEDIR set (no default) propagate the item to the @@ -1350,14 +1350,14 @@ lcl_SetTableBoxWidths2(SwTable & rTable, size_t const nMaxBoxes, // default width for box at the end of an incomplete line SwTableBoxFormat *const pNewFormat = rDoc.MakeTableBoxFormat(); size_t nWidth = nMaxBoxes ? USHRT_MAX / nMaxBoxes : USHRT_MAX; - pNewFormat->SetFormatAttr( SwFormatFrameSize(ATT_VAR_SIZE, + pNewFormat->SetFormatAttr( SwFormatFrameSize(SwFrameSize::Variable, nWidth * (nMissing + 1)) ); pNewFormat->Add(rBoxes.back()); } } size_t nWidth = nMaxBoxes ? USHRT_MAX / nMaxBoxes : USHRT_MAX; // default width for all boxes not at the end of an incomplete line - rBoxFormat.SetFormatAttr(SwFormatFrameSize(ATT_VAR_SIZE, nWidth)); + rBoxFormat.SetFormatAttr(SwFormatFrameSize(SwFrameSize::Variable, nWidth)); } SwTableNode* SwNodes::TextToTable( const SwNodes::TableRanges_t & rTableNodes, @@ -2823,8 +2823,8 @@ void SwDoc::SetTabRows( const SwTabCols &rNew, bool bCurColOnly, if( nNewSize != aNew.GetHeight() ) { aNew.SetHeight( nNewSize ); - if ( ATT_VAR_SIZE == aNew.GetHeightSizeType() ) - aNew.SetHeightSizeType( ATT_MIN_SIZE ); + if ( SwFrameSize::Variable == aNew.GetHeightSizeType() ) + aNew.SetHeightSizeType( SwFrameSize::Minimum ); // This position must not be in an overlapped box const SwPosition aPos(*static_cast<const SwTextFrame*>(pContent)->GetTextNodeFirst()); const SwCursor aTmpCursor( aPos, nullptr ); diff --git a/sw/source/core/docnode/ndtbl1.cxx b/sw/source/core/docnode/ndtbl1.cxx index c8e9db3c41a8..8fe8c6d0f5c6 100644 --- a/sw/source/core/docnode/ndtbl1.cxx +++ b/sw/source/core/docnode/ndtbl1.cxx @@ -456,7 +456,7 @@ bool SwDoc::BalanceRowHeight( const SwCursor& rCursor, bool bTstOnly, const bool if ( bOptimize ) nHeight = nTotalHeight / aRowArr.size(); - SwFormatFrameSize aNew( ATT_MIN_SIZE, 0, nHeight ); + SwFormatFrameSize aNew( SwFrameSize::Minimum, 0, nHeight ); if (GetIDocumentUndoRedo().DoesUndo()) { diff --git a/sw/source/core/frmedt/fefly1.cxx b/sw/source/core/frmedt/fefly1.cxx index ce770a70bb4f..8137013ab109 100644 --- a/sw/source/core/frmedt/fefly1.cxx +++ b/sw/source/core/frmedt/fefly1.cxx @@ -1326,7 +1326,7 @@ Size SwFEShell::RequestObjectResize( const SwRect &rRect, const uno::Reference < SwFrameFormat *pFormat = pChgFly->GetFormat(); SwFormatFrameSize aFrameSz( pFormat->GetFrameSize() ); aFrameSz.SetWidth( aNewSz.Width() ); - if( ATT_MIN_SIZE != aFrameSz.GetHeightSizeType() ) + if( SwFrameSize::Minimum != aFrameSz.GetHeightSizeType() ) { aNewSz.AdjustHeight(pChgFly->getFrameArea().Height() - pFly->getFramePrintArea().Height() ); @@ -1774,7 +1774,7 @@ void SwFEShell::ReplaceSdrObj( const OUString& rGrfName, const Graphic* pGrf ) const long nWidth = rBound.Right() - rBound.Left(); const long nHeight= rBound.Bottom() - rBound.Top(); - aFrameSet.Put( SwFormatFrameSize( ATT_MIN_SIZE, + aFrameSet.Put( SwFormatFrameSize( SwFrameSize::Minimum, std::max( nWidth, long(MINFLY) ), std::max( nHeight, long(MINFLY) ))); diff --git a/sw/source/core/frmedt/feshview.cxx b/sw/source/core/frmedt/feshview.cxx index 8f9d2af42df5..1e2e08a78c5b 100644 --- a/sw/source/core/frmedt/feshview.cxx +++ b/sw/source/core/frmedt/feshview.cxx @@ -1981,7 +1981,7 @@ bool SwFEShell::ImpEndCreate() // For OBJ_NONE a fly is inserted. const long nWidth = rBound.Right() - rBound.Left(); const long nHeight= rBound.Bottom() - rBound.Top(); - aSet.Put( SwFormatFrameSize( ATT_MIN_SIZE, std::max( nWidth, long(MINFLY) ), + aSet.Put( SwFormatFrameSize( SwFrameSize::Minimum, std::max( nWidth, long(MINFLY) ), std::max( nHeight, long(MINFLY) ))); SwFormatHoriOrient aHori( nXOffset, text::HoriOrientation::NONE, text::RelOrientation::FRAME ); diff --git a/sw/source/core/frmedt/tblsel.cxx b/sw/source/core/frmedt/tblsel.cxx index a020bb44170c..cc88ed1d8578 100644 --- a/sw/source/core/frmedt/tblsel.cxx +++ b/sw/source/core/frmedt/tblsel.cxx @@ -1402,7 +1402,7 @@ void GetMergeSel( const SwPaM& rPam, SwSelBoxes& rBoxes, } // set width of the box - (*ppMergeBox)->GetFrameFormat()->SetFormatAttr( SwFormatFrameSize( ATT_VAR_SIZE, nWidth, 0 )); + (*ppMergeBox)->GetFrameFormat()->SetFormatAttr( SwFormatFrameSize( SwFrameSize::Variable, nWidth, 0 )); if( pUndo ) pUndo->AddNewBox( (*ppMergeBox)->GetSttIdx() ); } diff --git a/sw/source/core/layout/atrfrm.cxx b/sw/source/core/layout/atrfrm.cxx index e214f9752a73..3ee1be7590e3 100644 --- a/sw/source/core/layout/atrfrm.cxx +++ b/sw/source/core/layout/atrfrm.cxx @@ -193,7 +193,7 @@ bool SwFormatFrameSize::HasMetrics() const { SwFormatFrameSize::SwFormatFrameSize( SwFrameSize eSize, SwTwips nWidth, SwTwips nHeight ) : SvxSizeItem( RES_FRM_SIZE, {nWidth, nHeight} ), m_eFrameHeightType( eSize ), - m_eFrameWidthType( ATT_FIX_SIZE ) + m_eFrameWidthType( SwFrameSize::Fixed ) { m_nWidthPercent = m_eWidthPercentRelation = m_nHeightPercent = m_eHeightPercentRelation = 0; } @@ -261,7 +261,7 @@ bool SwFormatFrameSize::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const rVal <<= static_cast<sal_Int16>(GetHeightSizeType()); break; case MID_FRMSIZE_IS_AUTO_HEIGHT: - rVal <<= ATT_FIX_SIZE != GetHeightSizeType(); + rVal <<= SwFrameSize::Fixed != GetHeightSizeType(); break; case MID_FRMSIZE_WIDTH_TYPE: rVal <<= static_cast<sal_Int16>(GetWidthSizeType()); @@ -379,7 +379,7 @@ bool SwFormatFrameSize::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId ) case MID_FRMSIZE_SIZE_TYPE: { sal_Int16 nType = 0; - if((rVal >>= nType) && nType >= 0 && nType <= ATT_MIN_SIZE ) + if((rVal >>= nType) && nType >= 0 && nType <= static_cast<int>(SwFrameSize::Minimum) ) { SetHeightSizeType(static_cast<SwFrameSize>(nType)); } @@ -390,13 +390,13 @@ bool SwFormatFrameSize::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId ) case MID_FRMSIZE_IS_AUTO_HEIGHT: { bool bSet = *o3tl::doAccess<bool>(rVal); - SetHeightSizeType(bSet ? ATT_VAR_SIZE : ATT_FIX_SIZE); + SetHeightSizeType(bSet ? SwFrameSize::Variable : SwFrameSize::Fixed); } break; case MID_FRMSIZE_WIDTH_TYPE: { sal_Int16 nType = 0; - if((rVal >>= nType) && nType >= 0 && nType <= ATT_MIN_SIZE ) + if((rVal >>= nType) && nType >= 0 && nType <= static_cast<int>(SwFrameSize::Minimum) ) { SetWidthSizeType(static_cast<SwFrameSize>(nType)); } @@ -419,8 +419,8 @@ void SwFormatFrameSize::dumpAsXml(xmlTextWriterPtr pWriter) const aSize << GetSize(); xmlTextWriterWriteAttribute(pWriter, BAD_CAST("size"), BAD_CAST(aSize.str().c_str())); - xmlTextWriterWriteAttribute(pWriter, BAD_CAST("eFrameHeightType"), BAD_CAST(OString::number(m_eFrameHeightType).getStr())); - xmlTextWriterWriteAttribute(pWriter, BAD_CAST("eFrameWidthType"), BAD_CAST(OString::number(m_eFrameWidthType).getStr())); + xmlTextWriterWriteAttribute(pWriter, BAD_CAST("eFrameHeightType"), BAD_CAST(OString::number(static_cast<int>(m_eFrameHeightType)).getStr())); + xmlTextWriterWriteAttribute(pWriter, BAD_CAST("eFrameWidthType"), BAD_CAST(OString::number(static_cast<int>(m_eFrameWidthType)).getStr())); xmlTextWriterWriteAttribute(pWriter, BAD_CAST("nWidthPercent"), BAD_CAST(OString::number(m_nWidthPercent).getStr())); xmlTextWriterWriteAttribute(pWriter, BAD_CAST("eWidthPercentRelation"), BAD_CAST(OString::number(m_eWidthPercentRelation).getStr())); xmlTextWriterWriteAttribute(pWriter, BAD_CAST("nHeightPercent"), BAD_CAST(OString::number(m_nHeightPercent).getStr())); diff --git a/sw/source/core/layout/fly.cxx b/sw/source/core/layout/fly.cxx index ee4cf8f8587a..76ef0c3f7465 100644 --- a/sw/source/core/layout/fly.cxx +++ b/sw/source/core/layout/fly.cxx @@ -146,13 +146,13 @@ SwFlyFrame::SwFlyFrame( SwFlyFrameFormat *pFormat, SwFrame* pSib, SwFrame *pAnch { SwFrameAreaDefinition::FrameAreaWriteAccess aFrm(*this); aFrm.Width( rFrameSize.GetWidth() ); - aFrm.Height( rFrameSize.GetHeightSizeType() == ATT_VAR_SIZE ? MINFLY : rFrameSize.GetHeight() ); + aFrm.Height( rFrameSize.GetHeightSizeType() == SwFrameSize::Variable ? MINFLY : rFrameSize.GetHeight() ); } // Fixed or variable Height? - if ( rFrameSize.GetHeightSizeType() == ATT_MIN_SIZE ) + if ( rFrameSize.GetHeightSizeType() == SwFrameSize::Minimum ) m_bMinHeight = true; - else if ( rFrameSize.GetHeightSizeType() == ATT_FIX_SIZE ) + else if ( rFrameSize.GetHeightSizeType() == SwFrameSize::Fixed ) mbFixSize = true; // insert columns, if necessary @@ -559,16 +559,16 @@ bool SwFlyFrame::FrameSizeChg( const SwFormatFrameSize &rFrameSize ) { bool bRet = false; SwTwips nDiffHeight = getFrameArea().Height(); - if ( rFrameSize.GetHeightSizeType() == ATT_VAR_SIZE ) + if ( rFrameSize.GetHeightSizeType() == SwFrameSize::Variable ) mbFixSize = m_bMinHeight = false; else { - if ( rFrameSize.GetHeightSizeType() == ATT_FIX_SIZE ) + if ( rFrameSize.GetHeightSizeType() == SwFrameSize::Fixed ) { mbFixSize = true; m_bMinHeight = false; } - else if ( rFrameSize.GetHeightSizeType() == ATT_MIN_SIZE ) + else if ( rFrameSize.GetHeightSizeType() == SwFrameSize::Minimum ) { mbFixSize = false; m_bMinHeight = true; @@ -1309,13 +1309,13 @@ void SwFlyFrame::Format( vcl::RenderContext* /*pRenderContext*/, const SwBorderA OSL_ENSURE( aRelSize == CalcRel( rFrameSz ), "SwFlyFrame::Format CalcRel problem" ); SwTwips nNewSize = aRectFnSet.IsVert() ? aRelSize.Height() : aRelSize.Width(); - if ( rFrameSz.GetWidthSizeType() != ATT_FIX_SIZE ) + if ( rFrameSz.GetWidthSizeType() != SwFrameSize::Fixed ) { // #i9046# Autowidth for fly frames const SwTwips nAutoWidth = lcl_CalcAutoWidth( *this ); if ( nAutoWidth ) { - if( ATT_MIN_SIZE == rFrameSz.GetWidthSizeType() ) + if( SwFrameSize::Minimum == rFrameSz.GetWidthSizeType() ) nNewSize = std::max( nNewSize - nLR, nAutoWidth ); else nNewSize = nAutoWidth; @@ -1922,7 +1922,7 @@ SwTwips SwFlyFrame::Grow_( SwTwips nDist, bool bTst ) // for the lower frame, which initiated this grow. const bool bOldFormatHeightOnly = m_bFormatHeightOnly; const SwFormatFrameSize& rFrameSz = GetFormat()->GetFrameSize(); - if ( rFrameSz.GetWidthSizeType() != ATT_FIX_SIZE ) + if ( rFrameSz.GetWidthSizeType() != SwFrameSize::Fixed ) { m_bFormatHeightOnly = true; } @@ -1934,7 +1934,7 @@ SwTwips SwFlyFrame::Grow_( SwTwips nDist, bool bTst ) static_cast<SwFlyFreeFrame*>(this)->SetNoMoveOnCheckClip( false ); } // #i55416# - if ( rFrameSz.GetWidthSizeType() != ATT_FIX_SIZE ) + if ( rFrameSz.GetWidthSizeType() != SwFrameSize::Fixed ) { m_bFormatHeightOnly = bOldFormatHeightOnly; } @@ -2033,7 +2033,7 @@ SwTwips SwFlyFrame::Shrink_( SwTwips nDist, bool bTst ) // for the lower frame, which initiated this shrink. const bool bOldFormatHeightOnly = m_bFormatHeightOnly; const SwFormatFrameSize& rFrameSz = GetFormat()->GetFrameSize(); - if ( rFrameSz.GetWidthSizeType() != ATT_FIX_SIZE ) + if ( rFrameSz.GetWidthSizeType() != SwFrameSize::Fixed ) { m_bFormatHeightOnly = true; } @@ -2041,7 +2041,7 @@ SwTwips SwFlyFrame::Shrink_( SwTwips nDist, bool bTst ) static_cast<SwFlyFreeFrame*>(this)->SwFlyFreeFrame::MakeAll(getRootFrame()->GetCurrShell()->GetOut()); static_cast<SwFlyFreeFrame*>(this)->SetNoMoveOnCheckClip( false ); // #i55416# - if ( rFrameSz.GetWidthSizeType() != ATT_FIX_SIZE ) + if ( rFrameSz.GetWidthSizeType() != SwFrameSize::Fixed ) { m_bFormatHeightOnly = bOldFormatHeightOnly; } diff --git a/sw/source/core/layout/flylay.cxx b/sw/source/core/layout/flylay.cxx index 4a7030ea241e..f64c5d3a21ab 100644 --- a/sw/source/core/layout/flylay.cxx +++ b/sw/source/core/layout/flylay.cxx @@ -458,7 +458,7 @@ bool SwFlyFreeFrame::HasEnvironmentAutoSize() const pToBeCheckedFrame->IsRowFrame() || pToBeCheckedFrame->IsFlyFrame() ) { - bRetVal = ATT_FIX_SIZE != + bRetVal = SwFrameSize::Fixed != pToBeCheckedFrame->GetAttrSet()->GetFrameSize().GetHeightSizeType(); break; } diff --git a/sw/source/core/layout/frmtool.cxx b/sw/source/core/layout/frmtool.cxx index 9c804b7c1ff8..df90b17b0f11 100644 --- a/sw/source/core/layout/frmtool.cxx +++ b/sw/source/core/layout/frmtool.cxx @@ -397,7 +397,7 @@ SwFrameNotify::~SwFrameNotify() COVERITY_NOEXCEPT_FALSE // the other hand, this is only rarely used and re-calculation of // the fly frame does not cause too much trouble. So we keep it this // way: - if ( ATT_FIX_SIZE != rFrameSz.GetWidthSizeType() ) + if ( SwFrameSize::Fixed != rFrameSz.GetWidthSizeType() ) { // #i50668#, #i50998# - invalidation of position // of as-character anchored fly frames not needed and can cause diff --git a/sw/source/core/layout/hffrm.cxx b/sw/source/core/layout/hffrm.cxx index 7c44bc31b57d..fa5e1044fcad 100644 --- a/sw/source/core/layout/hffrm.cxx +++ b/sw/source/core/layout/hffrm.cxx @@ -41,7 +41,7 @@ static SwTwips lcl_GetFrameMinHeight(const SwLayoutFrame & rFrame) switch (rSz.GetHeightSizeType()) { - case ATT_MIN_SIZE: + case SwFrameSize::Minimum: nMinHeight = rSz.GetHeight(); break; diff --git a/sw/source/core/layout/ssfrm.cxx b/sw/source/core/layout/ssfrm.cxx index a38c784f146f..14193b09d260 100644 --- a/sw/source/core/layout/ssfrm.cxx +++ b/sw/source/core/layout/ssfrm.cxx @@ -213,8 +213,8 @@ void SwFrame::CheckDirChange() SwTableLine* pLine = const_cast<SwTableLine*>(static_cast<SwCellFrame*>(this)->GetTabBox()->GetUpper()); SwFrameFormat* pFrameFormat = pLine->GetFrameFormat(); SwFormatFrameSize aNew( pFrameFormat->GetFrameSize() ); - if ( ATT_FIX_SIZE != aNew.GetHeightSizeType() ) - aNew.SetHeightSizeType( ATT_MIN_SIZE ); + if ( SwFrameSize::Fixed != aNew.GetHeightSizeType() ) + aNew.SetHeightSizeType( SwFrameSize::Minimum ); if ( aNew.GetHeight() < MIN_VERT_CELL_HEIGHT ) aNew.SetHeight( MIN_VERT_CELL_HEIGHT ); SwDoc* pDoc = pFrameFormat->GetDoc(); diff --git a/sw/source/core/layout/tabfrm.cxx b/sw/source/core/layout/tabfrm.cxx index 42150626aa10..ef0d2727fed2 100644 --- a/sw/source/core/layout/tabfrm.cxx +++ b/sw/source/core/layout/tabfrm.cxx @@ -534,7 +534,7 @@ static void lcl_PreprocessRowsInCells( SwTabFrame& rTab, SwRowFrame& rLastLine, { { const SwFormatFrameSize &rSz = pTmpLastLineRow->GetFormat()->GetFrameSize(); - if ( rSz.GetHeightSizeType() == ATT_MIN_SIZE ) + if ( rSz.GetHeightSizeType() == SwFrameSize::Minimum ) nMinHeight = rSz.GetHeight() - lcl_calcHeightOfRowBeforeThisFrame(*pTmpLastLineRow); } @@ -3997,12 +3997,12 @@ static SwTwips lcl_CalcMinRowHeight( const SwRowFrame* _pRow, const SwFormatFrameSize &rSz = _pRow->GetFormat()->GetFrameSize(); if ( _pRow->HasFixSize() ) { - OSL_ENSURE(ATT_FIX_SIZE == rSz.GetHeightSizeType(), "pRow claims to have fixed size"); + OSL_ENSURE(SwFrameSize::Fixed == rSz.GetHeightSizeType(), "pRow claims to have fixed size"); return rSz.GetHeight(); } // If this row frame is being split, then row's minimal height shouldn't restrict // this frame's minimal height, because the rest will go to follow frame. - else if ( !_pRow->IsInSplit() && rSz.GetHeightSizeType() == ATT_MIN_SIZE ) + else if ( !_pRow->IsInSplit() && rSz.GetHeightSizeType() == SwFrameSize::Minimum ) { nHeight = rSz.GetHeight() - lcl_calcHeightOfRowBeforeThisFrame(*_pRow); } @@ -4555,7 +4555,7 @@ SwTwips SwRowFrame::ShrinkFrame( SwTwips nDist, bool bTst, bool bInfo ) { const SwFormatFrameSize &rSz = pMod->GetFrameSize(); SwTwips nMinHeight = 0; - if (rSz.GetHeightSizeType() == ATT_MIN_SIZE) + if (rSz.GetHeightSizeType() == SwFrameSize::Minimum) nMinHeight = std::max(rSz.GetHeight() - lcl_calcHeightOfRowBeforeThisFrame(*this), 0L); @@ -4643,7 +4643,7 @@ bool SwRowFrame::IsRowSplitAllowed() const // Fixed size rows are never allowed to split: if ( HasFixSize() ) { - OSL_ENSURE( ATT_FIX_SIZE == GetFormat()->GetFrameSize().GetHeightSizeType(), "pRow claims to have fixed size" ); + OSL_ENSURE( SwFrameSize::Fixed == GetFormat()->GetFrameSize().GetHeightSizeType(), "pRow claims to have fixed size" ); return false; } @@ -5655,10 +5655,10 @@ SwTwips SwTabFrame::CalcHeightOfFirstContentLine() const SwFormatFrameSize const& rFrameSize(pFirstRow->GetAttrSet()->GetFrameSize()); if ( pFirstRow->GetPrev() && static_cast<const SwRowFrame*>(pFirstRow->GetPrev())->IsRowSpanLine() - && rFrameSize.GetHeightSizeType() != ATT_FIX_SIZE) + && rFrameSize.GetHeightSizeType() != SwFrameSize::Fixed) { // Calculate maximum height of all cells with rowspan = 1: - SwTwips nMaxHeight = rFrameSize.GetHeightSizeType() == ATT_MIN_SIZE + SwTwips nMaxHeight = rFrameSize.GetHeightSizeType() == SwFrameSize::Minimum ? rFrameSize.GetHeight() : 0; const SwCellFrame* pLower2 = static_cast<const SwCellFrame*>(pFirstRow->Lower()); @@ -5692,7 +5692,7 @@ SwTwips SwTabFrame::CalcHeightOfFirstContentLine() const const SwFormatFrameSize &rSz = pFirstRow->GetFormat()->GetFrameSize(); SwTwips nMinRowHeight = 0; - if (rSz.GetHeightSizeType() == ATT_MIN_SIZE) + if (rSz.GetHeightSizeType() == SwFrameSize::Minimum) { nMinRowHeight = std::max(rSz.GetHeight() - lcl_calcHeightOfRowBeforeThisFrame(*pFirstRow), 0L); diff --git a/sw/source/core/layout/wsfrm.cxx b/sw/source/core/layout/wsfrm.cxx index 0775d895143f..272306df1ba3 100644 --- a/sw/source/core/layout/wsfrm.cxx +++ b/sw/source/core/layout/wsfrm.cxx @@ -1977,8 +1977,8 @@ void SwFrame::ImplInvalidateLineNum() void SwFrame::ReinitializeFrameSizeAttrFlags() { const SwFormatFrameSize &rFormatSize = GetAttrSet()->GetFrameSize(); - if ( ATT_VAR_SIZE == rFormatSize.GetHeightSizeType() || - ATT_MIN_SIZE == rFormatSize.GetHeightSizeType()) + if ( SwFrameSize::Variable == rFormatSize.GetHeightSizeType() || + SwFrameSize::Minimum == rFormatSize.GetHeightSizeType()) { mbFixSize = false; if ( GetType() & (SwFrameType::Header | SwFrameType::Footer | SwFrameType::Row) ) @@ -2004,7 +2004,7 @@ void SwFrame::ReinitializeFrameSizeAttrFlags() } } } - else if ( rFormatSize.GetHeightSizeType() == ATT_FIX_SIZE ) + else if ( rFormatSize.GetHeightSizeType() == SwFrameSize::Fixed ) { if( IsVertical() ) ChgSize( Size( rFormatSize.GetWidth(), getFrameArea().Height())); @@ -2525,7 +2525,7 @@ SwLayoutFrame::SwLayoutFrame(SwFrameFormat *const pFormat, SwFrame *const pSib) , m_pLower(nullptr) { const SwFormatFrameSize &rFormatSize = pFormat->GetFrameSize(); - if ( rFormatSize.GetHeightSizeType() == ATT_FIX_SIZE ) + if ( rFormatSize.GetHeightSizeType() == SwFrameSize::Fixed ) mbFixSize = true; } @@ -3392,7 +3392,7 @@ void SwLayoutFrame::Format( vcl::RenderContext* /*pRenderContext*/, const SwBord { const SwTwips nBorder = nUpper + nLower; const SwFormatFrameSize &rSz = GetFormat()->GetFrameSize(); - SwTwips nMinHeight = rSz.GetHeightSizeType() == ATT_MIN_SIZE ? rSz.GetHeight() : 0; + SwTwips nMinHeight = rSz.GetHeightSizeType() == SwFrameSize::Minimum ? rSz.GetHeight() : 0; do { setFrameAreaSizeValid(true); diff --git a/sw/source/core/table/swnewtable.cxx b/sw/source/core/table/swnewtable.cxx index 69b61fd8b447..78d0525e553c 100644 --- a/sw/source/core/table/swnewtable.cxx +++ b/sw/source/core/table/swnewtable.cxx @@ -570,7 +570,7 @@ std::unique_ptr<SwBoxSelection> SwTable::CollectBoxSelection( const SwPaM& rPam { SwFrameFormat* pFormat = newWidth.first->ClaimFrameFormat(); long nNewWidth = pFormat->GetFrameSize().GetWidth() + newWidth.second; - pFormat->SetFormatAttr( SwFormatFrameSize( ATT_VAR_SIZE, nNewWidth, 0 ) ); + pFormat->SetFormatAttr( SwFormatFrameSize( SwFrameSize::Variable, nNewWidth, 0 ) ); } } else @@ -923,7 +923,7 @@ bool SwTable::PrepareMerge( const SwPaM& rPam, SwSelBoxes& rBoxes, FindSuperfluousRows_( rBoxes, pFirstLn, pLastLn ); // pNewFormat will be set to the new master box and the overlapped cells SwFrameFormat* pNewFormat = pMergeBox->ClaimFrameFormat(); - pNewFormat->SetFormatAttr( SwFormatFrameSize( ATT_VAR_SIZE, pSel->mnMergeWidth, 0 ) ); + pNewFormat->SetFormatAttr( SwFormatFrameSize( SwFrameSize::Variable, pSel->mnMergeWidth, 0 ) ); for( size_t nCurrLine = 0; nCurrLine < nLineCount; ++nCurrLine ) { const SwSelBoxes& rLineBoxes = pSel->maBoxes[nCurrLine]; @@ -936,7 +936,7 @@ bool SwTable::PrepareMerge( const SwPaM& rPam, SwSelBoxes& rBoxes, // Even this box will be deleted soon, // we have to correct the width to avoid side effects SwFrameFormat* pFormat = pBox->ClaimFrameFormat(); - pFormat->SetFormatAttr( SwFormatFrameSize( ATT_VAR_SIZE, 0, 0 ) ); + pFormat->SetFormatAttr( SwFormatFrameSize( SwFrameSize::Variable, 0, 0 ) ); } else { @@ -1172,7 +1172,7 @@ void SwTable::InsertSpannedRow( SwDoc* pDoc, sal_uInt16 nRowIdx, sal_uInt16 nCnt SwTableLine& rLine = *GetTabLines()[ nRowIdx ]; lcl_FillSelBoxes( aBoxes, rLine ); SwFormatFrameSize aFSz( rLine.GetFrameFormat()->GetFrameSize() ); - if( ATT_VAR_SIZE != aFSz.GetHeightSizeType() ) + if( SwFrameSize::Variable != aFSz.GetHeightSizeType() ) { SwFrameFormat* pFrameFormat = rLine.ClaimFrameFormat(); long nNewHeight = aFSz.GetHeight() / ( nCnt + 1 ); @@ -1427,7 +1427,7 @@ bool SwTable::NewSplitRow( SwDoc* pDoc, const SwSelBoxes& rBoxes, sal_uInt16 nCn SwTableLine* pRow = GetTabLines()[ nFirst ]; SwFrameFormat* pRowFormat = pRow->ClaimFrameFormat(); SwFormatFrameSize aFSz( pRowFormat->GetFrameSize() ); - aFSz.SetHeightSizeType( ATT_MIN_SIZE ); + aFSz.SetHeightSizeType( SwFrameSize::Minimum ); aFSz.SetHeight( *pSplit - nLast ); pRowFormat->SetFormatAttr( aFSz ); nLast = *pSplit; @@ -1439,7 +1439,7 @@ bool SwTable::NewSplitRow( SwDoc* pDoc, const SwSelBoxes& rBoxes, sal_uInt16 nCn SwTableLine* pRow = GetTabLines()[ nFirst ]; SwFrameFormat* pRowFormat = pRow->ClaimFrameFormat(); SwFormatFrameSize aFSz( pRowFormat->GetFrameSize() ); - aFSz.SetHeightSizeType( ATT_MIN_SIZE ); + aFSz.SetHeightSizeType( SwFrameSize::Minimum ); aFSz.SetHeight( rCurr - nLast ); pRowFormat->SetFormatAttr( aFSz ); nLast = rCurr; diff --git a/sw/source/core/table/swtable.cxx b/sw/source/core/table/swtable.cxx index 07667486eb5c..545787995612 100644 --- a/sw/source/core/table/swtable.cxx +++ b/sw/source/core/table/swtable.cxx @@ -290,7 +290,7 @@ static void lcl_ModifyLines( SwTableLines &rLines, const long nOld, for(SwFormat* pFormat : rFormatArr) { const SwTwips nBox = lcl_MulDiv64<SwTwips>(pFormat->GetFrameSize().GetWidth(), nNew, nOld); - SwFormatFrameSize aNewBox( ATT_VAR_SIZE, nBox, 0 ); + SwFormatFrameSize aNewBox( SwFrameSize::Variable, nBox, 0 ); pFormat->LockModify(); pFormat->SetFormatAttr( aNewBox ); pFormat->UnlockModify(); @@ -326,7 +326,7 @@ static void lcl_ModifyBoxes( SwTableBoxes &rBoxes, const long nOld, { nBox = nWishedSum; pFormat = rBox.ClaimFrameFormat(); - SwFormatFrameSize aNewBox( ATT_VAR_SIZE, static_cast< SwTwips >(nBox), 0 ); + SwFormatFrameSize aNewBox( SwFrameSize::Variable, static_cast< SwTwips >(nBox), 0 ); pFormat->LockModify(); pFormat->SetFormatAttr( aNewBox ); pFormat->UnlockModify(); diff --git a/sw/source/core/text/pormulti.cxx b/sw/source/core/text/pormulti.cxx index 340af76d0510..1ef0c04efd86 100644 --- a/sw/source/core/text/pormulti.cxx +++ b/sw/source/core/text/pormulti.cxx @@ -1941,7 +1941,7 @@ bool SwTextFormatter::BuildMultiPortion( SwTextFormatInfo &rInf, return false; const SwTableLine* pLine = static_cast<const SwRowFrame*>(pUpperFrame->GetUpper())->GetTabLine(); const SwFormatFrameSize& rFrameFormatSize = pLine->GetFrameFormat()->GetFrameSize(); - if ( ATT_VAR_SIZE == rFrameFormatSize.GetHeightSizeType() ) + if ( SwFrameSize::Variable == rFrameFormatSize.GetHeightSizeType() ) pUpperFrame = pPage; } if ( pUpperFrame == pPage && !m_pFrame->IsInFootnote() ) diff --git a/sw/source/core/undo/unattr.cxx b/sw/source/core/undo/unattr.cxx index d09a2c642862..0401f3b4be17 100644 --- a/sw/source/core/undo/unattr.cxx +++ b/sw/source/core/undo/unattr.cxx @@ -347,7 +347,7 @@ void SwUndoFormatAttr::SaveFlyAnchor( const SwFormat * pFormat, bool bSvDrwPt ) Point aPt( static_cast<const SwFrameFormat*>(pFormat)->FindSdrObject() ->GetRelativePos() ); // store old value as attribute, to keep SwUndoFormatAttr small - m_pOldSet->Put( SwFormatFrameSize( ATT_VAR_SIZE, aPt.X(), aPt.Y() ) ); + m_pOldSet->Put( SwFormatFrameSize( SwFrameSize::Variable, aPt.X(), aPt.Y() ) ); } } @@ -473,7 +473,7 @@ bool SwUndoFormatAttr::RestoreFlyAnchor(::sw::UndoRedoContext & rContext) // change of the Contact object by setting the anchor. pFrameFormat->CallSwClientNotify(sw::RestoreFlyAnchorHint(aDrawSavePt)); // cache the old value again - m_pOldSet->Put(SwFormatFrameSize(ATT_VAR_SIZE, aDrawOldPt.X(), aDrawOldPt.Y())); + m_pOldSet->Put(SwFormatFrameSize(SwFrameSize::Variable, aDrawOldPt.X(), aDrawOldPt.Y())); } if (RndStdIds::FLY_AS_CHAR == aNewAnchor.GetAnchorId()) { diff --git a/sw/source/core/unocore/unostyle.cxx b/sw/source/core/unocore/unostyle.cxx index a516eb30b958..e2c8459da312 100644 --- a/sw/source/core/unocore/unostyle.cxx +++ b/sw/source/core/unocore/unostyle.cxx @@ -2695,7 +2695,7 @@ void SAL_CALL SwXStyle::setAllPropertiesToDefault() pPageFormat->SetFormatAttr(aLR); pPageFormat->SetFormatAttr(aUL); SwPageDesc* pStdPgDsc = m_pDoc->getIDocumentStylePoolAccess().GetPageDescFromPool(RES_POOLPAGE_STANDARD); - std::shared_ptr<SwFormatFrameSize> aFrameSz(std::make_shared<SwFormatFrameSize>(ATT_FIX_SIZE)); + std::shared_ptr<SwFormatFrameSize> aFrameSz(std::make_shared<SwFormatFrameSize>(SwFrameSize::Fixed)); if(RES_POOLPAGE_STANDARD == rPageDesc.GetPoolFormatId()) { diff --git a/sw/source/core/unocore/unotbl.cxx b/sw/source/core/unocore/unotbl.cxx index 4618136409f2..3844f4de8fd3 100644 --- a/sw/source/core/unocore/unotbl.cxx +++ b/sw/source/core/unocore/unotbl.cxx @@ -1439,7 +1439,7 @@ void SwXTextTableRow::setPropertyValue(const OUString& rPropertyName, const uno: if(FN_UNO_ROW_AUTO_HEIGHT== pEntry->nWID) { bool bSet = *o3tl::doAccess<bool>(aValue); - aFrameSize.SetHeightSizeType(bSet ? ATT_VAR_SIZE : ATT_FIX_SIZE); + aFrameSize.SetHeightSizeType(bSet ? SwFrameSize::Variable : SwFrameSize::Fixed); } else { @@ -1495,7 +1495,7 @@ uno::Any SwXTextTableRow::getPropertyValue(const OUString& rPropertyName) const SwFormatFrameSize& rSize = pLn->GetFrameFormat()->GetFrameSize(); if(FN_UNO_ROW_AUTO_HEIGHT== pEntry->nWID) { - aRet <<= ATT_VAR_SIZE == rSize.GetHeightSizeType(); + aRet <<= SwFrameSize::Variable == rSize.GetHeightSizeType(); } else aRet <<= static_cast<sal_Int32>(convertTwipToMm100(rSize.GetSize().Height())); @@ -1998,7 +1998,7 @@ void SwTableProperties_Impl::ApplyTableAttr(const SwTable& rTable, SwDoc& rDoc) GetProperty(FN_TABLE_WIDTH, 0xff, pWidth); bool bPutSize = pWidth != nullptr; - SwFormatFrameSize aSz(ATT_VAR_SIZE); + SwFormatFrameSize aSz(SwFrameSize::Variable); if(pWidth) { aSz.PutValue(*pWidth, MID_FRMSIZE_WIDTH); |