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/filter | |
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/filter')
22 files changed, 72 insertions, 71 deletions
diff --git a/sw/source/filter/html/css1atr.cxx b/sw/source/filter/html/css1atr.cxx index 093409868ebc..16edd9b97fee 100644 --- a/sw/source/filter/html/css1atr.cxx +++ b/sw/source/filter/html/css1atr.cxx @@ -2881,10 +2881,10 @@ static Writer& OutCSS1_SwFormatFrameSize( Writer& rWrt, const SfxPoolItem& rHt, bool bOutHeight = false; switch( rFSItem.GetHeightSizeType() ) { - case ATT_FIX_SIZE: + case SwFrameSize::Fixed: bOutHeight = bool(nMode & Css1FrameSize::FixHeight); break; - case ATT_MIN_SIZE: + case SwFrameSize::Minimum: bOutHeight = bool(nMode & Css1FrameSize::MinHeight); break; default: diff --git a/sw/source/filter/html/htmlcss1.cxx b/sw/source/filter/html/htmlcss1.cxx index e7a1827543a6..c0ace59b4801 100644 --- a/sw/source/filter/html/htmlcss1.cxx +++ b/sw/source/filter/html/htmlcss1.cxx @@ -506,7 +506,7 @@ void SwCSS1Parser::SetPageDescAttrs( const SwPageDesc *pPageDesc, { if( rPropInfo.m_eSizeType == SVX_CSS1_STYPE_TWIP ) { - rMaster.SetFormatAttr( SwFormatFrameSize( ATT_FIX_SIZE, rPropInfo.m_nWidth, + rMaster.SetFormatAttr( SwFormatFrameSize( SwFrameSize::Fixed, rPropInfo.m_nWidth, rPropInfo.m_nHeight ) ); bChanged = true; } @@ -2058,7 +2058,7 @@ void SwHTMLParser::SetVarSize( SvxCSS1PropertyInfo const &rPropInfo, ; } - SwFormatFrameSize aFrameSize( ATT_MIN_SIZE, nWidth, nHeight ); + SwFormatFrameSize aFrameSize( SwFrameSize::Minimum, nWidth, nHeight ); aFrameSize.SetWidthPercent( nPrcWidth ); aFrameSize.SetHeightPercent( nPrcHeight ); rFrameItemSet.Put( aFrameSize ); diff --git a/sw/source/filter/html/htmlflywriter.cxx b/sw/source/filter/html/htmlflywriter.cxx index 61a255d633a3..8558fdab4b43 100644 --- a/sw/source/filter/html/htmlflywriter.cxx +++ b/sw/source/filter/html/htmlflywriter.cxx @@ -672,11 +672,11 @@ OString SwHTMLWriter::OutFrameFormatOptions( const SwFrameFormat &rFrameFormat, } // WIDTH and/or HEIGHT - // Output ATT_VAR_SIZE/ATT_MIN_SIZE only, if ANYSIZE is set + // Output SwFrameSize::Variable/SwFrameSize::Minimum only, if ANYSIZE is set if( (nFrameOpts & HtmlFrmOpts::Size) && SfxItemState::SET == rItemSet.GetItemState( RES_FRM_SIZE, true, &pItem ) && ( (nFrameOpts & HtmlFrmOpts::AnySize) || - ATT_FIX_SIZE == static_cast<const SwFormatFrameSize *>(pItem)->GetHeightSizeType()) ) + SwFrameSize::Fixed == static_cast<const SwFormatFrameSize *>(pItem)->GetHeightSizeType()) ) { const SwFormatFrameSize *pFSItem = static_cast<const SwFormatFrameSize *>(pItem); sal_uInt8 nPrcWidth = pFSItem->GetWidthPercent(); @@ -938,11 +938,11 @@ void SwHTMLWriter::writeFrameFormatOptions(HtmlWriter& aHtml, const SwFrameForma } // "width" and/or "height" - // Only output ATT_VAR_SIZE/ATT_MIN_SIZE if ANYSIZE is set + // Only output SwFrameSize::Variable/SwFrameSize::Minimum if ANYSIZE is set if( (nFrameOptions & HtmlFrmOpts::Size) && SfxItemState::SET == rItemSet.GetItemState( RES_FRM_SIZE, true, &pItem ) && ( (nFrameOptions & HtmlFrmOpts::AnySize) || - ATT_FIX_SIZE == static_cast<const SwFormatFrameSize *>(pItem)->GetHeightSizeType()) ) + SwFrameSize::Fixed == static_cast<const SwFormatFrameSize *>(pItem)->GetHeightSizeType()) ) { const SwFormatFrameSize *pFSItem = static_cast<const SwFormatFrameSize *>(pItem); sal_uInt8 nPrcWidth = pFSItem->GetWidthPercent(); diff --git a/sw/source/filter/html/htmlgrin.cxx b/sw/source/filter/html/htmlgrin.cxx index 488edb6dce06..3eb65061e849 100644 --- a/sw/source/filter/html/htmlgrin.cxx +++ b/sw/source/filter/html/htmlgrin.cxx @@ -778,7 +778,7 @@ IMAGE_SETEVENT: aTwipSz.setHeight( MINFLY ); } - SwFormatFrameSize aFrameSize( ATT_FIX_SIZE, aTwipSz.Width(), aTwipSz.Height() ); + SwFormatFrameSize aFrameSize( SwFrameSize::Fixed, aTwipSz.Width(), aTwipSz.Height() ); aFrameSize.SetWidthPercent( nPrcWidth ); aFrameSize.SetHeightPercent( nPrcHeight ); aFrameSet.Put( aFrameSize ); diff --git a/sw/source/filter/html/htmlplug.cxx b/sw/source/filter/html/htmlplug.cxx index a0da671de733..30b12aafbdc3 100644 --- a/sw/source/filter/html/htmlplug.cxx +++ b/sw/source/filter/html/htmlplug.cxx @@ -233,7 +233,7 @@ void SwHTMLParser::SetFixSize( const Size& rPixSize, } // set size - SwFormatFrameSize aFrameSize( ATT_FIX_SIZE, aTwipSz.Width(), aTwipSz.Height() ); + SwFormatFrameSize aFrameSize( SwFrameSize::Fixed, aTwipSz.Width(), aTwipSz.Height() ); aFrameSize.SetWidthPercent( nPrcWidth ); aFrameSize.SetHeightPercent( nPrcHeight ); rFlyItemSet.Put( aFrameSize ); @@ -513,7 +513,7 @@ bool SwHTMLParser::InsertEmbed() SwAttrSet aAttrSet(pFormat->GetAttrSet()); aAttrSet.ClearItem(RES_CNTNT); Size aTwipSize(pDevice->PixelToLogic(aSize, MapMode(MapUnit::MapTwip))); - SwFormatFrameSize aFrameSize(ATT_FIX_SIZE, aTwipSize.Width(), aTwipSize.Height()); + SwFormatFrameSize aFrameSize(SwFrameSize::Fixed, aTwipSize.Width(), aTwipSize.Height()); aAttrSet.Put(aFrameSize); pOLENode->GetDoc()->SetFlyFrameAttr(*pFormat, aAttrSet); return true; diff --git a/sw/source/filter/html/htmltab.cxx b/sw/source/filter/html/htmltab.cxx index a857534e5803..369bd413a521 100644 --- a/sw/source/filter/html/htmltab.cxx +++ b/sw/source/filter/html/htmltab.cxx @@ -1569,7 +1569,7 @@ SwTableLine *HTMLTable::MakeTableLine( SwTableBox *pUpper, nRowHeight += GetTopCellSpace( nTopRow ) + GetBottomCellSpace( nTopRow, 1 ); - pFrameFormat->SetFormatAttr( SwFormatFrameSize( ATT_MIN_SIZE, 0, nRowHeight ) ); + pFrameFormat->SetFormatAttr( SwFormatFrameSize( SwFrameSize::Minimum, 0, nRowHeight ) ); } if( pBGBrushItem ) @@ -2391,7 +2391,7 @@ void HTMLTable::MakeTable( SwTableBox *pBox, sal_uInt16 nAbsAvail, (m_pSwTable->GetTabLines())[0]->ClaimFrameFormat(); (m_pSwTable->GetTabLines())[0]->GetFrameFormat() - ->SetFormatAttr( SwFormatFrameSize( ATT_MIN_SIZE, 0, m_nHeight ) ); + ->SetFormatAttr( SwFormatFrameSize( SwFrameSize::Minimum, 0, m_nHeight ) ); } if( GetBGBrush() ) @@ -2414,7 +2414,7 @@ void HTMLTable::MakeTable( SwTableBox *pBox, sal_uInt16 nAbsAvail, sal_uInt32 nMin = m_xLayoutInfo->GetMin(); if( nMin > USHRT_MAX ) nMin = USHRT_MAX; - SwFormatFrameSize aFlyFrameSize( ATT_VAR_SIZE, static_cast<SwTwips>(nMin), MINLAY ); + SwFormatFrameSize aFlyFrameSize( SwFrameSize::Variable, static_cast<SwTwips>(nMin), MINLAY ); aFlyFrameSize.SetWidthPercent( 100 ); m_pContext->GetFrameFormat()->SetFormatAttr( aFlyFrameSize ); bIsInFlyFrame = false; @@ -2430,7 +2430,7 @@ void HTMLTable::MakeTable( SwTableBox *pBox, sal_uInt16 nAbsAvail, sal_uInt32 nMax = m_xLayoutInfo->GetMax(); if( nMax > USHRT_MAX ) nMax = USHRT_MAX; - SwFormatFrameSize aFlyFrameSize( ATT_VAR_SIZE, static_cast<SwTwips>(nMax), MINLAY ); + SwFormatFrameSize aFlyFrameSize( SwFrameSize::Variable, static_cast<SwTwips>(nMax), MINLAY ); m_pContext->GetFrameFormat()->SetFormatAttr( aFlyFrameSize ); bIsInFlyFrame = false; } @@ -3442,7 +3442,7 @@ void SwHTMLParser::BuildTableCell( HTMLTable *pCurTable, bool bReadOptions, true ); aFrameSet.Put( SwFormatSurround(eSurround) ); - SwFormatFrameSize aFrameSize( ATT_VAR_SIZE, 20*MM50, MINLAY ); + SwFormatFrameSize aFrameSize( SwFrameSize::Variable, 20*MM50, MINLAY ); aFrameSize.SetWidthPercent( 100 ); aFrameSet.Put( aFrameSize ); diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx index 70a540baf192..643b15b10fbf 100644 --- a/sw/source/filter/ww8/docxattributeoutput.cxx +++ b/sw/source/filter/ww8/docxattributeoutput.cxx @@ -4248,15 +4248,15 @@ void DocxAttributeOutput::TableHeight( ww8::WW8TableNodeInfoInner::Pointer_t pTa const SwFrameFormat * pLineFormat = pTabLine->GetFrameFormat(); const SwFormatFrameSize& rLSz = pLineFormat->GetFrameSize(); - if ( ATT_VAR_SIZE != rLSz.GetHeightSizeType() && rLSz.GetHeight() ) + if ( SwFrameSize::Variable != rLSz.GetHeightSizeType() && rLSz.GetHeight() ) { sal_Int32 nHeight = rLSz.GetHeight(); const char *pRule = nullptr; switch ( rLSz.GetHeightSizeType() ) { - case ATT_FIX_SIZE: pRule = "exact"; break; - case ATT_MIN_SIZE: pRule = "atLeast"; break; + case SwFrameSize::Fixed: pRule = "exact"; break; + case SwFrameSize::Minimum: pRule = "atLeast"; break; default: break; } @@ -7984,14 +7984,14 @@ void DocxAttributeOutput::FormatFrameSize( const SwFormatFrameSize& rSize ) } else if ( m_rExport.m_bOutFlyFrameAttrs ) { - if ( rSize.GetWidth() && rSize.GetWidthSizeType() == ATT_FIX_SIZE ) + if ( rSize.GetWidth() && rSize.GetWidthSizeType() == SwFrameSize::Fixed ) AddToAttrList( m_rExport.SdrExporter().getFlyAttrList(), FSNS( XML_w, XML_w ), OString::number( rSize.GetWidth( ) ).getStr() ); if ( rSize.GetHeight() ) { OString sRule( "exact" ); - if ( rSize.GetHeightSizeType() == ATT_MIN_SIZE ) + if ( rSize.GetHeightSizeType() == SwFrameSize::Minimum ) sRule = OString( "atLeast" ); AddToAttrList( m_rExport.SdrExporter().getFlyAttrList(), 2, FSNS( XML_w, XML_hRule ), sRule.getStr(), diff --git a/sw/source/filter/ww8/docxsdrexport.cxx b/sw/source/filter/ww8/docxsdrexport.cxx index 8cc14d097fa0..005e50ba5634 100644 --- a/sw/source/filter/ww8/docxsdrexport.cxx +++ b/sw/source/filter/ww8/docxsdrexport.cxx @@ -1400,7 +1400,8 @@ void DocxSdrExport::writeDMLTextFrame(ww8::Frame const* pParentFrame, int nAncho // AutoSize of the Text Frame. const SwFormatFrameSize& rSize = rFrameFormat.GetFrameSize(); pFS->singleElementNS( - XML_a, (rSize.GetHeightSizeType() == ATT_VAR_SIZE ? XML_spAutoFit : XML_noAutofit)); + XML_a, + (rSize.GetHeightSizeType() == SwFrameSize::Variable ? XML_spAutoFit : XML_noAutofit)); pFS->endElementNS(XML_wps, XML_bodyPr); pFS->endElementNS(XML_wps, XML_wsp); diff --git a/sw/source/filter/ww8/rtfattributeoutput.cxx b/sw/source/filter/ww8/rtfattributeoutput.cxx index 749613fa7cff..8150c14fcd0b 100644 --- a/sw/source/filter/ww8/rtfattributeoutput.cxx +++ b/sw/source/filter/ww8/rtfattributeoutput.cxx @@ -817,16 +817,16 @@ void RtfAttributeOutput::TableHeight(ww8::WW8TableNodeInfoInner::Pointer_t pTabl const SwFrameFormat* pLineFormat = pTabLine->GetFrameFormat(); const SwFormatFrameSize& rLSz = pLineFormat->GetFrameSize(); - if (ATT_VAR_SIZE != rLSz.GetHeightSizeType() && rLSz.GetHeight()) + if (SwFrameSize::Variable != rLSz.GetHeightSizeType() && rLSz.GetHeight()) { sal_Int32 nHeight = 0; switch (rLSz.GetHeightSizeType()) { - case ATT_FIX_SIZE: + case SwFrameSize::Fixed: nHeight = -rLSz.GetHeight(); break; - case ATT_MIN_SIZE: + case SwFrameSize::Minimum: nHeight = rLSz.GetHeight(); break; default: diff --git a/sw/source/filter/ww8/writerwordglue.cxx b/sw/source/filter/ww8/writerwordglue.cxx index d2ae4e6e7b19..256020c82a11 100644 --- a/sw/source/filter/ww8/writerwordglue.cxx +++ b/sw/source/filter/ww8/writerwordglue.cxx @@ -83,7 +83,7 @@ namespace myImplHelpers else { const SwFormatFrameSize& rSize = rFormat.GetFrameSize(); - if (ATT_VAR_SIZE != rSize.GetHeightSizeType()) + if (SwFrameSize::Variable != rSize.GetHeightSizeType()) nDist += rSize.GetHeight(); else { diff --git a/sw/source/filter/ww8/wrtww8.cxx b/sw/source/filter/ww8/wrtww8.cxx index 5ed779dcd069..18698337808b 100644 --- a/sw/source/filter/ww8/wrtww8.cxx +++ b/sw/source/filter/ww8/wrtww8.cxx @@ -2205,9 +2205,9 @@ void WW8AttributeOutput::TableHeight( ww8::WW8TableNodeInfoInner::Pointer_t pTab // output line height sprmTDyaRowHeight long nHeight = 0; const SwFormatFrameSize& rLSz = pLineFormat->GetFrameSize(); - if ( ATT_VAR_SIZE != rLSz.GetHeightSizeType() && rLSz.GetHeight() ) + if ( SwFrameSize::Variable != rLSz.GetHeightSizeType() && rLSz.GetHeight() ) { - if ( ATT_MIN_SIZE == rLSz.GetHeightSizeType() ) + if ( SwFrameSize::Minimum == rLSz.GetHeightSizeType() ) nHeight = rLSz.GetHeight(); else nHeight = -rLSz.GetHeight(); diff --git a/sw/source/filter/ww8/ww8atr.cxx b/sw/source/filter/ww8/ww8atr.cxx index 7c7ea52981ac..d7d30eb99773 100644 --- a/sw/source/filter/ww8/ww8atr.cxx +++ b/sw/source/filter/ww8/ww8atr.cxx @@ -3671,7 +3671,7 @@ void WW8AttributeOutput::FormatFrameSize( const SwFormatFrameSize& rSize ) return; // Fly around graphic -> Auto-size //???? What about percentages ??? - if ( rSize.GetWidth() && rSize.GetWidthSizeType() == ATT_FIX_SIZE) + if ( rSize.GetWidth() && rSize.GetWidthSizeType() == SwFrameSize::Fixed) { //"sprmPDxaWidth" m_rWW8Export.InsUInt16( NS_sprm::sprmPDxaWidth ); @@ -3686,8 +3686,8 @@ void WW8AttributeOutput::FormatFrameSize( const SwFormatFrameSize& rSize ) sal_uInt16 nH = 0; switch ( rSize.GetHeightSizeType() ) { - case ATT_VAR_SIZE: break; - case ATT_FIX_SIZE: nH = static_cast<sal_uInt16>(rSize.GetHeight()) & 0x7fff; break; + case SwFrameSize::Variable: break; + case SwFrameSize::Fixed: nH = static_cast<sal_uInt16>(rSize.GetHeight()) & 0x7fff; break; default: nH = static_cast<sal_uInt16>(rSize.GetHeight()) | 0x8000; break; } m_rWW8Export.InsUInt16( nH ); diff --git a/sw/source/filter/ww8/ww8graf.cxx b/sw/source/filter/ww8/ww8graf.cxx index 4f46c66e1fed..bacc90a07ecd 100644 --- a/sw/source/filter/ww8/ww8graf.cxx +++ b/sw/source/filter/ww8/ww8graf.cxx @@ -1782,7 +1782,7 @@ void SwWW8ImplReader::MatchSdrItemsIntoFlySet( SdrObject const * pSdrObj, const tools::Rectangle& rSnapRect = pSdrObj->GetSnapRect(); // if necessary adapt width and position of the framework: The // recorded interior is to remain equally large despite thick edges. - rFlySet.Put( SwFormatFrameSize(bFixSize ? ATT_FIX_SIZE : ATT_VAR_SIZE, + rFlySet.Put( SwFormatFrameSize(bFixSize ? SwFrameSize::Fixed : SwFrameSize::Variable, rSnapRect.GetWidth() + 2*nOutside, rSnapRect.GetHeight() + 2*nOutside) ); } @@ -1790,7 +1790,7 @@ void SwWW8ImplReader::MatchSdrItemsIntoFlySet( SdrObject const * pSdrObj, { SwFormatFrameSize aSize = rFlySet.Get(RES_FRM_SIZE); - SwFormatFrameSize aNewSize(bFixSize ? ATT_FIX_SIZE : ATT_VAR_SIZE, + SwFormatFrameSize aNewSize(bFixSize ? SwFrameSize::Fixed : SwFrameSize::Variable, aSize.GetWidth() + 2*nOutside, aSize.GetHeight() + 2*nOutside); aNewSize.SetWidthSizeType(aSize.GetWidthSizeType()); @@ -2980,8 +2980,8 @@ SwFlyFrameFormat* SwWW8ImplReader::ConvertDrawTextToFly(SdrObject* &rpObject, tools::Rectangle aInnerDist(pRecord->nDxTextLeft, pRecord->nDyTextTop, pRecord->nDxTextRight, pRecord->nDyTextBottom); - SwFormatFrameSize aFrameSize(ATT_FIX_SIZE, pF->nXaRight - pF->nXaLeft, pF->nYaBottom - pF->nYaTop); - aFrameSize.SetWidthSizeType(pRecord->bAutoWidth ? ATT_VAR_SIZE : ATT_FIX_SIZE); + SwFormatFrameSize aFrameSize(SwFrameSize::Fixed, pF->nXaRight - pF->nXaLeft, pF->nYaBottom - pF->nYaTop); + aFrameSize.SetWidthSizeType(pRecord->bAutoWidth ? SwFrameSize::Variable : SwFrameSize::Fixed); rFlySet.Put(aFrameSize); MatchSdrItemsIntoFlySet( rpObject, rFlySet, pRecord->eLineStyle, @@ -3096,7 +3096,7 @@ SwFlyFrameFormat* SwWW8ImplReader::ImportReplaceableDrawables( SdrObject* &rpObj ProcessEscherAlign(pRecord, pF, rFlySet); - rFlySet.Put(SwFormatFrameSize(ATT_FIX_SIZE, nWidthTw, nHeightTw)); + rFlySet.Put(SwFormatFrameSize(SwFrameSize::Fixed, nWidthTw, nHeightTw)); SfxItemSet aGrSet(m_rDoc.GetAttrPool(), svl::Items<RES_GRFATR_BEGIN, RES_GRFATR_END-1>{}); diff --git a/sw/source/filter/ww8/ww8graf2.cxx b/sw/source/filter/ww8/ww8graf2.cxx index e0a723aa4f64..809d587eefda 100644 --- a/sw/source/filter/ww8/ww8graf2.cxx +++ b/sw/source/filter/ww8/ww8graf2.cxx @@ -357,7 +357,7 @@ SwFlyFrameFormat* SwWW8ImplReader::MakeGrafNotInContent(const WW8PicDesc& rPD, aAnchor.SetAnchor(m_pPaM->GetPoint()); aFlySet.Put(aAnchor); - aFlySet.Put( SwFormatFrameSize( ATT_FIX_SIZE, nWidth, nHeight ) ); + aFlySet.Put( SwFormatFrameSize( SwFrameSize::Fixed, nWidth, nHeight ) ); SwFlyFrameFormat *const pFlyFormat = m_rDoc.getIDocumentContentOperations().InsertGraphic( @@ -609,7 +609,7 @@ SwFrameFormat* SwWW8ImplReader::ImportGraf(SdrTextObj const * pTextObj, // Set the size from the WinWord PIC-structure as graphic // size - aAttrSet.Put( SwFormatFrameSize( ATT_FIX_SIZE, aPD.nWidth, + aAttrSet.Put( SwFormatFrameSize( SwFrameSize::Fixed, aPD.nWidth, aPD.nHeight ) ); } diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx index b1cf6ac76796..2af0bee27c66 100644 --- a/sw/source/filter/ww8/ww8par.cxx +++ b/sw/source/filter/ww8/ww8par.cxx @@ -2211,8 +2211,8 @@ void SwWW8ImplReader::Read_HdFtTextAsHackedFrame(WW8_CP nStart, WW8_CP nLen, SwFormatAnchor aAnch( pFrame->GetAnchor() ); aAnch.SetType( RndStdIds::FLY_AT_PARA ); pFrame->SetFormatAttr( aAnch ); - SwFormatFrameSize aSz(ATT_MIN_SIZE, nPageWidth, MINLAY); - SwFrameSize eFrameSize = ATT_MIN_SIZE; + SwFormatFrameSize aSz(SwFrameSize::Minimum, nPageWidth, MINLAY); + SwFrameSize eFrameSize = SwFrameSize::Minimum; if( eFrameSize != aSz.GetWidthSizeType() ) aSz.SetWidthSizeType( eFrameSize ); pFrame->SetFormatAttr(aSz); diff --git a/sw/source/filter/ww8/ww8par2.cxx b/sw/source/filter/ww8/ww8par2.cxx index 9bedca2caee7..505a372d27b6 100644 --- a/sw/source/filter/ww8/ww8par2.cxx +++ b/sw/source/filter/ww8/ww8par2.cxx @@ -2369,7 +2369,7 @@ void WW8TabDesc::SetSizePosition(SwFrameFormat* pFrameFormat) if (pFrameFormat) { SwFormatFrameSize aSize = pFrameFormat->GetFrameSize(); - aSize.SetHeightSizeType(ATT_MIN_SIZE); + aSize.SetHeightSizeType(SwFrameSize::Minimum); aSize.SetHeight(MINLAY); pFrameFormat->SetFormatAttr(aSize); m_pTable->GetFrameFormat()->SetFormatAttr(SwFormatHoriOrient(0,text::HoriOrientation::FULL)); @@ -2477,7 +2477,7 @@ void WW8TabDesc::CreateSwTable() // total width of table if( m_nMaxRight - m_nMinLeft > MINLAY * m_nDefaultSwCols ) { - SwFormatFrameSize aFrameSize(ATT_FIX_SIZE, m_nSwWidth); + SwFormatFrameSize aFrameSize(SwFrameSize::Fixed, m_nSwWidth); // Don't set relative width if the table has been converted into a floating frame if ( m_nPercentWidth && (!m_pIo->m_xSFlyPara || !m_pIo->m_xSFlyPara->pFlyFormat) ) aFrameSize.SetWidthPercent(m_nPercentWidth); @@ -2774,7 +2774,7 @@ void WW8TabDesc::FinishSwTable() if((1 < groupIt->size()) && groupIt->row(0)[0]) { SwFrameFormat* pNewFormat = groupIt->row(0)[0]->ClaimFrameFormat(); - pNewFormat->SetFormatAttr(SwFormatFrameSize(ATT_VAR_SIZE, groupIt->nGroupWidth, 0)); + pNewFormat->SetFormatAttr(SwFormatFrameSize(SwFrameSize::Variable, groupIt->nGroupWidth, 0)); const sal_uInt16 nRowSpan = groupIt->rowsCount(); for (sal_uInt16 n = 0; n < nRowSpan; ++n) { @@ -2792,7 +2792,7 @@ void WW8TabDesc::FinishSwTable() else { SwFrameFormat* pFormat = pCurrentBox->ClaimFrameFormat(); - pFormat->SetFormatAttr(SwFormatFrameSize(ATT_VAR_SIZE, 0, 0)); + pFormat->SetFormatAttr(SwFormatFrameSize(SwFrameSize::Variable, 0, 0)); } } } @@ -3159,15 +3159,15 @@ void WW8TabDesc::AdjustNewBand() if( m_bClaimLineFormat ) { m_pTabLine->ClaimFrameFormat(); // necessary because of cell height - SwFormatFrameSize aF( ATT_MIN_SIZE, 0, 0 ); // default + SwFormatFrameSize aF( SwFrameSize::Minimum, 0, 0 ); // default if (m_pActBand->nLineHeight == 0) // 0 = Auto - aF.SetHeightSizeType( ATT_VAR_SIZE ); + aF.SetHeightSizeType( SwFrameSize::Variable ); else { if (m_pActBand->nLineHeight < 0) // positive = min, negative = exact { - aF.SetHeightSizeType(ATT_FIX_SIZE); + aF.SetHeightSizeType(SwFrameSize::Fixed); m_pActBand->nLineHeight = -m_pActBand->nLineHeight; } if (m_pActBand->nLineHeight < MINLAY) // invalid cell height @@ -3190,7 +3190,7 @@ void WW8TabDesc::AdjustNewBand() short i; // SW-Index short j; // WW-Index short nW; // Width - SwFormatFrameSize aFS( ATT_FIX_SIZE ); + SwFormatFrameSize aFS( SwFrameSize::Fixed ); j = m_pActBand->bLEmptyCol ? -1 : 0; for( i = 0; i < m_pActBand->nSwCols; i++ ) diff --git a/sw/source/filter/ww8/ww8par4.cxx b/sw/source/filter/ww8/ww8par4.cxx index ceaed401a577..581153ae3673 100644 --- a/sw/source/filter/ww8/ww8par4.cxx +++ b/sw/source/filter/ww8/ww8par4.cxx @@ -277,7 +277,7 @@ SwFrameFormat* SwWW8ImplReader::ImportOle(const Graphic* pGrf, const Size aSizeTwip = OutputDevice::LogicToLogic( aGraph.GetPrefSize(), aGraph.GetPrefMapMode(), MapMode(MapUnit::MapTwip)); - pTempSet->Put( SwFormatFrameSize( ATT_FIX_SIZE, aSizeTwip.Width(), + pTempSet->Put( SwFormatFrameSize( SwFrameSize::Fixed, aSizeTwip.Width(), aSizeTwip.Height() ) ); pTempSet->Put( SwFormatVertOrient( 0, text::VertOrientation::TOP, text::RelOrientation::FRAME )); diff --git a/sw/source/filter/ww8/ww8par6.cxx b/sw/source/filter/ww8/ww8par6.cxx index 67ed6c321c21..912b099ed233 100644 --- a/sw/source/filter/ww8/ww8par6.cxx +++ b/sw/source/filter/ww8/ww8par6.cxx @@ -647,7 +647,7 @@ void wwSectionManager::SetPageULSpaceItems(SwFrameFormat &rFormat, SvxULSpaceItem aHdUL(pHdFormat->GetULSpace()); if (!rSection.IsFixedHeightHeader()) //normal { - pHdFormat->SetFormatAttr(SwFormatFrameSize(ATT_MIN_SIZE, 0, rData.nSwHLo)); + pHdFormat->SetFormatAttr(SwFormatFrameSize(SwFrameSize::Minimum, 0, rData.nSwHLo)); // #i19922# - minimum page header height is now 1mm // use new constant <cMinHdFtHeight> aHdUL.SetLower( writer_cast<sal_uInt16>(rData.nSwHLo - cMinHdFtHeight) ); @@ -658,7 +658,7 @@ void wwSectionManager::SetPageULSpaceItems(SwFrameFormat &rFormat, { // #i48832# - set correct spacing between header and body. const sal_Int32 nHdLowerSpace( std::abs(rSection.maSep.dyaTop) - rData.nSwUp - rData.nSwHLo ); - pHdFormat->SetFormatAttr(SwFormatFrameSize(ATT_FIX_SIZE, 0, rData.nSwHLo + nHdLowerSpace)); + pHdFormat->SetFormatAttr(SwFormatFrameSize(SwFrameSize::Fixed, 0, rData.nSwHLo + nHdLowerSpace)); aHdUL.SetLower( static_cast< sal_uInt16 >(nHdLowerSpace) ); pHdFormat->SetFormatAttr(SwHeaderAndFooterEatSpacingItem( RES_HEADER_FOOTER_EAT_SPACING, false)); @@ -674,7 +674,7 @@ void wwSectionManager::SetPageULSpaceItems(SwFrameFormat &rFormat, SvxULSpaceItem aFtUL(pFtFormat->GetULSpace()); if (!rSection.IsFixedHeightFooter()) //normal { - pFtFormat->SetFormatAttr(SwFormatFrameSize(ATT_MIN_SIZE, 0, rData.nSwFUp)); + pFtFormat->SetFormatAttr(SwFormatFrameSize(SwFrameSize::Minimum, 0, rData.nSwFUp)); // #i19922# - minimum page header height is now 1mm // use new constant <cMinHdFtHeight> aFtUL.SetUpper( writer_cast<sal_uInt16>(rData.nSwFUp - cMinHdFtHeight) ); @@ -685,7 +685,7 @@ void wwSectionManager::SetPageULSpaceItems(SwFrameFormat &rFormat, { // #i48832# - set correct spacing between footer and body. const SwTwips nFtUpperSpace( std::abs(rSection.maSep.dyaBottom) - rData.nSwLo - rData.nSwFUp ); - pFtFormat->SetFormatAttr(SwFormatFrameSize(ATT_FIX_SIZE, 0, rData.nSwFUp + nFtUpperSpace)); + pFtFormat->SetFormatAttr(SwFormatFrameSize(SwFrameSize::Fixed, 0, rData.nSwFUp + nFtUpperSpace)); aFtUL.SetUpper( static_cast< sal_uInt16 >(nFtUpperSpace) ); pFtFormat->SetFormatAttr(SwHeaderAndFooterEatSpacingItem( RES_HEADER_FOOTER_EAT_SPACING, false)); @@ -1875,7 +1875,7 @@ nLoMgn(rWW.nLoMgn), nWidth(rWW.nSp28), nHeight(rWW.nSp45), nNetWidth(rWW.nSp28), -eHeightFix(ATT_FIX_SIZE), +eHeightFix(SwFrameSize::Fixed), eHRel(text::RelOrientation::PAGE_FRAME), eVRel(text::RelOrientation::FRAME), eVAlign(text::VertOrientation::NONE), @@ -1902,12 +1902,12 @@ bToggelPos(false) if( nHeight & 0x8000 ) { nHeight &= 0x7fff; - eHeightFix = ATT_MIN_SIZE; + eHeightFix = SwFrameSize::Minimum; } if( nHeight <= MINFLY ) { // no data, or bad data - eHeightFix = ATT_MIN_SIZE; + eHeightFix = SwFrameSize::Minimum; nHeight = MINFLY; } @@ -2205,7 +2205,7 @@ WW8FlySet::WW8FlySet( SwWW8ImplReader& rReader, const SwPaM* pPaM, aSizeArray[WW8_BOT]*=2; } - Put( SwFormatFrameSize( ATT_FIX_SIZE, nWidth+aSizeArray[WW8_LEFT]+ + Put( SwFormatFrameSize( SwFrameSize::Fixed, nWidth+aSizeArray[WW8_LEFT]+ aSizeArray[WW8_RIGHT], nHeight+aSizeArray[WW8_TOP] + aSizeArray[WW8_BOT]) ); } @@ -2338,7 +2338,7 @@ SwTwips SwWW8ImplReader::MoveOutsideFly(SwFrameFormat *pFlyFormat, if (pTableFormat) { SwFormatFrameSize aSize = pTableFormat->GetFrameSize(); - aSize.SetHeightSizeType(ATT_MIN_SIZE); + aSize.SetHeightSizeType(SwFrameSize::Minimum); aSize.SetHeight(MINLAY); pFlyFormat->SetFormatAttr(aSize); SwFormatHoriOrient aHori = pTableFormat->GetHoriOrient(); @@ -2703,7 +2703,7 @@ void SwWW8ImplReader::StopApo() nNewWidth = ItemGet<SwFormatFrameSize>(aFlySet, RES_FRM_SIZE).GetWidth(); aSize.SetWidth(nNewWidth); - aSize.SetWidthSizeType(ATT_VAR_SIZE); + aSize.SetWidthSizeType(SwFrameSize::Variable); m_xSFlyPara->pFlyFormat->SetFormatAttr(aSize); } diff --git a/sw/source/filter/xml/xmlexpit.cxx b/sw/source/filter/xml/xmlexpit.cxx index bab3f526a9a4..0017ea7e0076 100644 --- a/sw/source/filter/xml/xmlexpit.cxx +++ b/sw/source/filter/xml/xmlexpit.cxx @@ -1055,11 +1055,11 @@ bool SvXMLExportItemMapper::QueryXMLValue( } break; case MID_FRMSIZE_MIN_HEIGHT: - if( ATT_MIN_SIZE == rFrameSize.GetHeightSizeType() ) + if( SwFrameSize::Minimum == rFrameSize.GetHeightSizeType() ) bOutHeight = true; break; case MID_FRMSIZE_FIX_HEIGHT: - if( ATT_FIX_SIZE == rFrameSize.GetHeightSizeType() ) + if( SwFrameSize::Fixed == rFrameSize.GetHeightSizeType() ) bOutHeight = true; break; } diff --git a/sw/source/filter/xml/xmlimpit.cxx b/sw/source/filter/xml/xmlimpit.cxx index 4db664b1c84c..c1b550596e8b 100644 --- a/sw/source/filter/xml/xmlimpit.cxx +++ b/sw/source/filter/xml/xmlimpit.cxx @@ -830,7 +830,7 @@ bool SvXMLImportItemMapper::PutXMLValue( bool bSetHeight = false; bool bSetWidth = false; bool bSetSizeType = false; - SwFrameSize eSizeType = ATT_VAR_SIZE; + SwFrameSize eSizeType = SwFrameSize::Variable; sal_Int32 nMin = MINLAY; switch( nMemberId ) @@ -854,19 +854,19 @@ bool SvXMLImportItemMapper::PutXMLValue( bSetWidth = true; break; case MID_FRMSIZE_MIN_HEIGHT: - eSizeType = ATT_MIN_SIZE; + eSizeType = SwFrameSize::Minimum; bSetHeight = true; nMin = 1; bSetSizeType = true; break; case MID_FRMSIZE_FIX_HEIGHT: - eSizeType = ATT_FIX_SIZE; + eSizeType = SwFrameSize::Fixed; bSetHeight = true; nMin = 1; bSetSizeType = true; break; case MID_FRMSIZE_COL_WIDTH: - eSizeType = ATT_FIX_SIZE; + eSizeType = SwFrameSize::Fixed; bSetWidth = true; bSetSizeType = true; break; @@ -882,7 +882,7 @@ bool SvXMLImportItemMapper::PutXMLValue( nValue = SAL_MAX_UINT16; rFrameSize.SetWidth( static_cast<sal_uInt16>(nValue) ); - rFrameSize.SetHeightSizeType( ATT_VAR_SIZE ); + rFrameSize.SetHeightSizeType( SwFrameSize::Variable ); bOk = true; } } diff --git a/sw/source/filter/xml/xmltbli.cxx b/sw/source/filter/xml/xmltbli.cxx index 5873e9a6bf19..044e2e427ad4 100644 --- a/sw/source/filter/xml/xmltbli.cxx +++ b/sw/source/filter/xml/xmltbli.cxx @@ -790,7 +790,7 @@ SwXMLTableColContext_Impl::SwXMLTableColContext_Impl( { const SwFormatFrameSize *pSize = static_cast<const SwFormatFrameSize *>(pItem); nWidth = pSize->GetWidth(); - bRelWidth = ATT_VAR_SIZE == pSize->GetHeightSizeType(); + bRelWidth = SwFrameSize::Variable == pSize->GetHeightSizeType(); } } @@ -1884,7 +1884,7 @@ SwTableBox *SwXMLTableContext::MakeTableBox( SwTableLine *pUpper, pFrameFormat->ResetAllFormatAttr(); // #i73790# - method renamed pFrameFormat->SetFormatAttr( aFillOrder ); - pFrameFormat->SetFormatAttr( SwFormatFrameSize( ATT_VAR_SIZE, nColWidth ) ); + pFrameFormat->SetFormatAttr( SwFormatFrameSize( SwFrameSize::Variable, nColWidth ) ); SwTableLines& rLines = pBox->GetTabLines(); bool bSplitted = false; @@ -2132,7 +2132,7 @@ SwTableBox *SwXMLTableContext::MakeTableBox( if (! bModifyLocked) pBoxFormat2->UnlockModify(); - pBoxFormat2->SetFormatAttr( SwFormatFrameSize( ATT_VAR_SIZE, nColWidth ) ); + pBoxFormat2->SetFormatAttr( SwFormatFrameSize( SwFrameSize::Variable, nColWidth ) ); return pBox; } @@ -2750,7 +2750,7 @@ void SwXMLTableContext::MakeTable() // This must be after the call to MakeTable_, because nWidth might be // changed there. pFrameFormat->LockModify(); - SwFormatFrameSize aSize( ATT_VAR_SIZE, m_nWidth ); + SwFormatFrameSize aSize( SwFrameSize::Variable, m_nWidth ); aSize.SetWidthPercent( nPrcWidth ); pFrameFormat->SetFormatAttr( aSize ); pFrameFormat->UnlockModify(); diff --git a/sw/source/filter/xml/xmltexti.cxx b/sw/source/filter/xml/xmltexti.cxx index dac99fc9c7ac..383ab6f256ad 100644 --- a/sw/source/filter/xml/xmltexti.cxx +++ b/sw/source/filter/xml/xmltexti.cxx @@ -110,7 +110,7 @@ static void lcl_putHeightAndWidth ( SfxItemSet &rItemSet, nHeight = convertMm100ToTwip( nHeight ); if( nHeight < MINFLY ) nHeight = MINFLY; - rItemSet.Put( SwFormatFrameSize( ATT_FIX_SIZE, nWidth, nHeight ) ); + rItemSet.Put( SwFormatFrameSize( SwFrameSize::Fixed, nWidth, nHeight ) ); } SwFormatAnchor aAnchor( RndStdIds::FLY_AT_CHAR ); |