1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: outline.cxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 // MARKER(update_precomp.py): autogen include statement, do not remove
32 #include "precompiled_sw.hxx"
33 #ifdef SW_DLLIMPLEMENTATION
34 #undef SW_DLLIMPLEMENTATION
36 #include <hintids.hxx>
37 #include <tools/shl.hxx>
38 #ifndef _MENU_HXX //autogen
39 #include <vcl/menu.hxx>
41 #ifndef _MSGBOX_HXX //autogen
42 #include <vcl/msgbox.hxx>
44 #include <sfx2/tabdlg.hxx>
45 #include <svx/brshitem.hxx>
46 #include <unotools/configmgr.hxx>
47 #include <SwStyleNameMapper.hxx>
49 #ifndef _NUM_HXX //autogen
50 #define USE_NUMTABPAGES
62 #include <swmodule.hxx>
64 #include <outline.hxx>
66 #include <poolfmt.hxx>
67 #include <shellres.hxx>
68 #include <svtools/style.hxx>
69 #include <charfmt.hxx>
70 #include <docstyle.hxx>
71 #include <viewopt.hxx>
72 #include <svtools/ctrlbox.hxx>
77 #include <globals.hrc> // fuer Vorlagenname 'keins'
83 #include <outline.hrc>
89 #include <IDocumentOutlineNodes.hxx>
90 // --> OD 2008-04-14 #outlinelevel#
94 using namespace ::com::sun::star
;
96 /* -----------------------------31.01.01 10:23--------------------------------
98 ---------------------------------------------------------------------------*/
102 /*---------------------------------------------------------------------
104 ---------------------------------------------------------------------*/
106 class SwNumNamesDlg
: public ModalDialog
112 CancelButton aCancelBtn
;
115 DECL_LINK( ModifyHdl
, Edit
* );
116 DECL_LINK( SelectHdl
, ListBox
* );
117 DECL_LINK( DoubleClickHdl
, ListBox
* );
120 SwNumNamesDlg(Window
*pParent
);
122 void SetUserNames(const String
*pList
[]);
123 String
GetName() const { return aFormEdit
.GetText(); }
124 USHORT
GetCurEntryPos() const { return aFormBox
.GetSelectEntryPos(); }
127 /*------------------------------------------------------------------------
128 Beschreibung: selektierten Eintrag merken
129 ------------------------------------------------------------------------*/
132 IMPL_LINK_INLINE_START( SwNumNamesDlg
, SelectHdl
, ListBox
*, pBox
)
134 aFormEdit
.SetText(pBox
->GetSelectEntry());
135 aFormEdit
.SetSelection(Selection(0, SELECTION_MAX
));
138 IMPL_LINK_INLINE_END( SwNumNamesDlg
, SelectHdl
, ListBox
*, pBox
)
140 /*------------------------------------------------------------------------
141 Beschreibung: Setzen der vom Benutzer vergebenen Namen
142 Parameter: Liste der vom Benutzer vergebenen Namen;
143 nicht vom Benutzer benannte Positionen sind 0.
144 ------------------------------------------------------------------------*/
147 void SwNumNamesDlg::SetUserNames(const String
*pList
[])
150 for(USHORT i
= 0; i
< SwBaseNumRules::nMaxRules
; ++i
)
154 aFormBox
.RemoveEntry(i
);
155 aFormBox
.InsertEntry(*pList
[i
], i
);
156 if(i
== nSelect
&& nSelect
< SwBaseNumRules::nMaxRules
)
160 aFormBox
.SelectEntryPos(nSelect
);
161 SelectHdl(&aFormBox
);
163 /*------------------------------------------------------------------------
164 Beschreibung: OK-Button freischalten, wenn Text im Edit steht.
165 ------------------------------------------------------------------------*/
168 IMPL_LINK_INLINE_START( SwNumNamesDlg
, ModifyHdl
, Edit
*, pBox
)
170 aOKBtn
.Enable(0 != pBox
->GetText().Len());
173 IMPL_LINK_INLINE_END( SwNumNamesDlg
, ModifyHdl
, Edit
*, pBox
)
174 /*------------------------------------------------------------------------
175 Beschreibung: DoubleClickHdl
176 ------------------------------------------------------------------------*/
179 IMPL_LINK_INLINE_START( SwNumNamesDlg
, DoubleClickHdl
, ListBox
*, EMPTYARG
)
184 IMPL_LINK_INLINE_END( SwNumNamesDlg
, DoubleClickHdl
, ListBox
*, EMPTYARG
)
186 /*--------------------------------------------------
188 --------------------------------------------------*/
190 SwNumNamesDlg::SwNumNamesDlg(Window
*pParent
)
191 : ModalDialog(pParent
, SW_RES(DLG_NUM_NAMES
)),
192 aFormEdit(this, SW_RES(ED_FORM
)),
193 aFormBox(this, SW_RES(LB_FORM
)),
194 aFormFL(this, SW_RES(FL_FORM
)),
195 aOKBtn(this, SW_RES(BT_OK
)),
196 aCancelBtn(this, SW_RES(BT_CANCEL
)),
197 aHelpBtn(this, SW_RES(BT_HELP
))
200 aFormEdit
.SetModifyHdl(LINK(this, SwNumNamesDlg
, ModifyHdl
));
201 aFormBox
.SetSelectHdl(LINK(this, SwNumNamesDlg
, SelectHdl
));
202 aFormBox
.SetDoubleClickHdl(LINK(this, SwNumNamesDlg
, DoubleClickHdl
));
203 SelectHdl(&aFormBox
);
206 /*--------------------------------------------------
208 --------------------------------------------------*/
210 __EXPORT
SwNumNamesDlg::~SwNumNamesDlg() {}
213 /* -----------------08.07.98 08:46-------------------
215 * --------------------------------------------------*/
216 USHORT
lcl_BitToLevel(USHORT nActLevel
)
218 USHORT nTmp
= nActLevel
;
219 USHORT nTmpLevel
= 0;
220 while( 0 != (nTmp
>>= 1) )
225 /* -----------------07.07.98 14:13-------------------
227 * --------------------------------------------------*/
228 USHORT
SwOutlineTabDialog::nNumLevel
= 1;
229 SwOutlineTabDialog::SwOutlineTabDialog(Window
* pParent
,
230 const SfxItemSet
* pSwItemSet
,
232 //der UserString wird danach richtig gesetzt
233 SfxTabDialog(pParent
, SW_RES(DLG_TAB_OUTLINE
), pSwItemSet
, FALSE
, &aEmptyStr
),
234 aNullStr(C2S("____")),
235 aFormMenu(SW_RES(MN_FORM
)),
237 pChapterNumRules(SW_MOD()->GetChapterNumRules()),
238 bModified(rWrtSh
.IsModified())
240 // --> OD 2008-04-14 #outlinelevel#
241 SetText( SW_RES( STR_OUTLINE_NUMBERING
) );
243 PushButton
* pUserButton
= GetUserButton();
244 pUserButton
->SetText(SW_RES(ST_FORM
));
245 pUserButton
->SetHelpId(HID_OUTLINE_FORM
);
246 pUserButton
->SetClickHdl(LINK(this, SwOutlineTabDialog
, FormHdl
));
249 pNumRule
= new SwNumRule( *rSh
.GetOutlineNumRule() );
250 GetCancelButton().SetClickHdl(LINK(this, SwOutlineTabDialog
, CancelHdl
));
252 AddTabPage(TP_NUM_POSITION
, &SwNumPositionTabPage::Create
, 0);
253 AddTabPage(TP_OUTLINE_NUM
, &SwOutlineSettingsTabPage::Create
, 0);
258 for( i
= 0; i
< MAXLEVEL
; ++i
)
260 // wurde die Vorlage noch nicht angelegt, dann ist sie noch an dieserPosition
261 if( !rWrtSh
.GetParaStyle( sHeadline
=
262 SwStyleNameMapper::GetUIName( static_cast< sal_uInt16
>(RES_POOLCOLL_HEADLINE1
+ i
),
264 aCollNames
[i
] = sHeadline
;
267 // Erfragen der Gliederungsebenen der Textvorlagen
268 const USHORT nCount
= rWrtSh
.GetTxtFmtCollCount();
269 for(i
= 0; i
< nCount
; ++i
)
271 SwTxtFmtColl
&rTxtColl
= rWrtSh
.GetTxtFmtColl(i
);
272 if(!rTxtColl
.IsDefault())
274 //BYTE nOutLevel = rTxtColl.GetOutlineLevel(); //<-#outline level, removed out by zhaojianwei
275 //if(nOutLevel != NO_NUMBERING)
276 //->added by zhaojianwei
277 if(rTxtColl
.IsAssignedToListLevelOfOutlineStyle())
279 int nOutLevel
= rTxtColl
.GetAssignedOutlineStyleLevel();
280 aCollNames
[ nOutLevel
] = rTxtColl
.GetName();
287 /* -----------------07.07.98 14:13-------------------
289 * --------------------------------------------------*/
290 SwOutlineTabDialog::~SwOutlineTabDialog()
295 /* -----------------07.07.98 14:13-------------------
297 * --------------------------------------------------*/
298 void SwOutlineTabDialog::PageCreated(USHORT nPageId
, SfxTabPage
& rPage
)
302 case TP_NUM_POSITION
:
303 ((SwNumPositionTabPage
&)rPage
).SetWrtShell(&rWrtSh
);
304 ((SwNumPositionTabPage
&)rPage
).SetOutlineTabDialog(this);
307 ((SwOutlineSettingsTabPage
&)rPage
).SetWrtShell(&rWrtSh
);
311 /* -----------------07.07.98 14:19-------------------
313 * --------------------------------------------------*/
314 IMPL_LINK( SwOutlineTabDialog
, CancelHdl
, Button
*, EMPTYARG
)
317 rWrtSh
.ResetModified();
318 EndDialog(RET_CANCEL
);
321 /* -----------------08.07.98 12:14-------------------
323 * --------------------------------------------------*/
324 IMPL_LINK( SwOutlineTabDialog
, FormHdl
, Button
*, pBtn
)
326 //PopupMenu auffuellen
327 for( USHORT i
= 0; i
< SwChapterNumRules::nMaxRules
; ++i
)
329 const SwNumRulesWithName
*pRules
= pChapterNumRules
->GetRules(i
);
331 aFormMenu
.SetItemText(i
+ MN_FORMBASE
, pRules
->GetName());
333 aFormMenu
.SetSelectHdl(LINK(this, SwOutlineTabDialog
, MenuSelectHdl
));
334 aFormMenu
.Execute(pBtn
, Rectangle(Point(0,0), pBtn
->GetSizePixel()), POPUPMENU_EXECUTE_DOWN
);
338 /* -----------------08.07.98 12:14-------------------
340 * --------------------------------------------------*/
341 IMPL_LINK( SwOutlineTabDialog
, MenuSelectHdl
, Menu
*, pMenu
)
344 switch(pMenu
->GetCurItemId())
346 case MN_FORM1
: nLevelNo
= 1; break;
347 case MN_FORM2
: nLevelNo
= 2; break;
348 case MN_FORM3
: nLevelNo
= 3; break;
349 case MN_FORM4
: nLevelNo
= 4; break;
350 case MN_FORM5
: nLevelNo
= 5; break;
351 case MN_FORM6
: nLevelNo
= 6; break;
352 case MN_FORM7
: nLevelNo
= 7; break;
353 case MN_FORM8
: nLevelNo
= 8; break;
354 case MN_FORM9
: nLevelNo
= 9; break;
358 SwNumNamesDlg
*pDlg
= new SwNumNamesDlg(this);
359 const String
*aStrArr
[SwChapterNumRules::nMaxRules
];
360 for(USHORT i
= 0; i
< SwChapterNumRules::nMaxRules
; ++i
)
362 const SwNumRulesWithName
*pRules
= pChapterNumRules
->GetRules(i
);
364 aStrArr
[i
] = &pRules
->GetName();
368 pDlg
->SetUserNames(aStrArr
);
369 if(RET_OK
== pDlg
->Execute())
371 const String
aName(pDlg
->GetName());
372 pChapterNumRules
->ApplyNumRules( SwNumRulesWithName(
373 *pNumRule
, aName
), pDlg
->GetCurEntryPos() );
375 pDlg
->GetCurEntryPos() + MN_FORMBASE
, aName
);
385 const SwNumRulesWithName
*pRules
= pChapterNumRules
->GetRules( nLevelNo
);
388 pRules
->MakeNumRule( rWrtSh
, *pNumRule
);
389 pNumRule
->SetRuleType( OUTLINE_RULE
);
392 *pNumRule
= *rWrtSh
.GetOutlineNumRule();
395 USHORT nPageId
= GetCurPageId();
396 SfxTabPage
* pPage
= GetTabPage( nPageId
);
397 pPage
->Reset(*GetOutputItemSet());
401 /* -----------------07.07.98 14:19-------------------
403 * --------------------------------------------------*/
404 USHORT
SwOutlineTabDialog::GetLevel(const String
&rFmtName
) const
406 for(USHORT i
= 0; i
< MAXLEVEL
; ++i
)
408 if(aCollNames
[i
] == rFmtName
)
411 return MAXLEVEL
;//NO_NUMBERING; //#outline level,zhaojianwei
414 /* -----------------07.07.98 16:30-------------------
416 * --------------------------------------------------*/
417 short SwOutlineTabDialog::Ok()
420 // bei allen erzeugten Vorlagen die Ebenen setzen, muss
421 // geschehen, um evtl. aufgehobene Zuordnungen
422 // auch wieder zu loeschen
424 // --> OD 2006-12-11 #130443#
425 // encapsulate changes into a action to avoid effects on the current cursor
426 // position during the changes.
427 rWrtSh
.StartAction();
430 const SwNumRule
* pOutlineRule
= rWrtSh
.GetOutlineNumRule();
432 USHORT i
, nCount
= rWrtSh
.GetTxtFmtCollCount();
433 for( i
= 0; i
< nCount
; ++i
)
435 SwTxtFmtColl
&rTxtColl
= rWrtSh
.GetTxtFmtColl(i
);
436 if( !rTxtColl
.IsDefault() )
438 //rTxtColl.SetOutlineLevel( (BYTE)GetLevel(rTxtColl.GetName()));//#outline level,removed by zhaojianwei
440 const SfxPoolItem
& rItem
=
441 rTxtColl
.GetFmtAttr(RES_PARATR_NUMRULE
, FALSE
);
443 //if ((BYTE)GetLevel(rTxtColl.GetName()) == NO_NUMBERING) //#outline level,removed by zhaojianwei
445 // if (static_cast<const SwNumRuleItem &>(rItem).GetValue() ==
446 // pOutlineRule->GetName())
448 // rTxtColl.ResetFmtAttr(RES_PARATR_NUMRULE);
453 // if (static_cast<const SwNumRuleItem &>(rItem).GetValue() !=
454 // pOutlineRule->GetName())
456 // SwNumRuleItem aItem(pOutlineRule->GetName());
457 // rTxtColl.SetFmtAttr(aItem);
460 if ((BYTE
)GetLevel(rTxtColl
.GetName()) == MAXLEVEL
) //add by zhaojianwei
462 if(rTxtColl
.IsAssignedToListLevelOfOutlineStyle())
464 rTxtColl
.DeleteAssignmentToListLevelOfOutlineStyle();
466 if (static_cast<const SwNumRuleItem
&>(rItem
).GetValue() ==
467 pOutlineRule
->GetName())
469 rTxtColl
.ResetFmtAttr(RES_PARATR_NUMRULE
);
474 rTxtColl
.AssignToListLevelOfOutlineStyle(GetLevel(rTxtColl
.GetName()));
476 if (static_cast<const SwNumRuleItem
&>(rItem
).GetValue() !=
477 pOutlineRule
->GetName())
479 SwNumRuleItem
aItem(pOutlineRule
->GetName());
480 rTxtColl
.SetFmtAttr(aItem
);
482 } //<-end,zhaojianwei
486 for(i
= 0; i
< MAXLEVEL
; ++i
)
489 ::SwStyleNameMapper::FillUIName( static_cast< sal_uInt16
>(RES_POOLCOLL_HEADLINE1
+ i
),
491 SwTxtFmtColl
* pColl
= rWrtSh
.FindTxtFmtCollByName( sHeadline
);
494 //if( !aCollNames[i].Len() ) //#outline level,removed by zhaojianwei
496 // SwTxtFmtColl* pTxtColl = rWrtSh.GetTxtCollFromPool(
497 // static_cast< USHORT >(RES_POOLCOLL_HEADLINE1 + i) );
498 // pTxtColl->SetOutlineLevel( NO_NUMBERING );
499 // pTxtColl->ResetFmtAttr(RES_PARATR_NUMRULE);
501 //else if(aCollNames[i] != sHeadline)
503 // SwTxtFmtColl* pTxtColl = rWrtSh.GetParaStyle(
504 // aCollNames[i], SwWrtShell::GETSTYLE_CREATESOME);
507 // pTxtColl->SetOutlineLevel( static_cast< BYTE >(i) );
509 // SwNumRuleItem aItem(pOutlineRule->GetName());
510 // pTxtColl->SetFmtAttr(aItem);
513 if(aCollNames
[i
] != sHeadline
)//->added by zhaojianwei
515 SwTxtFmtColl
* pTxtColl
= rWrtSh
.GetTxtCollFromPool(
516 static_cast< USHORT
>(RES_POOLCOLL_HEADLINE1
+ i
) );
517 pTxtColl
->DeleteAssignmentToListLevelOfOutlineStyle();
518 pTxtColl
->ResetFmtAttr(RES_PARATR_NUMRULE
);
520 if( aCollNames
[i
].Len() )
522 pTxtColl
= rWrtSh
.GetParaStyle(
523 aCollNames
[i
], SwWrtShell::GETSTYLE_CREATESOME
);
526 pTxtColl
->AssignToListLevelOfOutlineStyle(i
);
527 SwNumRuleItem
aItem(pOutlineRule
->GetName());
528 pTxtColl
->SetFmtAttr(aItem
);
531 }//<--end,zhaojianwei
535 rWrtSh
.SetOutlineNumRule( *pNumRule
);
537 // --> OD 2006-12-11 #130443#
544 /* -----------------07.07.98 14:19-------------------
546 * --------------------------------------------------*/
547 SwOutlineSettingsTabPage::SwOutlineSettingsTabPage(Window
* pParent
, const SfxItemSet
& rSet
) :
548 SfxTabPage(pParent
, SW_RES(TP_OUTLINE_NUM
), rSet
),
549 aLevelLB( this, SW_RES(LB_LEVEL
)),
550 aLevelFL( this, SW_RES(FL_LEVEL
)),
551 aCollLbl(this, SW_RES(FT_COLL
)),
552 aCollBox(this, SW_RES(LB_COLL
)),
553 aNumberLbl(this, SW_RES(FT_NUMBER
)),
554 aNumberBox(this, SW_RES(LB_NUMBER
), INSERT_NUM_TYPE_NO_NUMBERING
|INSERT_NUM_EXTENDED_TYPES
),
555 aCharFmtFT(this, SW_RES(FT_CHARFMT
)),
556 aCharFmtLB(this, SW_RES(LB_CHARFMT
)),
557 aAllLevelFT( this, SW_RES(FT_ALL_LEVEL
)),
558 aAllLevelNF( this, SW_RES(NF_ALL_LEVEL
)),
559 aDelim(this, SW_RES(FT_DELIM
)),
560 aPrefixFT(this, SW_RES(FT_PREFIX
)),
561 aPrefixED(this, SW_RES(ED_PREFIX
)),
562 aSuffixFT(this, SW_RES(FT_SUFFIX
)),
563 aSuffixED(this, SW_RES(ED_SUFFIX
)),
564 aStartLbl(this, SW_RES(FT_START
)),
565 aStartEdit(this, SW_RES(ED_START
)),
566 aNumberFL(this, SW_RES(FL_NUMBER
)),
567 aPreviewWIN( this, SW_RES(WIN_PREVIEW
)),
569 aNoFmtName(SW_RES(ST_NO_COLL
)),
575 SetExchangeSupport();
577 aCollBox
.InsertEntry(aNoFmtName
);
578 aLevelLB
.SetSelectHdl(LINK(this, SwOutlineSettingsTabPage
, LevelHdl
));
579 aAllLevelNF
.SetModifyHdl(LINK(this, SwOutlineSettingsTabPage
, ToggleComplete
));
580 aCollBox
.SetSelectHdl(LINK(this, SwOutlineSettingsTabPage
, CollSelect
));
581 aCollBox
.SetGetFocusHdl(LINK(this, SwOutlineSettingsTabPage
, CollSelectGetFocus
));
582 aNumberBox
.SetSelectHdl(LINK(this, SwOutlineSettingsTabPage
, NumberSelect
));
583 aPrefixED
.SetModifyHdl(LINK(this, SwOutlineSettingsTabPage
, DelimModify
));
584 aSuffixED
.SetModifyHdl(LINK(this, SwOutlineSettingsTabPage
, DelimModify
));
585 aStartEdit
.SetModifyHdl(LINK(this, SwOutlineSettingsTabPage
, StartModified
));
586 aCharFmtLB
.SetSelectHdl(LINK(this, SwOutlineSettingsTabPage
, CharFmtHdl
));
589 /* -----------------07.07.98 14:19-------------------
591 * --------------------------------------------------*/
592 void SwOutlineSettingsTabPage::Update()
594 // falls eine Vorlage fuer diese Ebene bereits selektiert wurde,
595 // diese in der ListBox auswaehlean
596 aCollBox
.Enable(USHRT_MAX
!= nActLevel
);
597 if(USHRT_MAX
== nActLevel
)
599 BOOL bSamePrefix
= TRUE
;
600 BOOL bSameSuffix
= TRUE
;
601 BOOL bSameType
= TRUE
;
602 BOOL bSameComplete
= TRUE
;
603 BOOL bSameStart
= TRUE
;
604 BOOL bSameCharFmt
= TRUE
;
606 const SwNumFmt
* aNumFmtArr
[MAXLEVEL
];
607 const SwCharFmt
* pFirstFmt
= 0;
609 for(USHORT i
= 0; i
< MAXLEVEL
; i
++)
612 aNumFmtArr
[ i
] = &pNumRule
->Get(i
);
614 pFirstFmt
= aNumFmtArr
[i
]->GetCharFmt();
617 bSameType
&= aNumFmtArr
[i
]->GetNumberingType() == aNumFmtArr
[0]->GetNumberingType();
618 bSameStart
&= aNumFmtArr
[i
]->GetStart() == aNumFmtArr
[0]->GetStart();
619 bSamePrefix
&= aNumFmtArr
[i
]->GetPrefix() == aNumFmtArr
[0]->GetPrefix();
620 bSameSuffix
&= aNumFmtArr
[i
]->GetSuffix() == aNumFmtArr
[0]->GetSuffix();
621 bSameComplete
&= aNumFmtArr
[i
]->GetIncludeUpperLevels() == aNumFmtArr
[0]->GetIncludeUpperLevels();
622 const SwCharFmt
* pFmt
= aNumFmtArr
[i
]->GetCharFmt();
623 bSameCharFmt
&= !pFirstFmt
&& !pFmt
624 || pFirstFmt
&& pFmt
&& pFmt
->GetName() == pFirstFmt
->GetName();
627 CheckForStartValue_Impl(aNumFmtArr
[0]->GetNumberingType());
629 aNumberBox
.SelectNumberingType( aNumFmtArr
[0]->GetNumberingType() );
631 aNumberBox
.SetNoSelection();
633 aStartEdit
.SetValue(aNumFmtArr
[0]->GetStart());
635 aStartEdit
.SetText(aEmptyStr
);
637 aPrefixED
.SetText(aNumFmtArr
[0]->GetPrefix());
639 aPrefixED
.SetText(aEmptyStr
);
641 aSuffixED
.SetText(aNumFmtArr
[0]->GetSuffix());
643 aSuffixED
.SetText(aEmptyStr
);
648 aCharFmtLB
.SelectEntry(pFirstFmt
->GetName());
650 aCharFmtLB
.SelectEntry( ViewShell::GetShellRes()->aStrNone
);
653 aCharFmtLB
.SetNoSelection();
655 aAllLevelFT
.Enable(TRUE
);
656 aAllLevelNF
.Enable(TRUE
);
657 aAllLevelNF
.SetMax(MAXLEVEL
);
660 aAllLevelNF
.SetValue(aNumFmtArr
[0]->GetIncludeUpperLevels());
664 aAllLevelNF
.SetText(aEmptyStr
);
669 USHORT nTmpLevel
= lcl_BitToLevel(nActLevel
);
670 String
aColl(pCollNames
[nTmpLevel
]);
672 aCollBox
.SelectEntry(aColl
);
674 aCollBox
.SelectEntry(aNoFmtName
);
675 const SwNumFmt
&rFmt
= pNumRule
->Get(nTmpLevel
);
677 aNumberBox
.SelectNumberingType( rFmt
.GetNumberingType() );
678 aPrefixED
.SetText(rFmt
.GetPrefix());
679 aSuffixED
.SetText(rFmt
.GetSuffix());
680 const SwCharFmt
* pFmt
= rFmt
.GetCharFmt();
682 aCharFmtLB
.SelectEntry(pFmt
->GetName());
684 aCharFmtLB
.SelectEntry( ViewShell::GetShellRes()->aStrNone
);
688 aAllLevelFT
.Enable(TRUE
);
689 aAllLevelNF
.Enable(TRUE
);
690 aAllLevelNF
.SetMax(nTmpLevel
+ 1);
691 aAllLevelNF
.SetValue(rFmt
.GetIncludeUpperLevels());
695 aAllLevelNF
.SetText(aEmptyStr
);
696 aAllLevelNF
.Enable(FALSE
);
697 aAllLevelFT
.Enable(FALSE
);
699 CheckForStartValue_Impl(rFmt
.GetNumberingType());
700 aStartEdit
.SetValue( rFmt
.GetStart() );
705 /* -----------------07.07.98 14:19-------------------
707 * --------------------------------------------------*/
708 IMPL_LINK( SwOutlineSettingsTabPage
, LevelHdl
, ListBox
*, pBox
)
711 if(pBox
->IsEntryPosSelected( MAXLEVEL
))
718 for( USHORT i
= 0; i
< MAXLEVEL
; i
++ )
720 if(pBox
->IsEntryPosSelected( i
))
728 /* -----------------07.07.98 14:19-------------------
730 * --------------------------------------------------*/
731 IMPL_LINK( SwOutlineSettingsTabPage
, ToggleComplete
, NumericField
*, pFld
)
734 for(USHORT i
= 0; i
< MAXLEVEL
; i
++)
736 if(nActLevel
& nMask
)
738 SwNumFmt
aNumFmt(pNumRule
->Get(i
));
739 aNumFmt
.SetIncludeUpperLevels( Min( (BYTE
)pFld
->GetValue(),
741 pNumRule
->Set(i
, aNumFmt
);
748 /* -----------------07.07.98 14:19-------------------
750 * --------------------------------------------------*/
751 IMPL_LINK( SwOutlineSettingsTabPage
, CollSelect
, ListBox
*, pBox
)
755 const String
aCollName(pBox
->GetSelectEntry());
756 //0xFFFF darf hier nicht sein (disable)
757 USHORT nTmpLevel
= lcl_BitToLevel(nActLevel
);
758 String
sOldName( pCollNames
[nTmpLevel
] );
760 for( i
= 0; i
< MAXLEVEL
; ++i
)
761 pCollNames
[i
] = aSaveCollNames
[i
];
763 if(aCollName
== aNoFmtName
)
764 pCollNames
[nTmpLevel
] = aEmptyStr
;
767 pCollNames
[nTmpLevel
] = aCollName
;
768 // wird die Vorlage bereits verwendet ?
769 for( i
= 0; i
< MAXLEVEL
; ++i
)
770 if(i
!= nTmpLevel
&& pCollNames
[i
] == aCollName
)
771 pCollNames
[i
] = aEmptyStr
;
774 // search the oldname and put it into the current entries
776 for( i
= 0; i
< MAXLEVEL
; ++i
)
777 if( aSaveCollNames
[ i
] == sOldName
&& i
!= nTmpLevel
&&
778 !pCollNames
[ i
].Len() )
781 for( n
= 0; n
< MAXLEVEL
; ++n
)
782 if( pCollNames
[ n
] == sOldName
)
786 // it was a outline leveld name and the current entries is zero.
787 pCollNames
[ i
] = sOldName
;
794 IMPL_LINK( SwOutlineSettingsTabPage
, CollSelectGetFocus
, ListBox
*, EMPTYARG
)
796 for( BYTE i
= 0; i
< MAXLEVEL
; ++i
)
797 aSaveCollNames
[i
] = pCollNames
[i
];
801 /* -----------------07.07.98 14:19-------------------
803 * --------------------------------------------------*/
804 IMPL_LINK( SwOutlineSettingsTabPage
, NumberSelect
, SwNumberingTypeListBox
*, pBox
)
807 sal_Int16 nNumberType
= pBox
->GetSelectedNumberingType();//(sal_Int16)(ULONG)pBox->GetEntryData(pBox->GetSelectEntryPos());
808 for(USHORT i
= 0; i
< MAXLEVEL
; i
++)
810 if(nActLevel
& nMask
)
812 SwNumFmt
aNumFmt(pNumRule
->Get(i
));
813 aNumFmt
.SetNumberingType(nNumberType
);
814 pNumRule
->Set(i
, aNumFmt
);
815 CheckForStartValue_Impl(nNumberType
);
822 /* -----------------07.07.98 14:19-------------------
824 * --------------------------------------------------*/
825 IMPL_LINK( SwOutlineSettingsTabPage
, DelimModify
, Edit
*, EMPTYARG
)
828 for(USHORT i
= 0; i
< MAXLEVEL
; i
++)
830 if(nActLevel
& nMask
)
832 SwNumFmt
aNumFmt(pNumRule
->Get(i
));
833 aNumFmt
.SetPrefix( aPrefixED
.GetText() );
834 aNumFmt
.SetSuffix( aSuffixED
.GetText() );
835 pNumRule
->Set(i
, aNumFmt
);
842 /* -----------------07.07.98 14:19-------------------
844 * --------------------------------------------------*/
845 IMPL_LINK( SwOutlineSettingsTabPage
, StartModified
, NumericField
*, pFld
)
848 for(USHORT i
= 0; i
< MAXLEVEL
; i
++)
850 if(nActLevel
& nMask
)
852 SwNumFmt
aNumFmt(pNumRule
->Get(i
));
853 aNumFmt
.SetStart( (USHORT
)pFld
->GetValue() );
854 pNumRule
->Set(i
, aNumFmt
);
861 /* -----------------21.09.98 12:21-------------------
863 * --------------------------------------------------*/
864 IMPL_LINK( SwOutlineSettingsTabPage
, CharFmtHdl
, ListBox
*, EMPTYARG
)
866 // bAutomaticCharStyles = FALSE;
867 String sEntry
= aCharFmtLB
.GetSelectEntry();
869 BOOL bFormatNone
= sEntry
== ViewShell::GetShellRes()->aStrNone
;
873 USHORT nChCount
= pSh
->GetCharFmtCount();
874 for(USHORT i
= 0; i
< nChCount
; i
++)
876 SwCharFmt
& rChFmt
= pSh
->GetCharFmt(i
);
877 if(rChFmt
.GetName() == sEntry
)
885 SfxStyleSheetBasePool
* pPool
= pSh
->GetView().GetDocShell()->GetStyleSheetPool();
886 SfxStyleSheetBase
* pBase
;
887 pBase
= pPool
->Find(sEntry
, SFX_STYLE_FAMILY_CHAR
);
889 pBase
= &pPool
->Make(sEntry
, SFX_STYLE_FAMILY_PAGE
);
890 pFmt
= ((SwDocStyleSheet
*)pBase
)->GetCharFmt();
895 for(USHORT i
= 0; i
< MAXLEVEL
; i
++)
897 if(nActLevel
& nMask
)
899 SwNumFmt
aNumFmt(pNumRule
->Get(i
));
901 aNumFmt
.SetCharFmt(0);
903 aNumFmt
.SetCharFmt(pFmt
);
904 pNumRule
->Set(i
, aNumFmt
);
910 /* -----------------07.07.98 14:19-------------------
912 * --------------------------------------------------*/
913 SwOutlineSettingsTabPage::~SwOutlineSettingsTabPage()
916 /* -----------------07.07.98 16:27-------------------
918 * --------------------------------------------------*/
919 void SwOutlineSettingsTabPage::SetWrtShell(SwWrtShell
* pShell
)
922 // Erfragen der NumRules dieses Dokumentes
923 pNumRule
= ((SwOutlineTabDialog
*)GetTabDialog())->GetNumRule();
924 pCollNames
= ((SwOutlineTabDialog
*)GetTabDialog())->GetCollNames();
926 //pNumRule = new SwNumRule( *rSh.GetOutlineNumRule() );
928 aPreviewWIN
.SetNumRule(pNumRule
);
929 aPreviewWIN
.SetOutlineNames(pCollNames
);
930 // Startwert setzen - nActLevel muss hier 1 sein
931 USHORT nTmpLevel
= lcl_BitToLevel(nActLevel
);
932 const SwNumFmt
& rNumFmt
= pNumRule
->Get( nTmpLevel
);
933 aStartEdit
.SetValue( rNumFmt
.GetStart() );
935 // Poolformate fuer Ueberschriften anlegen
938 for( i
= 0; i
< MAXLEVEL
; ++i
)
940 aCollBox
.InsertEntry( SwStyleNameMapper::GetUIName(
941 static_cast< sal_uInt16
>(RES_POOLCOLL_HEADLINE1
+ i
), aEmptyStr
));
942 aLevelLB
.InsertEntry( String::CreateFromInt32(i
+ 1) );
944 sStr
.AssignAscii( RTL_CONSTASCII_STRINGPARAM( "1 - " ));
945 sStr
+= String::CreateFromInt32(MAXLEVEL
);
946 aLevelLB
.InsertEntry( sStr
);
948 // Erfragen der Gliederungsebenen der Textvorlagen
949 const USHORT nCount
= pSh
->GetTxtFmtCollCount();
950 for( i
= 0; i
< nCount
; ++i
)
952 SwTxtFmtColl
&rTxtColl
= pSh
->GetTxtFmtColl(i
);
953 if(!rTxtColl
.IsDefault())
955 sStr
= rTxtColl
.GetName();
956 if(LISTBOX_ENTRY_NOTFOUND
== aCollBox
.GetEntryPos( sStr
))
957 aCollBox
.InsertEntry( sStr
);
961 aNumberBox
.SelectNumberingType(rNumFmt
.GetNumberingType());
962 USHORT nOutlinePos
= pSh
->GetOutlinePos(MAXLEVEL
);
964 if(nOutlinePos
!= USHRT_MAX
)
966 nTmp
= static_cast<USHORT
>(pSh
->getIDocumentOutlineNodesAccess()->getOutlineLevel(nOutlinePos
));
968 aLevelLB
.SelectEntryPos(nTmp
-1);//nTmp);//#outline level,zhaojianwei
970 // Zeichenvorlagen sammeln
972 aCharFmtLB
.InsertEntry( ViewShell::GetShellRes()->aStrNone
);
975 ::FillCharStyleListBox(aCharFmtLB
,
976 pSh
->GetView().GetDocShell());
979 /* -----------------07.07.98 14:19-------------------
981 * --------------------------------------------------*/
982 void SwOutlineSettingsTabPage::ActivatePage(const SfxItemSet
& )
984 nActLevel
= SwOutlineTabDialog::GetActNumLevel();
985 if(nActLevel
!= USHRT_MAX
)
986 aLevelLB
.SelectEntryPos(lcl_BitToLevel(nActLevel
));
988 aLevelLB
.SelectEntryPos(MAXLEVEL
);
991 /* -----------------07.07.98 14:19-------------------
993 * --------------------------------------------------*/
994 int SwOutlineSettingsTabPage::DeactivatePage(SfxItemSet
*)
996 SwOutlineTabDialog::SetActNumLevel(nActLevel
);
999 /* -----------------07.07.98 14:19-------------------
1001 * --------------------------------------------------*/
1002 BOOL
SwOutlineSettingsTabPage::FillItemSet( SfxItemSet
& )
1006 /* -----------------07.07.98 14:19-------------------
1008 * --------------------------------------------------*/
1009 void SwOutlineSettingsTabPage::Reset( const SfxItemSet
& rSet
)
1013 /* -----------------07.07.98 14:19-------------------
1015 * --------------------------------------------------*/
1016 SfxTabPage
* SwOutlineSettingsTabPage::Create( Window
* pParent
,
1017 const SfxItemSet
& rAttrSet
)
1019 return new SwOutlineSettingsTabPage(pParent
, rAttrSet
);
1021 /* -----------------07.11.2002 15:13-----------------
1023 * --------------------------------------------------*/
1024 void SwOutlineSettingsTabPage::CheckForStartValue_Impl(sal_uInt16 nNumberingType
)
1026 BOOL bIsNull
= aStartEdit
.GetValue() == 0;
1027 BOOL bNoZeroAllowed
= nNumberingType
< SVX_NUM_ARABIC
||
1028 SVX_NUM_CHARS_UPPER_LETTER_N
== nNumberingType
||
1029 SVX_NUM_CHARS_LOWER_LETTER_N
== nNumberingType
;
1030 aStartEdit
.SetMin(bNoZeroAllowed
? 1 : 0);
1031 if(bIsNull
&& bNoZeroAllowed
)
1032 aStartEdit
.GetModifyHdl().Call(&aStartEdit
);
1034 /*-----------------09.12.97 11:54-------------------
1036 --------------------------------------------------*/
1037 USHORT
lcl_DrawBullet(VirtualDevice
* pVDev
,
1038 const SwNumFmt
& rFmt
, USHORT nXStart
,
1039 USHORT nYStart
, const Size
& rSize
)
1041 Font
aTmpFont(pVDev
->GetFont());
1043 Font
aFont(*rFmt
.GetBulletFont());
1044 aFont
.SetSize(rSize
);
1045 aFont
.SetTransparent(TRUE
);
1046 pVDev
->SetFont( aFont
);
1047 String
aText(rFmt
.GetBulletChar());
1048 pVDev
->DrawText( Point(nXStart
, nYStart
), aText
);
1049 USHORT nRet
= (USHORT
)pVDev
->GetTextWidth(aText
);
1051 pVDev
->SetFont(aTmpFont
);
1054 /*-----------------09.12.97 11:49-------------------
1056 --------------------------------------------------*/
1057 USHORT
lcl_DrawGraphic(VirtualDevice
* pVDev
, const SwNumFmt
&rFmt
, USHORT nXStart
,
1058 USHORT nYStart
, USHORT nDivision
)
1060 const SvxBrushItem
* pBrushItem
= rFmt
.GetBrush();
1064 const Graphic
* pGrf
= pBrushItem
->GetGraphic();
1067 Size
aGSize( rFmt
.GetGraphicSize());
1068 aGSize
.Width() /= nDivision
;
1069 nRet
= (USHORT
)aGSize
.Width();
1070 aGSize
.Height() /= nDivision
;
1071 pGrf
->Draw( pVDev
, Point(nXStart
,nYStart
),
1072 pVDev
->PixelToLogic( aGSize
) );
1078 /*-----------------02.12.97 10:34-------------------
1079 Vorschau der Numerierung painten
1080 --------------------------------------------------*/
1081 void NumberingPreview::Paint( const Rectangle
& /*rRect*/ )
1083 Size
aSize(PixelToLogic(GetOutputSizePixel()));
1084 Rectangle
aRect(Point(0,0), aSize
);
1086 VirtualDevice
* pVDev
= new VirtualDevice(*this);
1087 pVDev
->SetMapMode(GetMapMode());
1088 pVDev
->SetOutputSize( aSize
);
1091 pVDev
->SetFillColor( GetSettings().GetStyleSettings().GetWindowColor() );
1092 pVDev
->SetLineColor( GetSettings().GetStyleSettings().GetButtonTextColor() );
1093 pVDev
->DrawRect(aRect
);
1097 USHORT nWidthRelation
;
1100 nWidthRelation
= USHORT (nPageWidth
/ aSize
.Width());
1102 nWidthRelation
= nWidthRelation
* 2 / 3;
1104 nWidthRelation
= nWidthRelation
/ 4;
1107 nWidthRelation
= 30; // Kapiteldialog
1110 USHORT nXStep
= USHORT(aSize
.Width() / (3 * MAXLEVEL
));
1114 USHORT nYStep
= USHORT((aSize
.Height() - 6)/ MAXLEVEL
);
1115 aStdFont
= OutputDevice::GetDefaultFont(
1116 DEFAULTFONT_UI_SANS
, (LanguageType
)GetAppLanguage(),
1117 DEFAULTFONT_FLAGS_ONLYONE
, this );
1119 aStdFont
.SetColor( SwViewOption::GetFontColor() );
1122 USHORT nFontHeight
= nYStep
* 6 / 10;
1124 nFontHeight
= nYStep
* 15 / 10;
1125 aStdFont
.SetSize(Size( 0, nFontHeight
));
1127 USHORT nPreNum
= pActNum
->Get(0).GetStart();
1131 USHORT nLineHeight
= nFontHeight
* 8 / 7;
1133 while( !(nActLevel
& (1<<nStart
)) )
1137 if(nStart
) // damit moeglichs Vorgaenger und Nachfolger gezeigt werden
1140 SwNumberTree::tNumberVector aNumVector
;
1141 BYTE nEnd
= Min( (BYTE
)(nStart
+ 3), MAXLEVEL
);
1142 for( BYTE nLevel
= nStart
; nLevel
< nEnd
; ++nLevel
)
1144 const SwNumFmt
&rFmt
= pActNum
->Get(nLevel
);
1145 aNumVector
.push_back(rFmt
.GetStart());
1147 // --> OD 2008-02-01 #newlistlevelattrs#
1148 USHORT
nXStart( 0 );
1149 short nTextOffset( 0 );
1150 USHORT
nNumberXPos( 0 );
1151 if ( rFmt
.GetPositionAndSpaceMode() == SvxNumberFormat::LABEL_WIDTH_AND_POSITION
)
1153 nXStart
= rFmt
.GetAbsLSpace() / nWidthRelation
;
1154 nTextOffset
= rFmt
.GetCharTextDistance() / nWidthRelation
;
1155 nNumberXPos
= nXStart
;
1156 USHORT nFirstLineOffset
= (-rFmt
.GetFirstLineOffset()) / nWidthRelation
;
1158 if(nFirstLineOffset
<= nNumberXPos
)
1159 nNumberXPos
= nNumberXPos
- nFirstLineOffset
;
1163 else if ( rFmt
.GetPositionAndSpaceMode() == SvxNumberFormat::LABEL_ALIGNMENT
)
1165 const long nTmpNumberXPos( ( rFmt
.GetIndentAt() +
1166 rFmt
.GetFirstLineIndent() ) /
1168 if ( nTmpNumberXPos
< 0 )
1174 nNumberXPos
= static_cast<USHORT
>(nTmpNumberXPos
);
1179 USHORT nBulletWidth
= 0;
1180 if( SVX_NUM_BITMAP
== rFmt
.GetNumberingType() )
1182 nBulletWidth
= lcl_DrawGraphic(pVDev
, rFmt
,
1184 nYStart
, nWidthRelation
);
1186 else if( SVX_NUM_CHAR_SPECIAL
== rFmt
.GetNumberingType() )
1188 nBulletWidth
= lcl_DrawBullet(pVDev
, rFmt
, nNumberXPos
, nYStart
, aStdFont
.GetSize());
1192 pVDev
->SetFont(aStdFont
);
1193 if(pActNum
->IsContinusNum())
1194 aNumVector
[nLevel
] = nPreNum
;
1195 // --> OD 2005-11-17 #128041#
1196 String
aText(pActNum
->MakeNumString( aNumVector
));
1198 pVDev
->DrawText( Point(nNumberXPos
, nYStart
), aText
);
1199 nBulletWidth
= (USHORT
)pVDev
->GetTextWidth(aText
);
1202 // --> OD 2008-02-01 #newlistlevelattrs#
1203 if ( rFmt
.GetPositionAndSpaceMode() == SvxNumberFormat::LABEL_ALIGNMENT
&&
1204 rFmt
.GetLabelFollowedBy() == SvxNumberFormat::SPACE
)
1206 pVDev
->SetFont(aStdFont
);
1208 pVDev
->DrawText( Point(nNumberXPos
, nYStart
), aText
);
1209 nBulletWidth
= nBulletWidth
+ (USHORT
)pVDev
->GetTextWidth(aText
);
1213 // --> OD 2008-02-01 #newlistlevelattrs#
1214 USHORT
nTextXPos( 0 );
1215 if ( rFmt
.GetPositionAndSpaceMode() == SvxNumberFormat::LABEL_WIDTH_AND_POSITION
)
1217 nTextXPos
= nXStart
;
1219 nTextXPos
= nTextXPos
+ nTextOffset
;
1220 if(nNumberXPos
+ nBulletWidth
+ nTextOffset
> nTextXPos
)
1221 nTextXPos
= nNumberXPos
+ nBulletWidth
+ nTextOffset
;
1223 else if ( rFmt
.GetPositionAndSpaceMode() == SvxNumberFormat::LABEL_ALIGNMENT
)
1225 switch ( rFmt
.GetLabelFollowedBy() )
1227 case SvxNumberFormat::LISTTAB
:
1229 nTextXPos
= static_cast<USHORT
>(
1230 rFmt
.GetListtabPos() / nWidthRelation
);
1231 if ( nTextXPos
< nNumberXPos
+ nBulletWidth
)
1233 nTextXPos
= nNumberXPos
+ nBulletWidth
;
1237 case SvxNumberFormat::SPACE
:
1238 case SvxNumberFormat::NOTHING
:
1240 nTextXPos
= nNumberXPos
+ nBulletWidth
;
1245 nXStart
= static_cast<USHORT
>( rFmt
.GetIndentAt() / nWidthRelation
);
1250 Rectangle
aRect1(Point(nTextXPos
, nYStart
+ nFontHeight
/ 2), Size(aSize
.Width() / 2, 2));
1251 pVDev
->SetFillColor( GetSettings().GetStyleSettings().GetWindowColor() ); // Color( COL_BLACK ) );
1252 pVDev
->DrawRect( aRect1
);
1254 Rectangle
aRect2(Point(nXStart
, nYStart
+ nLineHeight
+ nFontHeight
/ 2 ), Size(aSize
.Width() / 2, 2));
1255 pVDev
->DrawRect( aRect2
);
1256 nYStart
+= 2 * nLineHeight
;
1261 SwNumberTree::tNumberVector aNumVector
;
1262 USHORT nLineHeight
= nFontHeight
* 3 / 2;
1263 for( BYTE nLevel
= 0; nLevel
< MAXLEVEL
;
1264 ++nLevel
, nYStart
= nYStart
+ nYStep
)
1266 const SwNumFmt
&rFmt
= pActNum
->Get(nLevel
);
1267 aNumVector
.push_back(rFmt
.GetStart());
1268 // --> OD 2008-02-01 #newlistlevelattrs#
1269 USHORT
nXStart( 0 );
1270 if ( rFmt
.GetPositionAndSpaceMode() == SvxNumberFormat::LABEL_WIDTH_AND_POSITION
)
1272 nXStart
= rFmt
.GetAbsLSpace() / nWidthRelation
;
1274 else if ( rFmt
.GetPositionAndSpaceMode() == SvxNumberFormat::LABEL_ALIGNMENT
)
1276 const long nTmpXStart( ( rFmt
.GetIndentAt() +
1277 rFmt
.GetFirstLineIndent() ) /
1279 if ( nTmpXStart
< 0 )
1285 nXStart
= static_cast<USHORT
>(nTmpXStart
);
1291 USHORT nTextOffset
= 2 * nXStep
;
1292 if( SVX_NUM_BITMAP
== rFmt
.GetNumberingType() )
1294 lcl_DrawGraphic(pVDev
, rFmt
, nXStart
, nYStart
, nWidthRelation
);
1295 nTextOffset
= nLineHeight
+ nXStep
;
1297 else if( SVX_NUM_CHAR_SPECIAL
== rFmt
.GetNumberingType() )
1299 nTextOffset
= lcl_DrawBullet(pVDev
, rFmt
, nXStart
, nYStart
, aStdFont
.GetSize());
1300 nTextOffset
= nTextOffset
+ nXStep
;
1304 pVDev
->SetFont(aStdFont
);
1305 if(pActNum
->IsContinusNum())
1306 aNumVector
[nLevel
] = nPreNum
;
1307 // --> OD 2005-11-17 #128041#
1308 String
aText(pActNum
->MakeNumString( aNumVector
));
1310 pVDev
->DrawText( Point(nXStart
, nYStart
), aText
);
1311 nTextOffset
= (USHORT
)pVDev
->GetTextWidth(aText
);
1312 nTextOffset
= nTextOffset
+ nXStep
;
1315 pVDev
->SetFont(aStdFont
);
1317 // Changed as per BugID 79541 Branding/Configuration
1318 uno::Any MyAny
= ::utl::ConfigManager::GetConfigManager()->
1319 GetDirectConfigProperty( ::utl::ConfigManager::PRODUCTNAME
);
1320 ::rtl::OUString aProductName
;
1322 MyAny
>>= aProductName
;
1323 String
sMsg(C2S("%PRODUCTNAME"));
1324 sMsg
.SearchAndReplaceAscii( "%PRODUCTNAME" , aProductName
);
1327 sMsg
= pOutlineNames
[nLevel
];
1328 pVDev
->DrawText( Point(nXStart
+ nTextOffset
, nYStart
), sMsg
);
1332 DrawOutDev( Point(0,0), aSize
,
1339 /*-----------------02.12.97 10:34-------------------
1341 --------------------------------------------------*/
1342 NumberingPreview::~NumberingPreview()