diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2016-11-02 10:57:21 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2016-11-02 13:06:37 +0000 |
commit | b1f8cf37828d5f37527e54774aa4935610aa6325 (patch) | |
tree | 33348c0208f76237f1b08823923f22f99d78b256 /editeng | |
parent | c3a3b876a3a2a739b266622f51a00016a81b0cdf (diff) |
loplugin:singlevalfields
Change-Id: I65f96d9cd24572c8d0946acf4d2d45eb3db83a76
Reviewed-on: https://gerrit.libreoffice.org/30476
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'editeng')
-rw-r--r-- | editeng/source/outliner/outliner.cxx | 2 | ||||
-rw-r--r-- | editeng/source/outliner/outlundo.cxx | 25 | ||||
-rw-r--r-- | editeng/source/outliner/outlundo.hxx | 1 |
3 files changed, 5 insertions, 23 deletions
diff --git a/editeng/source/outliner/outliner.cxx b/editeng/source/outliner/outliner.cxx index 3bf14860bb17..e9ff45b7d053 100644 --- a/editeng/source/outliner/outliner.cxx +++ b/editeng/source/outliner/outliner.cxx @@ -768,7 +768,6 @@ bool Outliner::Expand( Paragraph* pPara ) { UndoActionStart( OLUNDO_EXPAND ); pUndo = new OLUndoExpand( this, OLUNDO_EXPAND ); - pUndo->pParas = nullptr; pUndo->nCount = pParaList->GetAbsPos( pPara ); } pParaList->Expand( pPara ); @@ -796,7 +795,6 @@ bool Outliner::Collapse( Paragraph* pPara ) { UndoActionStart( OLUNDO_COLLAPSE ); pUndo = new OLUndoExpand( this, OLUNDO_COLLAPSE ); - pUndo->pParas = nullptr; pUndo->nCount = pParaList->GetAbsPos( pPara ); } diff --git a/editeng/source/outliner/outlundo.cxx b/editeng/source/outliner/outlundo.cxx index ab55e3a7a5db..6b70e0da7655 100644 --- a/editeng/source/outliner/outlundo.cxx +++ b/editeng/source/outliner/outlundo.cxx @@ -143,13 +143,11 @@ OLUndoExpand::OLUndoExpand(Outliner* pOut, sal_uInt16 _nId ) DBG_ASSERT(pOut,"Undo:No Outliner"); pOutliner = pOut; nCount = 0; - pParas = nullptr; } OLUndoExpand::~OLUndoExpand() { - delete pParas; } @@ -163,25 +161,12 @@ void OLUndoExpand::Restore( bool bUndo ) sal_uInt16 _nId = GetId(); if((_nId == OLUNDO_EXPAND && !bUndo) || (_nId == OLUNDO_COLLAPSE && bUndo)) bExpand = true; - if( !pParas ) - { - pPara = pOutliner->GetParagraph( nCount ); - if( bExpand ) - pOutliner->Expand( pPara ); - else - pOutliner->Collapse( pPara ); - } + + pPara = pOutliner->GetParagraph( nCount ); + if( bExpand ) + pOutliner->Expand( pPara ); else - { - for( sal_Int32 nIdx = 0; nIdx < nCount; nIdx++ ) - { - pPara = pOutliner->GetParagraph( pParas[nIdx] ); - if( bExpand ) - pOutliner->Expand( pPara ); - else - pOutliner->Collapse( pPara ); - } - } + pOutliner->Collapse( pPara ); } void OLUndoExpand::Undo() diff --git a/editeng/source/outliner/outlundo.hxx b/editeng/source/outliner/outlundo.hxx index f1d5fc9696d3..754c79b9ae8f 100644 --- a/editeng/source/outliner/outlundo.hxx +++ b/editeng/source/outliner/outlundo.hxx @@ -113,7 +113,6 @@ public: virtual void Undo() override; virtual void Redo() override; - sal_uInt16* pParas; // 0 == nCount contains paragraph number Outliner* pOutliner; sal_Int32 nCount; }; |