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

Oliver-Rainer Wittmann orw at apache.org
Wed Jul 16 01:01:34 PDT 2014


 sw/source/core/frmedt/feshview.cxx |    5 +++--
 sw/source/core/layout/fly.cxx      |   33 +++------------------------------
 2 files changed, 6 insertions(+), 32 deletions(-)

New commits:
commit 133d6d8d4dec497276c3a9b0ba6761cffd322f81
Author: Oliver-Rainer Wittmann <orw at apache.org>
Date:   Tue Jul 15 12:15:37 2014 +0000

    Resolves: #i121443# register text frames and graphics...
    
    on the correct page frame
    
    - trigger formatting of selected object when moving view to the selected object
    or when graphical horizontal line has been inserted.
    
    (cherry picked from commit 82fafc47de0c59c783c5df596c976a429ff8a21d)
    
    Conflicts:
    	sw/source/core/frmedt/feshview.cxx
    	sw/source/core/layout/fly.cxx
    	sw/source/ui/shells/textsh.cxx
    
    Change-Id: I4b4b523ff445f2ce20d9b81ad1187db7b44bd145

diff --git a/sw/source/core/frmedt/feshview.cxx b/sw/source/core/frmedt/feshview.cxx
index 75b3d33..8aa17a8 100644
--- a/sw/source/core/frmedt/feshview.cxx
+++ b/sw/source/core/frmedt/feshview.cxx
@@ -2253,9 +2253,10 @@ const SwFrmFmt*  SwFEShell::GetFlyNum(sal_uInt16 nIdx, FlyCntType eType, bool bI
 // show the current selected object
 void SwFEShell::MakeSelVisible()
 {
-    if( Imp()->HasDrawView() &&
-        Imp()->GetDrawView()->GetMarkedObjectList().GetMarkCount() )
+    if ( Imp()->HasDrawView() &&
+         Imp()->GetDrawView()->GetMarkedObjectList().GetMarkCount() )
     {
+        GetCurrFrm(); // just to trigger formatting in case the selected object is not formatted.
         MakeVisible( Imp()->GetDrawView()->GetAllMarkedRect() );
     }
     else
diff --git a/sw/source/core/layout/fly.cxx b/sw/source/core/layout/fly.cxx
index f4c01f4..6aa2579 100644
--- a/sw/source/core/layout/fly.cxx
+++ b/sw/source/core/layout/fly.cxx
@@ -2007,37 +2007,10 @@ void SwFrm::AppendFly( SwFlyFrm *pNew )
 
     // Register at the page
     // If there's none present, register via SwPageFrm::PreparePage
-    SwPageFrm *pPage = FindPageFrm();
-    if ( pPage )
+    SwPageFrm* pPage = FindPageFrm();
+    if ( pPage != NULL )
     {
-        if ( pNew->IsFlyAtCntFrm() && pNew->Frm().Top() == FAR_AWAY )
-        {
-            // Try to make the page formatting of new documents a bit handier:
-            // In the beginning we add the Flys to the back, so that the Anchors
-            // do not have to be reformatted unnecessarily often.
-            // However, we do not add them all the way at the end, so that we
-            // can still jump to the document's end in a meaningful way.
-            SwRootFrm *pRoot = (SwRootFrm*)pPage->GetUpper();
-            if( !SwLayHelper::CheckPageFlyCache( pPage, pNew ) )
-            {
-                SwPageFrm *pTmp = pRoot->GetLastPage();
-                if ( pTmp->GetPhyPageNum() > 30 )
-                {
-                    for ( sal_uInt16 i = 0; i < 10; ++i )
-                    {
-                        pTmp = (SwPageFrm*)pTmp->GetPrev();
-                        if( pTmp->GetPhyPageNum() <= pPage->GetPhyPageNum() )
-                            break; // So that we don't end up before the Anchor
-                    }
-                    if ( pTmp->IsEmptyPage() )
-                        pTmp = (SwPageFrm*)pTmp->GetPrev();
-                    pPage = pTmp;
-                }
-            }
-            pPage->AppendFlyToPage( pNew );
-        }
-        else
-            pPage->AppendFlyToPage( pNew );
+        pPage->AppendFlyToPage( pNew );
     }
 }
 


More information about the Libreoffice-commits mailing list