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