diff options
author | Noel Grandin <noel@peralex.com> | 2014-06-18 12:14:29 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2014-06-24 11:34:21 +0200 |
commit | e2080e70fe8b085f18e868e46340454720fa94ca (patch) | |
tree | 4038d1d57b41b68a47d5ebbbe6ad390648ec6303 /sw/source/core/frmedt | |
parent | f910280b8704ed9c289150a4ca3c8d60e15d0d97 (diff) |
new compilerplugin returnbyref
Find places where we are returning a pointer to something, where we can
be returning a reference.
e.g.
class A {
struct X x;
public X* getX() { return &x; }
}
which can be:
public X& getX() { return x; }
Change-Id: I796fd23fd36a18aedf6e36bc28f8fab4f518c6c7
Diffstat (limited to 'sw/source/core/frmedt')
-rw-r--r-- | sw/source/core/frmedt/fecopy.cxx | 22 | ||||
-rw-r--r-- | sw/source/core/frmedt/fefly1.cxx | 2 | ||||
-rw-r--r-- | sw/source/core/frmedt/fetab.cxx | 6 | ||||
-rw-r--r-- | sw/source/core/frmedt/tblsel.cxx | 8 |
4 files changed, 19 insertions, 19 deletions
diff --git a/sw/source/core/frmedt/fecopy.cxx b/sw/source/core/frmedt/fecopy.cxx index 2dfa6a9c08ad..c980082b5b82 100644 --- a/sw/source/core/frmedt/fecopy.cxx +++ b/sw/source/core/frmedt/fecopy.cxx @@ -348,11 +348,11 @@ bool SwFEShell::CopyDrawSel( SwFEShell* pDestShell, const Point& rSttPt, else { SwPaM *pCrsr = pDestShell->GetCrsr(); - if( pCrsr->GetNode()->IsNoTxtNode() ) + if( pCrsr->GetNode().IsNoTxtNode() ) bRet = false; else bRet = ::lcl_SetAnchor( *pCrsr->GetPoint(), - *pCrsr->GetNode(), 0, rInsPt, + pCrsr->GetNode(), 0, rInsPt, *pDestShell, aAnchor, aNewAnch, false ); } @@ -506,10 +506,10 @@ bool SwFEShell::Copy( SwFEShell* pDestShell, const Point& rSttPt, else { const SwPaM *pCrsr = pDestShell->GetCrsr(); - if( pCrsr->GetNode()->IsNoTxtNode() ) + if( pCrsr->GetNode().IsNoTxtNode() ) bRet = false; else - bRet = ::lcl_SetAnchor( *pCrsr->GetPoint(), *pCrsr->GetNode(), + bRet = ::lcl_SetAnchor( *pCrsr->GetPoint(), pCrsr->GetNode(), pFly, rInsPt, *pDestShell, aAnchor, aNewAnch, GetDoc() == pDestShell->GetDoc()); } @@ -587,7 +587,7 @@ bool SwFEShell::Copy( SwFEShell* pDestShell, const Point& rSttPt, if( !pDstPos->nNode.GetNode().IsNoTxtNode() ) bRet = true; } - else if( !pDestShell->GetCrsr()->GetNode()->IsNoTxtNode() ) + else if( !pDestShell->GetCrsr()->GetNode().IsNoTxtNode() ) { pDstPos = new SwPosition( *pDestShell->GetCrsr()->GetPoint() ); bRet = true; @@ -631,7 +631,7 @@ bool SwFEShell::Copy( SwFEShell* pDestShell, const Point& rSttPt, GetLayout()->GetCrsrOfst( &aPos, aPt ); bRet = !aPos.nNode.GetNode().IsNoTxtNode(); } - else if( pDestShell->GetCrsr()->GetNode()->IsNoTxtNode() ) + else if( pDestShell->GetCrsr()->GetNode().IsNoTxtNode() ) bRet = false; if( bRet ) @@ -682,10 +682,10 @@ bool SwFEShell::Paste( SwDoc* pClpDoc, bool bIncludingPageFrames ) // (individual boxes in the area are retrieved via the layout) SwFieldType* pTblFldTyp = GetDoc()->GetSysFldType( RES_TABLEFLD ); - SwTableNode *pDestNd, *pSrcNd = aCpyPam.GetNode()->GetTableNode(); + SwTableNode *pDestNd, *pSrcNd = aCpyPam.GetNode().GetTableNode(); if( !pSrcNd ) // TabellenNode ? { // nicht ueberspringen!! - SwCntntNode* pCNd = aCpyPam.GetNode()->GetCntntNode(); + SwCntntNode* pCNd = aCpyPam.GetNode().GetCntntNode(); if( pCNd ) aCpyPam.GetPoint()->nContent.Assign( pCNd, 0 ); else if( !aCpyPam.Move( fnMoveForward, fnGoNode )) @@ -819,7 +819,7 @@ bool SwFEShell::Paste( SwDoc* pClpDoc, bool bIncludingPageFrames ) SwPosition aDestPos( *PCURCRSR->GetPoint() ); bool bParkTblCrsr = false; - const SwStartNode* pSttNd = PCURCRSR->GetNode()->FindTableBoxStartNode(); + const SwStartNode* pSttNd = PCURCRSR->GetNode().FindTableBoxStartNode(); // TABLE IN TABLE: copy table in table // search boxes via the layout @@ -959,7 +959,7 @@ bool SwFEShell::Paste( SwDoc* pClpDoc, bool bIncludingPageFrames ) else if( FLY_AT_FLY == aAnchor.GetAnchorId() ) { Point aPt; - lcl_SetAnchor( *PCURCRSR->GetPoint(), *PCURCRSR->GetNode(), + lcl_SetAnchor( *PCURCRSR->GetPoint(), PCURCRSR->GetNode(), 0, aPt, *this, aAnchor, aPt, false ); } @@ -1133,7 +1133,7 @@ bool SwFEShell::PastePages( SwFEShell& rToFill, sal_uInt16 nStartPage, sal_uInt1 return false; } //if the page starts with a table a paragraph has to be inserted before - SwNode* pTableNode = aCpyPam.GetNode()->FindTableNode(); + SwNode* pTableNode = aCpyPam.GetNode().FindTableNode(); if(pTableNode) { //insert a paragraph diff --git a/sw/source/core/frmedt/fefly1.cxx b/sw/source/core/frmedt/fefly1.cxx index 25c329ffcf15..cb1c552b471e 100644 --- a/sw/source/core/frmedt/fefly1.cxx +++ b/sw/source/core/frmedt/fefly1.cxx @@ -774,7 +774,7 @@ void SwFEShell::Insert( const OUString& rGrfName, const OUString& rFltName, case FLY_AT_FLY: if( !pAnchor->GetCntntAnchor() ) { - lcl_SetNewFlyPos( *pCursor->GetNode(), + lcl_SetNewFlyPos( pCursor->GetNode(), *pAnchor, GetCrsrDocPos() ); } break; diff --git a/sw/source/core/frmedt/fetab.cxx b/sw/source/core/frmedt/fetab.cxx index b12762b31d12..0b104a395a21 100644 --- a/sw/source/core/frmedt/fetab.cxx +++ b/sw/source/core/frmedt/fetab.cxx @@ -452,7 +452,7 @@ sal_uInt16 SwFEShell::MergeTab() if( IsTableMode() ) { SwShellTableCrsr* pTableCrsr = GetTableCrsr(); - const SwTableNode* pTblNd = pTableCrsr->GetNode()->FindTableNode(); + const SwTableNode* pTblNd = pTableCrsr->GetNode().FindTableNode(); if( pTblNd->GetTable().ISA( SwDDETable )) { ErrorHandler::HandleError( ERR_TBLDDECHG_ERROR, @@ -884,7 +884,7 @@ bool SwFEShell::HasBoxSelection() const } SwNode* pNd; if( pPam->GetPoint()->nNode.GetIndex() -1 == - ( pNd = pPam->GetNode())->StartOfSectionIndex() && + ( pNd = &pPam->GetNode())->StartOfSectionIndex() && !pPam->GetPoint()->nContent.GetIndex() && pPam->GetMark()->nNode.GetIndex() + 1 == pNd->EndOfSectionIndex()) @@ -2081,7 +2081,7 @@ static bool lcl_GoTableRow( SwCrsrShell* pShell, bool bUp ) OSL_ENSURE( pShell != NULL, "need shell" ); SwPaM* pPam = pShell->GetCrsr(); - const SwStartNode* pTableBox = pPam->GetNode()->FindTableBoxStartNode(); + const SwStartNode* pTableBox = pPam->GetNode().FindTableBoxStartNode(); OSL_ENSURE( pTableBox != NULL, "I'm living in a box... NOT!" ); // move cursor to start node of table box diff --git a/sw/source/core/frmedt/tblsel.cxx b/sw/source/core/frmedt/tblsel.cxx index 2d94ddfbe82c..e69b80f7c9df 100644 --- a/sw/source/core/frmedt/tblsel.cxx +++ b/sw/source/core/frmedt/tblsel.cxx @@ -161,7 +161,7 @@ void GetTblSel( const SwCursor& rCrsr, SwSelBoxes& rBoxes, // Row-selection: // Check for complex tables. If Yes, search selected boxes via // the layout. Otherwise via the table structure (for macros !!) - const SwCntntNode* pContentNd = rCrsr.GetNode()->GetCntntNode(); + const SwCntntNode* pContentNd = rCrsr.GetNode().GetCntntNode(); const SwTableNode* pTblNd = pContentNd ? pContentNd->FindTableNode() : 0; if( pTblNd && pTblNd->GetTable().IsNewModel() ) { @@ -182,8 +182,8 @@ void GetTblSel( const SwCursor& rCrsr, SwSelBoxes& rBoxes, const SwTable& rTbl = pTblNd->GetTable(); const SwTableLines& rLines = rTbl.GetTabLines(); - const SwNode* pMarkNode = rCrsr.GetNode( false ); - const sal_uLong nMarkSectionStart = pMarkNode->StartOfSectionIndex(); + const SwNode& rMarkNode = rCrsr.GetNode( false ); + const sal_uLong nMarkSectionStart = rMarkNode.StartOfSectionIndex(); const SwTableBox* pMarkBox = rTbl.GetTblBox( nMarkSectionStart ); OSL_ENSURE( pMarkBox, "Point in table, mark outside?" ); @@ -191,7 +191,7 @@ void GetTblSel( const SwCursor& rCrsr, SwSelBoxes& rBoxes, const SwTableLine* pLine = pMarkBox ? pMarkBox->GetUpper() : 0; sal_uInt16 nSttPos = rLines.GetPos( pLine ); OSL_ENSURE( USHRT_MAX != nSttPos, "Where is my row in the table?" ); - pLine = rTbl.GetTblBox( rCrsr.GetNode( true )->StartOfSectionIndex() )->GetUpper(); + pLine = rTbl.GetTblBox( rCrsr.GetNode( true ).StartOfSectionIndex() )->GetUpper(); sal_uInt16 nEndPos = rLines.GetPos( pLine ); OSL_ENSURE( USHRT_MAX != nEndPos, "Where is my row in the table?" ); // pb: #i20193# if tableintable then nSttPos == nEndPos == USHRT_MAX |