1b3f79822SAndrew Rist /************************************************************** 2cdf0e10cSrcweir * 3b3f79822SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 4b3f79822SAndrew Rist * or more contributor license agreements. See the NOTICE file 5b3f79822SAndrew Rist * distributed with this work for additional information 6b3f79822SAndrew Rist * regarding copyright ownership. The ASF licenses this file 7b3f79822SAndrew Rist * to you under the Apache License, Version 2.0 (the 8b3f79822SAndrew Rist * "License"); you may not use this file except in compliance 9b3f79822SAndrew Rist * with the License. You may obtain a copy of the License at 10b3f79822SAndrew Rist * 11b3f79822SAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12b3f79822SAndrew Rist * 13b3f79822SAndrew Rist * Unless required by applicable law or agreed to in writing, 14b3f79822SAndrew Rist * software distributed under the License is distributed on an 15b3f79822SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16b3f79822SAndrew Rist * KIND, either express or implied. See the License for the 17b3f79822SAndrew Rist * specific language governing permissions and limitations 18b3f79822SAndrew Rist * under the License. 19b3f79822SAndrew Rist * 20b3f79822SAndrew Rist *************************************************************/ 21b3f79822SAndrew Rist 22b3f79822SAndrew Rist 23cdf0e10cSrcweir 24cdf0e10cSrcweir // MARKER(update_precomp.py): autogen include statement, do not remove 25cdf0e10cSrcweir #include "precompiled_sc.hxx" 26cdf0e10cSrcweir 27cdf0e10cSrcweir #undef SC_DLLIMPLEMENTATION 28cdf0e10cSrcweir 29cdf0e10cSrcweir 30cdf0e10cSrcweir 31cdf0e10cSrcweir //------------------------------------------------------------------ 32cdf0e10cSrcweir 33cdf0e10cSrcweir #define _TPHFEDIT_CXX 34cdf0e10cSrcweir #include "scitems.hxx" 35cdf0e10cSrcweir #include <editeng/eeitem.hxx> 36cdf0e10cSrcweir 37cdf0e10cSrcweir //CHINA001 #include <svx/chardlg.hxx> 38cdf0e10cSrcweir #include <editeng/editobj.hxx> 39cdf0e10cSrcweir #include <editeng/editstat.hxx> 40cdf0e10cSrcweir #include <editeng/editview.hxx> 41cdf0e10cSrcweir #include <editeng/flditem.hxx> 42cdf0e10cSrcweir #include <sfx2/basedlgs.hxx> 43cdf0e10cSrcweir #include <sfx2/objsh.hxx> 44cdf0e10cSrcweir #include <vcl/msgbox.hxx> 45cdf0e10cSrcweir #include <vcl/svapp.hxx> 46cdf0e10cSrcweir #include <unotools/useroptions.hxx> 47cdf0e10cSrcweir #define _SVSTDARR_USHORTS 48cdf0e10cSrcweir #include <svl/svstdarr.hxx> 49cdf0e10cSrcweir 50cdf0e10cSrcweir //CHINA001 #include "tphfedit.hxx" 51cdf0e10cSrcweir #include "editutil.hxx" 52cdf0e10cSrcweir #include "global.hxx" 53cdf0e10cSrcweir #include "attrib.hxx" 54cdf0e10cSrcweir #include "patattr.hxx" 55cdf0e10cSrcweir #include "scresid.hxx" 56cdf0e10cSrcweir #include "sc.hrc" 57cdf0e10cSrcweir #include "globstr.hrc" 58cdf0e10cSrcweir #include "tabvwsh.hxx" 59cdf0e10cSrcweir #include "prevwsh.hxx" 60cdf0e10cSrcweir #include "hfedtdlg.hrc" 61cdf0e10cSrcweir #include "textdlgs.hxx" 62cdf0e10cSrcweir #include "AccessibleEditObject.hxx" 63cdf0e10cSrcweir 64cdf0e10cSrcweir #include "scuitphfedit.hxx" //CHINA001 65cdf0e10cSrcweir #include <memory> // header file for auto_ptr 66cdf0e10cSrcweir 67cdf0e10cSrcweir // STATIC DATA ----------------------------------------------------------- 68cdf0e10cSrcweir 69cdf0e10cSrcweir static sal_uInt16 pPageRightHeaderRanges[] = { SID_SCATTR_PAGE_HEADERRIGHT, 70cdf0e10cSrcweir SID_SCATTR_PAGE_HEADERRIGHT, 71cdf0e10cSrcweir 0 }; 72cdf0e10cSrcweir 73cdf0e10cSrcweir static sal_uInt16 pPageRightFooterRanges[] = { SID_SCATTR_PAGE_FOOTERRIGHT, 74cdf0e10cSrcweir SID_SCATTR_PAGE_FOOTERRIGHT, 75cdf0e10cSrcweir 0 }; 76cdf0e10cSrcweir 77cdf0e10cSrcweir static sal_uInt16 pPageLeftHeaderRanges[] = { SID_SCATTR_PAGE_HEADERLEFT, 78cdf0e10cSrcweir SID_SCATTR_PAGE_HEADERLEFT, 79cdf0e10cSrcweir 0 }; 80cdf0e10cSrcweir 81cdf0e10cSrcweir static sal_uInt16 pPageLeftFooterRanges[] = { SID_SCATTR_PAGE_FOOTERLEFT, 82cdf0e10cSrcweir SID_SCATTR_PAGE_FOOTERLEFT, 83cdf0e10cSrcweir 0 }; 84cdf0e10cSrcweir 85cdf0e10cSrcweir 86cdf0e10cSrcweir static ScEditWindow* pActiveEdWnd = NULL; 87cdf0e10cSrcweir 88cdf0e10cSrcweir 89cdf0e10cSrcweir //======================================================================== 90cdf0e10cSrcweir // class ScHFEditPage 91cdf0e10cSrcweir // 92cdf0e10cSrcweir 93cdf0e10cSrcweir ScHFEditPage::ScHFEditPage( Window* pParent, 94cdf0e10cSrcweir sal_uInt16 nResId, 95cdf0e10cSrcweir const SfxItemSet& rCoreAttrs, 96cdf0e10cSrcweir sal_uInt16 nWhichId, 97cdf0e10cSrcweir bool bHeader ) 98cdf0e10cSrcweir 99cdf0e10cSrcweir : SfxTabPage ( pParent, ScResId( nResId ), rCoreAttrs ), 100cdf0e10cSrcweir 101cdf0e10cSrcweir aFtLeft ( this, ScResId( FT_LEFT ) ), 102cdf0e10cSrcweir aWndLeft ( this, ScResId( WND_LEFT ), Left ), 103cdf0e10cSrcweir aFtCenter ( this, ScResId( FT_CENTER ) ), 104cdf0e10cSrcweir aWndCenter ( this, ScResId( WND_CENTER ), Center ), 105cdf0e10cSrcweir aFtRight ( this, ScResId( FT_RIGHT ) ), 106cdf0e10cSrcweir aWndRight ( this, ScResId( WND_RIGHT ), Right ), 107cdf0e10cSrcweir maFtDefinedHF ( this, ScResId( FT_HF_DEFINED ) ), 108cdf0e10cSrcweir maLbDefined ( this, ScResId( LB_DEFINED ) ), 109cdf0e10cSrcweir maFtCustomHF ( this, ScResId( FT_HF_CUSTOM ) ), 110cdf0e10cSrcweir aBtnText ( this, ScResId( BTN_TEXT ) ), 111cdf0e10cSrcweir aBtnFile ( this, ScResId( BTN_FILE ) ), 112cdf0e10cSrcweir aBtnTable ( this, ScResId( BTN_TABLE ) ), 113cdf0e10cSrcweir aBtnPage ( this, ScResId( BTN_PAGE ) ), 114cdf0e10cSrcweir aBtnLastPage ( this, ScResId( BTN_PAGES ) ), 115cdf0e10cSrcweir aBtnDate ( this, ScResId( BTN_DATE ) ), 116cdf0e10cSrcweir aBtnTime ( this, ScResId( BTN_TIME ) ), 117cdf0e10cSrcweir aFlInfo ( this, ScResId( FL_INFO ) ), 118cdf0e10cSrcweir aFtInfo ( this, ScResId( FT_INFO ) ), 119cdf0e10cSrcweir aPopUpFile ( ScResId( RID_POPUP_FCOMMAND) ), 120cdf0e10cSrcweir nWhich ( nWhichId ) 121cdf0e10cSrcweir { 122cdf0e10cSrcweir //! use default style from current document? 123cdf0e10cSrcweir //! if font color is used, header/footer background color must be set 124cdf0e10cSrcweir 125cdf0e10cSrcweir ScPatternAttr aPatAttr( rCoreAttrs.GetPool() ); 126cdf0e10cSrcweir 127cdf0e10cSrcweir 128cdf0e10cSrcweir aBtnFile.SetPopupMenu(&aPopUpFile); 129cdf0e10cSrcweir 130cdf0e10cSrcweir maLbDefined.SetSelectHdl( LINK( this, ScHFEditPage, ListHdl_Impl ) ); 131cdf0e10cSrcweir aBtnFile.SetMenuHdl( LINK( this, ScHFEditPage, MenuHdl ) ); 132cdf0e10cSrcweir aBtnText .SetClickHdl( LINK( this, ScHFEditPage, ClickHdl ) ); 133cdf0e10cSrcweir aBtnPage .SetClickHdl( LINK( this, ScHFEditPage, ClickHdl ) ); 134cdf0e10cSrcweir aBtnLastPage.SetClickHdl( LINK( this, ScHFEditPage, ClickHdl ) ); 135cdf0e10cSrcweir aBtnDate .SetClickHdl( LINK( this, ScHFEditPage, ClickHdl ) ); 136cdf0e10cSrcweir aBtnTime .SetClickHdl( LINK( this, ScHFEditPage, ClickHdl ) ); 137cdf0e10cSrcweir aBtnFile .SetClickHdl( LINK( this, ScHFEditPage, ClickHdl ) ); 138cdf0e10cSrcweir aBtnTable .SetClickHdl( LINK( this, ScHFEditPage, ClickHdl ) ); 139cdf0e10cSrcweir 140cdf0e10cSrcweir aBtnText .SetModeImage( Image( ScResId( IMG_TEXT_H ) ), BMP_COLOR_HIGHCONTRAST ); 141cdf0e10cSrcweir aBtnFile .SetModeImage( Image( ScResId( IMG_FILE_H ) ), BMP_COLOR_HIGHCONTRAST ); 142cdf0e10cSrcweir aBtnTable .SetModeImage( Image( ScResId( IMG_TABLE_H ) ), BMP_COLOR_HIGHCONTRAST ); 143cdf0e10cSrcweir aBtnPage .SetModeImage( Image( ScResId( IMG_PAGE_H ) ), BMP_COLOR_HIGHCONTRAST ); 144cdf0e10cSrcweir aBtnLastPage.SetModeImage( Image( ScResId( IMG_PAGES_H ) ), BMP_COLOR_HIGHCONTRAST ); 145cdf0e10cSrcweir aBtnDate .SetModeImage( Image( ScResId( IMG_DATE_H ) ), BMP_COLOR_HIGHCONTRAST ); 146cdf0e10cSrcweir aBtnTime .SetModeImage( Image( ScResId( IMG_TIME_H ) ), BMP_COLOR_HIGHCONTRAST ); 147cdf0e10cSrcweir 148cdf0e10cSrcweir if(!bHeader) 149cdf0e10cSrcweir { 150cdf0e10cSrcweir maFtDefinedHF.SetText(ScGlobal::GetRscString( STR_FOOTER )); 151cdf0e10cSrcweir maFtCustomHF.SetText(ScGlobal::GetRscString( STR_HF_CUSTOM_FOOTER )); 152cdf0e10cSrcweir } 153cdf0e10cSrcweir if( Application::GetSettings().GetLayoutRTL() ) 154cdf0e10cSrcweir { 155cdf0e10cSrcweir Point pt1 = aWndLeft.GetPosPixel(); 156cdf0e10cSrcweir Point pt2 = aWndRight.GetPosPixel(); 157cdf0e10cSrcweir aWndLeft.SetPosPixel(pt2); 158cdf0e10cSrcweir aWndRight.SetPosPixel(pt1); 159cdf0e10cSrcweir 160cdf0e10cSrcweir pt1 = aFtLeft.GetPosPixel(); 161cdf0e10cSrcweir pt2 = aFtRight.GetPosPixel(); 162cdf0e10cSrcweir aFtLeft.SetPosPixel(pt2); 163cdf0e10cSrcweir aFtRight.SetPosPixel(pt1); 164cdf0e10cSrcweir } 165cdf0e10cSrcweir aWndLeft. SetFont( aPatAttr ); 166cdf0e10cSrcweir aWndCenter. SetFont( aPatAttr ); 167cdf0e10cSrcweir aWndRight. SetFont( aPatAttr ); 168cdf0e10cSrcweir 169*0deba7fbSSteve Yin //IAccessibility2 Implementation 2009----- 170*0deba7fbSSteve Yin aWndLeft.SetObjectSelectHdl( LINK(this,ScHFEditPage,ObjectSelectHdl) ); 171*0deba7fbSSteve Yin aWndCenter.SetObjectSelectHdl( LINK(this,ScHFEditPage,ObjectSelectHdl) ); 172*0deba7fbSSteve Yin aWndRight.SetObjectSelectHdl( LINK(this,ScHFEditPage,ObjectSelectHdl) ); 173*0deba7fbSSteve Yin aBtnText.SetAccessibleRelationMemberOf( &maFtCustomHF ); 174*0deba7fbSSteve Yin aBtnFile.SetAccessibleRelationMemberOf( &maFtCustomHF ); 175*0deba7fbSSteve Yin aBtnTable.SetAccessibleRelationMemberOf( &maFtCustomHF ); 176*0deba7fbSSteve Yin aBtnPage.SetAccessibleRelationMemberOf( &maFtCustomHF ); 177*0deba7fbSSteve Yin aBtnLastPage.SetAccessibleRelationMemberOf( &maFtCustomHF ); 178*0deba7fbSSteve Yin aBtnDate.SetAccessibleRelationMemberOf( &maFtCustomHF ); 179*0deba7fbSSteve Yin aBtnTime.SetAccessibleRelationMemberOf( &maFtCustomHF ); 180*0deba7fbSSteve Yin //-----IAccessibility2 Implementation 2009 181cdf0e10cSrcweir FillCmdArr(); 182cdf0e10cSrcweir 183cdf0e10cSrcweir aWndLeft.GrabFocus(); 184cdf0e10cSrcweir 185cdf0e10cSrcweir InitPreDefinedList(); 186cdf0e10cSrcweir 187cdf0e10cSrcweir FreeResource(); 188cdf0e10cSrcweir } 189*0deba7fbSSteve Yin //IAccessibility2 Implementation 2009----- 190*0deba7fbSSteve Yin IMPL_LINK( ScHFEditPage, ObjectSelectHdl, ScEditWindow*, pEdit ) 191*0deba7fbSSteve Yin { 192*0deba7fbSSteve Yin (void)pEdit; 193*0deba7fbSSteve Yin aBtnText.GrabFocus(); 194*0deba7fbSSteve Yin return NULL; 195*0deba7fbSSteve Yin } 196*0deba7fbSSteve Yin //-----IAccessibility2 Implementation 2009 197cdf0e10cSrcweir 198cdf0e10cSrcweir // ----------------------------------------------------------------------- 199cdf0e10cSrcweir 200cdf0e10cSrcweir __EXPORT ScHFEditPage::~ScHFEditPage() 201cdf0e10cSrcweir { 202cdf0e10cSrcweir } 203cdf0e10cSrcweir 204cdf0e10cSrcweir void ScHFEditPage::SetNumType(SvxNumType eNumType) 205cdf0e10cSrcweir { 206cdf0e10cSrcweir aWndLeft.SetNumType(eNumType); 207cdf0e10cSrcweir aWndCenter.SetNumType(eNumType); 208cdf0e10cSrcweir aWndRight.SetNumType(eNumType); 209cdf0e10cSrcweir } 210cdf0e10cSrcweir 211cdf0e10cSrcweir // ----------------------------------------------------------------------- 212cdf0e10cSrcweir 213cdf0e10cSrcweir #define IS_AVAILABLE(w)(rCoreSet.GetItemState( (w) ) >= SFX_ITEM_AVAILABLE) 214cdf0e10cSrcweir 215cdf0e10cSrcweir void __EXPORT ScHFEditPage::Reset( const SfxItemSet& rCoreSet ) 216cdf0e10cSrcweir { 217cdf0e10cSrcweir if ( IS_AVAILABLE( nWhich ) ) 218cdf0e10cSrcweir { 219cdf0e10cSrcweir const ScPageHFItem& rItem = (const ScPageHFItem&)(rCoreSet.Get( nWhich )); 220cdf0e10cSrcweir 221cdf0e10cSrcweir if( const EditTextObject* pLeft = rItem.GetLeftArea() ) 222cdf0e10cSrcweir aWndLeft.SetText( *pLeft ); 223cdf0e10cSrcweir if( const EditTextObject* pCenter = rItem.GetCenterArea() ) 224cdf0e10cSrcweir aWndCenter.SetText( *pCenter ); 225cdf0e10cSrcweir if( const EditTextObject* pRight = rItem.GetRightArea() ) 226cdf0e10cSrcweir aWndRight.SetText( *pRight ); 227cdf0e10cSrcweir 228cdf0e10cSrcweir SetSelectDefinedList(); 229cdf0e10cSrcweir } 230cdf0e10cSrcweir } 231cdf0e10cSrcweir 232cdf0e10cSrcweir #undef IS_AVAILABLE 233cdf0e10cSrcweir 234cdf0e10cSrcweir // ----------------------------------------------------------------------- 235cdf0e10cSrcweir 236cdf0e10cSrcweir sal_Bool __EXPORT ScHFEditPage::FillItemSet( SfxItemSet& rCoreSet ) 237cdf0e10cSrcweir { 238cdf0e10cSrcweir ScPageHFItem aItem( nWhich ); 239cdf0e10cSrcweir EditTextObject* pLeft = aWndLeft .CreateTextObject(); 240cdf0e10cSrcweir EditTextObject* pCenter = aWndCenter.CreateTextObject(); 241cdf0e10cSrcweir EditTextObject* pRight = aWndRight .CreateTextObject(); 242cdf0e10cSrcweir 243cdf0e10cSrcweir aItem.SetLeftArea ( *pLeft ); 244cdf0e10cSrcweir aItem.SetCenterArea( *pCenter ); 245cdf0e10cSrcweir aItem.SetRightArea ( *pRight ); 246cdf0e10cSrcweir delete pLeft; 247cdf0e10cSrcweir delete pCenter; 248cdf0e10cSrcweir delete pRight; 249cdf0e10cSrcweir 250cdf0e10cSrcweir rCoreSet.Put( aItem ); 251cdf0e10cSrcweir 252cdf0e10cSrcweir return sal_True; 253cdf0e10cSrcweir } 254cdf0e10cSrcweir 255cdf0e10cSrcweir // ----------------------------------------------------------------------- 256cdf0e10cSrcweir 257cdf0e10cSrcweir #define SET_CMD(i,id) \ 258cdf0e10cSrcweir aCmd = aDel; \ 259cdf0e10cSrcweir aCmd += ScGlobal::GetRscString( id ); \ 260cdf0e10cSrcweir aCmd += aDel; \ 261cdf0e10cSrcweir aCmdArr[i] = aCmd; 262cdf0e10cSrcweir 263cdf0e10cSrcweir // ----------------------------------------------------------------------- 264cdf0e10cSrcweir 265cdf0e10cSrcweir void ScHFEditPage::FillCmdArr() 266cdf0e10cSrcweir { 267cdf0e10cSrcweir String aDel( ScGlobal::GetRscString( STR_HFCMD_DELIMITER ) ); 268cdf0e10cSrcweir String aCmd; 269cdf0e10cSrcweir 270cdf0e10cSrcweir SET_CMD( 0, STR_HFCMD_PAGE ) 271cdf0e10cSrcweir SET_CMD( 1, STR_HFCMD_PAGES ) 272cdf0e10cSrcweir SET_CMD( 2, STR_HFCMD_DATE ) 273cdf0e10cSrcweir SET_CMD( 3, STR_HFCMD_TIME ) 274cdf0e10cSrcweir SET_CMD( 4, STR_HFCMD_FILE ) 275cdf0e10cSrcweir SET_CMD( 5, STR_HFCMD_TABLE ) 276cdf0e10cSrcweir } 277cdf0e10cSrcweir 278cdf0e10cSrcweir #undef SET_CMD 279cdf0e10cSrcweir 280cdf0e10cSrcweir void ScHFEditPage::InitPreDefinedList() 281cdf0e10cSrcweir { 282cdf0e10cSrcweir SvtUserOptions aUserOpt; 283cdf0e10cSrcweir 284cdf0e10cSrcweir Color* pTxtColour = NULL; 285cdf0e10cSrcweir Color* pFldColour = NULL; 286cdf0e10cSrcweir 287cdf0e10cSrcweir // Get the all field values at the outset. 288cdf0e10cSrcweir String aPageFieldValue(aWndLeft.GetEditEngine()->CalcFieldValue(SvxFieldItem(SvxPageField(), EE_FEATURE_FIELD), 0,0, pTxtColour, pFldColour)); 289cdf0e10cSrcweir String aSheetFieldValue(aWndLeft.GetEditEngine()->CalcFieldValue(SvxFieldItem(SvxTableField(), EE_FEATURE_FIELD), 0,0, pTxtColour, pFldColour)); 290cdf0e10cSrcweir String aFileFieldValue(aWndLeft.GetEditEngine()->CalcFieldValue(SvxFieldItem(SvxFileField(), EE_FEATURE_FIELD), 0,0, pTxtColour, pFldColour)); 291cdf0e10cSrcweir String aExtFileFieldValue(aWndLeft.GetEditEngine()->CalcFieldValue(SvxFieldItem(SvxExtFileField(), EE_FEATURE_FIELD), 0,0, pTxtColour, pFldColour)); 292cdf0e10cSrcweir String aDateFieldValue(aWndLeft.GetEditEngine()->CalcFieldValue(SvxFieldItem(SvxDateField(), EE_FEATURE_FIELD), 0,0, pTxtColour, pFldColour)); 293cdf0e10cSrcweir 294cdf0e10cSrcweir maLbDefined.Clear(); 295cdf0e10cSrcweir 296cdf0e10cSrcweir maLbDefined.InsertEntry( ScGlobal::GetRscString( STR_HF_NONE_IN_BRACKETS )); 297cdf0e10cSrcweir 298cdf0e10cSrcweir String aPageEntry(ScGlobal::GetRscString( STR_PAGE ) ); 299cdf0e10cSrcweir aPageEntry += ' '; 300cdf0e10cSrcweir aPageEntry += aPageFieldValue; 301cdf0e10cSrcweir maLbDefined.InsertEntry(aPageEntry); 302cdf0e10cSrcweir 303cdf0e10cSrcweir String aPageOfEntry(aPageEntry); 304cdf0e10cSrcweir aPageOfEntry += ' '; 305cdf0e10cSrcweir aPageOfEntry += ScGlobal::GetRscString( STR_HF_OF_QUESTION ); 306cdf0e10cSrcweir maLbDefined.InsertEntry( aPageOfEntry); 307cdf0e10cSrcweir 308cdf0e10cSrcweir maLbDefined.InsertEntry(aSheetFieldValue); 309cdf0e10cSrcweir 310cdf0e10cSrcweir String aConfidentialEntry(aUserOpt.GetCompany()); 311cdf0e10cSrcweir aConfidentialEntry += ' '; 312cdf0e10cSrcweir aConfidentialEntry += ScGlobal::GetRscString( STR_HF_CONFIDENTIAL ); 313cdf0e10cSrcweir aConfidentialEntry.AppendAscii(RTL_CONSTASCII_STRINGPARAM(", ")); 314cdf0e10cSrcweir aConfidentialEntry += aDateFieldValue; 315cdf0e10cSrcweir aConfidentialEntry.AppendAscii(RTL_CONSTASCII_STRINGPARAM(", ")); 316cdf0e10cSrcweir aConfidentialEntry += aPageEntry; 317cdf0e10cSrcweir maLbDefined.InsertEntry( aConfidentialEntry); 318cdf0e10cSrcweir 319cdf0e10cSrcweir String aFileNamePageEntry(aFileFieldValue); 320cdf0e10cSrcweir aFileNamePageEntry.AppendAscii(RTL_CONSTASCII_STRINGPARAM(", ")); 321cdf0e10cSrcweir aFileNamePageEntry += aPageEntry; 322cdf0e10cSrcweir maLbDefined.InsertEntry( aFileNamePageEntry); 323cdf0e10cSrcweir 324cdf0e10cSrcweir maLbDefined.InsertEntry( aExtFileFieldValue); 325cdf0e10cSrcweir 326cdf0e10cSrcweir String aPageSheetNameEntry(aPageEntry); 327cdf0e10cSrcweir aPageSheetNameEntry.AppendAscii(RTL_CONSTASCII_STRINGPARAM(", ")); 328cdf0e10cSrcweir aPageSheetNameEntry += aSheetFieldValue; 329cdf0e10cSrcweir maLbDefined.InsertEntry( aPageSheetNameEntry); 330cdf0e10cSrcweir 331cdf0e10cSrcweir String aPageFileNameEntry(aPageEntry); 332cdf0e10cSrcweir aPageFileNameEntry.AppendAscii(RTL_CONSTASCII_STRINGPARAM(", ")); 333cdf0e10cSrcweir aPageFileNameEntry += aFileFieldValue; 334cdf0e10cSrcweir maLbDefined.InsertEntry( aPageFileNameEntry); 335cdf0e10cSrcweir 336cdf0e10cSrcweir String aPagePathNameEntry(aPageEntry); 337cdf0e10cSrcweir aPagePathNameEntry.AppendAscii(RTL_CONSTASCII_STRINGPARAM(", ")); 338cdf0e10cSrcweir aPagePathNameEntry += aExtFileFieldValue; 339cdf0e10cSrcweir maLbDefined.InsertEntry( aPagePathNameEntry); 340cdf0e10cSrcweir 341cdf0e10cSrcweir String aUserNameEntry(aUserOpt.GetFirstName()); 342cdf0e10cSrcweir aUserNameEntry += ' '; 343cdf0e10cSrcweir aUserNameEntry += (String)aUserOpt.GetLastName(); 344cdf0e10cSrcweir aUserNameEntry.AppendAscii(RTL_CONSTASCII_STRINGPARAM(", ")); 345cdf0e10cSrcweir aUserNameEntry += aPageEntry; 346cdf0e10cSrcweir aUserNameEntry.AppendAscii(RTL_CONSTASCII_STRINGPARAM(", ")); 347cdf0e10cSrcweir aUserNameEntry += aDateFieldValue; 348cdf0e10cSrcweir maLbDefined.InsertEntry( aUserNameEntry); 349cdf0e10cSrcweir 350cdf0e10cSrcweir String aCreatedByEntry(ScGlobal::GetRscString( STR_HF_CREATED_BY ) ); 351cdf0e10cSrcweir aCreatedByEntry += ' '; 352cdf0e10cSrcweir aCreatedByEntry += (String)aUserOpt.GetFirstName(); 353cdf0e10cSrcweir aCreatedByEntry += ' '; 354cdf0e10cSrcweir aCreatedByEntry += (String)aUserOpt.GetLastName(); 355cdf0e10cSrcweir aCreatedByEntry.AppendAscii(RTL_CONSTASCII_STRINGPARAM(", ")); 356cdf0e10cSrcweir aCreatedByEntry += aDateFieldValue; 357cdf0e10cSrcweir aCreatedByEntry.AppendAscii(RTL_CONSTASCII_STRINGPARAM(", ")); 358cdf0e10cSrcweir aCreatedByEntry += aPageEntry; 359cdf0e10cSrcweir maLbDefined.InsertEntry( aCreatedByEntry); 360cdf0e10cSrcweir } 361cdf0e10cSrcweir 362cdf0e10cSrcweir void ScHFEditPage::InsertToDefinedList() 363cdf0e10cSrcweir { 364cdf0e10cSrcweir sal_uInt16 nCount = maLbDefined.GetEntryCount(); 365cdf0e10cSrcweir if(nCount == eEntryCount) 366cdf0e10cSrcweir { 367cdf0e10cSrcweir String aCustomizedEntry(ScGlobal::GetRscString( STR_HF_CUSTOMIZED ) ); 368cdf0e10cSrcweir maLbDefined.InsertEntry( aCustomizedEntry); 369cdf0e10cSrcweir maLbDefined.SelectEntryPos(eEntryCount); 370cdf0e10cSrcweir } 371cdf0e10cSrcweir } 372cdf0e10cSrcweir 373cdf0e10cSrcweir void ScHFEditPage::RemoveFromDefinedList() 374cdf0e10cSrcweir { 375cdf0e10cSrcweir sal_uInt16 nCount = maLbDefined.GetEntryCount(); 376cdf0e10cSrcweir if(nCount > eEntryCount ) 377cdf0e10cSrcweir maLbDefined.RemoveEntry( nCount-1); 378cdf0e10cSrcweir } 379cdf0e10cSrcweir 380cdf0e10cSrcweir // determine if the header/footer exists in our predefined list and set select to it. 381cdf0e10cSrcweir void ScHFEditPage::SetSelectDefinedList() 382cdf0e10cSrcweir { 383cdf0e10cSrcweir SvtUserOptions aUserOpt; 384cdf0e10cSrcweir 385cdf0e10cSrcweir // default to customized 386cdf0e10cSrcweir ScHFEntryId eSelectEntry = eEntryCount; 387cdf0e10cSrcweir 388cdf0e10cSrcweir ::std::auto_ptr< EditTextObject > pLeftObj; 389cdf0e10cSrcweir ::std::auto_ptr< EditTextObject > pCenterObj; 390cdf0e10cSrcweir ::std::auto_ptr< EditTextObject > pRightObj; 391cdf0e10cSrcweir 392cdf0e10cSrcweir XubString aLeftEntry; 393cdf0e10cSrcweir XubString aCenterEntry; 394cdf0e10cSrcweir XubString aRightEntry; 395cdf0e10cSrcweir 396cdf0e10cSrcweir pLeftObj.reset(aWndLeft.GetEditEngine()->CreateTextObject()); 397cdf0e10cSrcweir pCenterObj.reset(aWndCenter.GetEditEngine()->CreateTextObject()); 398cdf0e10cSrcweir pRightObj.reset(aWndRight.GetEditEngine()->CreateTextObject()); 399cdf0e10cSrcweir 400cdf0e10cSrcweir bool bFound = false; 401cdf0e10cSrcweir 402cdf0e10cSrcweir sal_uInt16 i; 403cdf0e10cSrcweir sal_uInt16 nCount = maLbDefined.GetEntryCount(); 404cdf0e10cSrcweir for(i = 0; i < nCount && !bFound; i++) 405cdf0e10cSrcweir { 406cdf0e10cSrcweir switch(static_cast<ScHFEntryId>(i)) 407cdf0e10cSrcweir { 408cdf0e10cSrcweir case eNoneEntry: 409cdf0e10cSrcweir { 410cdf0e10cSrcweir aLeftEntry = pLeftObj->GetText(0); 411cdf0e10cSrcweir aCenterEntry = pCenterObj->GetText(0); 412cdf0e10cSrcweir aRightEntry = pRightObj->GetText(0); 413cdf0e10cSrcweir if(aLeftEntry == EMPTY_STRING && aCenterEntry == EMPTY_STRING 414cdf0e10cSrcweir && aRightEntry == EMPTY_STRING) 415cdf0e10cSrcweir { 416cdf0e10cSrcweir eSelectEntry = eNoneEntry; 417cdf0e10cSrcweir bFound = true; 418cdf0e10cSrcweir } 419cdf0e10cSrcweir } 420cdf0e10cSrcweir break; 421cdf0e10cSrcweir 422cdf0e10cSrcweir case ePageEntry: 423cdf0e10cSrcweir { 424cdf0e10cSrcweir aLeftEntry = pLeftObj->GetText(0); 425cdf0e10cSrcweir aRightEntry = pRightObj->GetText(0); 426cdf0e10cSrcweir if(aLeftEntry == EMPTY_STRING && aRightEntry == EMPTY_STRING) 427cdf0e10cSrcweir { 428cdf0e10cSrcweir if(IsPageEntry(aWndCenter.GetEditEngine(), pCenterObj.get())) 429cdf0e10cSrcweir { 430cdf0e10cSrcweir eSelectEntry = ePageEntry; 431cdf0e10cSrcweir bFound = true; 432cdf0e10cSrcweir } 433cdf0e10cSrcweir } 434cdf0e10cSrcweir } 435cdf0e10cSrcweir break; 436cdf0e10cSrcweir 437cdf0e10cSrcweir 438cdf0e10cSrcweir //TODO 439cdf0e10cSrcweir case ePagesEntry: 440cdf0e10cSrcweir { 441cdf0e10cSrcweir } 442cdf0e10cSrcweir break; 443cdf0e10cSrcweir 444cdf0e10cSrcweir case eSheetEntry: 445cdf0e10cSrcweir { 446cdf0e10cSrcweir aLeftEntry = pLeftObj->GetText(0); 447cdf0e10cSrcweir aRightEntry = pRightObj->GetText(0); 448cdf0e10cSrcweir if(aLeftEntry == EMPTY_STRING && aRightEntry == EMPTY_STRING) 449cdf0e10cSrcweir { 450cdf0e10cSrcweir if(pCenterObj->IsFieldObject()) 451cdf0e10cSrcweir { 452cdf0e10cSrcweir const SvxFieldItem* pFieldItem = pCenterObj->GetField(); 453cdf0e10cSrcweir if(pFieldItem) 454cdf0e10cSrcweir { 455cdf0e10cSrcweir const SvxFieldData* pField = pFieldItem->GetField(); 456cdf0e10cSrcweir if(pField && pField->ISA(SvxTableField)) 457cdf0e10cSrcweir { 458cdf0e10cSrcweir eSelectEntry = eSheetEntry; 459cdf0e10cSrcweir bFound = true; 460cdf0e10cSrcweir } 461cdf0e10cSrcweir } 462cdf0e10cSrcweir } 463cdf0e10cSrcweir } 464cdf0e10cSrcweir } 465cdf0e10cSrcweir break; 466cdf0e10cSrcweir 467cdf0e10cSrcweir case eConfidentialEntry: 468cdf0e10cSrcweir { 469cdf0e10cSrcweir if(IsDateEntry(pCenterObj.get()) && IsPageEntry(aWndRight.GetEditEngine(), pRightObj.get())) 470cdf0e10cSrcweir { 471cdf0e10cSrcweir String aConfidentialEntry(aUserOpt.GetCompany()); 472cdf0e10cSrcweir aConfidentialEntry += ' '; 473cdf0e10cSrcweir aConfidentialEntry += ScGlobal::GetRscString( STR_HF_CONFIDENTIAL ); 474cdf0e10cSrcweir if(aConfidentialEntry == aWndLeft.GetEditEngine()->GetText(0)) 475cdf0e10cSrcweir { 476cdf0e10cSrcweir eSelectEntry = eConfidentialEntry; 477cdf0e10cSrcweir bFound = true; 478cdf0e10cSrcweir } 479cdf0e10cSrcweir } 480cdf0e10cSrcweir } 481cdf0e10cSrcweir break; 482cdf0e10cSrcweir 483cdf0e10cSrcweir //TODO 484cdf0e10cSrcweir case eFileNamePageEntry: 485cdf0e10cSrcweir { 486cdf0e10cSrcweir } 487cdf0e10cSrcweir break; 488cdf0e10cSrcweir 489cdf0e10cSrcweir case eExtFileNameEntry: 490cdf0e10cSrcweir { 491cdf0e10cSrcweir aLeftEntry = pLeftObj->GetText(0); 492cdf0e10cSrcweir aRightEntry = pRightObj->GetText(0); 493cdf0e10cSrcweir if(IsExtFileNameEntry(pCenterObj.get()) && aLeftEntry == EMPTY_STRING 494cdf0e10cSrcweir && aRightEntry == EMPTY_STRING) 495cdf0e10cSrcweir { 496cdf0e10cSrcweir eSelectEntry = eExtFileNameEntry; 497cdf0e10cSrcweir bFound = true; 498cdf0e10cSrcweir } 499cdf0e10cSrcweir } 500cdf0e10cSrcweir break; 501cdf0e10cSrcweir 502cdf0e10cSrcweir //TODO 503cdf0e10cSrcweir case ePageSheetEntry: 504cdf0e10cSrcweir { 505cdf0e10cSrcweir } 506cdf0e10cSrcweir break; 507cdf0e10cSrcweir 508cdf0e10cSrcweir //TODO 509cdf0e10cSrcweir case ePageFileNameEntry: 510cdf0e10cSrcweir { 511cdf0e10cSrcweir } 512cdf0e10cSrcweir break; 513cdf0e10cSrcweir 514cdf0e10cSrcweir case ePageExtFileNameEntry: 515cdf0e10cSrcweir { 516cdf0e10cSrcweir aLeftEntry = pLeftObj->GetText(0); 517cdf0e10cSrcweir if(IsPageEntry(aWndCenter.GetEditEngine(), pCenterObj.get()) && 518cdf0e10cSrcweir IsExtFileNameEntry(pRightObj.get()) && aLeftEntry == EMPTY_STRING) 519cdf0e10cSrcweir { 520cdf0e10cSrcweir eSelectEntry = ePageExtFileNameEntry; 521cdf0e10cSrcweir bFound = true; 522cdf0e10cSrcweir } 523cdf0e10cSrcweir } 524cdf0e10cSrcweir break; 525cdf0e10cSrcweir 526cdf0e10cSrcweir case eUserNameEntry: 527cdf0e10cSrcweir { 528cdf0e10cSrcweir if(IsDateEntry(pRightObj.get()) && IsPageEntry(aWndCenter.GetEditEngine(), pCenterObj.get())) 529cdf0e10cSrcweir { 530cdf0e10cSrcweir String aUserNameEntry(aUserOpt.GetFirstName()); 531cdf0e10cSrcweir aUserNameEntry += ' '; 532cdf0e10cSrcweir aUserNameEntry += (String)aUserOpt.GetLastName(); 533cdf0e10cSrcweir if(aUserNameEntry == aWndLeft.GetEditEngine()->GetText(0)) 534cdf0e10cSrcweir { 535cdf0e10cSrcweir eSelectEntry = eUserNameEntry; 536cdf0e10cSrcweir bFound = true; 537cdf0e10cSrcweir } 538cdf0e10cSrcweir } 539cdf0e10cSrcweir } 540cdf0e10cSrcweir break; 541cdf0e10cSrcweir 542cdf0e10cSrcweir case eCreatedByEntry: 543cdf0e10cSrcweir { 544cdf0e10cSrcweir if(IsDateEntry(pCenterObj.get()) && IsPageEntry(aWndRight.GetEditEngine(), pRightObj.get())) 545cdf0e10cSrcweir { 546cdf0e10cSrcweir String aCreatedByEntry(ScGlobal::GetRscString( STR_HF_CREATED_BY ) ); 547cdf0e10cSrcweir aCreatedByEntry += ' '; 548cdf0e10cSrcweir aCreatedByEntry += (String)aUserOpt.GetFirstName(); 549cdf0e10cSrcweir aCreatedByEntry += ' '; 550cdf0e10cSrcweir aCreatedByEntry += (String)aUserOpt.GetLastName(); 551cdf0e10cSrcweir if(aCreatedByEntry == aWndLeft.GetEditEngine()->GetText(0)) 552cdf0e10cSrcweir { 553cdf0e10cSrcweir eSelectEntry = eCreatedByEntry; 554cdf0e10cSrcweir bFound = true; 555cdf0e10cSrcweir } 556cdf0e10cSrcweir } 557cdf0e10cSrcweir } 558cdf0e10cSrcweir break; 559cdf0e10cSrcweir 560cdf0e10cSrcweir default: 561cdf0e10cSrcweir { 562cdf0e10cSrcweir // added to avoid warnings 563cdf0e10cSrcweir } 564cdf0e10cSrcweir } 565cdf0e10cSrcweir } 566cdf0e10cSrcweir 567cdf0e10cSrcweir if(eSelectEntry == eEntryCount) 568cdf0e10cSrcweir InsertToDefinedList(); 569cdf0e10cSrcweir 570cdf0e10cSrcweir maLbDefined.SelectEntryPos( sal::static_int_cast<sal_uInt16>( eSelectEntry ) ); 571cdf0e10cSrcweir } 572cdf0e10cSrcweir 573cdf0e10cSrcweir bool ScHFEditPage::IsPageEntry(EditEngine*pEngine, EditTextObject* pTextObj) 574cdf0e10cSrcweir { 575cdf0e10cSrcweir if(!pEngine && !pTextObj) 576cdf0e10cSrcweir return false; 577cdf0e10cSrcweir 578cdf0e10cSrcweir bool bReturn = false; 579cdf0e10cSrcweir 580cdf0e10cSrcweir if(!pTextObj->IsFieldObject()) 581cdf0e10cSrcweir { 582cdf0e10cSrcweir SvUShorts aPosList; 583cdf0e10cSrcweir pEngine->GetPortions(0,aPosList); 584cdf0e10cSrcweir if(aPosList.Count() == 2) 585cdf0e10cSrcweir { 586cdf0e10cSrcweir String aPageEntry(ScGlobal::GetRscString( STR_PAGE ) ); 587cdf0e10cSrcweir aPageEntry += ' '; 588cdf0e10cSrcweir ESelection aSel(0,0,0,0); 589cdf0e10cSrcweir aSel.nEndPos = aPageEntry.Len(); 590cdf0e10cSrcweir if(aPageEntry == pEngine->GetText(aSel)) 591cdf0e10cSrcweir { 592cdf0e10cSrcweir aSel.nStartPos = aSel.nEndPos; 593cdf0e10cSrcweir aSel.nEndPos++; 594cdf0e10cSrcweir ::std::auto_ptr< EditTextObject > pPageObj; 595cdf0e10cSrcweir pPageObj.reset(pEngine->CreateTextObject(aSel)); 596cdf0e10cSrcweir if(pPageObj.get() && pPageObj->IsFieldObject() ) 597cdf0e10cSrcweir { 598cdf0e10cSrcweir const SvxFieldItem* pFieldItem = pPageObj->GetField(); 599cdf0e10cSrcweir if(pFieldItem) 600cdf0e10cSrcweir { 601cdf0e10cSrcweir const SvxFieldData* pField = pFieldItem->GetField(); 602cdf0e10cSrcweir if(pField && pField->ISA(SvxPageField)) 603cdf0e10cSrcweir bReturn = true; 604cdf0e10cSrcweir } 605cdf0e10cSrcweir } 606cdf0e10cSrcweir } 607cdf0e10cSrcweir } 608cdf0e10cSrcweir } 609cdf0e10cSrcweir return bReturn; 610cdf0e10cSrcweir } 611cdf0e10cSrcweir 612cdf0e10cSrcweir bool ScHFEditPage::IsDateEntry(EditTextObject* pTextObj) 613cdf0e10cSrcweir { 614cdf0e10cSrcweir if(!pTextObj) 615cdf0e10cSrcweir return false; 616cdf0e10cSrcweir 617cdf0e10cSrcweir bool bReturn = false; 618cdf0e10cSrcweir if(pTextObj->IsFieldObject()) 619cdf0e10cSrcweir { 620cdf0e10cSrcweir const SvxFieldItem* pFieldItem = pTextObj->GetField(); 621cdf0e10cSrcweir if(pFieldItem) 622cdf0e10cSrcweir { 623cdf0e10cSrcweir const SvxFieldData* pField = pFieldItem->GetField(); 624cdf0e10cSrcweir if(pField && pField->ISA(SvxDateField)) 625cdf0e10cSrcweir bReturn = true; 626cdf0e10cSrcweir } 627cdf0e10cSrcweir } 628cdf0e10cSrcweir return bReturn; 629cdf0e10cSrcweir } 630cdf0e10cSrcweir 631cdf0e10cSrcweir bool ScHFEditPage::IsExtFileNameEntry(EditTextObject* pTextObj) 632cdf0e10cSrcweir { 633cdf0e10cSrcweir if(!pTextObj) 634cdf0e10cSrcweir return false; 635cdf0e10cSrcweir bool bReturn = false; 636cdf0e10cSrcweir if(pTextObj->IsFieldObject()) 637cdf0e10cSrcweir { 638cdf0e10cSrcweir const SvxFieldItem* pFieldItem = pTextObj->GetField(); 639cdf0e10cSrcweir if(pFieldItem) 640cdf0e10cSrcweir { 641cdf0e10cSrcweir const SvxFieldData* pField = pFieldItem->GetField(); 642cdf0e10cSrcweir if(pField && pField->ISA(SvxExtFileField)) 643cdf0e10cSrcweir bReturn = true; 644cdf0e10cSrcweir } 645cdf0e10cSrcweir } 646cdf0e10cSrcweir return bReturn; 647cdf0e10cSrcweir } 648cdf0e10cSrcweir 649cdf0e10cSrcweir void ScHFEditPage::ProcessDefinedListSel(ScHFEntryId eSel, bool bTravelling) 650cdf0e10cSrcweir { 651cdf0e10cSrcweir SvtUserOptions aUserOpt; 652cdf0e10cSrcweir ::std::auto_ptr< EditTextObject > pTextObj; 653cdf0e10cSrcweir 654cdf0e10cSrcweir switch(eSel) 655cdf0e10cSrcweir { 656cdf0e10cSrcweir case eNoneEntry: 657cdf0e10cSrcweir ClearTextAreas(); 658cdf0e10cSrcweir if(!bTravelling) 659cdf0e10cSrcweir aWndLeft.GrabFocus(); 660cdf0e10cSrcweir break; 661cdf0e10cSrcweir 662cdf0e10cSrcweir case ePageEntry: 663cdf0e10cSrcweir { 664cdf0e10cSrcweir ClearTextAreas(); 665cdf0e10cSrcweir String aPageEntry(ScGlobal::GetRscString( STR_PAGE ) ); 666cdf0e10cSrcweir aPageEntry += ' '; 667cdf0e10cSrcweir aWndCenter.GetEditEngine()->SetText(aPageEntry); 668cdf0e10cSrcweir aWndCenter.InsertField( SvxFieldItem(SvxPageField(), EE_FEATURE_FIELD) ); 669cdf0e10cSrcweir if(!bTravelling) 670cdf0e10cSrcweir aWndCenter.GrabFocus(); 671cdf0e10cSrcweir } 672cdf0e10cSrcweir break; 673cdf0e10cSrcweir 674cdf0e10cSrcweir case ePagesEntry: 675cdf0e10cSrcweir { 676cdf0e10cSrcweir ClearTextAreas(); 677cdf0e10cSrcweir ESelection aSel(0,0,0,0); 678cdf0e10cSrcweir String aPageEntry(ScGlobal::GetRscString( STR_PAGE ) ); 679cdf0e10cSrcweir aPageEntry += ' '; 680cdf0e10cSrcweir aWndCenter.GetEditEngine()->SetText(aPageEntry); 681cdf0e10cSrcweir aSel.nEndPos = aPageEntry.Len(); 682cdf0e10cSrcweir aWndCenter.GetEditEngine()->QuickInsertField(SvxFieldItem(SvxPageField(), EE_FEATURE_FIELD), ESelection(aSel.nEndPara, aSel.nEndPos, aSel.nEndPara, aSel.nEndPos)); 683cdf0e10cSrcweir ++aSel.nEndPos; 684cdf0e10cSrcweir String aPageOfEntry = ' '; 685cdf0e10cSrcweir aPageOfEntry += ScGlobal::GetRscString( STR_HF_OF ); 686cdf0e10cSrcweir aPageOfEntry += ' '; 687cdf0e10cSrcweir aWndCenter.GetEditEngine()->QuickInsertText(aPageOfEntry,ESelection(aSel.nEndPara,aSel.nEndPos, aSel.nEndPara, aSel.nEndPos)); 688cdf0e10cSrcweir aSel.nEndPos = sal::static_int_cast<xub_StrLen>( aSel.nEndPos + aPageOfEntry.Len() ); 689cdf0e10cSrcweir aWndCenter.GetEditEngine()->QuickInsertField(SvxFieldItem(SvxPagesField(), EE_FEATURE_FIELD), ESelection(aSel.nEndPara,aSel.nEndPos, aSel.nEndPara, aSel.nEndPos)); 690cdf0e10cSrcweir pTextObj.reset(aWndCenter.GetEditEngine()->CreateTextObject()); 691cdf0e10cSrcweir aWndCenter.SetText(*pTextObj); 692cdf0e10cSrcweir XubString aEntry(pTextObj.get()->GetText(0)); 693cdf0e10cSrcweir if(!bTravelling) 694cdf0e10cSrcweir aWndCenter.GrabFocus(); 695cdf0e10cSrcweir } 696cdf0e10cSrcweir break; 697cdf0e10cSrcweir 698cdf0e10cSrcweir case eSheetEntry: 699cdf0e10cSrcweir ClearTextAreas(); 700cdf0e10cSrcweir aWndCenter.InsertField( SvxFieldItem(SvxTableField(), EE_FEATURE_FIELD) ); 701cdf0e10cSrcweir if(!bTravelling) 702cdf0e10cSrcweir aWndCenter.GrabFocus(); 703cdf0e10cSrcweir break; 704cdf0e10cSrcweir 705cdf0e10cSrcweir case eConfidentialEntry: 706cdf0e10cSrcweir { 707cdf0e10cSrcweir ClearTextAreas(); 708cdf0e10cSrcweir String aConfidentialEntry(aUserOpt.GetCompany()); 709cdf0e10cSrcweir aConfidentialEntry += ' '; 710cdf0e10cSrcweir aConfidentialEntry += ScGlobal::GetRscString( STR_HF_CONFIDENTIAL ); 711cdf0e10cSrcweir aWndLeft.GetEditEngine()->SetText(aConfidentialEntry); 712cdf0e10cSrcweir aWndCenter.InsertField( SvxFieldItem(SvxDateField(Date(),SVXDATETYPE_VAR), EE_FEATURE_FIELD) ); 713cdf0e10cSrcweir String aPageEntry(ScGlobal::GetRscString( STR_PAGE ) ); 714cdf0e10cSrcweir aPageEntry += ' '; 715cdf0e10cSrcweir aWndRight.GetEditEngine()->SetText(aPageEntry); 716cdf0e10cSrcweir aWndRight.InsertField( SvxFieldItem(SvxPageField(), EE_FEATURE_FIELD) ); 717cdf0e10cSrcweir if(!bTravelling) 718cdf0e10cSrcweir aWndRight.GrabFocus(); 719cdf0e10cSrcweir } 720cdf0e10cSrcweir break; 721cdf0e10cSrcweir 722cdf0e10cSrcweir case eFileNamePageEntry: 723cdf0e10cSrcweir { 724cdf0e10cSrcweir ClearTextAreas(); 725cdf0e10cSrcweir ESelection aSel(0,0,0,0); 726cdf0e10cSrcweir aWndCenter.GetEditEngine()->QuickInsertField(SvxFieldItem( SvxFileField(), EE_FEATURE_FIELD ), aSel ); 727cdf0e10cSrcweir ++aSel.nEndPos; 728cdf0e10cSrcweir String aPageEntry(RTL_CONSTASCII_STRINGPARAM(", ")); 729cdf0e10cSrcweir aPageEntry += ScGlobal::GetRscString( STR_PAGE ) ; 730cdf0e10cSrcweir aPageEntry += ' '; 731cdf0e10cSrcweir aWndCenter.GetEditEngine()->QuickInsertText(aPageEntry, ESelection(aSel.nEndPara,aSel.nEndPos, aSel.nEndPara, aSel.nEndPos)); 732cdf0e10cSrcweir aSel.nStartPos = aSel.nEndPos; 733cdf0e10cSrcweir aSel.nEndPos = sal::static_int_cast<xub_StrLen>( aSel.nEndPos + aPageEntry.Len() ); 734cdf0e10cSrcweir aWndCenter.GetEditEngine()->QuickInsertField(SvxFieldItem(SvxPageField(), EE_FEATURE_FIELD), ESelection(aSel.nEndPara,aSel.nEndPos, aSel.nEndPara, aSel.nEndPos)); 735cdf0e10cSrcweir pTextObj.reset(aWndCenter.GetEditEngine()->CreateTextObject()); 736cdf0e10cSrcweir aWndCenter.SetText(*pTextObj); 737cdf0e10cSrcweir XubString aEntry2(pTextObj.get()->GetText(0)); 738cdf0e10cSrcweir if(!bTravelling) 739cdf0e10cSrcweir aWndCenter.GrabFocus(); 740cdf0e10cSrcweir } 741cdf0e10cSrcweir break; 742cdf0e10cSrcweir 743cdf0e10cSrcweir case eExtFileNameEntry: 744cdf0e10cSrcweir ClearTextAreas(); 745cdf0e10cSrcweir aWndCenter.InsertField( SvxFieldItem( SvxExtFileField( 746cdf0e10cSrcweir EMPTY_STRING, SVXFILETYPE_VAR, SVXFILEFORMAT_FULLPATH ), EE_FEATURE_FIELD ) ); 747cdf0e10cSrcweir if(!bTravelling) 748cdf0e10cSrcweir aWndCenter.GrabFocus(); 749cdf0e10cSrcweir break; 750cdf0e10cSrcweir 751cdf0e10cSrcweir case ePageSheetEntry: 752cdf0e10cSrcweir { 753cdf0e10cSrcweir ClearTextAreas(); 754cdf0e10cSrcweir ESelection aSel(0,0,0,0); 755cdf0e10cSrcweir String aPageEntry(ScGlobal::GetRscString( STR_PAGE ) ); 756cdf0e10cSrcweir aPageEntry += ' '; 757cdf0e10cSrcweir aWndCenter.GetEditEngine()->SetText(aPageEntry); 758cdf0e10cSrcweir aSel.nEndPos = aPageEntry.Len(); 759cdf0e10cSrcweir aWndCenter.GetEditEngine()->QuickInsertField(SvxFieldItem(SvxPageField(), EE_FEATURE_FIELD), ESelection(aSel.nEndPara, aSel.nEndPos, aSel.nEndPara, aSel.nEndPos)); 760cdf0e10cSrcweir ++aSel.nEndPos; 761cdf0e10cSrcweir String aCommaSpace(RTL_CONSTASCII_STRINGPARAM(", ")); 762cdf0e10cSrcweir aWndCenter.GetEditEngine()->QuickInsertText(aCommaSpace,ESelection(aSel.nEndPara, aSel.nEndPos, aSel.nEndPara, aSel.nEndPos)); 763cdf0e10cSrcweir aSel.nEndPos = sal::static_int_cast<xub_StrLen>( aSel.nEndPos + aCommaSpace.Len() ); 764cdf0e10cSrcweir aWndCenter.GetEditEngine()->QuickInsertField( SvxFieldItem(SvxTableField(), EE_FEATURE_FIELD), ESelection(aSel.nEndPara, aSel.nEndPos, aSel.nEndPara, aSel.nEndPos)); 765cdf0e10cSrcweir pTextObj.reset(aWndCenter.GetEditEngine()->CreateTextObject()); 766cdf0e10cSrcweir aWndCenter.SetText(*pTextObj); 767cdf0e10cSrcweir if(!bTravelling) 768cdf0e10cSrcweir aWndCenter.GrabFocus(); 769cdf0e10cSrcweir } 770cdf0e10cSrcweir break; 771cdf0e10cSrcweir 772cdf0e10cSrcweir case ePageFileNameEntry: 773cdf0e10cSrcweir { 774cdf0e10cSrcweir ClearTextAreas(); 775cdf0e10cSrcweir ESelection aSel(0,0,0,0); 776cdf0e10cSrcweir String aPageEntry(ScGlobal::GetRscString( STR_PAGE ) ); 777cdf0e10cSrcweir aPageEntry += ' '; 778cdf0e10cSrcweir aWndCenter.GetEditEngine()->SetText(aPageEntry); 779cdf0e10cSrcweir aSel.nEndPos = aPageEntry.Len(); 780cdf0e10cSrcweir aWndCenter.GetEditEngine()->QuickInsertField(SvxFieldItem(SvxPageField(), EE_FEATURE_FIELD), ESelection(aSel.nEndPara, aSel.nEndPos, aSel.nEndPara, aSel.nEndPos)); 781cdf0e10cSrcweir ++aSel.nEndPos; 782cdf0e10cSrcweir String aCommaSpace(RTL_CONSTASCII_STRINGPARAM(", ")); 783cdf0e10cSrcweir aWndCenter.GetEditEngine()->QuickInsertText(aCommaSpace,ESelection(aSel.nEndPara, aSel.nEndPos, aSel.nEndPara, aSel.nEndPos)); 784cdf0e10cSrcweir aSel.nEndPos = sal::static_int_cast<xub_StrLen>( aSel.nEndPos + aCommaSpace.Len() ); 785cdf0e10cSrcweir aWndCenter.GetEditEngine()->QuickInsertField( SvxFieldItem(SvxFileField(), EE_FEATURE_FIELD), ESelection(aSel.nEndPara, aSel.nEndPos, aSel.nEndPara, aSel.nEndPos)); 786cdf0e10cSrcweir pTextObj.reset(aWndCenter.GetEditEngine()->CreateTextObject()); 787cdf0e10cSrcweir aWndCenter.SetText(*pTextObj); 788cdf0e10cSrcweir if(!bTravelling) 789cdf0e10cSrcweir aWndCenter.GrabFocus(); 790cdf0e10cSrcweir } 791cdf0e10cSrcweir break; 792cdf0e10cSrcweir 793cdf0e10cSrcweir case ePageExtFileNameEntry: 794cdf0e10cSrcweir { 795cdf0e10cSrcweir ClearTextAreas(); 796cdf0e10cSrcweir String aPageEntry(ScGlobal::GetRscString( STR_PAGE ) ); 797cdf0e10cSrcweir aPageEntry += ' '; 798cdf0e10cSrcweir aWndCenter.GetEditEngine()->SetText(aPageEntry); 799cdf0e10cSrcweir aWndCenter.InsertField( SvxFieldItem(SvxPageField(), EE_FEATURE_FIELD) ); 800cdf0e10cSrcweir aWndRight.InsertField( SvxFieldItem( SvxExtFileField( 801cdf0e10cSrcweir EMPTY_STRING, SVXFILETYPE_VAR, SVXFILEFORMAT_FULLPATH ), EE_FEATURE_FIELD ) ); 802cdf0e10cSrcweir if(!bTravelling) 803cdf0e10cSrcweir aWndRight.GrabFocus(); 804cdf0e10cSrcweir } 805cdf0e10cSrcweir break; 806cdf0e10cSrcweir 807cdf0e10cSrcweir case eUserNameEntry: 808cdf0e10cSrcweir { 809cdf0e10cSrcweir ClearTextAreas(); 810cdf0e10cSrcweir String aUserNameEntry(aUserOpt.GetFirstName()); 811cdf0e10cSrcweir aUserNameEntry += ' '; 812cdf0e10cSrcweir aUserNameEntry += (String)aUserOpt.GetLastName(); 813cdf0e10cSrcweir aWndLeft.GetEditEngine()->SetText(aUserNameEntry); 814cdf0e10cSrcweir String aPageEntry(ScGlobal::GetRscString( STR_PAGE ) ); 815cdf0e10cSrcweir aPageEntry += ' '; 816cdf0e10cSrcweir aWndCenter.GetEditEngine()->SetText(aPageEntry); 817cdf0e10cSrcweir aWndCenter.InsertField( SvxFieldItem(SvxPageField(), EE_FEATURE_FIELD) ); 818cdf0e10cSrcweir aWndRight.InsertField( SvxFieldItem(SvxDateField(Date(),SVXDATETYPE_VAR), EE_FEATURE_FIELD) ); 819cdf0e10cSrcweir if(!bTravelling) 820cdf0e10cSrcweir aWndRight.GrabFocus(); 821cdf0e10cSrcweir } 822cdf0e10cSrcweir break; 823cdf0e10cSrcweir 824cdf0e10cSrcweir case eCreatedByEntry: 825cdf0e10cSrcweir { 826cdf0e10cSrcweir ClearTextAreas(); 827cdf0e10cSrcweir String aCreatedByEntry(ScGlobal::GetRscString( STR_HF_CREATED_BY ) ); 828cdf0e10cSrcweir aCreatedByEntry += ' '; 829cdf0e10cSrcweir aCreatedByEntry += (String)aUserOpt.GetFirstName(); 830cdf0e10cSrcweir aCreatedByEntry += ' '; 831cdf0e10cSrcweir aCreatedByEntry += (String)aUserOpt.GetLastName(); 832cdf0e10cSrcweir aWndLeft.GetEditEngine()->SetText(aCreatedByEntry); 833cdf0e10cSrcweir aWndCenter.InsertField( SvxFieldItem(SvxDateField(Date(),SVXDATETYPE_VAR), EE_FEATURE_FIELD) ); 834cdf0e10cSrcweir String aPageEntry(ScGlobal::GetRscString( STR_PAGE ) ); 835cdf0e10cSrcweir aPageEntry += ' '; 836cdf0e10cSrcweir aWndRight.GetEditEngine()->SetText(aPageEntry); 837cdf0e10cSrcweir aWndRight.InsertField( SvxFieldItem(SvxPageField(), EE_FEATURE_FIELD) ); 838cdf0e10cSrcweir if(!bTravelling) 839cdf0e10cSrcweir aWndRight.GrabFocus(); 840cdf0e10cSrcweir } 841cdf0e10cSrcweir break; 842cdf0e10cSrcweir 843cdf0e10cSrcweir default : 844cdf0e10cSrcweir break; 845cdf0e10cSrcweir } 846cdf0e10cSrcweir } 847cdf0e10cSrcweir 848cdf0e10cSrcweir void ScHFEditPage::ClearTextAreas() 849cdf0e10cSrcweir { 850cdf0e10cSrcweir aWndLeft.GetEditEngine()->SetText(EMPTY_STRING); 851cdf0e10cSrcweir aWndLeft.Invalidate(); 852cdf0e10cSrcweir aWndCenter.GetEditEngine()->SetText(EMPTY_STRING); 853cdf0e10cSrcweir aWndCenter.Invalidate(); 854cdf0e10cSrcweir aWndRight.GetEditEngine()->SetText(EMPTY_STRING); 855cdf0e10cSrcweir aWndRight.Invalidate(); 856cdf0e10cSrcweir } 857cdf0e10cSrcweir 858cdf0e10cSrcweir //----------------------------------------------------------------------- 859cdf0e10cSrcweir // Handler: 860cdf0e10cSrcweir //----------------------------------------------------------------------- 861cdf0e10cSrcweir 862cdf0e10cSrcweir IMPL_LINK( ScHFEditPage, ListHdl_Impl, ListBox*, pList ) 863cdf0e10cSrcweir { 864cdf0e10cSrcweir if ( pList && pList == &maLbDefined ) 865cdf0e10cSrcweir { 866cdf0e10cSrcweir ScHFEntryId eSel = static_cast<ScHFEntryId>(maLbDefined.GetSelectEntryPos()); 867cdf0e10cSrcweir if(!maLbDefined.IsTravelSelect()) 868cdf0e10cSrcweir { 869cdf0e10cSrcweir ProcessDefinedListSel(eSel); 870cdf0e10cSrcweir 871cdf0e10cSrcweir // check if we need to remove the customized entry. 872cdf0e10cSrcweir if(eSel < eEntryCount) 873cdf0e10cSrcweir RemoveFromDefinedList(); 874cdf0e10cSrcweir } 875cdf0e10cSrcweir else 876cdf0e10cSrcweir { 877cdf0e10cSrcweir ProcessDefinedListSel(eSel, true); 878cdf0e10cSrcweir } 879cdf0e10cSrcweir } 880cdf0e10cSrcweir return 0; 881cdf0e10cSrcweir } 882cdf0e10cSrcweir 883cdf0e10cSrcweir IMPL_LINK( ScHFEditPage, ClickHdl, ImageButton*, pBtn ) 884cdf0e10cSrcweir { 885cdf0e10cSrcweir pActiveEdWnd = ::GetScEditWindow(); //CHINA001 886cdf0e10cSrcweir if ( !pActiveEdWnd ) 887cdf0e10cSrcweir return 0; 888cdf0e10cSrcweir 889cdf0e10cSrcweir if ( pBtn == &aBtnText ) 890cdf0e10cSrcweir { 891cdf0e10cSrcweir pActiveEdWnd->SetCharAttriutes(); 892cdf0e10cSrcweir } 893cdf0e10cSrcweir else 894cdf0e10cSrcweir { 895cdf0e10cSrcweir if ( pBtn == &aBtnPage ) 896cdf0e10cSrcweir pActiveEdWnd->InsertField( SvxFieldItem(SvxPageField(), EE_FEATURE_FIELD) ); 897cdf0e10cSrcweir else if ( pBtn == &aBtnLastPage ) 898cdf0e10cSrcweir pActiveEdWnd->InsertField( SvxFieldItem(SvxPagesField(), EE_FEATURE_FIELD) ); 899cdf0e10cSrcweir else if ( pBtn == &aBtnDate ) 900cdf0e10cSrcweir pActiveEdWnd->InsertField( SvxFieldItem(SvxDateField(Date(),SVXDATETYPE_VAR), EE_FEATURE_FIELD) ); 901cdf0e10cSrcweir else if ( pBtn == &aBtnTime ) 902cdf0e10cSrcweir pActiveEdWnd->InsertField( SvxFieldItem(SvxTimeField(), EE_FEATURE_FIELD) ); 903cdf0e10cSrcweir else if ( pBtn == &aBtnFile ) 904cdf0e10cSrcweir { 905cdf0e10cSrcweir pActiveEdWnd->InsertField( SvxFieldItem( SvxFileField(), EE_FEATURE_FIELD ) ); 906cdf0e10cSrcweir } 907cdf0e10cSrcweir else if ( pBtn == &aBtnTable ) 908cdf0e10cSrcweir pActiveEdWnd->InsertField( SvxFieldItem(SvxTableField(), EE_FEATURE_FIELD) ); 909cdf0e10cSrcweir } 910cdf0e10cSrcweir InsertToDefinedList(); 911cdf0e10cSrcweir pActiveEdWnd->GrabFocus(); 912cdf0e10cSrcweir 913cdf0e10cSrcweir return 0; 914cdf0e10cSrcweir } 915cdf0e10cSrcweir 916cdf0e10cSrcweir IMPL_LINK( ScHFEditPage, MenuHdl, ScExtIButton*, pBtn ) 917cdf0e10cSrcweir { 918cdf0e10cSrcweir pActiveEdWnd = ::GetScEditWindow(); //CHINA001 919cdf0e10cSrcweir if ( !pActiveEdWnd ) 920cdf0e10cSrcweir return 0; 921cdf0e10cSrcweir 922cdf0e10cSrcweir if(pBtn!=NULL) 923cdf0e10cSrcweir { 924cdf0e10cSrcweir switch(pBtn->GetSelected()) 925cdf0e10cSrcweir { 926cdf0e10cSrcweir case FILE_COMMAND_TITEL: 927cdf0e10cSrcweir pActiveEdWnd->InsertField( SvxFieldItem( SvxFileField(), EE_FEATURE_FIELD ) ); 928cdf0e10cSrcweir break; 929cdf0e10cSrcweir case FILE_COMMAND_FILENAME: 930cdf0e10cSrcweir pActiveEdWnd->InsertField( SvxFieldItem( SvxExtFileField( 931cdf0e10cSrcweir EMPTY_STRING, SVXFILETYPE_VAR, SVXFILEFORMAT_NAME_EXT ), EE_FEATURE_FIELD ) ); 932cdf0e10cSrcweir break; 933cdf0e10cSrcweir case FILE_COMMAND_PATH: 934cdf0e10cSrcweir pActiveEdWnd->InsertField( SvxFieldItem( SvxExtFileField( 935cdf0e10cSrcweir EMPTY_STRING, SVXFILETYPE_VAR, SVXFILEFORMAT_FULLPATH ), EE_FEATURE_FIELD ) ); 936cdf0e10cSrcweir break; 937cdf0e10cSrcweir } 938cdf0e10cSrcweir } 939cdf0e10cSrcweir return 0; 940cdf0e10cSrcweir } 941cdf0e10cSrcweir 942cdf0e10cSrcweir //======================================================================== 943cdf0e10cSrcweir // class ScRightHeaderEditPage 944cdf0e10cSrcweir //======================================================================== 945cdf0e10cSrcweir 946cdf0e10cSrcweir ScRightHeaderEditPage::ScRightHeaderEditPage( Window* pParent, const SfxItemSet& rCoreSet ) 947cdf0e10cSrcweir : ScHFEditPage( pParent, RID_SCPAGE_HFED_HR, rCoreSet, 948cdf0e10cSrcweir rCoreSet.GetPool()->GetWhich(SID_SCATTR_PAGE_HEADERRIGHT ), true ) 949cdf0e10cSrcweir {} 950cdf0e10cSrcweir 951cdf0e10cSrcweir // ----------------------------------------------------------------------- 952cdf0e10cSrcweir 953cdf0e10cSrcweir sal_uInt16* __EXPORT ScRightHeaderEditPage::GetRanges() 954cdf0e10cSrcweir { return pPageRightHeaderRanges; } 955cdf0e10cSrcweir 956cdf0e10cSrcweir // ----------------------------------------------------------------------- 957cdf0e10cSrcweir 958cdf0e10cSrcweir SfxTabPage* __EXPORT ScRightHeaderEditPage::Create( Window* pParent, const SfxItemSet& rCoreSet ) 959cdf0e10cSrcweir { return ( new ScRightHeaderEditPage( pParent, rCoreSet ) ); }; 960cdf0e10cSrcweir 961cdf0e10cSrcweir 962cdf0e10cSrcweir //======================================================================== 963cdf0e10cSrcweir // class ScLeftHeaderEditPage 964cdf0e10cSrcweir //======================================================================== 965cdf0e10cSrcweir 966cdf0e10cSrcweir ScLeftHeaderEditPage::ScLeftHeaderEditPage( Window* pParent, const SfxItemSet& rCoreSet ) 967cdf0e10cSrcweir : ScHFEditPage( pParent, RID_SCPAGE_HFED_HL, rCoreSet, 968cdf0e10cSrcweir rCoreSet.GetPool()->GetWhich(SID_SCATTR_PAGE_HEADERLEFT ), true ) 969cdf0e10cSrcweir {} 970cdf0e10cSrcweir 971cdf0e10cSrcweir // ----------------------------------------------------------------------- 972cdf0e10cSrcweir 973cdf0e10cSrcweir sal_uInt16* __EXPORT ScLeftHeaderEditPage::GetRanges() 974cdf0e10cSrcweir { return pPageLeftHeaderRanges; } 975cdf0e10cSrcweir 976cdf0e10cSrcweir // ----------------------------------------------------------------------- 977cdf0e10cSrcweir 978cdf0e10cSrcweir SfxTabPage* __EXPORT ScLeftHeaderEditPage::Create( Window* pParent, const SfxItemSet& rCoreSet ) 979cdf0e10cSrcweir { return ( new ScLeftHeaderEditPage( pParent, rCoreSet ) ); }; 980cdf0e10cSrcweir 981cdf0e10cSrcweir //======================================================================== 982cdf0e10cSrcweir // class ScRightFooterEditPage 983cdf0e10cSrcweir //======================================================================== 984cdf0e10cSrcweir 985cdf0e10cSrcweir ScRightFooterEditPage::ScRightFooterEditPage( Window* pParent, const SfxItemSet& rCoreSet ) 986cdf0e10cSrcweir : ScHFEditPage( pParent, RID_SCPAGE_HFED_FR, rCoreSet, 987cdf0e10cSrcweir rCoreSet.GetPool()->GetWhich(SID_SCATTR_PAGE_FOOTERRIGHT ), false ) 988cdf0e10cSrcweir {} 989cdf0e10cSrcweir 990cdf0e10cSrcweir // ----------------------------------------------------------------------- 991cdf0e10cSrcweir 992cdf0e10cSrcweir sal_uInt16* __EXPORT ScRightFooterEditPage::GetRanges() 993cdf0e10cSrcweir { return pPageRightFooterRanges; } 994cdf0e10cSrcweir 995cdf0e10cSrcweir // ----------------------------------------------------------------------- 996cdf0e10cSrcweir 997cdf0e10cSrcweir SfxTabPage* __EXPORT ScRightFooterEditPage::Create( Window* pParent, const SfxItemSet& rCoreSet ) 998cdf0e10cSrcweir { return ( new ScRightFooterEditPage( pParent, rCoreSet ) ); }; 999cdf0e10cSrcweir 1000cdf0e10cSrcweir //======================================================================== 1001cdf0e10cSrcweir // class ScLeftFooterEditPage 1002cdf0e10cSrcweir //======================================================================== 1003cdf0e10cSrcweir 1004cdf0e10cSrcweir ScLeftFooterEditPage::ScLeftFooterEditPage( Window* pParent, const SfxItemSet& rCoreSet ) 1005cdf0e10cSrcweir : ScHFEditPage( pParent, RID_SCPAGE_HFED_FL, rCoreSet, 1006cdf0e10cSrcweir rCoreSet.GetPool()->GetWhich(SID_SCATTR_PAGE_FOOTERLEFT ), false ) 1007cdf0e10cSrcweir {} 1008cdf0e10cSrcweir 1009cdf0e10cSrcweir // ----------------------------------------------------------------------- 1010cdf0e10cSrcweir 1011cdf0e10cSrcweir sal_uInt16* __EXPORT ScLeftFooterEditPage::GetRanges() 1012cdf0e10cSrcweir { return pPageLeftFooterRanges; } 1013cdf0e10cSrcweir 1014cdf0e10cSrcweir // ----------------------------------------------------------------------- 1015cdf0e10cSrcweir 1016cdf0e10cSrcweir SfxTabPage* __EXPORT ScLeftFooterEditPage::Create( Window* pParent, const SfxItemSet& rCoreSet ) 1017cdf0e10cSrcweir { return ( new ScLeftFooterEditPage( pParent, rCoreSet ) ); }; 1018