sw: use SAL_RET_MAYBENULL in GetTableBox()
This could have caught tdf#162180 Change-Id: I71e86b402ae0c603d1c7ace209d55f5808b9ebe2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171054 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
This commit is contained in:
+1
-1
@@ -307,7 +307,7 @@ public:
|
||||
SwFrameFormat* GetFlyFormat() const;
|
||||
|
||||
/// If node is in a table return the respective table box.
|
||||
SwTableBox* GetTableBox() const;
|
||||
SAL_RET_MAYBENULL SwTableBox* GetTableBox() const;
|
||||
|
||||
SwNodeOffset GetIndex() const { return SwNodeOffset(GetPos()); }
|
||||
|
||||
|
||||
@@ -616,10 +616,13 @@ static void lcl_setRowNotTracked(SwNode& rNode)
|
||||
if ( rDoc.GetIDocumentUndoRedo().DoesUndo() && rNode.GetTableBox() )
|
||||
{
|
||||
SvxPrintItem aSetTracking(RES_PRINT, false);
|
||||
SwNodeIndex aInsPos( *(rNode.GetTableBox()->GetSttNd()), 1);
|
||||
SwCursor aCursor( SwPosition(aInsPos), nullptr );
|
||||
::sw::UndoGuard const undoGuard(rNode.GetDoc().GetIDocumentUndoRedo());
|
||||
rDoc.SetRowNotTracked( aCursor, aSetTracking );
|
||||
if (const SwTableBox* pTableBox = rNode.GetTableBox())
|
||||
{
|
||||
SwNodeIndex aInsPos( *(pTableBox->GetSttNd()), 1);
|
||||
SwCursor aCursor( SwPosition(aInsPos), nullptr );
|
||||
::sw::UndoGuard const undoGuard(rNode.GetDoc().GetIDocumentUndoRedo());
|
||||
rDoc.SetRowNotTracked( aCursor, aSetTracking );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -243,21 +243,24 @@ void SwASCWriter::WriteTable(SwTableNode* pTableNd, SwTextNode* pNd)
|
||||
Out( aASCNodeFnTab, *pNd, *this );
|
||||
|
||||
Point aPrevBoxPoint;
|
||||
if (const SwTableBox* pPrevBox = pNd->GetTableBox())
|
||||
aPrevBoxPoint = pPrevBox->GetCoordinates();
|
||||
SwTableBox* pTableBox = pNd->GetTableBox();
|
||||
if (pTableBox)
|
||||
aPrevBoxPoint = pTableBox->GetCoordinates();
|
||||
m_pCurrentPam->Move(fnMoveForward, GoInNode);
|
||||
pNd = m_pCurrentPam->GetPoint()->GetNode().GetTextNode();
|
||||
pTableBox = pNd->GetTableBox();
|
||||
|
||||
// Line break in a box
|
||||
// Each line is a new SwTextNode so we
|
||||
// need to parse inside the current box
|
||||
while (pNd->GetTableBox() && (pNd->GetTableBox()->GetCoordinates() == aPrevBoxPoint))
|
||||
while (pTableBox && pTableBox->GetCoordinates() == aPrevBoxPoint)
|
||||
{
|
||||
Strm().WriteUnicodeOrByteText(sPreLineEnd);
|
||||
Out(aASCNodeFnTab, *pNd, *this);
|
||||
|
||||
m_pCurrentPam->Move(fnMoveForward, GoInNode);
|
||||
pNd = m_pCurrentPam->GetPoint()->GetNode().GetTextNode();
|
||||
pTableBox = pNd->GetTableBox();
|
||||
}
|
||||
if (pBox != pLine->GetTabBoxes().back())
|
||||
Strm().WriteUChar( 0x9 );
|
||||
|
||||
Reference in New Issue
Block a user