[Libreoffice-commits] .: sw/source
Cédric Bosdonnat
cbosdo at kemper.freedesktop.org
Wed Oct 5 08:34:22 PDT 2011
sw/source/core/layout/paintfrm.cxx | 11 +++++++++--
sw/source/ui/docvw/PageBreakWin.cxx | 24 +++++++++++++++++++-----
sw/source/ui/shells/tabsh.cxx | 3 +++
3 files changed, 31 insertions(+), 7 deletions(-)
New commits:
commit 86456335a32a630547e774f23dc34fe567660497
Author: Cédric Bosdonnat <cedric.bosdonnat.ooo at free.fr>
Date: Wed Oct 5 17:33:05 2011 +0200
Page Break: implement the break before page case
diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx
index 22f3d6c..d51ef08 100755
--- a/sw/source/core/layout/paintfrm.cxx
+++ b/sw/source/core/layout/paintfrm.cxx
@@ -3335,8 +3335,15 @@ void SwPageFrm::PaintBreak( ) const
if ( pBodyFrm )
{
- const SwCntntFrm *pCnt = static_cast< const SwLayoutFrm* >( pBodyFrm )->ContainsCntnt();
- if ( pCnt && pCnt->IsPageBreak( sal_True ) )
+ const SwLayoutFrm* pLayBody = static_cast< const SwLayoutFrm* >( pBodyFrm );
+ const SwFlowFrm *pFlowFrm = pLayBody->ContainsCntnt();
+
+ // Test if the first node is a table
+ const SwFrm* pFirstFrm = pLayBody->Lower();
+ if ( pFirstFrm->IsTabFrm() )
+ pFlowFrm = static_cast< const SwTabFrm* >( pFirstFrm );
+
+ if ( pFlowFrm && pFlowFrm->IsPageBreak( sal_True ) )
{
SwWrtShell* pWrtSh = dynamic_cast< SwWrtShell* >( pGlobalShell );
if ( pWrtSh )
diff --git a/sw/source/ui/docvw/PageBreakWin.cxx b/sw/source/ui/docvw/PageBreakWin.cxx
index 2b70887..170ccce 100644
--- a/sw/source/ui/docvw/PageBreakWin.cxx
+++ b/sw/source/ui/docvw/PageBreakWin.cxx
@@ -244,10 +244,25 @@ void SwPageBreakWin::Select( )
{
case FN_PAGEBREAK_EDIT:
{
- // TODO Handle the break on a table case
- SfxUInt16Item aItem( GetEditWin()->GetView().GetPool( ).GetWhich( SID_PARA_DLG ), TP_PARA_EXT );
- GetEditWin()->GetView().GetViewFrame()->GetDispatcher()->Execute(
- SID_PARA_DLG, SFX_CALLMODE_SYNCHRON|SFX_CALLMODE_RECORD, &aItem, NULL );
+ const SwLayoutFrm* pBodyFrm = static_cast< const SwLayoutFrm* >( GetPageFrame()->Lower() );
+ while ( pBodyFrm && !pBodyFrm->IsBodyFrm() )
+ pBodyFrm = static_cast< const SwLayoutFrm* >( pBodyFrm->GetNext() );
+
+ if ( pBodyFrm )
+ {
+ if ( pBodyFrm->Lower()->IsTabFrm() )
+ {
+ SfxUInt16Item aItem( GetEditWin()->GetView().GetPool( ).GetWhich( FN_FORMAT_TABLE_DLG ), TP_TABLE_TEXTFLOW );
+ GetEditWin()->GetView().GetViewFrame()->GetDispatcher()->Execute(
+ FN_FORMAT_TABLE_DLG, SFX_CALLMODE_SYNCHRON|SFX_CALLMODE_RECORD, &aItem, NULL );
+ }
+ else
+ {
+ SfxUInt16Item aItem( GetEditWin()->GetView().GetPool( ).GetWhich( SID_PARA_DLG ), TP_PARA_EXT );
+ GetEditWin()->GetView().GetViewFrame()->GetDispatcher()->Execute(
+ SID_PARA_DLG, SFX_CALLMODE_SYNCHRON|SFX_CALLMODE_RECORD, &aItem, NULL );
+ }
+ }
}
break;
case FN_PAGEBREAK_DELETE:
@@ -258,7 +273,6 @@ void SwPageBreakWin::Select( )
if ( pBodyFrm )
{
- // TODO Handle the break before a table case
SwCntntFrm *pCnt = const_cast< SwCntntFrm* >( pBodyFrm->ContainsCntnt() );
sal_uInt16 nWhich = pCnt->GetAttrSet()->GetPool()->GetWhich( SID_ATTR_PARA_PAGEBREAK );
SwCntntNode* pNd = pCnt->GetNode();
diff --git a/sw/source/ui/shells/tabsh.cxx b/sw/source/ui/shells/tabsh.cxx
index bfc441a..44500b8 100644
--- a/sw/source/ui/shells/tabsh.cxx
+++ b/sw/source/ui/shells/tabsh.cxx
@@ -596,6 +596,9 @@ void SwTableShell::Execute(SfxRequest &rReq)
pDlg = pFact->CreateSwTableTabDlg( GetView().GetWindow(), GetPool(), &aCoreSet, &rSh, DLG_FORMAT_TABLE );
OSL_ENSURE(pDlg, "Dialogdiet fail!");
+
+ if( pItem )
+ pDlg->SetCurPageId( ((SfxUInt16Item *)pItem)->GetValue() );
}
aCoreSet.Put(SfxUInt16Item(SID_HTML_MODE, ::GetHtmlMode(GetView().GetDocShell())));
rSh.GetTblAttr(aCoreSet);
More information about the Libreoffice-commits
mailing list