Kaydet (Commit) 9decbd59 authored tarafından Noel Grandin's avatar Noel Grandin

convert SwTableAutoFormat::UpdateFlags to scoped enum

and remove unused UPDATE_ALL

Change-Id: Ib8f21dcddec66947fff8e9cda63f10711da02883
Reviewed-on: https://gerrit.libreoffice.org/63748Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
Tested-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst 507dc611
......@@ -464,8 +464,6 @@ sw/inc/poolfmt.hxx:233
enum RES_POOL_TABSTYLE_TYPE RES_POOLTABLESTYLE_LO6_SIMPLE_GRID_ROWS
sw/inc/poolfmt.hxx:234
enum RES_POOL_TABSTYLE_TYPE RES_POOLTABLESTYLE_LO6_SIMPLE_LIST_SHADED
sw/inc/tblafmt.hxx:286
enum SwTableAutoFormat::UpdateFlags UPDATE_ALL
sw/source/filter/ww8/ww8scan.hxx:388
enum ePLCFT SEP
sw/source/filter/ww8/ww8struc.hxx:944
......
......@@ -189,6 +189,11 @@ public:
void SaveVersionNo( SvStream& rStream, sal_uInt16 fileVersion ) const;
};
enum class SwTableAutoFormatUpdateFlags { Char = 1, Box = 2 };
namespace o3tl {
template<> struct typed_flags<SwTableAutoFormatUpdateFlags> : is_typed_flags<SwTableAutoFormatUpdateFlags, 0x03> {};
};
/*
@remarks
A table has a number of lines. These lines seem to correspond with rows, except in the case of
......@@ -283,10 +288,9 @@ public:
void SetName( const OUString& rNew ) { m_aName = rNew; nStrResId = USHRT_MAX; }
const OUString& GetName() const { return m_aName; }
enum UpdateFlags { UPDATE_CHAR = 1, UPDATE_BOX = 2, UPDATE_ALL = 3 };
void UpdateFromSet( sal_uInt8 nPos, const SfxItemSet& rSet,
UpdateFlags eFlags, SvNumberFormatter const * );
void UpdateToSet( sal_uInt8 nPos, SfxItemSet& rSet, UpdateFlags eFlags,
SwTableAutoFormatUpdateFlags eFlags, SvNumberFormatter const * );
void UpdateToSet( sal_uInt8 nPos, SfxItemSet& rSet, SwTableAutoFormatUpdateFlags eFlags,
SvNumberFormatter* ) const ;
void RestoreTableProperties(SwTable &table) const;
......
......@@ -728,7 +728,7 @@ const SwBoxAutoFormat& SwTableAutoFormat::GetDefaultBoxFormat()
void SwTableAutoFormat::UpdateFromSet( sal_uInt8 nPos,
const SfxItemSet& rSet,
UpdateFlags eFlags,
SwTableAutoFormatUpdateFlags eFlags,
SvNumberFormatter const * pNFormatr)
{
OSL_ENSURE( nPos < 16, "wrong area" );
......@@ -740,7 +740,7 @@ void SwTableAutoFormat::UpdateFromSet( sal_uInt8 nPos,
aBoxAutoFormat[ nPos ] = pFormat;
}
if( UPDATE_CHAR & eFlags )
if( SwTableAutoFormatUpdateFlags::Char & eFlags )
{
pFormat->SetFont( rSet.Get( RES_CHRATR_FONT ) );
pFormat->SetHeight( rSet.Get( RES_CHRATR_FONTSIZE ) );
......@@ -762,7 +762,7 @@ void SwTableAutoFormat::UpdateFromSet( sal_uInt8 nPos,
pFormat->SetColor( rSet.Get( RES_CHRATR_COLOR ) );
pFormat->SetAdjust( rSet.Get( RES_PARATR_ADJUST ) );
}
if( UPDATE_BOX & eFlags )
if( SwTableAutoFormatUpdateFlags::Box & eFlags )
{
pFormat->SetBox( rSet.Get( RES_BOX ) );
// FIXME - add attribute IDs for the diagonal line items
......@@ -792,11 +792,11 @@ void SwTableAutoFormat::UpdateFromSet( sal_uInt8 nPos,
}
void SwTableAutoFormat::UpdateToSet(sal_uInt8 nPos, SfxItemSet& rSet,
UpdateFlags eFlags, SvNumberFormatter* pNFormatr) const
SwTableAutoFormatUpdateFlags eFlags, SvNumberFormatter* pNFormatr) const
{
const SwBoxAutoFormat& rChg = GetBoxFormat( nPos );
if( UPDATE_CHAR & eFlags )
if( SwTableAutoFormatUpdateFlags::Char & eFlags )
{
if( IsFont() )
{
......@@ -851,7 +851,7 @@ void SwTableAutoFormat::UpdateToSet(sal_uInt8 nPos, SfxItemSet& rSet,
rSet.Put( rChg.GetAdjust() );
}
if( UPDATE_BOX & eFlags )
if( SwTableAutoFormatUpdateFlags::Box & eFlags )
{
if( IsFrame() )
{
......
......@@ -171,7 +171,7 @@ lcl_SetDfltBoxAttr(SwTableBox& rBox, DfltBoxAttrList_t & rBoxFormatArr,
if( pAutoFormat )
pAutoFormat->UpdateToSet( nId, const_cast<SfxItemSet&>(static_cast<SfxItemSet const &>(pNewTableBoxFormat->GetAttrSet())),
SwTableAutoFormat::UPDATE_BOX,
SwTableAutoFormatUpdateFlags::Box,
pDoc->GetNumberFormatter() );
else
::lcl_SetDfltBoxAttr( *pNewTableBoxFormat, nId );
......@@ -204,7 +204,7 @@ static SwTableBoxFormat *lcl_CreateAFormatBoxFormat( SwDoc &rDoc, std::vector<Sw
{
SwTableBoxFormat* pBoxFormat = rDoc.MakeTableBoxFormat();
rAutoFormat.UpdateToSet( nId, const_cast<SfxItemSet&>(static_cast<SfxItemSet const &>(pBoxFormat->GetAttrSet())),
SwTableAutoFormat::UPDATE_BOX,
SwTableAutoFormatUpdateFlags::Box,
rDoc.GetNumberFormatter( ) );
if( USHRT_MAX != nCols )
pBoxFormat->SetFormatAttr( SwFormatFrameSize( ATT_VAR_SIZE,
......@@ -503,7 +503,7 @@ const SwTable* SwDoc::InsertTable( const SwInsertTableOptions& rInsTableOpts,
{
aCharSet.ClearItem();
pTAFormat->UpdateToSet( nId, aCharSet,
SwTableAutoFormat::UPDATE_CHAR, nullptr );
SwTableAutoFormatUpdateFlags::Char, nullptr );
if( aCharSet.Count() )
GetNodes()[ aNdIdx.GetIndex()+1 ]->GetContentNode()->
SetAttr( aCharSet );
......@@ -802,7 +802,7 @@ const SwTable* SwDoc::TextToTable( const SwInsertTableOptions& rInsTableOpts,
{
aCharSet.ClearItem();
pTAFormat->UpdateToSet( nId, aCharSet,
SwTableAutoFormat::UPDATE_CHAR, nullptr );
SwTableAutoFormatUpdateFlags::Char, nullptr );
if( aCharSet.Count() )
{
sal_uLong nSttNd = pBox->GetSttIdx()+1;
......@@ -3644,8 +3644,8 @@ static bool lcl_SetAFormatBox(FndBox_ & rBox, SetAFormatTabPara *pSetPara, bool
SfxItemSet aCharSet(pDoc->GetAttrPool(), svl::Items<RES_CHRATR_BEGIN, RES_PARATR_LIST_END-1>{});
SfxItemSet aBoxSet(pDoc->GetAttrPool(), aTableBoxSetRange);
sal_uInt8 nPos = pSetPara->nAFormatLine * 4 + pSetPara->nAFormatBox;
pSetPara->rTableFormat.UpdateToSet(nPos, aCharSet, SwTableAutoFormat::UPDATE_CHAR, nullptr);
pSetPara->rTableFormat.UpdateToSet(nPos, aBoxSet, SwTableAutoFormat::UPDATE_BOX, pDoc->GetNumberFormatter());
pSetPara->rTableFormat.UpdateToSet(nPos, aCharSet, SwTableAutoFormatUpdateFlags::Char, nullptr);
pSetPara->rTableFormat.UpdateToSet(nPos, aBoxSet, SwTableAutoFormatUpdateFlags::Box, pDoc->GetNumberFormatter());
if (aCharSet.Count())
{
......@@ -3834,9 +3834,9 @@ bool SwDoc::GetTableAutoFormat( const SwSelBoxes& rBoxes, SwTableAutoFormat& rGe
if( pCNd )
rGet.UpdateFromSet( nPos, pCNd->GetSwAttrSet(),
SwTableAutoFormat::UPDATE_CHAR, nullptr );
SwTableAutoFormatUpdateFlags::Char, nullptr );
rGet.UpdateFromSet( nPos, pFBox->GetFrameFormat()->GetAttrSet(),
SwTableAutoFormat::UPDATE_BOX,
SwTableAutoFormatUpdateFlags::Box,
GetNumberFormatter() );
}
}
......
......@@ -1482,7 +1482,7 @@ void HTMLTable::FixFrameFormat( SwTableBox *pBox,
pTableFormat->UpdateToSet(nPos,
const_cast<SfxItemSet&>(static_cast<SfxItemSet const&>(
pFrameFormat->GetAttrSet())),
SwTableAutoFormat::UPDATE_BOX,
SwTableAutoFormatUpdateFlags::Box,
pFrameFormat->GetDoc()->GetNumberFormatter());
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment