[Libreoffice-commits] core.git: sw/source

Michael Stahl (via logerrit) logerrit at kemper.freedesktop.org
Fri Dec 6 14:45:05 UTC 2019


 sw/source/core/doc/docedt.cxx  |   36 +++++++++++++++---------------
 sw/source/core/undo/undobj.cxx |   49 ++++++++++++++++++++---------------------
 2 files changed, 42 insertions(+), 43 deletions(-)

New commits:
commit 933dc9f99d6f8d608f67514d1236b5b2904f2b0a
Author:     Michael Stahl <Michael.Stahl at cib.de>
AuthorDate: Fri Dec 6 13:33:24 2019 +0100
Commit:     Michael Stahl <michael.stahl at cib.de>
CommitDate: Fri Dec 6 15:42:44 2019 +0100

    sw: reindent that
    
    Change-Id: Iea5784d98d2780166c88912f898f3da95d45e2ab
    Reviewed-on: https://gerrit.libreoffice.org/84623
    Tested-by: Jenkins
    Reviewed-by: Michael Stahl <michael.stahl at cib.de>

diff --git a/sw/source/core/doc/docedt.cxx b/sw/source/core/doc/docedt.cxx
index 7edd87e12850..d881ca1d3d40 100644
--- a/sw/source/core/doc/docedt.cxx
+++ b/sw/source/core/doc/docedt.cxx
@@ -228,26 +228,26 @@ void DelFlyInRange( const SwNodeIndex& rMkNdIdx,
                     ? DelContentType::AllMask
                     : DelContentType::AllMask|DelContentType::CheckNoCntnt))))
         {
-                // If the Fly is deleted, all Flys in its content have to be deleted too.
-                const SwFormatContent &rContent = pFormat->GetContent();
-                // But only fly formats own their content, not draw formats.
-                if (rContent.GetContentIdx() && pFormat->Which() == RES_FLYFRMFMT)
-                {
-                    DelFlyInRange( *rContent.GetContentIdx(),
-                                    SwNodeIndex( *rContent.GetContentIdx()->
-                                            GetNode().EndOfSectionNode() ));
-                    // Position could have been moved!
-                    if( i > rTable.size() )
-                        i = rTable.size();
-                    else if( pFormat != rTable[i] )
-                        i = std::distance(rTable.begin(), rTable.find( pFormat ));
-                }
+            // If the Fly is deleted, all Flys in its content have to be deleted too.
+            const SwFormatContent &rContent = pFormat->GetContent();
+            // But only fly formats own their content, not draw formats.
+            if (rContent.GetContentIdx() && pFormat->Which() == RES_FLYFRMFMT)
+            {
+                DelFlyInRange( *rContent.GetContentIdx(),
+                                SwNodeIndex( *rContent.GetContentIdx()->
+                                        GetNode().EndOfSectionNode() ));
+                // Position could have been moved!
+                if (i > rTable.size())
+                    i = rTable.size();
+                else if (pFormat != rTable[i])
+                    i = std::distance(rTable.begin(), rTable.find( pFormat ));
+            }
 
-                pDoc->getIDocumentLayoutAccess().DelLayoutFormat( pFormat );
+            pDoc->getIDocumentLayoutAccess().DelLayoutFormat( pFormat );
 
-                // DelLayoutFormat can also trigger the deletion of objects.
-                if( i > rTable.size() )
-                    i = rTable.size();
+            // DelLayoutFormat can also trigger the deletion of objects.
+            if (i > rTable.size())
+                i = rTable.size();
         }
     }
 }
diff --git a/sw/source/core/undo/undobj.cxx b/sw/source/core/undo/undobj.cxx
index 21db9be5c8e3..22794f5316d5 100644
--- a/sw/source/core/undo/undobj.cxx
+++ b/sw/source/core/undo/undobj.cxx
@@ -967,32 +967,31 @@ void SwUndoSaveContent::DelContentIndex( const SwPosition& rMark,
                         if (pAPos &&
                             pStt->nNode <= pAPos->nNode && pAPos->nNode <= pEnd->nNode)
                         {
-                                if( !m_pHistory )
-                                    m_pHistory.reset( new SwHistory );
+                            if (!m_pHistory)
+                                m_pHistory.reset( new SwHistory );
 
-                                if (IsSelectFrameAnchoredAtPara(*pAPos, *pStt, *pEnd, nDelContentType))
-                                {
-                                    m_pHistory->AddDeleteFly(*pFormat, nChainInsPos);
-                                    // reset n so that no Format is skipped
-                                    n = n >= rSpzArr.size()
-                                        ? rSpzArr.size() : n+1;
-                                }
-                                // Moving the anchor?
-                                else if (!((DelContentType::CheckNoCntnt|DelContentType::ExcludeFlyAtStartEnd)
-                                        & nDelContentType) &&
-                                    // at least for calls from SwUndoDelete,
-                                    // this should work - other Undos don't
-                                    // remember the order of the cursor
-                                    (rPoint.nNode.GetIndex() == pAPos->nNode.GetIndex())
-                                    // Do not try to move the anchor to a table!
-                                    && rMark.nNode.GetNode().IsTextNode())
-                                {
-                                    m_pHistory->AddChangeFlyAnchor(*pFormat);
-                                    SwFormatAnchor aAnch( *pAnchor );
-                                    SwPosition aPos( rMark.nNode );
-                                    aAnch.SetAnchor( &aPos );
-                                    pFormat->SetFormatAttr( aAnch );
-                                }
+                            if (IsSelectFrameAnchoredAtPara(*pAPos, *pStt, *pEnd, nDelContentType))
+                            {
+                                m_pHistory->AddDeleteFly(*pFormat, nChainInsPos);
+                                // reset n so that no Format is skipped
+                                n = n >= rSpzArr.size() ? rSpzArr.size() : n+1;
+                            }
+                            // Moving the anchor?
+                            else if (!((DelContentType::CheckNoCntnt|DelContentType::ExcludeFlyAtStartEnd)
+                                    & nDelContentType) &&
+                                // at least for calls from SwUndoDelete,
+                                // this should work - other Undos don't
+                                // remember the order of the cursor
+                                (rPoint.nNode.GetIndex() == pAPos->nNode.GetIndex())
+                                // Do not try to move the anchor to a table!
+                                && rMark.nNode.GetNode().IsTextNode())
+                            {
+                                m_pHistory->AddChangeFlyAnchor(*pFormat);
+                                SwFormatAnchor aAnch( *pAnchor );
+                                SwPosition aPos( rMark.nNode );
+                                aAnch.SetAnchor( &aPos );
+                                pFormat->SetFormatAttr( aAnch );
+                            }
                         }
                     }
                     break;


More information about the Libreoffice-commits mailing list