Kaydet (Commit) 8c85e746 authored tarafından Miklos Vajna's avatar Miklos Vajna

sw: prefix members of SwTableBox

Change-Id: If4c4a043f3d9c2e1e89eb4199d33cd39f502c56e
üst ac630469
...@@ -391,9 +391,9 @@ class SW_DLLPUBLIC SwTableBox: public SwClient //Client of FrameFormat. ...@@ -391,9 +391,9 @@ class SW_DLLPUBLIC SwTableBox: public SwClient //Client of FrameFormat.
SwTableBox( const SwTableBox & ) = delete; SwTableBox( const SwTableBox & ) = delete;
SwTableBox &operator=( const SwTableBox &) = delete; SwTableBox &operator=( const SwTableBox &) = delete;
SwTableLines aLines; SwTableLines m_aLines;
const SwStartNode * pSttNd; const SwStartNode * m_pStartNode;
SwTableLine *pUpper; SwTableLine *m_pUpper;
std::unique_ptr<Color> mpUserColor; std::unique_ptr<Color> mpUserColor;
std::unique_ptr<Color> mpNumFormatColor; std::unique_ptr<Color> mpNumFormatColor;
...@@ -417,12 +417,12 @@ public: ...@@ -417,12 +417,12 @@ public:
SwTableBox( SwTableBoxFormat*, const SwNodeIndex&, SwTableLine *pUp = 0 ); SwTableBox( SwTableBoxFormat*, const SwNodeIndex&, SwTableLine *pUp = 0 );
virtual ~SwTableBox(); virtual ~SwTableBox();
SwTableLines &GetTabLines() { return aLines; } SwTableLines &GetTabLines() { return m_aLines; }
const SwTableLines &GetTabLines() const { return aLines; } const SwTableLines &GetTabLines() const { return m_aLines; }
SwTableLine *GetUpper() { return pUpper; } SwTableLine *GetUpper() { return m_pUpper; }
const SwTableLine *GetUpper() const { return pUpper; } const SwTableLine *GetUpper() const { return m_pUpper; }
void SetUpper( SwTableLine *pNew ) { pUpper = pNew; } void SetUpper( SwTableLine *pNew ) { m_pUpper = pNew; }
SwFrameFormat* GetFrameFormat() { return static_cast<SwFrameFormat*>(GetRegisteredIn()); } SwFrameFormat* GetFrameFormat() { return static_cast<SwFrameFormat*>(GetRegisteredIn()); }
SwFrameFormat* GetFrameFormat() const { return const_cast<SwFrameFormat*>(static_cast<const SwFrameFormat*>(GetRegisteredIn())); } SwFrameFormat* GetFrameFormat() const { return const_cast<SwFrameFormat*>(static_cast<const SwFrameFormat*>(GetRegisteredIn())); }
...@@ -438,7 +438,7 @@ public: ...@@ -438,7 +438,7 @@ public:
void ChgFrameFormat( SwTableBoxFormat *pNewFormat ); void ChgFrameFormat( SwTableBoxFormat *pNewFormat );
void RemoveFromTable(); void RemoveFromTable();
const SwStartNode *GetSttNd() const { return pSttNd; } const SwStartNode *GetSttNd() const { return m_pStartNode; }
sal_uLong GetSttIdx() const; sal_uLong GetSttIdx() const;
// Search next/previous box with content. // Search next/previous box with content.
......
...@@ -81,7 +81,7 @@ double SwTableBox::GetValue( SwTableCalcPara& rCalcPara ) const ...@@ -81,7 +81,7 @@ double SwTableBox::GetValue( SwTableCalcPara& rCalcPara ) const
rCalcPara.rCalc.SetCalcError( CALC_SYNTAX ); // default: error rCalcPara.rCalc.SetCalcError( CALC_SYNTAX ); // default: error
// no content box? // no content box?
if( !pSttNd ) if( !m_pStartNode )
return nRet; return nRet;
if( rCalcPara.IncStackCnt() ) if( rCalcPara.IncStackCnt() )
...@@ -138,7 +138,7 @@ double SwTableBox::GetValue( SwTableCalcPara& rCalcPara ) const ...@@ -138,7 +138,7 @@ double SwTableBox::GetValue( SwTableCalcPara& rCalcPara ) const
break; break;
} }
SwTextNode* pTextNd = pDoc->GetNodes()[ pSttNd->GetIndex() + 1 ]->GetTextNode(); SwTextNode* pTextNd = pDoc->GetNodes()[ m_pStartNode->GetIndex() + 1 ]->GetTextNode();
if( !pTextNd ) if( !pTextNd )
break; break;
......
...@@ -240,7 +240,7 @@ void DelBoxNode( SwTableSortBoxes& rSortCntBoxes ) ...@@ -240,7 +240,7 @@ void DelBoxNode( SwTableSortBoxes& rSortCntBoxes )
{ {
for (size_t n = 0; n < rSortCntBoxes.size(); ++n) for (size_t n = 0; n < rSortCntBoxes.size(); ++n)
{ {
rSortCntBoxes[ n ]->pSttNd = 0; rSortCntBoxes[ n ]->m_pStartNode = 0;
} }
} }
...@@ -1612,8 +1612,8 @@ SwTwips SwTableLine::GetTableLineHeight( bool& bLayoutAvailable ) const ...@@ -1612,8 +1612,8 @@ SwTwips SwTableLine::GetTableLineHeight( bool& bLayoutAvailable ) const
} }
SwTableBox::SwTableBox() SwTableBox::SwTableBox()
: pSttNd(0) : m_pStartNode(0)
, pUpper(0) , m_pUpper(0)
, mnRowSpan(1) , mnRowSpan(1)
, mbDummyFlag(false) , mbDummyFlag(false)
, mbDirectFormatting(false) , mbDirectFormatting(false)
...@@ -1622,32 +1622,32 @@ SwTableBox::SwTableBox() ...@@ -1622,32 +1622,32 @@ SwTableBox::SwTableBox()
SwTableBox::SwTableBox( SwTableBoxFormat* pFormat, sal_uInt16 nLines, SwTableLine *pUp ) SwTableBox::SwTableBox( SwTableBoxFormat* pFormat, sal_uInt16 nLines, SwTableLine *pUp )
: SwClient(0) : SwClient(0)
, aLines() , m_aLines()
, pSttNd(0) , m_pStartNode(0)
, pUpper(pUp) , m_pUpper(pUp)
, mnRowSpan(1) , mnRowSpan(1)
, mbDummyFlag(false) , mbDummyFlag(false)
, mbDirectFormatting(false) , mbDirectFormatting(false)
{ {
aLines.reserve( nLines ); m_aLines.reserve( nLines );
CheckBoxFormat( pFormat )->Add( this ); CheckBoxFormat( pFormat )->Add( this );
} }
SwTableBox::SwTableBox( SwTableBoxFormat* pFormat, const SwNodeIndex &rIdx, SwTableBox::SwTableBox( SwTableBoxFormat* pFormat, const SwNodeIndex &rIdx,
SwTableLine *pUp ) SwTableLine *pUp )
: SwClient(0) : SwClient(0)
, aLines() , m_aLines()
, pUpper(pUp) , m_pUpper(pUp)
, mnRowSpan(1) , mnRowSpan(1)
, mbDummyFlag(false) , mbDummyFlag(false)
, mbDirectFormatting(false) , mbDirectFormatting(false)
{ {
CheckBoxFormat( pFormat )->Add( this ); CheckBoxFormat( pFormat )->Add( this );
pSttNd = rIdx.GetNode().GetStartNode(); m_pStartNode = rIdx.GetNode().GetStartNode();
// insert into the table // insert into the table
const SwTableNode* pTableNd = pSttNd->FindTableNode(); const SwTableNode* pTableNd = m_pStartNode->FindTableNode();
OSL_ENSURE( pTableNd, "In which table is that box?" ); OSL_ENSURE( pTableNd, "In which table is that box?" );
SwTableSortBoxes& rSrtArr = (SwTableSortBoxes&)pTableNd->GetTable(). SwTableSortBoxes& rSrtArr = (SwTableSortBoxes&)pTableNd->GetTable().
GetTabSortBoxes(); GetTabSortBoxes();
...@@ -1657,9 +1657,9 @@ SwTableBox::SwTableBox( SwTableBoxFormat* pFormat, const SwNodeIndex &rIdx, ...@@ -1657,9 +1657,9 @@ SwTableBox::SwTableBox( SwTableBoxFormat* pFormat, const SwNodeIndex &rIdx,
SwTableBox::SwTableBox( SwTableBoxFormat* pFormat, const SwStartNode& rSttNd, SwTableLine *pUp ) SwTableBox::SwTableBox( SwTableBoxFormat* pFormat, const SwStartNode& rSttNd, SwTableLine *pUp )
: SwClient(0) : SwClient(0)
, aLines() , m_aLines()
, pSttNd(&rSttNd) , m_pStartNode(&rSttNd)
, pUpper(pUp) , m_pUpper(pUp)
, mnRowSpan(1) , mnRowSpan(1)
, mbDummyFlag(false) , mbDummyFlag(false)
, mbDirectFormatting(false) , mbDirectFormatting(false)
...@@ -1667,7 +1667,7 @@ SwTableBox::SwTableBox( SwTableBoxFormat* pFormat, const SwStartNode& rSttNd, Sw ...@@ -1667,7 +1667,7 @@ SwTableBox::SwTableBox( SwTableBoxFormat* pFormat, const SwStartNode& rSttNd, Sw
CheckBoxFormat( pFormat )->Add( this ); CheckBoxFormat( pFormat )->Add( this );
// insert into the table // insert into the table
const SwTableNode* pTableNd = pSttNd->FindTableNode(); const SwTableNode* pTableNd = m_pStartNode->FindTableNode();
OSL_ENSURE( pTableNd, "In which table is the box?" ); OSL_ENSURE( pTableNd, "In which table is the box?" );
SwTableSortBoxes& rSrtArr = (SwTableSortBoxes&)pTableNd->GetTable(). SwTableSortBoxes& rSrtArr = (SwTableSortBoxes&)pTableNd->GetTable().
GetTabSortBoxes(); GetTabSortBoxes();
...@@ -1677,16 +1677,16 @@ SwTableBox::SwTableBox( SwTableBoxFormat* pFormat, const SwStartNode& rSttNd, Sw ...@@ -1677,16 +1677,16 @@ SwTableBox::SwTableBox( SwTableBoxFormat* pFormat, const SwStartNode& rSttNd, Sw
void SwTableBox::RemoveFromTable() void SwTableBox::RemoveFromTable()
{ {
if (pSttNd) // box containing contents? if (m_pStartNode) // box containing contents?
{ {
// remove from table // remove from table
const SwTableNode* pTableNd = pSttNd->FindTableNode(); const SwTableNode* pTableNd = m_pStartNode->FindTableNode();
assert(pTableNd && "In which table is that box?"); assert(pTableNd && "In which table is that box?");
SwTableSortBoxes& rSrtArr = (SwTableSortBoxes&)pTableNd->GetTable(). SwTableSortBoxes& rSrtArr = (SwTableSortBoxes&)pTableNd->GetTable().
GetTabSortBoxes(); GetTabSortBoxes();
SwTableBox *p = this; // error: &this SwTableBox *p = this; // error: &this
rSrtArr.erase( p ); // remove rSrtArr.erase( p ); // remove
pSttNd = 0; // clear it so this is only run once m_pStartNode = 0; // clear it so this is only run once
} }
} }
...@@ -1824,13 +1824,13 @@ void sw_GetTableBoxColStr( sal_uInt16 nCol, OUString& rNm ) ...@@ -1824,13 +1824,13 @@ void sw_GetTableBoxColStr( sal_uInt16 nCol, OUString& rNm )
Point SwTableBox::GetCoordinates() const Point SwTableBox::GetCoordinates() const
{ {
if( !pSttNd ) // box without content? if( !m_pStartNode ) // box without content?
{ {
// search for the next first box? // search for the next first box?
return Point( 0, 0 ); return Point( 0, 0 );
} }
const SwTable& rTable = pSttNd->FindTableNode()->GetTable(); const SwTable& rTable = m_pStartNode->FindTableNode()->GetTable();
sal_uInt16 nX, nY; sal_uInt16 nX, nY;
const SwTableBox* pBox = this; const SwTableBox* pBox = this;
do { do {
...@@ -1849,13 +1849,13 @@ Point SwTableBox::GetCoordinates() const ...@@ -1849,13 +1849,13 @@ Point SwTableBox::GetCoordinates() const
OUString SwTableBox::GetName() const OUString SwTableBox::GetName() const
{ {
if( !pSttNd ) // box without content? if( !m_pStartNode ) // box without content?
{ {
// search for the next first box? // search for the next first box?
return OUString(); return OUString();
} }
const SwTable& rTable = pSttNd->FindTableNode()->GetTable(); const SwTable& rTable = m_pStartNode->FindTableNode()->GetTable();
sal_uInt16 nPos; sal_uInt16 nPos;
OUString sNm, sTmp; OUString sNm, sTmp;
const SwTableBox* pBox = this; const SwTableBox* pBox = this;
...@@ -1888,7 +1888,7 @@ bool SwTableBox::IsInHeadline( const SwTable* pTable ) const ...@@ -1888,7 +1888,7 @@ bool SwTableBox::IsInHeadline( const SwTable* pTable ) const
return false; return false;
if( !pTable ) if( !pTable )
pTable = &pSttNd->FindTableNode()->GetTable(); pTable = &m_pStartNode->FindTableNode()->GetTable();
const SwTableLine* pLine = GetUpper(); const SwTableLine* pLine = GetUpper();
while( pLine->GetUpper() ) while( pLine->GetUpper() )
...@@ -1900,7 +1900,7 @@ bool SwTableBox::IsInHeadline( const SwTable* pTable ) const ...@@ -1900,7 +1900,7 @@ bool SwTableBox::IsInHeadline( const SwTable* pTable ) const
sal_uLong SwTableBox::GetSttIdx() const sal_uLong SwTableBox::GetSttIdx() const
{ {
return pSttNd ? pSttNd->GetIndex() : 0; return m_pStartNode ? m_pStartNode->GetIndex() : 0;
} }
// retrieve information from the client // retrieve information from the client
...@@ -2381,7 +2381,7 @@ bool SwTableBox::HasNumContent( double& rNum, sal_uInt32& rFormatIndex, ...@@ -2381,7 +2381,7 @@ bool SwTableBox::HasNumContent( double& rNum, sal_uInt32& rFormatIndex,
sal_uLong nNdPos = IsValidNumTextNd(); sal_uLong nNdPos = IsValidNumTextNd();
if( ULONG_MAX != nNdPos ) if( ULONG_MAX != nNdPos )
{ {
OUString aText( pSttNd->GetNodes()[ nNdPos ]->GetTextNode()->GetRedlineText() ); OUString aText( m_pStartNode->GetNodes()[ nNdPos ]->GetTextNode()->GetRedlineText() );
// Keep Tabs // Keep Tabs
lcl_TabToBlankAtSttEnd( aText ); lcl_TabToBlankAtSttEnd( aText );
rIsEmptyTextNd = aText.isEmpty(); rIsEmptyTextNd = aText.isEmpty();
...@@ -2429,7 +2429,7 @@ bool SwTableBox::IsNumberChanged() const ...@@ -2429,7 +2429,7 @@ bool SwTableBox::IsNumberChanged() const
sal_uLong nNdPos; sal_uLong nNdPos;
if( pNumFormat && pValue && ULONG_MAX != ( nNdPos = IsValidNumTextNd() ) ) if( pNumFormat && pValue && ULONG_MAX != ( nNdPos = IsValidNumTextNd() ) )
{ {
OUString sNewText, sOldText( pSttNd->GetNodes()[ nNdPos ]-> OUString sNewText, sOldText( m_pStartNode->GetNodes()[ nNdPos ]->
GetTextNode()->GetRedlineText() ); GetTextNode()->GetRedlineText() );
lcl_DelTabsAtSttEnd( sOldText ); lcl_DelTabsAtSttEnd( sOldText );
...@@ -2449,15 +2449,15 @@ bool SwTableBox::IsNumberChanged() const ...@@ -2449,15 +2449,15 @@ bool SwTableBox::IsNumberChanged() const
sal_uLong SwTableBox::IsValidNumTextNd( bool bCheckAttr ) const sal_uLong SwTableBox::IsValidNumTextNd( bool bCheckAttr ) const
{ {
sal_uLong nPos = ULONG_MAX; sal_uLong nPos = ULONG_MAX;
if( pSttNd ) if( m_pStartNode )
{ {
SwNodeIndex aIdx( *pSttNd ); SwNodeIndex aIdx( *m_pStartNode );
sal_uLong nIndex = aIdx.GetIndex(); sal_uLong nIndex = aIdx.GetIndex();
const sal_uLong nIndexEnd = pSttNd->GetNodes()[ nIndex ]->EndOfSectionIndex(); const sal_uLong nIndexEnd = m_pStartNode->GetNodes()[ nIndex ]->EndOfSectionIndex();
const SwTextNode *pTextNode = 0; const SwTextNode *pTextNode = 0;
while( ++nIndex < nIndexEnd ) while( ++nIndex < nIndexEnd )
{ {
const SwNode* pNode = pSttNd->GetNodes()[nIndex]; const SwNode* pNode = m_pStartNode->GetNodes()[nIndex];
if( pNode->IsTableNode() ) if( pNode->IsTableNode() )
{ {
pTextNode = 0; pTextNode = 0;
...@@ -2535,8 +2535,8 @@ sal_uInt16 SwTableBox::IsFormulaOrValueBox() const ...@@ -2535,8 +2535,8 @@ sal_uInt16 SwTableBox::IsFormulaOrValueBox() const
!pFormat->GetDoc()->GetNumberFormatter()->IsTextFormat( !pFormat->GetDoc()->GetNumberFormatter()->IsTextFormat(
pFormat->GetTableBoxNumFormat().GetValue() )) pFormat->GetTableBoxNumFormat().GetValue() ))
nWhich = RES_BOXATR_VALUE; nWhich = RES_BOXATR_VALUE;
else if( pSttNd && pSttNd->GetIndex() + 2 == pSttNd->EndOfSectionIndex() else if( m_pStartNode && m_pStartNode->GetIndex() + 2 == m_pStartNode->EndOfSectionIndex()
&& 0 != ( pTNd = pSttNd->GetNodes()[ pSttNd->GetIndex() + 1 ] && 0 != ( pTNd = m_pStartNode->GetNodes()[ m_pStartNode->GetIndex() + 1 ]
->GetTextNode() ) && pTNd->GetText().isEmpty()) ->GetTextNode() ) && pTNd->GetText().isEmpty())
nWhich = USHRT_MAX; nWhich = USHRT_MAX;
...@@ -2562,7 +2562,7 @@ void SwTableBox::ActualiseValueBox() ...@@ -2562,7 +2562,7 @@ void SwTableBox::ActualiseValueBox()
OUString sNewText; OUString sNewText;
pNumFormatr->GetOutputString( fVal, nFormatId, sNewText, &pCol ); pNumFormatr->GetOutputString( fVal, nFormatId, sNewText, &pCol );
const OUString& rText = pSttNd->GetNodes()[ nNdPos ]->GetTextNode()->GetText(); const OUString& rText = m_pStartNode->GetNodes()[ nNdPos ]->GetTextNode()->GetText();
if( rText != sNewText ) if( rText != sNewText )
ChgTextToNum( *this, sNewText, pCol, false ,nNdPos); ChgTextToNum( *this, sNewText, pCol, false ,nNdPos);
} }
......
...@@ -2765,7 +2765,7 @@ void SwXMLTableContext::MakeTable() ...@@ -2765,7 +2765,7 @@ void SwXMLTableContext::MakeTable()
SwTableLine *pLine1 = pTableNode->GetTable().GetTabLines()[0U]; SwTableLine *pLine1 = pTableNode->GetTable().GetTabLines()[0U];
OSL_ENSURE( pBox1 == pLine1->GetTabBoxes()[0U], OSL_ENSURE( pBox1 == pLine1->GetTabBoxes()[0U],
"Why is box 1 change?" ); "Why is box 1 change?" );
pBox1->pSttNd = pSttNd1; pBox1->m_pStartNode = pSttNd1;
pLine1->GetTabBoxes().erase( pLine1->GetTabBoxes().begin() ); pLine1->GetTabBoxes().erase( pLine1->GetTabBoxes().begin() );
pLineFormat = static_cast<SwTableLineFormat*>(pLine1->GetFrameFormat()); pLineFormat = static_cast<SwTableLineFormat*>(pLine1->GetFrameFormat());
...@@ -2879,7 +2879,7 @@ const SwStartNode *SwXMLTableContext::InsertTableSection( ...@@ -2879,7 +2879,7 @@ const SwStartNode *SwXMLTableContext::InsertTableSection(
if( !pPrevSttNd && pBox1 != NULL ) if( !pPrevSttNd && pBox1 != NULL )
{ {
pBox1->pSttNd = pStNd; pBox1->m_pStartNode = pStNd;
SwContentNode *pCNd = pDoc->GetNodes()[ pStNd->GetIndex() + 1 ] SwContentNode *pCNd = pDoc->GetNodes()[ pStNd->GetIndex() + 1 ]
->GetContentNode(); ->GetContentNode();
SwPosition aPos( *pCNd ); SwPosition aPos( *pCNd );
......
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