diff options
author | Jan-Marek Glogowski <glogow@fbihome.de> | 2014-06-27 14:58:24 +0200 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-09-05 10:59:50 -0500 |
commit | 8a798ef5582e91ca51ffc835f6b8c8521bee3174 (patch) | |
tree | 250febba922b3e3f54ddc6c87e5fe9aa5d49187e /sw/source/core/frmedt/fecopy.cxx | |
parent | 01e5ff37499d115e652ddab793488a54174fb4a9 (diff) |
Some minor MM related refactoring
Refactors some code of SwFEShell::Paste and
SwDBManager::MergeDocuments to make it more readable.
Change-Id: Ifd78d6a44fa78eaf1f4fca63f4bbd3ee43ca129d
Reviewed-on: https://gerrit.libreoffice.org/10965
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sw/source/core/frmedt/fecopy.cxx')
-rw-r--r-- | sw/source/core/frmedt/fecopy.cxx | 19 |
1 files changed, 6 insertions, 13 deletions
diff --git a/sw/source/core/frmedt/fecopy.cxx b/sw/source/core/frmedt/fecopy.cxx index f4fcbb6044f8..e3612e40beba 100644 --- a/sw/source/core/frmedt/fecopy.cxx +++ b/sw/source/core/frmedt/fecopy.cxx @@ -681,7 +681,7 @@ bool SwFEShell::Paste( SwDoc* pClpDoc, bool bIncludingPageFrames ) // If there are table formulas in the area, then display the table first // so that the table formula can calculate a new value first // (individual boxes in the area are retrieved via the layout) - SwFieldType* pTblFldTyp = GetDoc()->getIDocumentFieldsAccess().GetSysFldType( RES_TABLEFLD ); + SwFieldType* pTblFldTyp = GetDoc()->getIDocumentFieldsAccess().GetSysFldType( RES_TABLEFLD ); SwTableNode *pDestNd, *pSrcNd = aCpyPam.GetNode().GetTableNode(); if( !pSrcNd ) // TabellenNode ? @@ -1077,19 +1077,12 @@ bool SwFEShell::Paste( SwDoc* pClpDoc, bool bIncludingPageFrames ) for ( sal_uInt16 i = 0; i < pClpDoc->GetSpzFrmFmts()->size(); ++i ) { - bool bInsWithFmt = true; const SwFrmFmt& rCpyFmt = *(*pClpDoc->GetSpzFrmFmts())[i]; - if( bInsWithFmt ) - { - SwFmtAnchor aAnchor( rCpyFmt.GetAnchor() ); - if ( FLY_AT_PAGE == aAnchor.GetAnchorId() ) - { - aAnchor.SetPageNum( aAnchor.GetPageNum() + nStartPageNumber - 1 ); - } - else - continue; - GetDoc()->getIDocumentLayoutAccess().CopyLayoutFmt( rCpyFmt, aAnchor, true, true ); - } + SwFmtAnchor aAnchor( rCpyFmt.GetAnchor() ); + if ( FLY_AT_PAGE != aAnchor.GetAnchorId() ) + continue; + aAnchor.SetPageNum( aAnchor.GetPageNum() + nStartPageNumber - 1 ); + GetDoc()->getIDocumentLayoutAccess().CopyLayoutFmt( rCpyFmt, aAnchor, true, true ); } } } |