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