[Libreoffice-commits] core.git: Branch 'aoo/trunk' - sw/source
Oliver-Rainer Wittmann
orw at apache.org
Tue Jul 15 07:08:01 PDT 2014
sw/source/core/frmedt/feshview.cxx | 6 +++-
sw/source/core/layout/fly.cxx | 36 ++-------------------------
sw/source/ui/shells/textsh.cxx | 49 ++++++++++++++++++++-----------------
3 files changed, 34 insertions(+), 57 deletions(-)
New commits:
commit 82fafc47de0c59c783c5df596c976a429ff8a21d
Author: Oliver-Rainer Wittmann <orw at apache.org>
Date: Tue Jul 15 12:15:37 2014 +0000
121443: - 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.
diff --git a/sw/source/core/frmedt/feshview.cxx b/sw/source/core/frmedt/feshview.cxx
index e26c904..ccb2314 100644
--- a/sw/source/core/frmedt/feshview.cxx
+++ b/sw/source/core/frmedt/feshview.cxx
@@ -2459,12 +2459,14 @@ const SwFrmFmt* SwFEShell::GetFlyNum(sal_uInt16 nIdx, FlyCntType eType ) const
return GetDoc()->GetFlyNum(nIdx, eType );
}
+
// zeige das akt. selektierte "Object" an
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 839f677..6b569b1 100644
--- a/sw/source/core/layout/fly.cxx
+++ b/sw/source/core/layout/fly.cxx
@@ -2223,40 +2223,10 @@ void SwFrm::AppendFly( SwFlyFrm *pNew )
pDrawObjs->Insert( *pNew );
pNew->ChgAnchorFrm( this );
- //Bei der Seite anmelden; kann sein, dass noch keine da ist - die
- //Anmeldung wird dann in SwPageFrm::PreparePage durch gefuehrt.
- SwPageFrm *pPage = FindPageFrm();
- if ( pPage )
+ SwPageFrm* pPage = FindPageFrm();
+ if ( pPage != NULL )
{
- if ( pNew->IsFlyAtCntFrm() && pNew->Frm().Top() == WEIT_WECH )
- {
- //Versuch die Seitenformatierung von neuen Dokumenten etwas
- //guenstiger zu gestalten.
- //Wir haengen die Flys erstenmal nach hinten damit sie bei heftigem
- //Fluss der Anker nicht unoetig oft formatiert werden.
- //Damit man noch brauchbar an das Ende des Dokumentes springen
- //kann werden die Flys nicht ganz an das Ende gehaengt.
- 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; // damit wir nicht vor unserem Anker landen
- }
- if ( pTmp->IsEmptyPage() )
- pTmp = (SwPageFrm*)pTmp->GetPrev();
- pPage = pTmp;
- }
- }
- pPage->AppendFlyToPage( pNew );
- }
- else
- pPage->AppendFlyToPage( pNew );
+ pPage->AppendFlyToPage( pNew );
}
}
diff --git a/sw/source/ui/shells/textsh.cxx b/sw/source/ui/shells/textsh.cxx
index 746f245..2357b52 100644
--- a/sw/source/ui/shells/textsh.cxx
+++ b/sw/source/ui/shells/textsh.cxx
@@ -680,6 +680,7 @@ void SwTextShell::ExecInsert(SfxRequest &rReq)
}
break;
}
+
case FN_INSERT_HRULER:
{
String sPath;
@@ -688,22 +689,22 @@ void SwTextShell::ExecInsert(SfxRequest &rReq)
Window* pParent = GetView().GetWindow();
if ( pItem )
{
- sPath = ((SfxStringItem*)pItem)->GetValue();
- SFX_REQUEST_ARG( rReq, pSimple, SfxBoolItem, FN_PARAM_1 , sal_False );
+ sPath = ( (SfxStringItem*) pItem )->GetValue();
+ SFX_REQUEST_ARG( rReq, pSimple, SfxBoolItem, FN_PARAM_1, sal_False );
if ( pSimple )
bSimpleLine = pSimple->GetValue();
}
else
{
SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
- DBG_ASSERT(pFact, "Dialogdiet fail!");
+ DBG_ASSERT( pFact, "Dialogdiet fail!" );
AbstractInsertGrfRulerDlg* pDlg = pFact->CreateInsertGrfRulerDlg( DLG_INSERT_RULER,
- pParent );
- DBG_ASSERT(pDlg, "Dialogdiet fail!");
+ pParent );
+ DBG_ASSERT( pDlg, "Dialogdiet fail!" );
// MessageBox fuer fehlende Grafiken
- if(!pDlg->HasImages())
- InfoBox( pParent, SW_RES(MSG_NO_RULER)).Execute();
- if(RET_OK == pDlg->Execute())
+ if ( !pDlg->HasImages() )
+ InfoBox( pParent, SW_RES( MSG_NO_RULER ) ).Execute();
+ if ( RET_OK == pDlg->Execute() )
{
sPath = pDlg->GetGraphicName();
bSimpleLine = pDlg->IsSimpleLine();
@@ -715,39 +716,43 @@ void SwTextShell::ExecInsert(SfxRequest &rReq)
}
rSh.StartAllAction();
- rSh.StartUndo(UNDO_UI_INSERT_RULER);
- if(bSimpleLine)
+ rSh.StartUndo( UNDO_UI_INSERT_RULER );
+ if ( bSimpleLine )
{
- if(!(rSh.IsSttOfPara() && rSh.IsEndOfPara())) // kein leerer Absatz?
+ if ( !( rSh.IsSttOfPara() && rSh.IsEndOfPara() ) ) // kein leerer Absatz?
rSh.SplitNode( sal_False, sal_False ); // dann Platz schaffen
rSh.SplitNode( sal_False, sal_False );
- rSh.Left(CRSR_SKIP_CHARS, sal_False, 1, sal_False );
- rSh.SetTxtFmtColl( rSh.GetTxtCollFromPool( RES_POOLCOLL_HTML_HR ));
- rSh.Right(CRSR_SKIP_CHARS, sal_False, 1, sal_False );
+ rSh.Left( CRSR_SKIP_CHARS, sal_False, 1, sal_False );
+ rSh.SetTxtFmtColl( rSh.GetTxtCollFromPool( RES_POOLCOLL_HTML_HR ) );
+ rSh.Right( CRSR_SKIP_CHARS, sal_False, 1, sal_False );
bRet = sal_True;
}
- else if(sPath.Len())
+ else if ( sPath.Len() )
{
SwFlyFrmAttrMgr aFrmMgr( sal_True, &rSh, FRMMGR_TYPE_GRF );
// am FrmMgr muessen die richtigen Parameter eingestellt werden
- aFrmMgr.SetAnchor(FLY_AS_CHAR);
+ aFrmMgr.SetAnchor( FLY_AS_CHAR );
rSh.SplitNode( sal_False, sal_False );
rSh.SplitNode( sal_False, sal_False );
- rSh.Left(CRSR_SKIP_CHARS, sal_False, 1, sal_False );
- rSh.SetAttrItem(SvxAdjustItem(SVX_ADJUST_CENTER,RES_PARATR_ADJUST ));
- if(GRFILTER_OK == GetView().InsertGraphic(sPath, aEmptyStr, sal_True, 0, 0 ))
+ rSh.Left( CRSR_SKIP_CHARS, sal_False, 1, sal_False );
+ rSh.SetAttrItem( SvxAdjustItem( SVX_ADJUST_CENTER, RES_PARATR_ADJUST ) );
+ if ( GRFILTER_OK == GetView().InsertGraphic( sPath, aEmptyStr, sal_True, 0, 0 ) )
+ {
+ rSh.GetCurrFrm(); // just to trigger formatting in case the inserted graphic is not formatted.
bRet = sal_True;
+ }
rSh.EnterStdMode();
- rSh.Right(CRSR_SKIP_CHARS, sal_False, 1, sal_False );
+ rSh.Right( CRSR_SKIP_CHARS, sal_False, 1, sal_False );
}
rSh.EndAllAction();
- rSh.EndUndo(UNDO_UI_INSERT_RULER);
- rReq.SetReturnValue(SfxBoolItem(nSlot, bRet));
+ rSh.EndUndo( UNDO_UI_INSERT_RULER );
+ rReq.SetReturnValue( SfxBoolItem( nSlot, bRet ) );
rReq.Done();
}
break;
+
case FN_FORMAT_COLUMN :
{
SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
More information about the Libreoffice-commits
mailing list