Kaydet (Commit) 91042f3f authored tarafından Cédric Bosdonnat's avatar Cédric Bosdonnat

Header/Footer: implement the edit menu item

Opens the page style at the header or footer tab.
üst dc557cd0
......@@ -112,7 +112,7 @@ class SW_DLLPUBLIC SwDocShell: public SfxObjectShell, public SfxListener
// Methods for StyleSheets
SW_DLLPRIVATE sal_uInt16 Edit( const String &rName, const String& rParent, sal_uInt16 nFamily,
sal_uInt16 nMask, sal_Bool bNew,
sal_Bool bColumn = sal_False,
sal_uInt16 nPageId = 0,
SwWrtShell* pActShell = 0,
sal_Bool bBasic = sal_False );
SW_DLLPRIVATE sal_uInt16 Delete(const String &rName, sal_uInt16 nFamily);
......@@ -254,7 +254,7 @@ public:
// Display dialog for page style. If required display column page.
void FormatPage( const String& rPage,
sal_Bool bColumn = sal_False,
sal_uInt16 nPageId = 0,
SwWrtShell* pActShell = 0 );
// #i59688#
......
......@@ -427,7 +427,7 @@ public:
Window* pParent,
SfxStyleSheetBase& rBase,
sal_uInt16 nRegion,
sal_Bool bColumn = sal_False,
sal_uInt16 nPageId = 0,
SwWrtShell* pActShell = 0,
sal_Bool bNew = sal_False ) = 0; //add for SwTemplateDlg
virtual AbstractGlossaryDlg* CreateGlossaryDlg( int nResId,
......
......@@ -508,7 +508,7 @@ void SwDocShell::ExecStyleSheet( SfxRequest& rReq )
sal_uInt16 SwDocShell::Edit( const String &rName, const String &rParent, sal_uInt16 nFamily, sal_uInt16 nMask,
sal_Bool bNew, sal_Bool bColumn, SwWrtShell* pActShell,
sal_Bool bNew, sal_uInt16 nPageId, SwWrtShell* pActShell,
sal_Bool bBasic )
{
OSL_ENSURE(GetWrtShell(), "No Shell, no Styles");
......@@ -660,7 +660,7 @@ sal_uInt16 SwDocShell::Edit( const String &rName, const String &rParent, sal_uIn
SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
OSL_ENSURE(pFact, "Dialogdiet fail!");
SfxAbstractTabDialog* pDlg = pFact->CreateTemplateDialog( DLG_TEMPLATE_BASE,
0, *(xTmp.get()), nFamily, bColumn,
0, *(xTmp.get()), nFamily, nPageId,
pActShell ? pActShell : pWrtShell, bNew);
OSL_ENSURE(pDlg, "Dialogdiet fail!");
while (true)
......@@ -1246,9 +1246,9 @@ void SwDocShell::_LoadStyles( SfxObjectShell& rSource, sal_Bool bPreserveCurrent
}
void SwDocShell::FormatPage( const String& rPage, sal_Bool bColumn, SwWrtShell* pActShell )
void SwDocShell::FormatPage( const String& rPage, sal_uInt16 nPageId, SwWrtShell* pActShell )
{
Edit( rPage, aEmptyStr, SFX_STYLE_FAMILY_PAGE, 0, sal_False, bColumn, pActShell);
Edit( rPage, aEmptyStr, SFX_STYLE_FAMILY_PAGE, 0, sal_False, nPageId, pActShell);
}
Bitmap SwDocShell::GetStyleFamilyBitmap( SfxStyleFamily eFamily )
......
......@@ -1202,7 +1202,7 @@ SfxAbstractTabDialog* SwAbstractDialogFactory_Impl::CreateTemplateDialog( int nR
Window* pParent,
SfxStyleSheetBase& rBase,
sal_uInt16 nRegion,
sal_Bool bColumn,
sal_uInt16 nPageId,
SwWrtShell* pActShell,
sal_Bool bNew ) //add for SwTemplateDlg
{
......@@ -1210,7 +1210,7 @@ SfxAbstractTabDialog* SwAbstractDialogFactory_Impl::CreateTemplateDialog( int nR
switch ( nResId )
{
case DLG_TEMPLATE_BASE :
pDlg = new SwTemplateDlg( pParent, rBase, nRegion, bColumn, pActShell, bNew );
pDlg = new SwTemplateDlg( pParent, rBase, nRegion, nPageId, pActShell, bNew );
break;
default:
break;
......
......@@ -506,7 +506,7 @@ public:
Window* pParent,
SfxStyleSheetBase& rBase,
sal_uInt16 nRegion,
sal_Bool bColumn = sal_False,
sal_uInt16 nPageId = 0,
SwWrtShell* pActShell = 0,
sal_Bool bNew = sal_False ); //add for SwTemplateDlg
virtual AbstractGlossaryDlg* CreateGlossaryDlg( int nResId,
......
......@@ -28,10 +28,12 @@
#include <app.hrc>
#include <docvw.hrc>
#include <globals.hrc>
#include <popup.hrc>
#include <svtools/svtools.hrc>
#include <cmdid.h>
#include <docsh.hxx>
#include <edtwin.hxx>
#include <fmthdft.hxx>
#include <HeaderFooterWin.hxx>
......@@ -252,7 +254,17 @@ void SwHeaderFooterWin::ExecuteCommand( sal_uInt16 nSlot )
switch ( nSlot )
{
case FN_HEADERFOOTER_EDIT:
// TODO Implement me
{
SwView& rView = m_pEditWin->GetView();
SwWrtShell& rSh = rView.GetWrtShell();
sal_uInt16 nPageId = TP_FOOTER_PAGE;
if ( IsHeader() )
nPageId = TP_HEADER_PAGE;
rView.GetDocShell()->FormatPage(
GetPageFrame()->GetPageDesc()->GetName(),
nPageId, &rSh );
}
break;
case FN_HEADERFOOTER_DELETE:
ChangeHeaderOrFooter( false );
......@@ -274,7 +286,7 @@ SwHeaderFooterButton::SwHeaderFooterButton( SwHeaderFooterWin* pWindow ) :
SwHeaderFooterButton::~SwHeaderFooterButton( )
{
delete m_pWindow;
delete m_pPopupMenu;
}
void SwHeaderFooterButton::Paint( const Rectangle& )
......
......@@ -97,7 +97,7 @@ extern SW_DLLPUBLIC SwWrtShell* GetActiveWrtShell();
SwTemplateDlg::SwTemplateDlg(Window* pParent,
SfxStyleSheetBase& rBase,
sal_uInt16 nRegion,
sal_Bool bColumn,
sal_uInt16 nPageId,
SwWrtShell* pActShell,
sal_Bool bNew ) :
SfxStyleDialog( pParent,
......@@ -263,8 +263,8 @@ SwTemplateDlg::SwTemplateDlg(Window* pParent,
AddTabPage(TP_FOOTER_PAGE, String(SW_RES(STR_PAGE_FOOTER)),
SvxFooterPage::Create,
SvxFooterPage::GetRanges );
if(bColumn)
SetCurPageId(TP_COLUMN);
if(nPageId)
SetCurPageId(nPageId);
OSL_ENSURE(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_PAGE ), "GetTabPageCreatorFunc fail!");
OSL_ENSURE(pFact->GetTabPageRangesFunc( RID_SVXPAGE_PAGE ), "GetTabPageRangesFunc fail!");
......
......@@ -51,7 +51,7 @@ public:
SwTemplateDlg( Window* pParent,
SfxStyleSheetBase& rBase,
sal_uInt16 nRegion,
sal_Bool bColumn = sal_False,
sal_uInt16 nPageId = 0,
SwWrtShell* pActShell = 0,
sal_Bool bNew = sal_False );
......
......@@ -2388,9 +2388,11 @@ void SwBaseShell::ExecDlg(SfxRequest &rReq)
//temp. View, weil die Shell nach dem Dialog nicht mehr gueltig sein muss
//z.B. Kopfzeile ausschalten
SwView& rTempView = GetView();
sal_uInt16 nPageId = 0;
if ( nSlot == FN_FORMAT_PAGE_COLUMN_DLG )
nPageId = TP_COLUMN ;
rTempView.GetDocShell()->FormatPage(rPageDesc.GetName(),
nSlot == FN_FORMAT_PAGE_COLUMN_DLG,
&rSh );
nPageId, &rSh );
rTempView.InvalidateRulerPos();
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment