1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
|
/*************************************************************************
*
* $RCSfile: outline.cxx,v $
*
* $Revision: 1.1.1.1 $
*
* last change: $Author: hr $ $Date: 2000-09-18 17:14:45 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
*
* - GNU Lesser General Public License Version 2.1
* - Sun Industry Standards Source License Version 1.1
*
* Sun Microsystems Inc., October, 2000
*
* GNU Lesser General Public License Version 2.1
* =============================================
* Copyright 2000 by Sun Microsystems, Inc.
* 901 San Antonio Road, Palo Alto, CA 94303, USA
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License version 2.1, as published by the Free Software Foundation.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
* MA 02111-1307 USA
*
*
* Sun Industry Standards Source License Version 1.1
* =================================================
* The contents of this file are subject to the Sun Industry Standards
* Source License Version 1.1 (the "License"); You may not use this file
* except in compliance with the License. You may obtain a copy of the
* License at http://www.openoffice.org/license.html.
*
* Software provided under this License is provided on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
* WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
* MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
* See the License for the specific provisions governing your rights and
* obligations concerning the Software.
*
* The Initial Developer of the Original Code is: Sun Microsystems, Inc.
*
* Copyright: 2000 by Sun Microsystems, Inc.
*
* All Rights Reserved.
*
* Contributor(s): _______________________________________
*
*
************************************************************************/
#ifdef PRECOMPILED
#include "ui_pch.hxx"
#endif
#pragma hdrstop
#ifndef _HINTIDS_HXX
#include <hintids.hxx>
#endif
#ifndef _SHL_HXX //autogen
#include <tools/shl.hxx>
#endif
#ifndef _MENU_HXX //autogen
#include <vcl/menu.hxx>
#endif
#ifndef _MSGBOX_HXX //autogen
#include <vcl/msgbox.hxx>
#endif
#ifndef _SFXTABDLG_HXX //autogen
#include <sfx2/tabdlg.hxx>
#endif
#ifndef _SV_SYSTEM_HXX //autogen
#include <vcl/system.hxx>
#endif
#ifndef _SVX_BRSHITEM_HXX //autogen
#include <svx/brshitem.hxx>
#endif
#ifndef _NUM_HXX //autogen
#define USE_NUMTABPAGES
#include <num.hxx>
#endif
#ifndef _VIEW_HXX
#include <view.hxx>
#endif
#ifndef _DOCSH_HXX
#include <docsh.hxx>
#endif
#ifndef _UITOOL_HXX
#include <uitool.hxx>
#endif
#ifndef _ERRHDL_HXX
#include <errhdl.hxx>
#endif
#ifndef _WRTSH_HXX
#include <wrtsh.hxx>
#endif
#ifndef _SWMODULE_HXX
#include <swmodule.hxx>
#endif
#ifndef _NUMRULE_HXX
#include <numrule.hxx>
#endif
#ifndef _FMTCOL_HXX
#include <fmtcol.hxx>
#endif
#ifndef _OUTLINE_HXX
#include <outline.hxx>
#endif
#ifndef _UINUMS_HXX
#include <uinums.hxx>
#endif
#ifndef _POOLFMT_HXX
#include <poolfmt.hxx>
#endif
#ifndef _SHELLRES_HXX //autogen
#include <shellres.hxx>
#endif
#ifndef _SFXSTYLE_HXX //autogen
#include <svtools/style.hxx>
#endif
#ifndef _CHARFMT_HXX //autogen
#include <charfmt.hxx>
#endif
#ifndef _DOCSTYLE_HXX //autogen
#include <docstyle.hxx>
#endif
#ifndef _HELPID_H
#include <helpid.h>
#endif
#ifndef _GLOBALS_HRC
#include <globals.hrc> // fuer Vorlagenname 'keins'
#endif
#ifndef _MISC_HRC
#include <misc.hrc>
#endif
#ifndef _OUTLINE_HRC
#include <outline.hrc>
#endif
#define C2S(cChar) UniString::CreateFromAscii(cChar)
DBG_NAME(outlinehdl);
// ReplaceTabStr implementiert in doc/docedt.cxx
//extern void ReplaceTabsStr( String& rStr, const String& rSrch,
// const String& rRepl );
USHORT lcl_AdjustToPos(SvxAdjust eAdjust)
{
USHORT nRet = 0;
switch( eAdjust )
{
case SVX_ADJUST_CENTER: nRet = 1;break;
case SVX_ADJUST_RIGHT: nRet = 2; break;
}
return nRet;
}
// Numerierungsformat Umsetzung:
// ListBox - Format - Enum-Wert
// 0 - A, B, C, ... - 0
// 1 - a, b, c, ... - 1
// 2 - I, II, III, ... - 2
// 3 - i, ii, iii, ... - 3
// 4 - 1, 2, 3, ... - 4
// 5 - A, .., AA, .., - 9
// 6 - a, .., aa, .., - 10
// 7 - Ohne - 5
inline USHORT GetNumPos( USHORT n )
{
return SVX_NUM_NUMBER_NONE == n ? 7 : SVX_NUM_ARABIC < n ? n - 4 : n;
}
inline SvxExtNumType GetNumType( USHORT n )
{
return (SvxExtNumType)(7 == n ? SVX_NUM_NUMBER_NONE : SVX_NUM_ARABIC < n ? n + 4 : n);
}
/*---------------------------------------------------------------------
---------------------------------------------------------------------*/
class SwNumNamesDlg: public ModalDialog
{
Edit aFormEdit;
ListBox aFormBox;
GroupBox aFormGrp;
OKButton aOKBtn;
CancelButton aCancelBtn;
HelpButton aHelpBtn;
DECL_LINK( ModifyHdl, Edit * );
DECL_LINK( SelectHdl, ListBox * );
DECL_LINK( DoubleClickHdl, ListBox * );
public:
SwNumNamesDlg(Window *pParent);
~SwNumNamesDlg();
void SetUserNames(const String *pList[]);
String GetName() const { return aFormEdit.GetText(); }
USHORT GetCurEntryPos() const { return aFormBox.GetSelectEntryPos(); }
};
/*------------------------------------------------------------------------
Beschreibung: selektierten Eintrag merken
------------------------------------------------------------------------*/
IMPL_LINK_INLINE_START( SwNumNamesDlg, SelectHdl, ListBox *, pBox )
{
aFormEdit.SetText(pBox->GetSelectEntry());
aFormEdit.SetSelection(Selection(0, SELECTION_MAX));
return 0;
}
IMPL_LINK_INLINE_END( SwNumNamesDlg, SelectHdl, ListBox *, pBox )
/*------------------------------------------------------------------------
Beschreibung: Setzen der vom Benutzer vergebenen Namen
Parameter: Liste der vom Benutzer vergebenen Namen;
nicht vom Benutzer benannte Positionen sind 0.
------------------------------------------------------------------------*/
void SwNumNamesDlg::SetUserNames(const String *pList[])
{
USHORT nSelect = 0;
for(USHORT i = 0; i < SwBaseNumRules::nMaxRules; ++i)
{
if(pList[i])
{
aFormBox.RemoveEntry(i);
aFormBox.InsertEntry(*pList[i], i);
if(i == nSelect && nSelect < SwBaseNumRules::nMaxRules)
nSelect++;
}
}
aFormBox.SelectEntryPos(nSelect);
SelectHdl(&aFormBox);
}
/*------------------------------------------------------------------------
Beschreibung: OK-Button freischalten, wenn Text im Edit steht.
------------------------------------------------------------------------*/
IMPL_LINK_INLINE_START( SwNumNamesDlg, ModifyHdl, Edit *, pBox )
{
aOKBtn.Enable(0 != pBox->GetText().Len());
return 0;
}
IMPL_LINK_INLINE_END( SwNumNamesDlg, ModifyHdl, Edit *, pBox )
/*------------------------------------------------------------------------
Beschreibung: DoubleClickHdl
------------------------------------------------------------------------*/
IMPL_LINK_INLINE_START( SwNumNamesDlg, DoubleClickHdl, ListBox *, EMPTYARG )
{
EndDialog(RET_OK);
return 0;
}
IMPL_LINK_INLINE_END( SwNumNamesDlg, DoubleClickHdl, ListBox *, EMPTYARG )
/*--------------------------------------------------
--------------------------------------------------*/
SwNumNamesDlg::SwNumNamesDlg(Window *pParent)
: ModalDialog(pParent, SW_RES(DLG_NUM_NAMES)),
aFormEdit(this, SW_RES(ED_FORM)),
aFormBox(this, SW_RES(LB_FORM)),
aFormGrp(this, SW_RES(GB_FORM)),
aOKBtn(this, SW_RES(BT_OK)),
aCancelBtn(this, SW_RES(BT_CANCEL)),
aHelpBtn(this, SW_RES(BT_HELP))
{
FreeResource();
aFormEdit.SetModifyHdl(LINK(this, SwNumNamesDlg, ModifyHdl));
aFormBox.SetSelectHdl(LINK(this, SwNumNamesDlg, SelectHdl));
aFormBox.SetDoubleClickHdl(LINK(this, SwNumNamesDlg, DoubleClickHdl));
SelectHdl(&aFormBox);
}
/*--------------------------------------------------
--------------------------------------------------*/
__EXPORT SwNumNamesDlg::~SwNumNamesDlg() {}
/* -----------------08.07.98 08:46-------------------
*
* --------------------------------------------------*/
USHORT lcl_BitToLevel(USHORT nActLevel)
{
USHORT nTmp = nActLevel;
USHORT nTmpLevel = 0;
while( 0 != (nTmp >>= 1) )
nTmpLevel++;
return nTmpLevel;
}
/* -----------------07.07.98 14:13-------------------
*
* --------------------------------------------------*/
SwOutlineTabDialog::SwOutlineTabDialog(Window* pParent,
const SfxItemSet* pSwItemSet,
SwWrtShell &rSh) :
//der UserString wird danach richtig gesetzt
SfxTabDialog(pParent, SW_RES(DLG_TAB_OUTLINE), pSwItemSet, FALSE, &aEmptyStr),
aFormMenu(SW_RES(MN_FORM)),
bModified(rWrtSh.IsModified()),
aNullStr(C2S("____")),
nNumLevel(1),
pChapterNumRules(SW_MOD()->GetChapterNumRules()),
rWrtSh(rSh)
{
PushButton* pUserBtn = GetUserButton();
pUserBtn->SetText(SW_RES(ST_FORM));
pUserBtn->SetHelpId(HID_OUTLINE_FORM);
pUserBtn->SetClickHdl(LINK(this, SwOutlineTabDialog, FormHdl));
FreeResource();
pNumRule = new SwNumRule( *rSh.GetOutlineNumRule() );
GetCancelButton().SetClickHdl(LINK(this, SwOutlineTabDialog, CancelHdl));
AddTabPage(TP_NUM_POSITION , &SwNumPositionTabPage::Create, 0);
AddTabPage(TP_OUTLINE_NUM , &SwOutlineSettingsTabPage::Create, 0);
String sHeadline;
for(USHORT i = 0; i < MAXLEVEL; ++i )
{
// wurde die Vorlage noch nicht angelegt, dann ist sie noch an dieserPosition
if( !rWrtSh.GetParaStyle( GetDocPoolNm( RES_POOLCOLL_HEADLINE1 + i,
sHeadline )) )
aCollNames[i] = sHeadline;
}
// Erfragen der Gliederungsebenen der Textvorlagen
const USHORT nCount = rWrtSh.GetTxtFmtCollCount();
for(i = 0; i < nCount; ++i )
{
SwTxtFmtColl &rTxtColl = rWrtSh.GetTxtFmtColl(i);
if(!rTxtColl.IsDefault())
{
BYTE nOutLevel = rTxtColl.GetOutlineLevel();
if(nOutLevel != NO_NUMBERING)
aCollNames[ nOutLevel ] = rTxtColl.GetName();
}
}
}
/* -----------------07.07.98 14:13-------------------
*
* --------------------------------------------------*/
SwOutlineTabDialog::~SwOutlineTabDialog()
{
delete pNumRule;
}
/* -----------------07.07.98 14:13-------------------
*
* --------------------------------------------------*/
void SwOutlineTabDialog::PageCreated(USHORT nPageId, SfxTabPage& rPage)
{
switch ( nPageId )
{
case TP_NUM_POSITION:
((SwNumPositionTabPage&)rPage).SetWrtShell(&rWrtSh);
((SwNumPositionTabPage&)rPage).SetOutlineTabDialog(this);
break;
case TP_OUTLINE_NUM:
((SwOutlineSettingsTabPage&)rPage).SetWrtShell(&rWrtSh);
break;
}
}
/* -----------------07.07.98 14:19-------------------
*
* --------------------------------------------------*/
IMPL_LINK( SwOutlineTabDialog, CancelHdl, Button *, pBtn )
{
if (!bModified)
rWrtSh.ResetModified();
EndDialog(RET_CANCEL);
return 0;
}
/* -----------------08.07.98 12:14-------------------
*
* --------------------------------------------------*/
IMPL_LINK( SwOutlineTabDialog, FormHdl, Button *, pBtn )
{
//PopupMenu auffuellen
for( USHORT i = 0; i < SwChapterNumRules::nMaxRules; ++i )
{
const SwNumRulesWithName *pRules = pChapterNumRules->GetRules(i);
if( pRules )
aFormMenu.SetItemText(i + MN_FORMBASE, pRules->GetName());
}
aFormMenu.SetSelectHdl(LINK(this, SwOutlineTabDialog, MenuSelectHdl));
aFormMenu.Execute(pBtn, Rectangle(Point(0,0), pBtn->GetSizePixel()), POPUPMENU_EXECUTE_DOWN);
return 0;
}
/* -----------------08.07.98 12:14-------------------
*
* --------------------------------------------------*/
IMPL_LINK( SwOutlineTabDialog, MenuSelectHdl, Menu *, pMenu )
{
BYTE nLevelNo = 0;
switch(pMenu->GetCurItemId())
{
case MN_FORM1: nLevelNo = 1; break;
case MN_FORM2: nLevelNo = 2; break;
case MN_FORM3: nLevelNo = 3; break;
case MN_FORM4: nLevelNo = 4; break;
case MN_FORM5: nLevelNo = 5; break;
case MN_FORM6: nLevelNo = 6; break;
case MN_FORM7: nLevelNo = 7; break;
case MN_FORM8: nLevelNo = 8; break;
case MN_FORM9: nLevelNo = 9; break;
case MN_SAVE:
{
SwNumNamesDlg *pDlg = new SwNumNamesDlg(this);
const String *aStrArr[SwChapterNumRules::nMaxRules];
for(USHORT i = 0; i < SwChapterNumRules::nMaxRules; ++i)
{
const SwNumRulesWithName *pRules = pChapterNumRules->GetRules(i);
if(pRules)
aStrArr[i] = &pRules->GetName();
else
aStrArr[i] = 0;
}
pDlg->SetUserNames(aStrArr);
if(RET_OK == pDlg->Execute())
{
const String aName(pDlg->GetName());
pChapterNumRules->ApplyNumRules( SwNumRulesWithName(
*pNumRule, aName ), pDlg->GetCurEntryPos() );
pMenu->SetItemText(
pDlg->GetCurEntryPos() + MN_FORMBASE, aName);
}
delete pDlg;
return 0;
}
}
if( nLevelNo-- )
{
const SwNumRulesWithName *pRules = pChapterNumRules->GetRules( nLevelNo );
if( pRules )
{
pRules->MakeNumRule( rWrtSh, *pNumRule );
pNumRule->SetRuleType( OUTLINE_RULE );
}
else
*pNumRule = *rWrtSh.GetOutlineNumRule();
}
USHORT nPageId = GetCurPageId();
SfxTabPage* pPage = GetTabPage( nPageId );
pPage->Reset(*GetOutputItemSet());
return 0;
}
/* -----------------07.07.98 14:19-------------------
*
* --------------------------------------------------*/
USHORT SwOutlineTabDialog::GetLevel(const String &rFmtName) const
{
for(USHORT i = 0; i < MAXLEVEL; ++i)
{
if(aCollNames[i] == rFmtName)
return i;
}
return NO_NUMBERING;
}
/* -----------------07.07.98 16:30-------------------
*
* --------------------------------------------------*/
short SwOutlineTabDialog::Ok()
{
short nRet = SfxTabDialog::Ok();
// bei allen erzeugten Vorlagen die Ebenen setzen, muss
// geschehen, um evtl. aufgehobene Zuordnungen
// auch wieder zu loeschen
USHORT i, nCount = rWrtSh.GetTxtFmtCollCount();
for( i = 0; i < nCount; ++i )
{
SwTxtFmtColl &rTxtColl = rWrtSh.GetTxtFmtColl(i);
if( !rTxtColl.IsDefault() )
rTxtColl.SetOutlineLevel( (BYTE)GetLevel(rTxtColl.GetName()));
}
for( i = 0; i < MAXLEVEL; ++i )
if( !aCollNames[i].Len() )
{
SwTxtFmtColl* pTxtColl = rWrtSh.GetTxtCollFromPool(
RES_POOLCOLL_HEADLINE1 + i );
pTxtColl->SetOutlineLevel( NO_NUMBERING );
}
rWrtSh.SetOutlineNumRule( *pNumRule );
return RET_OK;
}
/* -----------------07.07.98 14:19-------------------
*
* --------------------------------------------------*/
SwOutlineSettingsTabPage::SwOutlineSettingsTabPage(Window* pParent, const SfxItemSet& rSet) :
SfxTabPage(pParent, SW_RES(TP_OUTLINE_NUM), rSet),
aLevelGB( this, ResId(GB_LEVEL )),
aLevelLB( this, ResId(LB_LEVEL )),
aPreviewGB( this, ResId(GB_PREVIEW )),
aPreviewWIN( this, ResId(WIN_PREVIEW )),
aCollLbl(this, SW_RES(FT_COLL)),
aCollBox(this, SW_RES(LB_COLL)),
aNumberLbl(this, SW_RES(FT_NUMBER)),
aNumberBox(this, SW_RES(LB_NUMBER)),
aCharFmtFT(this, SW_RES(FT_CHARFMT)),
aCharFmtLB(this, SW_RES(LB_CHARFMT)),
aAllLevelFT( this, ResId(FT_ALL_LEVEL)),
aAllLevelNF( this, ResId(NF_ALL_LEVEL)),
aDelim(this, SW_RES(FT_DELIM)),
aPrefixFT(this, SW_RES(FT_PREFIX)),
aPrefixED(this, SW_RES(ED_PREFIX)),
aSuffixFT(this, SW_RES(FT_SUFFIX)),
aSuffixED(this, SW_RES(ED_SUFFIX)),
aStartLbl(this, SW_RES(FT_START)),
aStartEdit(this, SW_RES(ED_START)),
aNumberGrp(this, SW_RES(GB_NUMBER)),
aNoFmtName(SW_RES(ST_NO_COLL)),
nActLevel(1),
pCollNames(0),
pSh(0)
{
FreeResource();
SetExchangeSupport();
aCollBox.InsertEntry(aNoFmtName);
aLevelLB.SetSelectHdl(LINK(this, SwOutlineSettingsTabPage, LevelHdl));
aAllLevelNF.SetModifyHdl(LINK(this, SwOutlineSettingsTabPage, ToggleComplete));
aCollBox.SetSelectHdl(LINK(this, SwOutlineSettingsTabPage, CollSelect));
aCollBox.SetGetFocusHdl(LINK(this, SwOutlineSettingsTabPage, CollSelectGetFocus));
aNumberBox.SetSelectHdl(LINK(this, SwOutlineSettingsTabPage, NumberSelect));
aPrefixED.SetModifyHdl(LINK(this, SwOutlineSettingsTabPage, DelimModify));
aSuffixED.SetModifyHdl(LINK(this, SwOutlineSettingsTabPage, DelimModify));
aStartEdit.SetModifyHdl(LINK(this, SwOutlineSettingsTabPage, StartModified));
aCharFmtLB.SetSelectHdl(LINK(this, SwOutlineSettingsTabPage, CharFmtHdl));
}
/* -----------------07.07.98 14:19-------------------
*
* --------------------------------------------------*/
void SwOutlineSettingsTabPage::Update()
{
// falls eine Vorlage fuer diese Ebene bereits selektiert wurde,
// diese in der ListBox auswaehlean
aCollBox.Enable(USHRT_MAX != nActLevel);
if(USHRT_MAX == nActLevel)
{
BOOL bSamePrefix = TRUE;
BOOL bSameSuffix = TRUE;
BOOL bSameType = TRUE;
BOOL bSameComplete = TRUE;
BOOL bSameStart = TRUE;
BOOL bSameCharFmt = TRUE;
const SwNumFmt* aNumFmtArr[MAXLEVEL];
const SwCharFmt* pFirstFmt = 0;
for(USHORT i = 0; i < MAXLEVEL; i++)
{
aNumFmtArr[ i ] = &pNumRule->Get(i);
if(i == 0)
pFirstFmt = aNumFmtArr[i]->GetCharFmt();
else
{
bSameType &= aNumFmtArr[i]->eType == aNumFmtArr[0]->eType;
bSameStart &= aNumFmtArr[i]->GetStartValue() == aNumFmtArr[0]->GetStartValue();
bSamePrefix &= aNumFmtArr[i]->GetPrefix() == aNumFmtArr[0]->GetPrefix();
bSameSuffix &= aNumFmtArr[i]->GetPostfix() == aNumFmtArr[0]->GetPostfix();
bSameComplete &= aNumFmtArr[i]->GetUpperLevel() == aNumFmtArr[0]->GetUpperLevel();
const SwCharFmt* pFmt = aNumFmtArr[i]->GetCharFmt();
bSameCharFmt &= !pFirstFmt && !pFmt
|| pFirstFmt && pFmt && pFmt->GetName() == pFirstFmt->GetName();
}
}
if(bSameType)
aNumberBox.SelectEntryPos( GetNumPos( aNumFmtArr[0]->eType ));
else
aNumberBox.SetNoSelection();
if(bSameStart)
aStartEdit.SetValue(aNumFmtArr[0]->GetStartValue());
else
aStartEdit.SetText(aEmptyStr);
if(bSamePrefix)
aPrefixED.SetText(aNumFmtArr[0]->GetPrefix());
else
aPrefixED.SetText(aEmptyStr);
if(bSameSuffix)
aSuffixED.SetText(aNumFmtArr[0]->GetPostfix());
else
aSuffixED.SetText(aEmptyStr);
if(bSameCharFmt)
{
if(pFirstFmt)
aCharFmtLB.SelectEntry(pFirstFmt->GetName());
else
aCharFmtLB.SelectEntry( ViewShell::GetShellRes()->aStrNone );
}
else
aCharFmtLB.SetNoSelection();
aAllLevelNF.Enable(TRUE);
aAllLevelNF.SetMax(MAXLEVEL);
if(bSameComplete)
{
aAllLevelNF.SetValue(aNumFmtArr[0]->GetUpperLevel());
}
else
{
aAllLevelNF.SetText(aEmptyStr);
}
}
else
{
USHORT nTmpLevel = lcl_BitToLevel(nActLevel);
String aColl(pCollNames[nTmpLevel]);
if(aColl.Len())
aCollBox.SelectEntry(aColl);
else
aCollBox.SelectEntry(aNoFmtName);
const SwNumFmt &rFmt = pNumRule->Get(nTmpLevel);
aNumberBox.SelectEntryPos( GetNumPos( rFmt.eType ));
aPrefixED.SetText(rFmt.GetPrefix());
aSuffixED.SetText(rFmt.GetPostfix());
const SwCharFmt* pFmt = rFmt.GetCharFmt();
if(pFmt)
aCharFmtLB.SelectEntry(pFmt->GetName());
else
aCharFmtLB.SelectEntry( ViewShell::GetShellRes()->aStrNone );
if(nTmpLevel)
{
aAllLevelNF.Enable(TRUE);
aAllLevelNF.SetMax(nTmpLevel + 1);
aAllLevelNF.SetValue(rFmt.GetUpperLevel());
}
else
{
aAllLevelNF.SetText(aEmptyStr);
aAllLevelNF.Enable(FALSE);
}
aStartEdit.SetValue( rFmt.GetStartValue() );
}
SetModified();
}
/* -----------------07.07.98 14:19-------------------
*
* --------------------------------------------------*/
IMPL_LINK( SwOutlineSettingsTabPage, LevelHdl, ListBox *, pBox )
{
nActLevel = 0;
if(pBox->IsEntryPosSelected( MAXLEVEL ))
{
nActLevel = 0xFFFF;
}
else
{
USHORT nMask = 1;
for( USHORT i = 0; i < MAXLEVEL; i++ )
{
if(pBox->IsEntryPosSelected( i ))
nActLevel |= nMask;
nMask <<= 1;
}
}
Update();
return 0;
}
/* -----------------07.07.98 14:19-------------------
*
* --------------------------------------------------*/
IMPL_LINK( SwOutlineSettingsTabPage, ToggleComplete, NumericField *, pFld )
{
USHORT nStart = 0;
USHORT nEnd = MAXLEVEL;
USHORT nMask = 1;
for(USHORT i = 0; i < MAXLEVEL; i++)
{
if(nActLevel & nMask)
{
SwNumFmt aNumFmt(pNumRule->Get(i));
aNumFmt.SetUpperLevel((BYTE) min(pFld->GetValue(), i + 1) );
pNumRule->Set(i, aNumFmt);
}
nMask <<= 1;
}
SetModified();
return 0;
}
/* -----------------07.07.98 14:19-------------------
*
* --------------------------------------------------*/
IMPL_LINK( SwOutlineSettingsTabPage, CollSelect, ListBox *, pBox )
{
BYTE i;
const String aCollName(pBox->GetSelectEntry());
//0xFFFF darf hier nicht sein (disable)
USHORT nTmp = nActLevel;
USHORT nTmpLevel = lcl_BitToLevel(nActLevel);
String sOldName( pCollNames[nTmpLevel] );
for( i = 0; i < MAXLEVEL; ++i)
pCollNames[i] = aSaveCollNames[i];
if(aCollName == aNoFmtName)
pCollNames[nTmpLevel] = aEmptyStr;
else
{
pCollNames[nTmpLevel] = aCollName;
// wird die Vorlage bereits verwendet ?
for( i = 0; i < MAXLEVEL; ++i)
if(i != nTmpLevel && pCollNames[i] == aCollName )
pCollNames[i] = aEmptyStr;
}
// search the oldname and put it into the current entries
if( sOldName.Len() )
for( i = 0; i < MAXLEVEL; ++i)
if( aSaveCollNames[ i ] == sOldName && i != nTmpLevel &&
!pCollNames[ i ].Len() )
{
BYTE n;
for( n = 0; n < MAXLEVEL; ++n )
if( pCollNames[ n ] == sOldName )
break;
if( MAXLEVEL == n )
// it was a outline leveld name and the current entries is zero.
pCollNames[ i ] = sOldName;
}
SetModified();
return 0;
}
IMPL_LINK( SwOutlineSettingsTabPage, CollSelectGetFocus, ListBox *, pBox )
{
for( BYTE i = 0; i < MAXLEVEL; ++i)
aSaveCollNames[i] = pCollNames[i];
return 0;
}
/* -----------------07.07.98 14:19-------------------
*
* --------------------------------------------------*/
IMPL_LINK( SwOutlineSettingsTabPage, NumberSelect, ListBox *, pBox )
{
USHORT nStart = 0;
USHORT nEnd = MAXLEVEL;
USHORT nMask = 1;
for(USHORT i = 0; i < MAXLEVEL; i++)
{
if(nActLevel & nMask)
{
SwNumFmt aNumFmt(pNumRule->Get(i));
aNumFmt.eType = GetNumType( pBox->GetSelectEntryPos() );
pNumRule->Set(i, aNumFmt);
}
nMask <<= 1;
}
SetModified();
return 0;
}
/* -----------------07.07.98 14:19-------------------
*
* --------------------------------------------------*/
IMPL_LINK( SwOutlineSettingsTabPage, DelimModify, Edit *, pEdt )
{
USHORT nStart = 0;
USHORT nEnd = MAXLEVEL;
USHORT nMask = 1;
for(USHORT i = 0; i < MAXLEVEL; i++)
{
if(nActLevel & nMask)
{
SwNumFmt aNumFmt(pNumRule->Get(i));
aNumFmt.SetPrefix( aPrefixED.GetText() );
aNumFmt.SetPostfix( aSuffixED.GetText() );
pNumRule->Set(i, aNumFmt);
}
nMask <<= 1;
}
SetModified();
return 0;
}
/* -----------------07.07.98 14:19-------------------
*
* --------------------------------------------------*/
IMPL_LINK( SwOutlineSettingsTabPage, StartModified, NumericField *, pFld )
{
USHORT nStart = 0;
USHORT nEnd = MAXLEVEL;
USHORT nMask = 1;
for(USHORT i = 0; i < MAXLEVEL; i++)
{
if(nActLevel & nMask)
{
SwNumFmt aNumFmt(pNumRule->Get(i));
aNumFmt.SetStartValue( (USHORT)pFld->GetValue() );
pNumRule->Set(i, aNumFmt);
}
nMask <<= 1;
}
// SetModified();
return 0;
}
/* -----------------21.09.98 12:21-------------------
*
* --------------------------------------------------*/
IMPL_LINK( SwOutlineSettingsTabPage, CharFmtHdl, ListBox *, EMPTYARG )
{
// bAutomaticCharStyles = FALSE;
String sEntry = aCharFmtLB.GetSelectEntry();
USHORT nMask = 1;
BOOL bFormatNone = sEntry == ViewShell::GetShellRes()->aStrNone;
SwCharFmt* pFmt = 0;
if(!bFormatNone)
{
USHORT nChCount = pSh->GetCharFmtCount();
for(USHORT i = 0; i < nChCount; i++)
{
SwCharFmt& rChFmt = pSh->GetCharFmt(i);
if(rChFmt.GetName() == sEntry)
{
pFmt = &rChFmt;
break;
}
}
if(!pFmt)
{
SfxStyleSheetBasePool* pPool = pSh->GetView().GetDocShell()->GetStyleSheetPool();
SfxStyleSheetBase* pBase;
pBase = pPool->Find(sEntry, SFX_STYLE_FAMILY_CHAR);
if(!pBase)
pBase = &pPool->Make(sEntry, SFX_STYLE_FAMILY_PAGE);
pFmt = ((SwDocStyleSheet*)pBase)->GetCharFmt();
}
}
for(USHORT i = 0; i < MAXLEVEL; i++)
{
if(nActLevel & nMask)
{
SwNumFmt aNumFmt(pNumRule->Get(i));
if(bFormatNone)
aNumFmt.SetCharFmt(0);
else
aNumFmt.SetCharFmt(pFmt);
pNumRule->Set(i, aNumFmt);
}
nMask <<= 1;
}
// SetModified(FALSE);
return RET_OK;
}
/* -----------------07.07.98 14:19-------------------
*
* --------------------------------------------------*/
SwOutlineSettingsTabPage::~SwOutlineSettingsTabPage()
{
}
/* -----------------07.07.98 16:27-------------------
*
* --------------------------------------------------*/
void SwOutlineSettingsTabPage::SetWrtShell(SwWrtShell* pShell)
{
pSh = pShell;
// Erfragen der NumRules dieses Dokumentes
pNumRule = ((SwOutlineTabDialog*)GetTabDialog())->GetNumRule();
pCollNames = ((SwOutlineTabDialog*)GetTabDialog())->GetCollNames();
//pNumRule = new SwNumRule( *rSh.GetOutlineNumRule() );
aPreviewWIN.SetNumRule(pNumRule);
aPreviewWIN.SetOutlineNames(pCollNames);
// Startwert setzen - nActLevel muss hier 1 sein
USHORT nTmpLevel = lcl_BitToLevel(nActLevel);
const SwNumFmt& rNumFmt = pNumRule->Get( nTmpLevel );
aStartEdit.SetValue( rNumFmt.GetStartValue() );
// Poolformate fuer Ueberschriften anlegen
String sStr;
USHORT i;
for( i = 0; i < MAXLEVEL; ++i )
{
aCollBox.InsertEntry( GetDocPoolNm( RES_POOLCOLL_HEADLINE1 + i, sStr ));
aLevelLB.InsertEntry( String::CreateFromInt32(i + 1) );
}
sStr.AssignAscii( RTL_CONSTASCII_STRINGPARAM( "1 - " ));
sStr += String::CreateFromInt32(MAXLEVEL);
aLevelLB.InsertEntry( sStr );
// Erfragen der Gliederungsebenen der Textvorlagen
const USHORT nCount = pSh->GetTxtFmtCollCount();
for( i = 0; i < nCount; ++i )
{
SwTxtFmtColl &rTxtColl = pSh->GetTxtFmtColl(i);
if(!rTxtColl.IsDefault())
{
BYTE nOutLevel = rTxtColl.GetOutlineLevel();
sStr = rTxtColl.GetName();
if(LISTBOX_ENTRY_NOTFOUND == aCollBox.GetEntryPos( sStr ))
aCollBox.InsertEntry( sStr );
}
}
aNumberBox.SelectEntryPos( GetNumPos( rNumFmt.eType ));
USHORT nOutlinePos = pSh->GetOutlinePos(MAXLEVEL);
USHORT nTmp = 0;
if(nOutlinePos != USHRT_MAX)
{
nTmp = pSh->GetOutlineLevel(nOutlinePos);
}
aLevelLB.SelectEntryPos(nTmp);
// Zeichenvorlagen sammeln
aCharFmtLB.Clear();
aCharFmtLB.InsertEntry( ViewShell::GetShellRes()->aStrNone );
// Zeichenvorlagen
::FillCharStyleListBox(aCharFmtLB,
pSh->GetView().GetDocShell());
Update();
}
/* -----------------07.07.98 14:19-------------------
*
* --------------------------------------------------*/
void SwOutlineSettingsTabPage::ActivatePage(const SfxItemSet& rSet)
{
nActLevel = ((SwOutlineTabDialog*)GetTabDialog())->GetActNumLevel();
if(nActLevel != USHRT_MAX)
aLevelLB.SelectEntryPos(lcl_BitToLevel(nActLevel));
else
aLevelLB.SelectEntryPos(MAXLEVEL);
LevelHdl(&aLevelLB);
}
/* -----------------07.07.98 14:19-------------------
*
* --------------------------------------------------*/
int SwOutlineSettingsTabPage::DeactivatePage(SfxItemSet *pSet)
{
((SwOutlineTabDialog*)GetTabDialog())->SetActNumLevel(nActLevel);
return LEAVE_PAGE;
}
/* -----------------07.07.98 14:19-------------------
*
* --------------------------------------------------*/
BOOL SwOutlineSettingsTabPage::FillItemSet( SfxItemSet& rSet )
{
return TRUE;
}
/* -----------------07.07.98 14:19-------------------
*
* --------------------------------------------------*/
void SwOutlineSettingsTabPage::Reset( const SfxItemSet& rSet )
{
ActivatePage(rSet);
}
/* -----------------07.07.98 14:19-------------------
*
* --------------------------------------------------*/
SfxTabPage* SwOutlineSettingsTabPage::Create( Window* pParent,
const SfxItemSet& rAttrSet)
{
return new SwOutlineSettingsTabPage(pParent, rAttrSet);
}
/*-----------------09.12.97 11:54-------------------
--------------------------------------------------*/
USHORT lcl_DrawBullet(VirtualDevice* pVDev,
const SwNumFmt& rFmt, USHORT nXStart,
USHORT nYStart, const Size& rSize)
{
Font aTmpFont(pVDev->GetFont());
Font aFont(*rFmt.GetBulletFont());
aFont.SetSize(rSize);
aFont.SetTransparent(TRUE);
pVDev->SetFont( aFont );
String aText(rFmt.GetBulletChar());
pVDev->DrawText( Point(nXStart, nYStart), aText );
USHORT nRet = (USHORT)pVDev->GetTextWidth(aText);
pVDev->SetFont(aTmpFont);
return nRet;
}
/*-----------------09.12.97 11:49-------------------
--------------------------------------------------*/
USHORT lcl_DrawGraphic(VirtualDevice* pVDev, const SwNumFmt &rFmt, USHORT nXStart,
USHORT nYStart, USHORT nDivision)
{
const SvxBrushItem* pBrushItem = rFmt.GetGrfBrush();
USHORT nRet = 0;
if(pBrushItem)
{
const Graphic* pGrf = pBrushItem->GetGraphic();
if(pGrf)
{
Size aGSize( rFmt.GetGrfSize() );
aGSize.Width() /= nDivision;
nRet = (USHORT)aGSize.Width();
aGSize.Height() /= nDivision;
pGrf->Draw( pVDev, Point(nXStart,nYStart),
pVDev->PixelToLogic( aGSize ) );
}
}
return nRet;
}
/*-----------------02.12.97 10:34-------------------
Vorschau der Numerierung painten
--------------------------------------------------*/
void NumberingPreview::Paint( const Rectangle& rRect )
{
Size aSize(PixelToLogic(GetOutputSizePixel()));
Rectangle aRect(Point(0,0), aSize);
VirtualDevice* pVDev = new VirtualDevice(*this);
pVDev->SetMapMode(GetMapMode());
pVDev->SetOutputSize( aSize );
pVDev->SetFillColor( Color( COL_WHITE ) );
pVDev->DrawRect(aRect);
if(pActNum)
{
USHORT nWidthRelation;
if(nPageWidth)
{
nWidthRelation = USHORT (nPageWidth / aSize.Width());
if(bPosition)
nWidthRelation = nWidthRelation * 2 / 3;
else
nWidthRelation = nWidthRelation / 4;
}
else
nWidthRelation = 30; // Kapiteldialog
//Hoehe pro Ebene
USHORT nXStep = aSize.Width() / (3 * MAXLEVEL);
if(MAXLEVEL < 10)
nXStep /= 2;
USHORT nYStart = 4;
USHORT nYStep = (aSize.Height() - 6)/ MAXLEVEL;
// USHORT nLineHeight = nYStep * 8 / 10;
aStdFont = System::GetStandardFont(STDFONT_SWISS);
//
USHORT nFontHeight = nYStep * 6 / 10;
if(bPosition)
nFontHeight = nYStep * 15 / 10;
aStdFont.SetSize(Size( 0, nFontHeight ));
SwNodeNum aNum( (BYTE)0 );
USHORT nPreNum = pActNum->Get(0).GetStartValue();
if(bPosition)
{
USHORT nLineHeight = nFontHeight * 8 / 7;
BYTE nStart = 0;
while( !(nActLevel & (1<<nStart)) )
{
nStart++;
}
if(nStart) // damit moeglichs Vorgaenger und Nachfolger gezeigt werden
nStart--;
BYTE nEnd = min(nStart + 3, MAXLEVEL);
for( BYTE nLevel = nStart; nLevel < nEnd; ++nLevel )
{
const SwNumFmt &rFmt = pActNum->Get(nLevel);
aNum.GetLevelVal()[ nLevel ] = rFmt.GetStartValue();
USHORT nXStart = rFmt.GetAbsLSpace() / nWidthRelation;
USHORT nTextOffset = rFmt.GetCharTextOffset() / nWidthRelation;
USHORT nNumberXPos = nXStart;
USHORT nFirstLineOffset = (-rFmt.GetFirstLineOffset()) / nWidthRelation;
if(nFirstLineOffset <= nNumberXPos)
nNumberXPos -= nFirstLineOffset;
else
nNumberXPos = 0;
USHORT nBulletWidth = 0;
if( SVX_NUM_BITMAP == rFmt.eType )
{
nBulletWidth = lcl_DrawGraphic(pVDev, rFmt,
nNumberXPos,
nYStart, nWidthRelation);
}
else if( SVX_NUM_CHAR_SPECIAL == rFmt.eType )
{
nBulletWidth = lcl_DrawBullet(pVDev, rFmt, nNumberXPos, nYStart, aStdFont.GetSize());
}
else
{
pVDev->SetFont(aStdFont);
aNum.SetLevel( nLevel );
if(pActNum->IsContinusNum())
aNum.GetLevelVal()[nLevel] = nPreNum;
String aText(pActNum->MakeNumString( aNum ));
pVDev->DrawText( Point(nNumberXPos, nYStart), aText );
nBulletWidth = (USHORT)pVDev->GetTextWidth(aText);
nPreNum++;
}
USHORT nTextXPos = nXStart;
if(nNumberXPos + nBulletWidth + nTextOffset > nTextXPos )
nTextXPos = nNumberXPos + nBulletWidth + nTextOffset;
Rectangle aRect1(Point(nTextXPos, nYStart + nFontHeight / 2), Size(aSize.Width() / 2, 2));
pVDev->SetFillColor( Color( COL_BLACK ) );
pVDev->DrawRect( aRect1 );
Rectangle aRect2(Point(nXStart, nYStart + nLineHeight + nFontHeight / 2 ), Size(aSize.Width() / 2, 2));
pVDev->DrawRect( aRect2 );
nYStart += 2 * nLineHeight;
}
}
else
{
USHORT nLineHeight = nFontHeight * 3 / 2;
for( BYTE nLevel = 0; nLevel < MAXLEVEL;
++nLevel, nYStart += nYStep )
{
const SwNumFmt &rFmt = pActNum->Get(nLevel);
aNum.GetLevelVal()[ nLevel ] = rFmt.GetStartValue();
USHORT nXStart = (rFmt.GetAbsLSpace() / nWidthRelation) / 2 + 2;
USHORT nTextOffset = 2 * nXStep;
if( SVX_NUM_BITMAP == rFmt.eType )
{
lcl_DrawGraphic(pVDev, rFmt, nXStart, nYStart, nWidthRelation);
nTextOffset = nLineHeight + nXStep;
}
else if( SVX_NUM_CHAR_SPECIAL == rFmt.eType )
{
// aNum.GetLevelVal()[ nLevel ] = 0;
nTextOffset = lcl_DrawBullet(pVDev, rFmt, nXStart, nYStart, aStdFont.GetSize());
nTextOffset += nXStep;
}
else
{
pVDev->SetFont(aStdFont);
aNum.SetLevel( nLevel );
if(pActNum->IsContinusNum())
aNum.GetLevelVal()[nLevel] = nPreNum;
String aText(pActNum->MakeNumString( aNum ));
pVDev->DrawText( Point(nXStart, nYStart), aText );
nTextOffset = (USHORT)pVDev->GetTextWidth(aText);
nTextOffset += nXStep;
nPreNum++;
}
pVDev->SetFont(aStdFont);
String sMsg(C2S("StarOffice"));
if(pOutlineNames)
sMsg = pOutlineNames[nLevel];
pVDev->DrawText( Point(nXStart + nTextOffset, nYStart), sMsg );
}
}
}
DrawOutDev( Point(0,0), aSize,
Point(0,0), aSize,
*pVDev );
delete pVDev;
}
/*-----------------02.12.97 10:34-------------------
--------------------------------------------------*/
NumberingPreview::~NumberingPreview()
{
}
/*------------------------------------------------------------------------
$Log: not supported by cvs2svn $
Revision 1.105 2000/09/18 16:05:58 willem.vandorp
OpenOffice header added.
Revision 1.104 2000/07/26 12:03:33 jp
OkHdl: don't use invalid PoolIds
Revision 1.103 2000/07/25 10:40:29 jp
Bug #76772#,#76774#: don't remove all selected templates from the preview, LoadNameRules must set the outline type
Revision 1.102 2000/07/03 08:54:11 jp
must changes for VCL
Revision 1.101 2000/06/13 14:11:58 os
#74049# save outline numbering form to the first empty position
Revision 1.100 2000/05/23 19:22:39 jp
Bugfixes for Unicode
Revision 1.99 2000/04/26 14:55:46 os
GetName() returns const String&
Revision 1.98 2000/04/18 15:08:17 os
UNICODE
Revision 1.97 2000/03/14 09:32:31 os
#74039# outline assignment corrected
Revision 1.96 2000/03/03 15:17:02 os
StarView remainders removed
Revision 1.95 2000/02/11 14:56:40 hr
#70473# changes for unicode ( patched by automated patchtool )
Revision 1.94 1999/01/06 14:04:56 OS
#58643# Positionsbeispiel berichtigt
Rev 1.93 06 Jan 1999 15:04:56 OS
#58643# Positionsbeispiel berichtigt
Rev 1.92 18 Nov 1998 08:35:04 OS
#58263# Numerierung in den Svx - Reste
Rev 1.91 17 Nov 1998 10:57:52 OS
#58263# NumType durch SvxExtNumType ersetzt
Rev 1.90 10 Nov 1998 16:03:34 OS
#58201# HelpId fuer Form-Button
Rev 1.89 09 Nov 1998 14:03:04 AWO
Inlcudes hinzugefuegt
Rev 1.88 06 Nov 1998 14:10:00 OS
#45264# Outline-Ebenen nicht fuer index-ebenen
Rev 1.87 21 Sep 1998 15:31:30 OS
#56738# Zeichenvorlage fuer Kapitelnumerierung einstellbar
Rev 1.86 06 Aug 1998 21:42:08 JP
Bug #54796#: neue NumerierungsTypen (WW97 kompatibel)
Rev 1.85 18 Jul 1998 14:50:52 OS
richtige Ebenenanzahl fuer vollst. Numerierung #53233#
Rev 1.84 09 Jul 1998 14:03:06 OS
Kapitelnumerierung jetzt TabDialog
Rev 1.83 01 Apr 1998 15:15:22 OS
Beispielhintergrund zuruecksetzen #49133#
Rev 1.82 26 Feb 1998 17:07:34 OS
keins->keine #47632#
Rev 1.81 24 Feb 1998 15:44:48 OS
Ausrichtung berichtigt #47417#
Rev 1.80 08 Dec 1997 11:53:30 OS
benannte Numerierungen entfernt
Rev 1.79 05 Dec 1997 16:50:56 OS
Numerierungsumbau
Rev 1.78 05 Dec 1997 10:42:50 OS
Numerierungsumbau
Rev 1.77 04 Dec 1997 16:57:20 OS
Numerierungsumbau
Rev 1.76 24 Nov 1997 16:47:44 MA
includes
Rev 1.75 17 Nov 1997 10:20:58 JP
Umstellung Numerierung
Rev 1.74 03 Nov 1997 13:22:42 MA
precomp entfernt
Rev 1.73 09 Oct 1997 08:48:32 OS
Beispieltexte nur noch setzen, wenn sie sich veraendert wurden #44493#
Rev 1.72 08 Aug 1997 17:28:08 OM
Headerfile-Umstellung
Rev 1.71 31 Jul 1997 15:22:06 MH
chg: header
Rev 1.70 08 Jul 1997 14:09:44 OS
ConfigItems von der App ans Module
Rev 1.69 01 Jul 1997 09:49:52 OS
Erweiterung auf neun Formen
Rev 1.68 09 Jan 1997 18:49:44 OS
gfs. aktuelle Ebene selektieren
Rev 1.67 11 Dec 1996 10:27:02 MA
Warnings
Rev 1.66 11 Nov 1996 11:05:44 MA
ResMgr
Rev 1.65 02 Oct 1996 18:29:00 MA
Umstellung Enable/Disable
Rev 1.64 28 Aug 1996 14:12:18 OS
includes
Rev 1.63 20 Aug 1996 16:22:50 OS
Handler zusammengefasst, timeouthdl vor Levelumschaltung rufen
Rev 1.62 22 Jul 1996 20:54:02 JP
Anpassung an die neuen SwUiNumRules
Rev 1.61 19 Jul 1996 15:32:32 JP
Umstellung Numerierung
Rev 1.60 21 Mar 1996 10:46:00 MA
Umstellung SV311
Rev 1.59 19 Feb 1996 12:33:28 JP
MakeNumString kann den Post-/Prefix-String per Flag selbst zufuegen
Rev 1.58 06 Feb 1996 15:21:12 JP
Link Umstellung 305
Rev 1.57 01 Feb 1996 11:45:58 mk
SINIX
Rev 1.56 03 Jan 1996 11:07:56 OS
Format fuer Kapitelnumerierung kann jetzt gespeichert werden
Rev 1.55 24 Nov 1995 16:58:48 OM
PCH->PRECOMPILED
Rev 1.54 13 Nov 1995 10:51:34 OM
static entfernt
------------------------------------------------------------------------*/
|